diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..fadb38a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*~ +[._]*.un~ +*.swp diff --git a/IDE_Board_Manager/package_sparkfun_index.json b/IDE_Board_Manager/package_sparkfun_index.json index 434d71b5..77fd744d 100644 --- a/IDE_Board_Manager/package_sparkfun_index.json +++ b/IDE_Board_Manager/package_sparkfun_index.json @@ -6,352 +6,3025 @@ "websiteURL": "https://SparkFun.com", "email": "TechSupport@SparkFun.com", "help": { - "online": "https://forum.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "platforms": [ { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.5", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.2.1", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.5.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.5.tar.bz2", - "checksum": "SHA-256:41f9728983e0dbab597bb46ddf00b5bac6cfec7c8f3771ecd1612dae58bb0366", - "size": "1162215", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.2.1.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.2.1.tar.gz", + "checksum": "SHA-256:9314d74c46e7f762438ccc065a827b72da88367224b9d22091ed0ab78b1ed9d2", + "size": "73180870", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" - }, - { - "name": "MaKey MaKey" + "name": "SparkFun Artemis Module" }, { - "name": "Pro Micro" + "name": "SparkFun Artemis Dev Kit" }, { - "name": "Fio v3" + "name": "SparkFun Artemis MicroMod" }, { - "name": "Qduino Mini" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Digital Sandbox" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Mega Pro" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "RedBot" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun Edge" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.6", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.2.0", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.6.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.6.tar.bz2", - "checksum": "SHA-256:049FA0DF51602120EC1BDAC19F440FC0CC448C23BB277DD0D8DF855C52ACD483", - "size": "1159276", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.2.0.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.2.0.tar.gz", + "checksum": "SHA-256:89c19130dd1826cccfc25c2ade1c455cbb496ce79d287549f37f47df45529e8c", + "size": "73160477", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" - }, - { - "name": "MaKey MaKey" - }, - { - "name": "Pro Micro" + "name": "SparkFun Artemis Module" }, { - "name": "Fio v3" + "name": "SparkFun Artemis Dev Kit" }, { - "name": "Qduino Mini" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Digital Sandbox" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Mega Pro" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "RedBot" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun Edge" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.7", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.1.2", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.7.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.7.tar.bz2", - "checksum": "SHA-256:16A9CA03A7869C424562795504B82FEED0FB6A7D4A63FC94280FBBA44132257C", - "size": "1236343", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.1.2_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.1.2_ble-beta.tar.gz", + "checksum": "SHA-256:8f1377d92d206f78d737a337626d24ed8e80c55a82f9a3c99bad3944a5727f5b", + "size": "73604683", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" + "name": "SparkFun Artemis Module" }, { - "name": "MaKey MaKey" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Pro Micro" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Fio v3" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "Qduino Mini" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Digital Sandbox" + "name": "SparkFun Edge" }, { - "name": "Mega Pro" + "name": "SparkFun Edge2" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.1.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.1.1_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.1.1_ble-beta.tar.gz", + "checksum": "SHA-256:996510336f9eae30d9ecc53b95b964367767ac31ab8853b01a77002361b77c09", + "size": "73595443", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" }, { - "name": "RedBot" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "LilyPad USB Plus" + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.8", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.30", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.8.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.8.tar.bz2", - "checksum": "SHA-256:23D479AF10DC97F4DB8EA8AD514FE92C4391EADD8D9DD5EF1D49A70EA05255C3", - "size": "1238017", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.30_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.30_ble-beta.tar.gz", + "checksum": "SHA-256:0c90ce012b94ab584005f8aa791efc8e3577580048256131d174eadb6fd7c709", + "size": "78908328", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" + "name": "SparkFun Artemis Module" }, { - "name": "MaKey MaKey" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Pro Micro" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Fio v3" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "Qduino Mini" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Digital Sandbox" + "name": "SparkFun Edge" }, { - "name": "Mega Pro" + "name": "SparkFun Edge2" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.29", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.29_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.29_ble-beta.tar.gz", + "checksum": "SHA-256:7e40c8e365d76a1d05b8b6a61ac2b6819b8ce41a8c41390cb61a89d9367a79cd", + "size": "64401917", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" }, { - "name": "RedBot" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "LilyPad USB Plus" + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.9", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.28", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.9.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.9.tar.bz2", - "checksum": "SHA-256:89480C355876966DB68504E4E4130719942320AECF0AD6AEF819299796B22202", - "size": "1238253", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.28_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.28_ble-beta.tar.gz", + "checksum": "SHA-256:fb699e84dc66137ebcc4dee59b58cd6395d50c023fd9c66c3a7da16611a1a8dd", + "size": "64399205", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" + "name": "SparkFun Artemis Module" }, { - "name": "MaKey MaKey" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Pro Micro" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Fio v3" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "Qduino Mini" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Digital Sandbox" + "name": "SparkFun Edge" }, { - "name": "Mega Pro" + "name": "SparkFun Edge2" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.27", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.27_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.27_ble-beta.tar.gz", + "checksum": "SHA-256:5a50e63d4a1e0d4c9e9812338b6adb433062ab0df539975c6bb6e65a266e42fa", + "size": "64398505", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" }, { - "name": "RedBot" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "LilyPad USB Plus" + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun AVR Boards", - "architecture": "avr", - "version": "1.1.10", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.23", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfunboards.1.1.10.tar.bz2", - "archiveFileName": "sparkfunboards.1.1.10.tar.bz2", - "checksum": "SHA-256:ABC30EF048B0BE63B6E3BB02A1FD52F35E2FC4A1CAFD60D4E7C3F9FD776129C0", - "size": "1237620", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.23_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.23_ble-beta.tar.gz", + "checksum": "SHA-256:c7128c8f5b30b71f3b498ac3f88758564fb8f6fa3eb8dded45b00873e3e16ffa", + "size": "64396858", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "RedBoard" + "name": "SparkFun Artemis Module" }, { - "name": "MaKey MaKey" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Pro Micro" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "Fio v3" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "Qduino Mini" + "name": "SparkFun Artemis Thing Plus" }, { - "name": "Digital Sandbox" + "name": "SparkFun Edge" }, { - "name": "Mega Pro" + "name": "SparkFun Edge2" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.20", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.20_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.20_ble-beta.tar.gz", + "checksum": "SHA-256:da6de17179dda462a1a2abd0ab1f384e4fcfe0ad0e581fd4720f254042767bce", + "size": "63501439", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" }, { - "name": "RedBot" + "name": "SparkFun RedBoard Artemis" }, { - "name": "Serial 7-segment Display" + "name": "SparkFun RedBoard Artemis ATP" }, { - "name": "ATmega128RFA1 Dev Board" + "name": "SparkFun RedBoard Artemis Nano" }, { - "name": "LilyPad USB Plus" + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", - "architecture": "samd", - "version": "1.0.0", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.17", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.0.0.tar.bz2", - "archiveFileName": "sparkfun-samd-1.0.0.tar.bz2", - "checksum": "SHA-256:12e0be6862a3a28b6515755dcad2842757caf4e5270326554f95059512ebaab5", - "size": "268954", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.17_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.17_ble-beta.tar.gz", + "checksum": "SHA-256:63918da5aeacafd3dcace4bd34a02a29044b926167b0de0e8ffd0d1fdc1835d0", + "size": "47788681", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "name": "SparkFun Artemis Module" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "name": "SparkFun RedBoard Artemis" + }, + { + "name": "SparkFun RedBoard Artemis ATP" + }, + { + "name": "SparkFun RedBoard Artemis Nano" + }, + { + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", - "architecture": "samd", - "version": "1.1.0", + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.11", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.1.0.tar.bz2", - "archiveFileName": "sparkfun-samd-1.1.0.tar.bz2", - "checksum": "SHA-256:5d71cbf8ccf5781eef9809d7b3141041daf3ed1a1272f5278762ece5a0aecf44", - "size": "279683", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.11_ble-beta.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.11_ble-beta.tar.gz", + "checksum": "SHA-256:ceddc7ee397108c6c71cc7eacebbff547b40b4a49bf7f20899dc09d864774a3e", + "size": "48118344", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "name": "SparkFun Artemis Module" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "name": "SparkFun RedBoard Artemis" + }, + { + "name": "SparkFun RedBoard Artemis ATP" + }, + { + "name": "SparkFun RedBoard Artemis Nano" + }, + { + "name": "SparkFun Artemis Thing Plus" + }, + { + "name": "SparkFun Edge" + }, + { + "name": "SparkFun Edge2" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.4", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/v1.0.4.tar.gz", + "archiveFileName": "Arduino_Apollo3-1.0.4.tar.gz", + "checksum": "SHA-256:e7881e3aec46fc8269586506634d1e4838f3de14e422ca37ac65c0c73e5edd50", + "size": "47539194", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" + }, + { + "name": "SparkFun BlackBoard Artemis" + }, + { + "name": "SparkFun BlackBoard Artemis ATP" + }, + { + "name": "SparkFun BlackBoard Artemis Nano" + }, + { + "name": "SparkFun Edge" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "1.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/1.0.0.zip", + "archiveFileName": "Arduino_Apollo3-1.0.0.zip", + "checksum": "SHA-256:36f0e04e2f2d2b281622d0f7fc1c41f38f1a24b6824c3f2f2b568cb29eb9fb6b", + "size": "66433091", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" + }, + { + "name": "SparkFun BlackBoard Artemis" + }, + { + "name": "SparkFun BlackBoard Artemis ATP" + }, + { + "name": "SparkFun BlackBoard Artemis Nano" + }, + { + "name": "SparkFun Edge" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun Apollo3 Boards", + "architecture": "apollo3", + "version": "0.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Apollo3/archive/0.0.0.zip", + "archiveFileName": "Arduino_Apollo3-0.0.0.zip", + "checksum": "SHA-256:4cece2fcfff35e7b9d8ef1c433cf7fde3b94ae8ad9b1f9eb0fb5ee8b8abd5231", + "size": "45062118", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun Artemis Module" + }, + { + "name": "SparkFun BlackBoard Artemis" + }, + { + "name": "SparkFun BlackBoard Artemis Mega" + }, + { + "name": "SparkFun BlackBoard Artemis Nano" + }, + { + "name": "SparkFun Edge" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "8-2018-q4-major" + } + ] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.5", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.5.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.5.tar.bz2", + "checksum": "SHA-256:41f9728983e0dbab597bb46ddf00b5bac6cfec7c8f3771ecd1612dae58bb0366", + "size": "1162215", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.6", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.6.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.6.tar.bz2", + "checksum": "SHA-256:049FA0DF51602120EC1BDAC19F440FC0CC448C23BB277DD0D8DF855C52ACD483", + "size": "1159276", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.7", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.7.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.7.tar.bz2", + "checksum": "SHA-256:16A9CA03A7869C424562795504B82FEED0FB6A7D4A63FC94280FBBA44132257C", + "size": "1236343", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.8", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.8.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.8.tar.bz2", + "checksum": "SHA-256:23D479AF10DC97F4DB8EA8AD514FE92C4391EADD8D9DD5EF1D49A70EA05255C3", + "size": "1238017", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.9", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.9.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.9.tar.bz2", + "checksum": "SHA-256:89480C355876966DB68504E4E4130719942320AECF0AD6AEF819299796B22202", + "size": "1238253", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.10", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.10.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.10.tar.bz2", + "checksum": "SHA-256:ABC30EF048B0BE63B6E3BB02A1FD52F35E2FC4A1CAFD60D4E7C3F9FD776129C0", + "size": "1237620", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.11", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.11.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.11.tar.bz2", + "checksum": "SHA-256:59CFDDF1C806B42DECFB52297F2BCF2CF0B31DFBF27ED413B7421B476369B1DD", + "size": "1239209", + "help": { + "online": "https://forums.sparkfun.com" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + }, + { + "name": "SerLCD" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.12", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.12.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.12.tar.bz2", + "checksum": "SHA-256:034005EAC0255376E3108858238A17CF8654F31400DAC60BF0D756E332C3251D", + "size": "1249477", + "help": { + "online": "https://forums.sparkfun.com" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + }, + { + "name": "SerLCD" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun AVR Boards", + "architecture": "avr", + "version": "1.1.13", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfunboards.1.1.13.tar.bz2", + "archiveFileName": "sparkfunboards.1.1.13.tar.bz2", + "checksum": "SHA-256:D7AF391CAFC5E16830CAC7C13484EF62765DD7A36AABA5F25020CE3C39617115", + "size": "1257480", + "help": { + "online": "https://forums.sparkfun.com" + }, + "boards": [ + { + "name": "RedBoard" + }, + { + "name": "MaKey MaKey" + }, + { + "name": "Pro Micro" + }, + { + "name": "Fio v3" + }, + { + "name": "Qduino Mini" + }, + { + "name": "Digital Sandbox" + }, + { + "name": "Mega Pro" + }, + { + "name": "RedBot" + }, + { + "name": "Serial 7-segment Display" + }, + { + "name": "ATmega128RFA1 Dev Board" + }, + { + "name": "LilyPad USB Plus" + }, + { + "name": "SerLCD" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun ESP32 Boards", + "architecture": "esp32", + "version": "1.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-esp32-1.0.0.tar.bz2", + "archiveFileName": "sparkfun-esp32-1.0.0.tar.bz2", + "checksum": "SHA-256:030ee494bdf5ae8870042704e99ba0e27313c42f90a284babeaaac9a2deeb6a1", + "size": "33167738", + "boards": [ + { + "name": "SparkFun ESP32 Thing" + }, + { + "name": "SparkFun ESP32 Thing Plus" + }, + { + "name": "SparkFun ESP32 MicroMod" + }, + { + "name": "SparkFun Lora Gateway 1-Channel" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-80-g6c4433a-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "2.6.1", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ] + }, + { + "name": "SparkFun ESP32 Boards", + "architecture": "esp32", + "version": "1.0.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-esp32-1.0.1.tar.bz2", + "archiveFileName": "sparkfun-esp32-1.0.1.tar.bz2", + "checksum": "SHA-256:030ee494bdf5ae8870042704e99ba0e27313c42f90a284babeaaac9a2deeb6a1", + "size": "33167738", + "boards": [ + { + "name": "SparkFun ESP32 Thing" + }, + { + "name": "SparkFun ESP32 Thing Plus" + }, + { + "name": "SparkFun ESP32 MicroMod" + }, + { + "name": "SparkFun Lora Gateway 1-Channel" + } + ], + "toolsDependencies": [ + { + "packager": "esp32", + "version": "1.22.0-97-gc752ad5-5.2.0", + "name": "xtensa-esp32-elf-gcc" + }, + { + "packager": "esp32", + "version": "3.0.0", + "name": "esptool_py" + }, + { + "packager": "esp32", + "version": "0.2.3", + "name": "mkspiffs" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", + "architecture": "samd", + "version": "1.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.0.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.0.0.tar.bz2", + "checksum": "SHA-256:12e0be6862a3a28b6515755dcad2842757caf4e5270326554f95059512ebaab5", + "size": "268954", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", + "architecture": "samd", + "version": "1.1.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.1.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.1.0.tar.bz2", + "checksum": "SHA-256:5d71cbf8ccf5781eef9809d7b3141041daf3ed1a1272f5278762ece5a0aecf44", + "size": "279683", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", + "architecture": "samd", + "version": "1.2.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.2.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.2.0.tar.bz2", + "checksum": "SHA-256:50e055f311e07ba4d154bf00aa10579648024bef680bb3eb267401c496f791e6", + "size": "281932", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.6)", + "architecture": "samd", + "version": "1.2.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.2.1.tar.bz2", + "archiveFileName": "sparkfun-samd-1.2.1.tar.bz2", + "checksum": "SHA-256:63b90fb26a18a89b2f51556a08286117cdade38d6cb7a16eb1eccb7d1d92422a", + "size": "280405", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.8)", + "architecture": "samd", + "version": "1.2.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.2.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.2.2.tar.bz2", + "checksum": "SHA-256:21bc1ab1a8fd6550dca3b4953deaa2066d49ffa2583cd8e8a1e36d0c0ab00d52", + "size": "283240", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.8)", + "architecture": "samd", + "version": "1.3.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.3.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.3.0.tar.bz2", + "checksum": "SHA-256:87695137f303000099e7e6d3fae3e87d5882ed999e4c14403c65cf51a4d6a6be", + "size": "195440", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.9)", + "architecture": "samd", + "version": "1.3.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.3.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.3.2.tar.bz2", + "checksum": "SHA-256:eb4274a3df4c6c4dbc1396600b1efc9cd9454e5be4880530ff87ba4fb3e6216a", + "size": "206253", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards", + "architecture": "samd", + "version": "1.4.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.4.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.4.0.tar.bz2", + "checksum": "SHA-256:968918117E6EA9C7F3982F83E07B6459663AB844779855B5E175E19461C16691", + "size": "289555", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "bossac", + "version": "1.4.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.19)", + "architecture": "samd", + "version": "1.5.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.5.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.5.0.tar.bz2", + "checksum": "SHA-256:05C4FBC7CC924BED99B9A2618F57FAA1DDEA210AFFB7AFEE57639E6B9FEB445C", + "size": "322443", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.19)", + "architecture": "samd", + "version": "1.5.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.5.1.tar.bz2", + "archiveFileName": "sparkfun-samd-1.5.1.tar.bz2", + "checksum": "SHA-256:774052679A88EA43F5CEA2BAD88398E7310D4B879B8745613648D9F09BCB26DA", + "size": "323505", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.19)", + "architecture": "samd", + "version": "1.5.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.5.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.5.2.tar.bz2", + "checksum": "SHA-256:AB0F5486D0EFAE48E47716C7B01340F3E503D55CFD6872FFD3DBEB28E4095F2B", + "size": "328665", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.19)", + "architecture": "samd", + "version": "1.5.3", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.5.3.tar.bz2", + "archiveFileName": "sparkfun-samd-1.5.3.tar.bz2", + "checksum": "SHA-256:EB3721D8C72D02F32DBC0D9F1F2730B4A5EA809D13F0C3D7606E789B9281B545", + "size": "337917", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.19)", + "architecture": "samd", + "version": "1.5.4", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.5.4.tar.bz2", + "archiveFileName": "sparkfun-samd-1.5.4.tar.bz2", + "checksum": "SHA-256:3C92A1EEAF05F7166C21D7AB507FA7ADBFF23F5802A084A34133CB074BB812E0", + "size": "453746", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + } + ], + "toolsDependencies": [] + }, + { + "name": "SparkFun SAMD Boards", + "architecture": "samd", + "version": "1.6.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.6.1.tar.bz2", + "archiveFileName": "sparkfun-samd-1.6.1.tar.bz2", + "checksum": "SHA-256:AF18934847988926A71BB1C998D4FB2C1A5B5336442FAE8576EE80944EB49456", + "size": "1619817", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.6.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.6.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.6.2.tar.bz2", + "checksum": "SHA-256:C06952DC372B9C42B4B308C44449979AC6B4F8B87356C45061E3B1CBCC699B2D", + "size": "1619901", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.0.tar.bz2", + "checksum": "SHA-256:543F0B2F4E10AA81E3961791E30986763C0E8C9841FF2725C3DDD4747E5D83AF", + "size": "1696059", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.1.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.1.tar.bz2", + "checksum": "SHA-256:86E5F0C0D089E7384557E54191B4BE17A473FE0ACA31181606425BA3199402AC", + "size": "1713629", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.2.tar.bz2", + "checksum": "SHA-256:8356F897430129912057E7D7AB8611D2739B8B79E7E0E47CD0A798255D19E960", + "size": "1713505", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.3", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.3.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.3.tar.bz2", + "checksum": "SHA-256:2AD34AB24D42E2BE0AE2C6D09BF550E26A6BB2182C2CAFBD76CFE69E2FFE8325", + "size": "1702560", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.4", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.4.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.4.tar.bz2", + "checksum": "SHA-256:3EA7A59316A8E59D7F552E9714C74DA9D16F9CFE420294BC5F0007B6512D8FD0", + "size": "1695731", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.5", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.5.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.5.tar.bz2", + "checksum": "SHA-256:B7A7F787960D41B378197EE6FF83CD0324892170818902B28FD1B28B40C908FC", + "size": "1696179", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.6", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.6.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.6.tar.bz2", + "checksum": "SHA-256:BEFF40BBD0832B6478A49FEBD1DC839C1F3635431788A6A482F67C6300AE798E", + "size": "2840910", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.7", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.7.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.7.tar.bz2", + "checksum": "SHA-256:2B5DD4726EAF42BEFC44F23ADCE18C4D40EB376E795839A20E130F1D6C3F543B", + "size": "2841070", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.8", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.8.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.8.tar.bz2", + "checksum": "SHA-256:312FC086189AE7D66C33E56EBB68DE51FAC86F13EE6476D4284278E043ED9971", + "size": "2841028", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.7.9", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.7.9.tar.bz2", + "archiveFileName": "sparkfun-samd-1.7.9.tar.bz2", + "checksum": "SHA-256:56034D4E9A4DA4AFF1366E7931C4088CBBC2F469CB195D85E9FCFCED44A7730D", + "size": "2840851", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.0.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.0.tar.bz2", + "checksum": "SHA-256:1E4EF7ACBE51E13669CCD48DFC4724A44FA28A962E7F3E4A37A0F7DB516C8703", + "size": "2841419", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.1", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.1.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.1.tar.bz2", + "checksum": "SHA-256:F13CD49463FAD77A0B132030CDD59DA12C9D9B9C3255C6B124101108DE282B9F", + "size": "2840753", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.2", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.2.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.2.tar.bz2", + "checksum": "SHA-256:D3EC50E06BF1A8F9A58CBEE5AFB9797180964F6BD794BE252FF71A6459731A59", + "size": "2841065", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.3", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.3.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.3.tar.bz2", + "checksum": "SHA-256:74393DAD50FCFDCCF36EC15FA1CC4354258E9050BDB1C1692E58F0C21F82C2D6", + "size": "2840829", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.4", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.4.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.4.tar.bz2", + "checksum": "SHA-256:44AF7E7C756B863AE9303DD217740BE60DC305ED3EEBC8B46F0FCA3CC7848F1F", + "size": "2841082", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.5", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.5.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.5.tar.bz2", + "checksum": "SHA-256:41F1C50981C2435F1423F128EF678830B92606396429DD86D376333F4DC82540", + "size": "2841197", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.6", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.6.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.6.tar.bz2", + "checksum": "SHA-256:DB464F1224D46AF4C9780A79F3E29505D7EE98528AD1761C3775E4EA2FCE6009", + "size": "2841326", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "Sparkfun SAMD21 Pro RF" + }, + { + "name": "Sparkfun RedBoard Turbo" + }, + { + "name": "Sparkfun SAMD51 Thing Plus" + }, + { + "name": "Sparkfun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.7", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.7.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.7.tar.bz2", + "checksum": "SHA-256:BCE89B08AD7661DF68469F5C2B5A84B3E6457948EFEACEB0C5743334FEC58303", + "size": "2914716", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.8", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.8.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.8.tar.bz2", + "checksum": "SHA-256:521363491AF51B1E48F5C5EB00D8B4BDFF0311ACDE9C267FE926F43AC519E0B6", + "size": "2963776", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.9", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.9.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.9.tar.bz2", + "checksum": "SHA-256:9FA7994E170112A5DCC399FD1D13CC0D59D63AD6F1FE346B7FE9A2BD48517825", + "size": "2937532", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.5)", + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", "architecture": "samd", - "version": "1.2.0", + "version": "1.8.10", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.2.0.tar.bz2", - "archiveFileName": "sparkfun-samd-1.2.0.tar.bz2", - "checksum": "SHA-256:50e055f311e07ba4d154bf00aa10579648024bef680bb3eb267401c496f791e6", - "size": "281932", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.10.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.10.tar.bz2", + "checksum": "SHA-256:28877556ae73317e7aa1ab36d0b6e35bb8f7bc6c07c6fd7acc691fcb52390e54", + "size": "2945910", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { @@ -359,166 +3032,843 @@ }, { "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.6)", + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", "architecture": "samd", - "version": "1.2.1", + "version": "1.8.11", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.2.1.tar.bz2", - "archiveFileName": "sparkfun-samd-1.2.1.tar.bz2", - "checksum": "SHA-256:63b90fb26a18a89b2f51556a08286117cdade38d6cb7a16eb1eccb7d1d92422a", - "size": "280405", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.11.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.11.tar.bz2", + "checksum": "SHA-256:8514a8da20695ea48577f89a52046ef4c3e23190aac190128c3bb32ef308aa28", + "size": "2945652", "help": { - "online": "https://forums.sparkfun.com" + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "4.8.3-2014q1" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.12", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.12.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.12.tar.bz2", + "checksum": "SHA-256:5cff4d33754f7b431e1edac81e87d6b5b5e709c4c2d7aafd983f38d15b8fdfbe", + "size": "2945670", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" + }, + "boards": [ + { + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "7-2017q4" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.8.1)", + "architecture": "samd", + "version": "1.8.13", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-samd-1.8.13.tar.bz2", + "archiveFileName": "sparkfun-samd-1.8.13.tar.bz2", + "checksum": "SHA-256:226fd5bba05a7842db47e6d0b0d880d15fa9a7180b8bb48f0c1611b9abcceb48", + "size": "2950780", + "help": { + "online": "https://learn.sparkfun.com/tutorials/installing-arduino-ide/board-add-ons-with-arduino-board-manager" }, "boards": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "name": "SparkFun SAMD21 Mini Breakout" + }, + { + "name": "SparkFun SAMD21 Dev Breakout" + }, + { + "name": "SparkFun 9DoF Razor IMU M0" + }, + { + "name": "LilyPad LilyMini" + }, + { + "name": "SparkFun SAMD21 Pro RF" + }, + { + "name": "SparkFun RedBoard Turbo" + }, + { + "name": "SparkFun SAMD51 Thing Plus" + }, + { + "name": "SparkFun Qwiic Micro" + }, + { + "name": "SparkFun Qwiic USB Bridge" + }, + { + "name": "SparkFun SAMD51 MicroMod" + } + ], + "toolsDependencies": [ + { + "packager": "arduino", + "name": "arm-none-eabi-gcc", + "version": "7-2017q4" + }, + { + "packager": "arduino", + "name": "bossac", + "version": "1.8.0-48-gb176eee" + }, + { + "packager": "arduino", + "name": "openocd", + "version": "0.9.0-arduino" + }, + { + "packager": "arduino", + "name": "CMSIS", + "version": "4.5.0" + }, + { + "packager": "arduino", + "name": "CMSIS-Atmel", + "version": "1.2.0" + } + ] + }, + { + "name": "SparkFun STM32 Boards", + "architecture": "stm32", + "version": "1.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-stm32-1.0.0.tar.bz2", + "archiveFileName": "sparkfun-stm32-1.0.0.tar.bz2", + "checksum": "SHA-256:2ea9f35f66fbb73b26698319f202391b525d1cceb7a8fe2be454e89dc6e5b922", + "size": "4982552", + "boards": [ + { + "name": "SparkFun STM32 Thing Plus" + }, + { + "name": "SparkFun STM32 MicroMod" + }, + { + "name": "Generic F405RG" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "version": "5.5.1", + "name": "CMSIS" + }, + { + "packager": "SparkFun", + "version": "1.4.0", + "name": "STM32Tools" + }, + { + "packager": "SparkFun", + "version": "9.2.1-1.1", + "name": "xpack-arm-none-eabi-gcc" + } + ] + }, + { + "name": "SparkFun STM32 Boards", + "architecture": "stm32", + "version": "2.0.0", + "category": "Contributed", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-stm32-2.0.0.tar.bz2", + "archiveFileName": "sparkfun-stm32-2.0.0.tar.bz2", + "checksum": "SHA-256:B896703B553C925A2F04E23611919356F02D10DA6B545A513CD3C0FEF65540E3", + "size": "4910455", + "boards": [ + { + "name": "SparkFun STM32 Thing Plus" + }, + { + "name": "SparkFun STM32 MicroMod" + }, + { + "name": "Generic F405RG" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "version": "5.7.0", + "name": "CMSIS" + }, + { + "packager": "SparkFun", + "version": "2.0.0", + "name": "STM32Tools" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "packager": "SparkFun", + "version": "9.3.1-1.3", + "name": "xpack-arm-none-eabi-gcc" } - ], - "toolsDependencies": [] + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.8)", - "architecture": "samd", - "version": "1.2.2", + "name": "SparkFun STM32 Boards", + "architecture": "stm32", + "version": "2.1.0", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.2.2.tar.bz2", - "archiveFileName": "sparkfun-samd-1.2.2.tar.bz2", - "checksum": "SHA-256:21bc1ab1a8fd6550dca3b4953deaa2066d49ffa2583cd8e8a1e36d0c0ab00d52", - "size": "283240", - "help": { - "online": "https://forums.sparkfun.com" - }, + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-stm32-2.1.0.tar.bz2", + "archiveFileName": "sparkfun-stm32-2.1.0.tar.bz2", + "checksum": "SHA-256:7fce5c41b0c645134c9ec640636329594d5750fc82e2e4a61f2d605bb5633872", + "size": "4955866", "boards": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "name": "SparkFun STM32 Thing Plus" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "name": "SparkFun STM32 MicroMod" + }, + { + "name": "SparkFun STM32 MicroMod DFU" + }, + { + "name": "Generic F405RG" } ], - "toolsDependencies": [] + "toolsDependencies": [ + { + "packager": "SparkFun", + "version": "5.7.0", + "name": "CMSIS" + }, + { + "packager": "SparkFun", + "version": "2.0.0", + "name": "STM32Tools" + }, + { + "packager": "SparkFun", + "version": "9.3.1-1.3", + "name": "xpack-arm-none-eabi-gcc" + } + ] }, { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.8)", - "architecture": "samd", - "version": "1.3.0", + "name": "SparkFun nRF52 boards using Adafruit nRF52 core", + "architecture": "nrf52", + "version": "1.0.0", "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.3.0.tar.bz2", - "archiveFileName": "sparkfun-samd-1.3.0.tar.bz2", - "checksum": "SHA-256:87695137f303000099e7e6d3fae3e87d5882ed999e4c14403c65cf51a4d6a6be", - "size": "195440", - "help": { - "online": "https://forums.sparkfun.com" - }, + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-nrf52-1.0.0.tar.bz2", + "archiveFileName": "sparkfun-nrf52-1.0.0.tar.bz2", + "checksum": "SHA-256:132d7b14433daf5cf8ae2db4f52e32e7e18eb0f8f038836c6948c1ead2be7597", + "size": "16458697", "boards": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "name": "SparkFun Thing Plus NINA-B306" + } + ], + "toolsDependencies": [ + { + "packager": "SparkFun", + "name": "arm-none-eabi-gcc", + "version": "9-2019q4" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "packager": "SparkFun", + "name": "nrfjprog", + "version": "9.4.0" }, { - "name": "SparkFun 9DoF Razor IMU M0" + "packager": "SparkFun", + "name": "CMSIS", + "version": "5.7.0" } - ], - "toolsDependencies": [] - }, + ] + } + ], + "tools": [ { - "name": "SparkFun SAMD Boards (dependency: Arduino SAMD Boards 1.6.9)", - "architecture": "samd", - "version": "1.3.2", - "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.3.2.tar.bz2", - "archiveFileName": "sparkfun-samd-1.3.2.tar.bz2", - "checksum": "SHA-256:eb4274a3df4c6c4dbc1396600b1efc9cd9454e5be4880530ff87ba4fb3e6216a", - "size": "206253", - "help": { - "online": "https://forums.sparkfun.com" - }, - "boards": [ + "version": "8-2018-q4-major", + "name": "arm-none-eabi-gcc", + "systems": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "host": "x86_64-apple-darwin", + "url": "https://cdn.sparkfun.com/large/gcc-arm-none-eabi-8-2018-q4-major-mac.tar.bz2", + "checksum": "SHA-256:0b528ed24db9f0fa39e5efdae9bcfc56bf9e07555cb267c70ff3fee84ec98460", + "archiveFileName": "gcc-arm-none-eabi-8-2018-q4-major-mac.tar.bz2", + "size": "111430151" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "host": "i386-apple-darwin11", + "url": "https://cdn.sparkfun.com/large/gcc-arm-none-eabi-8-2018-q4-major-mac.tar.bz2", + "checksum": "SHA-256:0b528ed24db9f0fa39e5efdae9bcfc56bf9e07555cb267c70ff3fee84ec98460", + "archiveFileName": "gcc-arm-none-eabi-8-2018-q4-major-mac.tar.bz2", + "size": "111430151" }, { - "name": "SparkFun 9DoF Razor IMU M0" + "host": "i686-linux-gnu", + "url": "https://cdn.sparkfun.com/large/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2", + "checksum": "SHA-256:fb31fbdfe08406ece43eef5df623c0b2deb8b53e405e2c878300f7a1f303ee52", + "archiveFileName": "gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2", + "size": "107253352" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://cdn.sparkfun.com/large/gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2", + "checksum": "SHA-256:fb31fbdfe08406ece43eef5df623c0b2deb8b53e405e2c878300f7a1f303ee52", + "archiveFileName": "gcc-arm-none-eabi-8-2018-q4-major-linux.tar.bz2", + "size": "107253352" + }, + { + "host": "i686-mingw32", + "url": "https://cdn.sparkfun.com/large/gcc-arm-none-eabi-8-2018-q4-major-win32-modified.zip", + "checksum": "SHA-256:98f47ed254ce31942408028c3a4a75ad4ee9fe7f318daecafb8c101bc19a6e23", + "archiveFileName": "gcc-arm-none-eabi-8-2018-q4-major-win32-modified.zip", + "size": "135448870" } - ], - "toolsDependencies": [] + ] }, { - "name": "SparkFun SAMD Boards", - "architecture": "samd", - "version": "1.4.0", - "category": "Contributed", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/IDE_Board_Manager/sparkfun-samd-1.4.0.tar.bz2", - "archiveFileName": "sparkfun-samd-1.4.0.tar.bz2", - "checksum": "SHA-256:968918117E6EA9C7F3982F83E07B6459663AB844779855B5E175E19461C16691", - "size": "289555", - "help": { - "online": "https://forums.sparkfun.com" - }, - "boards": [ + "name": "arm-none-eabi-gcc", + "version": "9-2019q4", + "systems": [ { - "name": "SparkFun SAMD21 Mini Breakout" + "host": "arm-linux-gnueabihf", + "url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2019-q4-major-linuxarm.tar.bz2", + "archiveFileName": "gcc-arm-none-eabi-7-2019-q4-major-linuxarm.tar.bz2", + "checksum": "SHA-256:34180943d95f759c66444a40b032f7dd9159a562670fc334f049567de140c51b", + "size": "96613739" }, { - "name": "SparkFun SAMD21 Dev Breakout" + "host": "aarch64-linux-gnu", + "url": "https://github.com/adafruit/arduino-board-index/releases/download/build-tools/gcc-arm-none-eabi-9-2019-q4-major-aarch64-linux.tar.bz2", + "archiveFileName": "gcc-arm-none-eabi-9-2019-q4-major-aarch64-linux.tar.bz2", + "checksum": "MD5:0dfa059aae18fcf7d842e30c525076a4", + "size": "128670769" }, { - "name": "SparkFun 9DoF Razor IMU M0" + "host": "i686-mingw32", + "url": "https://github.com/adafruit/arduino-board-index/releases/download/build-tools/gcc-arm-none-eabi-9-2019-q4-major-win32.zip", + "archiveFileName": "gcc-arm-none-eabi-9-2019-q4-major-win32.zip", + "checksum": "MD5:9d60cbb0e358ab6a9d3c9e5dc3624dd2", + "size": "153520070" }, { - "name": "LilyPad LilyMini" - } - ], - "toolsDependencies": [ + "host": "x86_64-apple-darwin", + "url": "https://github.com/adafruit/arduino-board-index/releases/download/build-tools/gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2", + "archiveFileName": "gcc-arm-none-eabi-9-2019-q4-major-mac.tar.bz2", + "checksum": "MD5:241b64f0578db2cf146034fc5bcee3d4", + "size": "116770520" + }, { - "packager": "SparkFun", - "name": "bossac", - "version": "1.4.0" + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/adafruit/arduino-board-index/releases/download/build-tools/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2", + "archiveFileName": "gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2", + "checksum": "MD5:fe0029de4f4ec43cf7008944e34ff8cc", + "size": "116802378" + }, + { + "host": "i686-pc-linux-gnu", + "url": "http://downloads.arduino.cc/tools/gcc-arm-none-eabi-7-2018-q2-update-linux32.tar.bz2", + "archiveFileName": "gcc-arm-none-eabi-7-2018-q2-update-linux32.tar.bz2", + "checksum": "SHA-256:090a0bc2b1956bc49392dff924a6c30fa57c88130097b1972204d67a45ce3cf3", + "size": "97427309" } ] - } - ], - "tools": [ + }, { "name": "bossac", "version": "1.4.0", "systems": [ { "host": "i686-mingw32", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/sparkfun/samd-tools/bossac/bossac-1.4.0-win.zip", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/sparkfun/samd-tools/bossac/bossac-1.4.0-win.zip", "archiveFileName": "bossac-1.4.0-win.zip", "checksum": "SHA-256:BCA6503F5DBB1F96693AFD0701A759ECFB3BE5B9FB3F9D901CA17853B224F4EB", "size": "314705" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/sparkfun/samd-tools/bossac/bossac-1.4.0-linux64.tar.bz2", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/sparkfun/samd-tools/bossac/bossac-1.4.0-linux64.tar.bz2", "archiveFileName": "bossac-1.4.0-linux64.tar.bz2", "checksum": "SHA-256:BB8F398BF84C5F31880FE9A2C7AE0174592516CE4821B49744B426AA968ADA10", "size": "225696" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/sparkfun/Arduino_Boards/raw/master/sparkfun/samd-tools/bossac/bossac-1.4.0-osx.tar.bz2", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/sparkfun/samd-tools/bossac/bossac-1.4.0-osx.tar.bz2", "archiveFileName": "bossac-1.4.0-osx.tar.bz2", "checksum": "SHA-256:D0F225846D7BC80A74324D783CDB35C42A7F85EAD73CC016C0CC767B0AA5E81C", "size": "74461" } ] + }, + { + "name": "CMSIS", + "version": "5.5.1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + }, + { + "host": "all", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.5.1/CMSIS-5.5.1.tar.bz2", + "archiveFileName": "CMSIS-5.5.1.tar.bz2", + "checksum": "SHA-256:3dddbd241986fc7a7861a62c748abf350055ac4542d362f38f1778caad2c4bf8", + "size": "24351965" + } + ] + }, + { + "name": "CMSIS", + "version": "5.7.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + }, + { + "host": "all", + "url": "https://github.com/stm32duino/ArduinoModule-CMSIS/releases/download/5.7.0/CMSIS-5.7.0.tar.bz2", + "archiveFileName": "CMSIS-5.7.0.tar.bz2", + "checksum": "SHA-256:0b04b0f214e483bcc360cda985cddc0de8031714019ceabcda4770d510b82bfe", + "size": "26151901" + } + ] + }, + { + "name": "STM32Tools", + "version": "1.4.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/1.4.0/STM32Tools-1.4.0-windows.tar.bz2", + "archiveFileName": "STM32Tools-1.4.0-windows.tar.bz2", + "checksum": "SHA-256:9d0e5401c28f83de6b9e5c1d3dd08c71f89ed574113af8a0b78c3e677653be07", + "size": "2818862" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/1.4.0/STM32Tools-1.4.0-mac.tar.bz2", + "archiveFileName": "STM32Tools-1.4.0-mac.tar.bz2", + "checksum": "SHA-256:861ab52fbfd6aa02e9efbd4f568bc536c6669975675660417b4c2e719fe15304", + "size": "757807" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/1.4.0/STM32Tools-1.4.0-linux.tar.bz2", + "archiveFileName": "STM32Tools-1.4.0-linux.tar.bz2", + "checksum": "SHA-256:03ce112090a39ea5176b4401ec06208b8d8cccb4eb705c8f03c5aa74f3c99918", + "size": "755585" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/1.4.0/STM32Tools-1.4.0-linux.tar.bz2", + "archiveFileName": "STM32Tools-1.4.0-linux.tar.bz2", + "checksum": "SHA-256:03ce112090a39ea5176b4401ec06208b8d8cccb4eb705c8f03c5aa74f3c99918", + "size": "755585" + } + ] + }, + { + "name": "STM32Tools", + "version": "2.0.0", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/2.0.0/STM32Tools-2.0.0-windows.tar.bz2", + "archiveFileName": "STM32Tools-2.0.0-windows.tar.bz2", + "checksum": "SHA-256:6316ffd1667344952bc5e16ff60783f9b4211d1eb54fc0d0c28e836b1490b717", + "size": "2486087" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/2.0.0/STM32Tools-2.0.0-mac.tar.bz2", + "archiveFileName": "STM32Tools-2.0.0-mac.tar.bz2", + "checksum": "SHA-256:2612be87206d2ba6f7cf797c194dbc070139defc884b881c1957a8d148c2114c", + "size": "486398" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/2.0.0/STM32Tools-2.0.0-linux.tar.bz2", + "archiveFileName": "STM32Tools-2.0.0-linux.tar.bz2", + "checksum": "SHA-256:850186554df1d56f5f5336d6310551b734b2ff97c92677ca0ece11f134b72d0f", + "size": "479795" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/2.0.0/STM32Tools-2.0.0-linux.tar.bz2", + "archiveFileName": "STM32Tools-2.0.0-linux.tar.bz2", + "checksum": "SHA-256:850186554df1d56f5f5336d6310551b734b2ff97c92677ca0ece11f134b72d0f", + "size": "479795" + }, + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/stm32duino/Arduino_Tools/releases/download/2.0.0/STM32Tools-2.0.0-linux.tar.bz2", + "archiveFileName": "STM32Tools-2.0.0-linux.tar.bz2", + "checksum": "SHA-256:850186554df1d56f5f5336d6310551b734b2ff97c92677ca0ece11f134b72d0f", + "size": "479795" + } + ] + }, + { + "name": "xpack-arm-none-eabi-gcc", + "version": "9.2.1-1.1", + "systems": [ + { + "host": "i686-mingw32", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.2.1-1.1/xpack-arm-none-eabi-gcc-9.2.1-1.1-win32-x32.zip", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.2.1-1.1-win32-x32.zip", + "checksum": "SHA-256:d13aaff4caae6e5f1b871d50accc1759c4f5750574dbd4d6f6e3017c33f39dc6", + "size": "128697954" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.2.1-1.1/xpack-arm-none-eabi-gcc-9.2.1-1.1-darwin-x64.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.2.1-1.1-darwin-x64.tar.gz", + "checksum": "SHA-256:6ff68117083624273c56244cf4242989a65069b376a9727ec4a230be824340f3", + "size": "132371371" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.2.1-1.1/xpack-arm-none-eabi-gcc-9.2.1-1.1-linux-x64.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.2.1-1.1-linux-x64.tar.gz", + "checksum": "SHA-256:bbde117b97f229dfe63721c0323c3da6839e83cf302c8f4ff25e0f36ecf7a428", + "size": "135081450" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.2.1-1.1/xpack-arm-none-eabi-gcc-9.2.1-1.1-linux-x32.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.2.1-1.1-linux-x32.tar.gz", + "checksum": "SHA-256:e9f4b5f3ebe7e4391e2423e4106493d7cfcdee9eee4a1f0766f1c23662093a49", + "size": "137429272" + } + ] + }, + { + "name": "xpack-arm-none-eabi-gcc", + "version": "9.3.1-1.3", + "systems": [ + { + "host": "arm-linux-gnueabihf", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-arm.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-arm.tar.gz", + "checksum": "SHA-256:0e6720296f291141cd757d90e6bf60867a1232de9abc52b0cde28af12eeb94f2", + "size": "147111321" + }, + { + "host": "aarch64-linux-gnu", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-arm64.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-arm64.tar.gz", + "checksum": "SHA-256:9a9e96b9ac3634d7632d35aa0d8138f8468d4f3f4d752374a95420ff7c8e4476", + "size": "150584175" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-win32-x32.zip", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-win32-x32.zip", + "checksum": "SHA-256:7432cfff045dc421d2ba177c3777ec1e82d4febe5f5f51fb2e90ff07d27cd466", + "size": "148593506" + }, + { + "host": "x86_64-apple-darwin", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-darwin-x64.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-darwin-x64.tar.gz", + "checksum": "SHA-256:f22f0d49c27f844dcfe629a6a33878d767b6945acd7508d9578b20b17b106f4c", + "size": "148641073" + }, + { + "host": "x86_64-pc-linux-gnu", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-x64.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-x64.tar.gz", + "checksum": "SHA-256:9045d261b000d921887fc801427542eed2df1616f63a2969a2640f8be2593686", + "size": "151422620" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/xpack-dev-tools/arm-none-eabi-gcc-xpack/releases/download/v9.3.1-1.3/xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-x32.tar.gz", + "archiveFileName": "xpack-arm-none-eabi-gcc-9.3.1-1.3-linux-x32.tar.gz", + "checksum": "SHA-256:1950c7b0b4e35bacec32450158ec192ac469189a5fb27c2fd7c01e9603e50e64", + "size": "154309058" + } + ] + }, + { + "name": "nrfjprog", + "version": "9.4.0", + "systems": [ + { + "host": "i386-apple-darwin11", + "checksum": "MD5:04f65e24f36d55d10b71c1ebf49cd070", + "size": "362222", + "archiveFileName": "nrfjprog-9.4.0-mac.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-9.4.0-mac.tar.bz2" + }, + { + "host": "i686-linux-gnu", + "checksum": "MD5:9cf73f1f78cb8e249ed4e6f963d08a35", + "size": "177428", + "archiveFileName": "nrfjprog-9.4.0-linux32.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-9.4.0-linux32.tar.bz2" + }, + { + "host": "x86_64-pc-linux-gnu", + "checksum": "MD5:da3c7b348e0c22766f175a4a9cca0d19", + "size": "190020", + "archiveFileName": "nrfjprog-9.4.0-linux64.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-9.4.0-linux64.tar.bz2" + }, + { + "host": "i686-mingw32", + "checksum": "MD5:8352392ae0272173e1508d1218f51671", + "size": "851576", + "archiveFileName": "nrfjprog-9.4.0-win32.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-9.4.0-win32.tar.bz2" + }, + { + "host": "arm-linux-gnueabihf", + "checksum": "MD5:3703bed3c1114e8f4ef1b0b2d65aeb0a", + "size": "2794097", + "archiveFileName": "nrfjprog-10.15.0-arm.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-10.15.0-arm.tar.bz2" + }, + { + "host": "aarch64-linux-gnu", + "checksum": "MD5:3703bed3c1114e8f4ef1b0b2d65aeb0a", + "size": "2794097", + "archiveFileName": "nrfjprog-10.15.0-arm.tar.bz2", + "url": "https://github.com/adafruit/Adafruit_nRF52_Arduino/releases/download/gcc-5_2-2015q4/nrfjprog-10.15.0-arm.tar.bz2" + } + ] } ] }, @@ -532,14 +3882,14 @@ { "category": "Contributed", "name": "SparkFun ESP8266 Boards", - "url": "https://cdn.sparkfun.com/assets/learn_tutorials/4/9/5/sparkfun-esp8266-2.1.0.tar.bz2", - "checksum": "SHA-256:FE3E0504B38A5A4C912801A3E4633380A666DC77B8D3043548187AF8675477DA", + "url": "https://github.com/sparkfun/Arduino_Boards/raw/main/IDE_Board_Manager/sparkfun-esp8266-2.1.2.tar.bz2", + "checksum": "SHA-256:6A3722A50B09DCEF92818B5C0E5A6C752E84181F1ABFD0959DACC39D8E2F1C94", "help": { "online": "https://learn.sparkfun.com" }, - "version": "2.1.0", + "version": "2.1.2", "architecture": "esp8266", - "archiveFileName": "sparkfun-esp8266-2.1.0.tar.bz2", + "archiveFileName": "sparkfun-esp8266-2.1.2.tar.bz2", "boards": [ { "name": "SparkFun Blynk Board - ESP8266" @@ -571,7 +3921,7 @@ "name": "mkspiffs" } ], - "size": "5436076" + "size": "1905291" } ], "tools": [ @@ -580,39 +3930,46 @@ "name": "xtensa-lx106-elf-gcc", "systems": [ { - "url": "http://arduino.esp8266.com/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz", + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/win32-xtensa-lx106-elf-gb404fb9-2.tar.gz", "checksum": "SHA-256:10476b9c11a7a90f40883413ddfb409f505b20692e316c4e597c4c175b4be09c", "host": "i686-mingw32", "archiveFileName": "win32-xtensa-lx106-elf-gb404fb9-2.tar.gz", "size": "153527527" }, { - "url": "http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "checksum": "SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6", "host": "x86_64-apple-darwin", "archiveFileName": "osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "size": "35385382" }, { - "url": "http://arduino.esp8266.com/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "checksum": "SHA-256:0cf150193997bd1355e0f49d3d49711730035257bc1aee1eaaad619e56b9e4e6", "host": "i386-apple-darwin", "archiveFileName": "osx-xtensa-lx106-elf-gb404fb9-2.tar.gz", "size": "35385382" }, { - "url": "http://arduino.esp8266.com/linux64-xtensa-lx106-elf-gb404fb9.tar.gz", + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/linux64-xtensa-lx106-elf-gb404fb9.tgz", "checksum": "SHA-256:46f057fbd8b320889a26167daf325038912096d09940b2a95489db92431473b7", "host": "x86_64-pc-linux-gnu", "archiveFileName": "linux64-xtensa-lx106-elf-gb404fb9.tar.gz", "size": "30262903" }, { - "url": "http://arduino.esp8266.com/linux32-xtensa-lx106-elf.tar.gz", + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/linux32-xtensa-lx106-elf.tar.gz", "checksum": "SHA-256:b24817819f0078fb05895a640e806e0aca9aa96b47b80d2390ac8e2d9ddc955a", "host": "i686-pc-linux-gnu", "archiveFileName": "linux32-xtensa-lx106-elf.tar.gz", "size": "32734156" + }, + { + "url": "https://github.com/esp8266/Arduino/releases/download/2.3.0/linuxarm-xtensa-lx106-elf-g46f160f-2.tar.gz", + "checksum": "SHA-256:f693946288f2ffa17288ef75ae16fa08573993f2b0a2a5e6bc35a68dc6087443", + "host": "arm-linux-gnueabihf", + "archiveFileName": "linuxarm-xtensa-lx106-elf-g46f160f-2.tar.gz", + "size": "34938475" } ] }, @@ -822,8 +4179,8 @@ ] } ], - "email": "ivan@esp8266.com", - "name": "esp8266" + "email": "elias.santistevan@sparkfun.com", + "name": "SparkFun" } ] } diff --git a/IDE_Board_Manager/sparkfun-esp32-1.0.0.tar.bz2 b/IDE_Board_Manager/sparkfun-esp32-1.0.0.tar.bz2 new file mode 100644 index 00000000..2e8b1953 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-esp32-1.0.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-esp32-1.0.1.tar.bz2 b/IDE_Board_Manager/sparkfun-esp32-1.0.1.tar.bz2 new file mode 100644 index 00000000..2e8b1953 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-esp32-1.0.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-esp8266-2.1.1.tar.bz2 b/IDE_Board_Manager/sparkfun-esp8266-2.1.1.tar.bz2 new file mode 100644 index 00000000..fb680e9c Binary files /dev/null and b/IDE_Board_Manager/sparkfun-esp8266-2.1.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-esp8266-2.1.2.tar.bz2 b/IDE_Board_Manager/sparkfun-esp8266-2.1.2.tar.bz2 new file mode 100644 index 00000000..75ae6cc6 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-esp8266-2.1.2.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-nrf52-1.0.0.tar.bz2 b/IDE_Board_Manager/sparkfun-nrf52-1.0.0.tar.bz2 new file mode 100644 index 00000000..643a4576 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-nrf52-1.0.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.5.0.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.5.0.tar.bz2 new file mode 100644 index 00000000..eb3a1ded Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.5.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.5.1.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.5.1.tar.bz2 new file mode 100644 index 00000000..f7e7c031 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.5.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.5.2.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.5.2.tar.bz2 new file mode 100644 index 00000000..dfdd414f Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.5.2.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.5.3.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.5.3.tar.bz2 new file mode 100644 index 00000000..05a732b3 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.5.3.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.5.4.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.5.4.tar.bz2 new file mode 100644 index 00000000..251771fa Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.5.4.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.6.1.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.6.1.tar.bz2 new file mode 100644 index 00000000..bb24b140 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.6.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.6.2.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.6.2.tar.bz2 new file mode 100644 index 00000000..f1bca472 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.6.2.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.0.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.0.tar.bz2 new file mode 100644 index 00000000..7e06149a Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.1.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.1.tar.bz2 new file mode 100644 index 00000000..069cba62 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.2.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.2.tar.bz2 new file mode 100644 index 00000000..4c1f36f8 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.2.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.3.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.3.tar.bz2 new file mode 100644 index 00000000..2e6bc3cb Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.3.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.4.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.4.tar.bz2 new file mode 100644 index 00000000..c4cfe783 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.4.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.5.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.5.tar.bz2 new file mode 100644 index 00000000..ab253b39 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.5.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.6.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.6.tar.bz2 new file mode 100644 index 00000000..acbfba3f Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.6.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.7.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.7.tar.bz2 new file mode 100644 index 00000000..528afcc9 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.7.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.8.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.8.tar.bz2 new file mode 100644 index 00000000..dce47eae Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.8.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.7.9.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.7.9.tar.bz2 new file mode 100644 index 00000000..21a19c54 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.7.9.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.0.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.0.tar.bz2 new file mode 100644 index 00000000..bf495ccc Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.1.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.1.tar.bz2 new file mode 100644 index 00000000..f82e787b Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.1.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.10.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.10.tar.bz2 new file mode 100644 index 00000000..9f00ec6a Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.10.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.11.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.11.tar.bz2 new file mode 100644 index 00000000..0abe1ba7 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.11.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.12.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.12.tar.bz2 new file mode 100644 index 00000000..c32e33fb Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.12.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.13.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.13.tar.bz2 new file mode 100644 index 00000000..7c92674b Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.13.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.2.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.2.tar.bz2 new file mode 100644 index 00000000..3cfa97de Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.2.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.3.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.3.tar.bz2 new file mode 100644 index 00000000..b4de2211 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.3.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.4.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.4.tar.bz2 new file mode 100644 index 00000000..e7dd815d Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.4.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.5.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.5.tar.bz2 new file mode 100644 index 00000000..6cf3f7af Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.5.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.6.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.6.tar.bz2 new file mode 100644 index 00000000..ae15c4ea Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.6.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.7.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.7.tar.bz2 new file mode 100644 index 00000000..40d8d59a Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.7.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.8.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.8.tar.bz2 new file mode 100644 index 00000000..012b90a0 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.8.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-samd-1.8.9.tar.bz2 b/IDE_Board_Manager/sparkfun-samd-1.8.9.tar.bz2 new file mode 100644 index 00000000..10f0e46d Binary files /dev/null and b/IDE_Board_Manager/sparkfun-samd-1.8.9.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-stm32-1.0.0.tar.bz2 b/IDE_Board_Manager/sparkfun-stm32-1.0.0.tar.bz2 new file mode 100644 index 00000000..dbb1d76f Binary files /dev/null and b/IDE_Board_Manager/sparkfun-stm32-1.0.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-stm32-2.0.0.tar.bz2 b/IDE_Board_Manager/sparkfun-stm32-2.0.0.tar.bz2 new file mode 100644 index 00000000..a32d93e4 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-stm32-2.0.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfun-stm32-2.1.0.tar.bz2 b/IDE_Board_Manager/sparkfun-stm32-2.1.0.tar.bz2 new file mode 100644 index 00000000..eaf2f8a3 Binary files /dev/null and b/IDE_Board_Manager/sparkfun-stm32-2.1.0.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfunboards.1.1.11.tar.bz2 b/IDE_Board_Manager/sparkfunboards.1.1.11.tar.bz2 new file mode 100644 index 00000000..28a3cd6c Binary files /dev/null and b/IDE_Board_Manager/sparkfunboards.1.1.11.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfunboards.1.1.12.tar.bz2 b/IDE_Board_Manager/sparkfunboards.1.1.12.tar.bz2 new file mode 100644 index 00000000..36e6f77d Binary files /dev/null and b/IDE_Board_Manager/sparkfunboards.1.1.12.tar.bz2 differ diff --git a/IDE_Board_Manager/sparkfunboards.1.1.13.tar.bz2 b/IDE_Board_Manager/sparkfunboards.1.1.13.tar.bz2 new file mode 100644 index 00000000..1ab0ef85 Binary files /dev/null and b/IDE_Board_Manager/sparkfunboards.1.1.13.tar.bz2 differ diff --git a/README.md b/README.md index f9523220..f5fc00db 100644 --- a/README.md +++ b/README.md @@ -4,52 +4,79 @@ This repository contains support for the following SparkFun Arduino-compatible d **IMPORTANT NOTE:** These board files have been updated for compatibility with Arduino version 1.8 and higher. Some boards (e.g. SAMD) may not compile correctly with earlier versions of Arduino. If you need compatibility with earlier versions of Arduino, you can choose previous releases of these boards from the Boards Manager. +#### Apollo3 Boards + +- [Artemis Module](https://www.sparkfun.com/products/15484) +- [Redboard Artemis](https://www.sparkfun.com/products/15444) +- [Redboard Artemis ATP](https://www.sparkfun.com/products/15442) +- [Redboard Artemis Nano](https://www.sparkfun.com/products/15443) +- [Edge](https://www.sparkfun.com/products/15170) + #### AVR Boards -* [RedBoard](https://www.sparkfun.com/products/12757) -* [MaKey MaKey](https://www.sparkfun.com/products/11511) -* [Pro Micro 3.3V](https://www.sparkfun.com/products/10999) -* [Pro Micro 5V](https://www.sparkfun.com/products/11098) -* [Fio v3](https://www.sparkfun.com/products/11520) -* [Qduino Mini](https://www.sparkfun.com/products/13614) -* [Digital Sandbox](https://www.sparkfun.com/products/12651) -* [Mega Pro 3.3V](https://www.sparkfun.com/products/10744) -* [Mega Pro 5V](https://www.sparkfun.com/products/11007) -* [RedBot](https://www.sparkfun.com/products/12097) -* [Serial 7-Segment Display](https://www.sparkfun.com/products/11441) -* [ATmega128RFA1 Development Board](https://www.sparkfun.com/products/11197) -* [LilyPad USB Plus](https://www.sparkfun.com/products/14346) +- [RedBoard](https://www.sparkfun.com/products/12757) +- [MaKey MaKey](https://www.sparkfun.com/products/11511) +- [Pro Micro 3.3V](https://www.sparkfun.com/products/10999) +- [Pro Micro 5V](https://www.sparkfun.com/products/11098) +- [Fio v3](https://www.sparkfun.com/products/11520) +- [Qduino Mini](https://www.sparkfun.com/products/13614) +- [Digital Sandbox](https://www.sparkfun.com/products/12651) +- [Mega Pro 3.3V](https://www.sparkfun.com/products/10744) +- [Mega Pro 5V](https://www.sparkfun.com/products/11007) +- [RedBot](https://www.sparkfun.com/products/12097) +- [Serial 7-Segment Display](https://www.sparkfun.com/products/11441) +- [ATmega128RFA1 Development Board](https://www.sparkfun.com/products/11197) +- [LilyPad USB Plus](https://www.sparkfun.com/products/14346) #### SAMD (ARM Cortex-M0+) Boards -* [SparkFun SAMD21 Dev Breakout](https://www.sparkfun.com/products/13672) -* [SparkFun SAMD21 Mini Breakout](https://www.sparkfun.com/products/13664) -* [SparkFun 9DoF Razor IMU M0 (SAMD21)](https://www.sparkfun.com/products/14001) -* [SparkFun LilyMini ProtoSnap (SAMD11)](https://www.sparkfun.com/products/14063) -* [SparkFun LilyMini (SAMD11)](https://www.sparkfun.com/products/14064) +- [SparkFun SAMD21 Dev Breakout](https://www.sparkfun.com/products/13672) +- [SparkFun SAMD21 Mini Breakout](https://www.sparkfun.com/products/13664) +- [SparkFun 9DoF Razor IMU M0 (SAMD21)](https://www.sparkfun.com/products/14001) +- [SparkFun LilyMini ProtoSnap (SAMD11)](https://www.sparkfun.com/products/14063) +- [SparkFun LilyMini (SAMD11)](https://www.sparkfun.com/products/14064) +- [SparkFun SAMD21 Pro RF LoRa 915MHz](https://www.sparkfun.com/products/14916) +- [SparkFun Qwiic Micro](https://www.sparkfun.com/products/15423) #### ESP8266 Boards -* [ESP8266 Thing](https://www.sparkfun.com/products/13231) -* [ESP8266 WiFi Shield](https://www.sparkfun.com/products/13287) +_These boards are supported by [Espressif](https://github.com/esp8266/Arduino)_. :+1: + +- [ESP8266 Thing](https://www.sparkfun.com/products/13231) +- [ESP8266 Thing Dev](https://www.sparkfun.com/products/13711) +- [ESP8266 WiFi Shield](https://www.sparkfun.com/products/13287) +- [SparkFun Blynk](https://www.sparkfun.com/products/13794) + +#### ESP32 Boards + +_These boards are supported by [Espressif](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md)._ :+1: + +- [SparkFun Thing Plus - ESP32 WROOM](https://www.sparkfun.com/products/14689) +- [SparkFun ESP32 Thing](https://www.sparkfun.com/products/13907) +- [SparkFun LoRa Gateway - 1-Channel (ESP32)](https://www.sparkfun.com/products/15006) +- [SparkFun MicroMod ESP32 Processor](https://www.sparkfun.com/products/16781) + +#### nRF52 Boards + +- [SparkFun Thing Plus NINA-B306](https://www.sparkfun.com/products/20854) ### Installation Instructions To add board support for our products, start Arduino and open the Preferences window (**File** > **Preferences**). Now copy and paste the following URL into the 'Additional Boards Manager URLs' input field: - https://raw.githubusercontent.com/sparkfun/Arduino_Boards/master/IDE_Board_Manager/package_sparkfun_index.json + https://raw.githubusercontent.com/sparkfun/Arduino_Boards/main/IDE_Board_Manager/package_sparkfun_index.json ![Location of Additional Boards Manager URL input field](prefs-arrow.png) If there is already an URL from another manufacturer in that field, click the button at the right end of the field. This will open an editing window allowing you to paste the above URL onto a new line. -### AVR and ESP Installation Instructions +### Apollo3 and AVR Installation Instructions Open the Boards Manager window by selecting **Tools** > **Board**, scroll to the top of the board list, and select **Boards Manager**. ![Boards Manager Menu](manager-menu.png) -If you type "sparkfun" (without quotes) into the "filter your search" field, you will see options to install SparkFun's AVR and ESP board files. Click in the desired box, and click the "Install" button that appears. Once installed, the boards will appear at the bottom of the board list. +If you type "sparkfun" (without quotes) into the "filter your search" field, you will see options to install SparkFun's Apollo3 and AVR board files. Click in the desired box, and click the "Install" button that appears. Once installed, the boards will appear at the bottom of the board list. ![Sparkfun Boards](sparkfunboards.png) @@ -69,10 +96,18 @@ Now click anywhere in the "SparkFun SAMD Boards" box, and click "Install". This You're now ready to use SparkFun SAMD boards. They will appear at the bottom of the board list. +### ESP Boards? + +All support for our ESP based boards are supported within their respective Espressif's Repository. + +- For our ESP8266 based boards: [Blynk](https://www.sparkfun.com/products/13794), [ESP8266 Thing](https://www.sparkfun.com/products/13231), or [ESP8266 Thing Dev](https://www.sparkfun.com/products/13711), you can install the board files by following the instructions [here](https://github.com/esp8266/Arduino). + +- For our ESP32 based boards Boards: [SparkFun Thing Plus - ESP32 WROOM](https://www.sparkfun.com/products/14689), [SparkFun ESP32 Thing](https://www.sparkfun.com/products/13907), [SparkFun LoRa Gateway - 1-Channel (ESP32](https://www.sparkfun.com/products/15006) you can install the board files by following the instructions [here](https://github.com/espressif/arduino-esp32/blob/master/docs/arduino-ide/boards_manager.md). + ### Notes -* Some boards such as the Arduino Pro and Pro Mini come in more than one flavor. For these **you must select the correct processor** in the 'Tools' menu. -* Information on compiling and programming the bootloaders can be found in the bootloaders directory. +- Some boards such as the Arduino Pro and Pro Mini come in more than one flavor. For these **you must select the correct processor** in the 'Tools' menu. +- Information on compiling and programming the bootloaders can be found in the bootloaders directory. **Have fun!**
-\-Your friends at SparkFun \ No newline at end of file +\-Your friends at SparkFun diff --git a/sparkfun/avr/Qduino/Qduino.cpp b/sparkfun/avr/Qduino/Qduino.cpp index 2e2c1f4c..3573ff56 100755 --- a/sparkfun/avr/Qduino/Qduino.cpp +++ b/sparkfun/avr/Qduino/Qduino.cpp @@ -7,7 +7,7 @@ * mattnewberry@me.com * * * *************************************************************************** - * * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU License. * * This program is distributed in the hope that it will be useful, * @@ -22,7 +22,7 @@ #include "Wire.h" void qduino::setup(){ - + pinMode(13, OUTPUT); digitalWrite(13, HIGH); pinMode(11, OUTPUT); @@ -32,21 +32,21 @@ void qduino::setup(){ } void qduino::setRGB(uint8_t r, uint8_t g, uint8_t b){ - + // ratio for R:G:B is 4:7:7 for forward voltage - + r = 255 - r; // set all values to opposite values g = 255 - g; // because LED is common anode b = 255 - b; - + int newr = map(r, 0, 255, 0, 146); - + analogWrite(10, newr); analogWrite(11, g); analogWrite(13, b); } -void qduino::setRGB(COLORS color){ +void qduino::setRGB(COLORS color){ switch (color) { case RED: analogWrite(10, 0); @@ -97,31 +97,31 @@ void qduino::setRGB(COLORS color){ } void qduino::rainbow(uint8_t duration) -{ +{ uint8_t rgbColor[3]; // Keep values for duration bounded if (duration < 1) duration = 1; if (duration > 5) duration = 5; - + int newDuration = map(duration, 1, 5, 500, 3000); - + // Start off with red. rgbColor[0] = 255; rgbColor[1] = 0; - rgbColor[2] = 0; - + rgbColor[2] = 0; + // Choose the colours to increment and decrement. for (uint8_t decColor = 0; decColor < 3; decColor += 1) { int incColor = decColor == 2 ? 0 : decColor + 1; - + // cross-fade the two colours. for(uint8_t i = 0; i < 255; i += 1) { rgbColor[decColor] -= 1; rgbColor[incColor] += 1; - + analogWrite(10, rgbColor[0]); analogWrite(11, rgbColor[1]); analogWrite(13, rgbColor[2]); @@ -131,7 +131,7 @@ void qduino::rainbow(uint8_t duration) } void qduino::ledOff() -{ +{ analogWrite(10, 255); analogWrite(11, 255); analogWrite(13, 255); @@ -167,7 +167,7 @@ char fuelGauge::getVersion() byte msb = 0; byte lsb = 0; readFrom(MAX1704_VERSION, msb, lsb); - + value = 0xFF00 & (msb<<8); value |= 0xFF & lsb; @@ -211,7 +211,7 @@ boolean fuelGauge::inSleep() byte lsb = 0; readFrom(MAX1704_CONFIG,msb,lsb); - byte sleep = (lsb >>7) & 0x01; + byte sleep = (lsb >>7) & 0x01; return int(sleep) == 1; } @@ -256,7 +256,7 @@ void fuelGauge::wakeUp() Wire.endTransmission(); // This delay is here to ensure it's fully awake before moving on - delay(150); + delay(150); } void fuelGauge::performCommand(byte address, int value) @@ -281,6 +281,5 @@ void fuelGauge::readFrom(byte address, byte &msb, byte &lsb) msb = Wire.read(); lsb = Wire.read(); } - Wire.endTransmission(); + //Wire.endTransmission(); } - diff --git a/sparkfun/avr/Qduino/examples/batteryLeveltoRGB/batteryLeveltoRGB.ino b/sparkfun/avr/Qduino/examples/batteryLeveltoRGB/batteryLeveltoRGB.ino index 754a8f2d..9b29481d 100644 --- a/sparkfun/avr/Qduino/examples/batteryLeveltoRGB/batteryLeveltoRGB.ino +++ b/sparkfun/avr/Qduino/examples/batteryLeveltoRGB/batteryLeveltoRGB.ino @@ -36,15 +36,15 @@ void loop(){ q.setRGB("green"); - } else if(charge >= 50 && charge << 75) { + } else if(charge >= 50 && charge < 75) { q.setRGB("yellow"); - } else if(charge >= 25 && charge << 50) { + } else if(charge >= 25 && charge < 50) { q.setRGB("orange"); - } else if(charge << 25) { + } else if(charge < 25) { q.setRGB("red"); } diff --git a/sparkfun/avr/avrdude.conf b/sparkfun/avr/avrdude.conf index c8b7467e..0557959c 100644 --- a/sparkfun/avr/avrdude.conf +++ b/sparkfun/avr/avrdude.conf @@ -1,4 +1,4 @@ -# $Id: avrdude.conf.in 1236 2013-09-16 19:40:15Z joerg_wunsch $ -*- text -*- +# $Id: avrdude.conf.in 1371 2016-02-15 20:15:07Z joerg_wunsch $ -*- text -*- # # AVRDUDE Configuration File # @@ -10,6 +10,10 @@ # identifies which part AVRDUDE is going to be programming and must match # one of the parts' "id" parameter. # +# DO NOT MODIFY THIS FILE. Modifications will be overwritten the next +# time a "make install" is run. For user-specific additions, use the +# "-C +filename" commandline option. +# # Possible entry formats are: # # programmer @@ -31,7 +35,7 @@ # pgmled = ; # pin number # vfyled = ; # pin number # usbvid = ; # USB VID (Vendor ID) -# usbpid = ; # USB PID (Product ID) +# usbpid = [, ...] # USB PID (Product ID) (1) # usbdev = ; # USB interface or other device info # usbvendor = ; # USB Vendor Name # usbproduct = ; # USB Product Name @@ -41,6 +45,8 @@ # For a pin list all pins must be inverted. # A single pin can be specified as usual = ~ , for lists # specify it as follows = ~ ( [, ... ] ) . +# +# (1) Not all programmer types can process a list of PIDs. # ; # # part @@ -54,6 +60,7 @@ # stk500_devcode = ; # numeric # avr910_devcode = ; # numeric # signature = ; # signature bytes +# usbpid = ; # DFU USB PID # chip_erase_delay = ; # micro-seconds # reset = dedicated | io; # retry_pulse = reset | sck; @@ -327,8 +334,8 @@ # # Overall avrdude defaults; suitable for ~/.avrduderc # -default_parallel = "unknown"; -default_serial = "unknown"; +default_parallel = "lpt1"; +default_serial = "com1"; # default_bitclock = 2.5; # Turn off safemode by default @@ -460,6 +467,64 @@ programmer # from Amontec ; +# UM232H module from FTDI and Glyn.com.au. +# See helix.air.net.au for detailed usage information. +# J1: Connect pin 2 and 3 for USB power. +# J2: Connect pin 2 and 3 for USB power. +# J2: Pin 7 is SCK +# : Pin 8 is MOSI +# : Pin 9 is MISO +# : Pin 11 is RST +# : Pin 6 is ground +# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get +# a 16MHz Atmega1280 to program reliably. The 232H is conveniently 5V tolerant. +programmer + id = "UM232H"; + desc = "FT232H based module from FTDI and Glyn.com.au"; + type = "avrftdi"; + usbvid = 0x0403; +# Note: This PID is reserved for generic 232H devices and +# should be programmed into the EEPROM + usbpid = 0x6014; + usbdev = "A"; + usbvendor = ""; + usbproduct = ""; + usbsn = ""; +#ISP-signals + sck = 0; + mosi = 1; + miso = 2; + reset = 3; +; + +# C232HM module from FTDI and Glyn.com.au. +# : Orange is SCK +# : Yellow is MOSI +# : Green is MISO +# : Brown is RST +# : Black is ground +# Use the -b flag to set the SPI clock rate eg -b 3750000 is the fastest I could get +# a 16MHz Atmega1280 to program reliably. The 232H is conveniently 5V tolerant. +programmer + id = "C232HM"; + desc = "FT232H based module from FTDI and Glyn.com.au"; + type = "avrftdi"; + usbvid = 0x0403; +# Note: This PID is reserved for generic 232H devices and +# should be programmed into the EEPROM + usbpid = 0x6014; + usbdev = "A"; + usbvendor = ""; + usbproduct = ""; + usbsn = ""; +#ISP-signals + sck = 0; + mosi = 1; + miso = 2; + reset = 3; +; + + # On the adapter you can read "O-Link". On the PCB is printed "OpenJTAG v3.1" # You can find it as "OpenJTAG ARM JTAG USB" in the internet. # (But there are also several projects called Open JTAG, eg. @@ -521,6 +586,24 @@ programmer buff = 7; ; +# submitted as bug #46020 +programmer + id = "tumpa"; + desc = "TIAO USB Multi-Protocol Adapter"; + type = "avrftdi"; + connection_type = usb; + usbvid = 0x0403; + usbpid = 0x8A98; + usbdev = "A"; + usbvendor = "TIAO"; + usbproduct = ""; + usbsn = ""; + sck = 0; # TCK 9 + mosi = 1; # TDI 5 + miso = 2; # TDO 13 + reset = 3; # TMS 7 +; + programmer id = "avrisp"; desc = "Atmel AVR ISP"; @@ -658,8 +741,8 @@ programmer type = "ftdi_syncbb"; connection_type = usb; miso = 1; # RxD - sck = 0; # RTS - mosi = 2; # TxD + sck = 0; # TxD + mosi = 2; # RTS reset = 4; # DTR ; @@ -694,6 +777,47 @@ programmer parent "arduino-ft232r" desc = "alias for arduino-ft232r"; ; +# There is a ATmega328P kit PCB called "uncompatino". +# This board allows ISP via its on-board FT232R. +# This is designed like Arduino Duemilanove but has no standard ICPS header. +# Its 4 pairs of pins are shorted to enable ftdi_syncbb. +# http://akizukidenshi.com/catalog/g/gP-07487/ +# http://akizukidenshi.com/download/ds/akizuki/k6096_manual_20130816.pdf +programmer + id = "uncompatino"; + desc = "uncompatino with all pairs of pins shorted"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 3; # cts + sck = 5; # dsr + mosi = 6; # dcd + reset = 7; # ri +; + +# FTDI USB to serial cable TTL-232R-5V with a custom adapter for ICSP +# http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm +# http://www.ftdichip.com/Support/Documents/DataSheets/Cables/DS_TTL-232R_CABLES.pdf +# For ICSP pinout see for example http://www.atmel.com/images/doc2562.pdf +# (Figure 1. ISP6PIN header pinout and Table 1. Connections required for ISP ...) +# TTL-232R GND 1 Black -> ICPS GND (pin 6) +# TTL-232R CTS 2 Brown -> ICPS MOSI (pin 4) +# TTL-232R VCC 3 Red -> ICPS VCC (pin 2) +# TTL-232R TXD 4 Orange -> ICPS RESET (pin 5) +# TTL-232R RXD 5 Yellow -> ICPS SCK (pin 3) +# TTL-232R RTS 6 Green -> ICPS MISO (pin 1) +# Except for VCC and GND, you can connect arbitual pairs as long as +# the following table is adjusted. +programmer + id = "ttl232r"; + desc = "FTDI TTL232R-5V with ICSP adapter"; + type = "ftdi_syncbb"; + connection_type = usb; + miso = 2; # rts + sck = 1; # rxd + mosi = 3; # cts + reset = 0; # txd +; + programmer id = "usbasp"; desc = "USBasp, http://www.fischl.de/usbasp/"; @@ -752,13 +876,22 @@ programmer programmer id = "arduinoisp"; - desc = " "; + desc = "Arduino ISP Programmer"; type = "usbtiny"; connection_type = usb; usbvid = 0x2341; usbpid = 0x0049; ; +programmer + id = "arduinoisporg"; + desc = "Arduino ISP Programmer"; + type = "usbtiny"; + connection_type = usb; + usbvid = 0x2A03; + usbpid = 0x0049; +; + programmer id = "butterfly"; desc = "Atmel Butterfly Development Board"; @@ -944,6 +1077,7 @@ programmer desc = "Atmel AVR JTAGICE3 in JTAG mode"; type = "jtagice3"; connection_type = usb; + usbpid = 0x2110, 0x2140; ; programmer @@ -951,6 +1085,7 @@ programmer desc = "Atmel AVR JTAGICE3 in PDI mode"; type = "jtagice3_pdi"; connection_type = usb; + usbpid = 0x2110, 0x2140; ; programmer @@ -958,6 +1093,7 @@ programmer desc = "Atmel AVR JTAGICE3 in debugWIRE mode"; type = "jtagice3_dw"; connection_type = usb; + usbpid = 0x2110, 0x2140; ; programmer @@ -965,6 +1101,63 @@ programmer desc = "Atmel AVR JTAGICE3 in ISP mode"; type = "jtagice3_isp"; connection_type = usb; + usbpid = 0x2110, 0x2140; +; + +programmer + id = "xplainedpro"; + desc = "Atmel AVR XplainedPro in JTAG mode"; + type = "jtagice3"; + connection_type = usb; + usbpid = 0x2111; +; + +programmer + id = "xplainedmini"; + desc = "Atmel AVR XplainedMini in ISP mode"; + type = "jtagice3_isp"; + connection_type = usb; + usbpid = 0x2145; +; + +programmer + id = "xplainedmini_dw"; + desc = "Atmel AVR XplainedMini in debugWIRE mode"; + type = "jtagice3_dw"; + connection_type = usb; + usbpid = 0x2145; +; + +programmer + id = "atmelice"; + desc = "Atmel-ICE (ARM/AVR) in JTAG mode"; + type = "jtagice3"; + connection_type = usb; + usbpid = 0x2141; +; + +programmer + id = "atmelice_pdi"; + desc = "Atmel-ICE (ARM/AVR) in PDI mode"; + type = "jtagice3_pdi"; + connection_type = usb; + usbpid = 0x2141; +; + +programmer + id = "atmelice_dw"; + desc = "Atmel-ICE (ARM/AVR) in debugWIRE mode"; + type = "jtagice3_dw"; + connection_type = usb; + usbpid = 0x2141; +; + +programmer + id = "atmelice_isp"; + desc = "Atmel-ICE (ARM/AVR) in ISP mode"; + type = "jtagice3_isp"; + connection_type = usb; + usbpid = 0x2141; ; @@ -982,6 +1175,225 @@ programmer connection_type = usb; ; +programmer + id = "flip1"; + desc = "FLIP USB DFU protocol version 1 (doc7618)"; + type = "flip1"; + connection_type = usb; +; + +programmer + id = "flip2"; + desc = "FLIP USB DFU protocol version 2 (AVR4023)"; + type = "flip2"; + connection_type = usb; +; + +# Parallel port programmers. + +programmer + id = "bsd"; + desc = "Brian Dean's Programmer, http://www.bsdhome.com/avrdude/"; + type = "par"; + connection_type = parallel; + vcc = 2, 3, 4, 5; + reset = 7; + sck = 8; + mosi = 9; + miso = 10; +; + +programmer + id = "stk200"; + desc = "STK200"; + type = "par"; + connection_type = parallel; + buff = 4, 5; + sck = 6; + mosi = 7; + reset = 9; + miso = 10; +; + +# The programming dongle used by the popular Ponyprog +# utility. It is almost similar to the STK200 one, +# except that there is a LED indicating that the +# programming is currently in progress. + +programmer parent "stk200" + id = "pony-stk200"; + desc = "Pony Prog STK200"; + pgmled = 8; +; + +programmer + id = "dt006"; + desc = "Dontronics DT006"; + type = "par"; + connection_type = parallel; + reset = 4; + sck = 5; + mosi = 2; + miso = 11; +; + +programmer parent "dt006" + id = "bascom"; + desc = "Bascom SAMPLE programming cable"; +; + +programmer + id = "alf"; + desc = "Nightshade ALF-PgmAVR, http://nightshade.homeip.net/"; + type = "par"; + connection_type = parallel; + vcc = 2, 3, 4, 5; + buff = 6; + reset = 7; + sck = 8; + mosi = 9; + miso = 10; + errled = 1; + rdyled = 14; + pgmled = 16; + vfyled = 17; +; + +programmer + id = "sp12"; + desc = "Steve Bolt's Programmer"; + type = "par"; + connection_type = parallel; + vcc = 4,5,6,7,8; + reset = 3; + sck = 2; + mosi = 9; + miso = 11; +; + +programmer + id = "picoweb"; + desc = "Picoweb Programming Cable, http://www.picoweb.net/"; + type = "par"; + connection_type = parallel; + reset = 2; + sck = 3; + mosi = 4; + miso = 13; +; + +programmer + id = "abcmini"; + desc = "ABCmini Board, aka Dick Smith HOTCHIP"; + type = "par"; + connection_type = parallel; + reset = 4; + sck = 3; + mosi = 2; + miso = 10; +; + +programmer + id = "futurlec"; + desc = "Futurlec.com programming cable."; + type = "par"; + connection_type = parallel; + reset = 3; + sck = 2; + mosi = 1; + miso = 10; +; + + +# From the contributor of the "xil" jtag cable: +# The "vcc" definition isn't really vcc (the cable gets its power from +# the programming circuit) but is necessary to switch one of the +# buffer lines (trying to add it to the "buff" lines doesn't work in +# avrdude versions before 5.5j). +# With this, TMS connects to RESET, TDI to MOSI, TDO to MISO and TCK +# to SCK (plus vcc/gnd of course) +programmer + id = "xil"; + desc = "Xilinx JTAG cable"; + type = "par"; + connection_type = parallel; + mosi = 2; + sck = 3; + reset = 4; + buff = 5; + miso = 13; + vcc = 6; +; + + +programmer + id = "dapa"; + desc = "Direct AVR Parallel Access cable"; + type = "par"; + connection_type = parallel; + vcc = 3; + reset = 16; + sck = 1; + mosi = 2; + miso = 11; +; + +programmer + id = "atisp"; + desc = "AT-ISP V1.1 programming cable for AVR-SDK1 from micro-research.co.th"; + type = "par"; + connection_type = parallel; + reset = ~6; + sck = ~8; + mosi = ~7; + miso = ~10; +; + +programmer + id = "ere-isp-avr"; + desc = "ERE ISP-AVR "; + type = "par"; + connection_type = parallel; + reset = ~4; + sck = 3; + mosi = 2; + miso = 10; +; + +programmer + id = "blaster"; + desc = "Altera ByteBlaster"; + type = "par"; + connection_type = parallel; + sck = 2; + miso = 11; + reset = 3; + mosi = 8; + buff = 14; +; + +# It is almost same as pony-stk200, except vcc on pin 5 to auto +# disconnect port (download on http://electropol.free.fr/spip/spip.php?article27) +programmer parent "pony-stk200" + id = "frank-stk200"; + desc = "Frank STK200"; + buff = ; # delete buff pin assignment + vcc = 5; +; + +# The AT98ISP Cable is a simple parallel dongle for AT89 family. +# http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2877 +programmer + id = "89isp"; + desc = "Atmel at89isp cable"; + type = "par"; + connection_type = parallel; + reset = 17; + sck = 1; + mosi = 2; + miso = 10; +; + #This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface # @@ -1005,30 +1417,7 @@ programmer # miso = ?; #; -#This programmer bitbangs GPIO lines using the Linux sysfs GPIO interface and direct -#GPIO memory registers read/write. -# -#To enable it set the configuration below to match the GPIO lines connected to the -#relevant ISP header pins and uncomment the entry definition. In case you don't -#have the required permissions to edit this system wide config file put the -#entry in a separate .conf file and use it with -C+.conf -#on the command line. -# -#To check if your avrdude build has support for the arduinotre programmer compiled in, -#use -c?type on the command line and look for arduinotre in the list. If it's not available -#you need pass the --enable-arduinotre=yes option to configure and recompile avrdude. -# -#programmer -# id = "arduinotre"; -# desc = "Arduino TRE bitbanging using GPIO registers"; -# type = "arduinotre"; -# reset = ~65; -# sck = 49; -# mosi = 48; -# miso = 61; -#; - -# some ultra cheap programmers use bitbanging on the +# some ultra cheap programmers use bitbanging on the # serialport. # # PC - DB9 - Pins for RS232: @@ -4041,28 +4430,236 @@ part readback_p1 = 0xff; readback_p2 = 0xff; read_lo = " 0 0 1 0 0 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + read_hi = " 0 0 1 0 1 0 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + loadpage_lo = " 0 1 0 0 0 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_hi = " 0 1 0 0 1 0 0 0", + " 0 0 x x x x x x", + " x x a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 0 1 0 0 1 1 0 0", + " 0 a14 a13 a12 a11 a10 a9 a8", + " a7 a6 x x x x x x", + " x x x x x x x x"; + + mode = 0x21; + delay = 6; + blocksize = 256; + readsize = 256; + ; + + memory "lock" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x x x o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", + "x x x x x x x x 1 1 i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "lfuse" + size = 1; + read = "0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "hfuse" + size = 1; + read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 1 0 0 0", + "x x x x x x x x i i i i i i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "efuse" + size = 1; + + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x 1 1 1 1 1 i i i"; + min_write_delay = 9000; + max_write_delay = 9000; + ; + + memory "signature" + size = 3; + read = "0 0 1 1 0 0 0 0 x x x x x x x x", + "x x x x x x a1 a0 o o o o o o o o"; + ; + + memory "calibration" + size = 1; + + read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", + "0 0 0 0 0 0 0 0 o o o o o o o o"; + ; + ; + + +#------------------------------------------------------------ +# ATmega324PA +#------------------------------------------------------------ + +# similar to ATmega324P + +part parent "m324p" + id = "m324pa"; + desc = "ATmega324PA"; + signature = 0x1e 0x95 0x11; + + ocdrev = 3; + ; + + +#------------------------------------------------------------ +# ATmega644 +#------------------------------------------------------------ + +# similar to ATmega164 + +part + id = "m644"; + desc = "ATmega644"; + has_jtag = yes; + stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one + avr910_devcode = 0x74; + signature = 0x1e 0x96 0x09; + pagel = 0xd7; + bs2 = 0xa0; + chip_erase_delay = 55000; + pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", + "x x x x x x x x x x x x x x x x"; + + chip_erase = "1 0 1 0 1 1 0 0 1 0 0 x x x x x", + "x x x x x x x x x x x x x x x x"; + + timeout = 200; + stabdelay = 100; + cmdexedelay = 25; + synchloops = 32; + bytedelay = 0; + pollindex = 3; + pollvalue = 0x53; + predelay = 1; + postdelay = 1; + pollmethod = 0; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 6; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + idr = 0x31; + spmcr = 0x57; + allowfullpagebitstream = no; + + ocdrev = 3; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 9000; + max_write_delay = 9000; + readback_p1 = 0xff; + readback_p2 = 0xff; + read = " 1 0 1 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 128; + readsize = 256; + ; + + memory "flash" + paged = yes; + size = 65536; + page_size = 256; + num_pages = 256; + min_write_delay = 4500; + max_write_delay = 4500; + readback_p1 = 0xff; + readback_p2 = 0xff; + read_lo = " 0 0 1 0 0 0 0 0", + "a15 a14 a13 a12 a11 a10 a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", " o o o o o o o o"; read_hi = " 0 0 1 0 1 0 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", + "a15 a14 a13 a12 a11 a10 a9 a8", " a7 a6 a5 a4 a3 a2 a1 a0", " o o o o o o o o"; loadpage_lo = " 0 1 0 0 0 0 0 0", " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", + " x a6 a5 a4 a3 a2 a1 a0", " i i i i i i i i"; loadpage_hi = " 0 1 0 0 1 0 0 0", " 0 0 x x x x x x", - " x x a5 a4 a3 a2 a1 a0", + " x a6 a5 a4 a3 a2 a1 a0", " i i i i i i i i"; writepage = " 0 1 0 0 1 1 0 0", - " 0 a14 a13 a12 a11 a10 a9 a8", - " a7 a6 x x x x x x", + "a15 a14 a13 a12 a11 a10 a9 a8", + " a7 x x x x x x x", " x x x x x x x x"; mode = 0x21; @@ -4130,35 +4727,35 @@ part ; ; - #------------------------------------------------------------ -# ATmega324PA +# ATmega644P #------------------------------------------------------------ -# similar to ATmega324P +# similar to ATmega164p -part parent "m324p" - id = "m324pa"; - desc = "ATmega324PA"; - signature = 0x1e 0x95 0x11; +part parent "m644" + id = "m644p"; + desc = "ATmega644P"; + signature = 0x1e 0x96 0x0a; ocdrev = 3; ; + #------------------------------------------------------------ -# ATmega644 +# ATmega1284 #------------------------------------------------------------ # similar to ATmega164 part - id = "m644"; - desc = "ATmega644"; + id = "m1284"; + desc = "ATmega1284"; has_jtag = yes; stk500_devcode = 0x82; # no STK500v1 support, use the ATmega16 one avr910_devcode = 0x74; - signature = 0x1e 0x96 0x09; + signature = 0x1e 0x97 0x06; pagel = 0xd7; bs2 = 0xa0; chip_erase_delay = 55000; @@ -4177,7 +4774,7 @@ part pollvalue = 0x53; predelay = 1; postdelay = 1; - pollmethod = 0; + pollmethod = 1; pp_controlstack = 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, @@ -4187,9 +4784,9 @@ part hventerstabdelay = 100; progmodedelay = 0; latchcycles = 6; - togglevtg = 0; - poweroffdelay = 0; - resetdelayms = 0; + togglevtg = 1; + poweroffdelay = 15; + resetdelayms = 1; resetdelayus = 0; hvleavestabdelay = 15; chiperasepulsewidth = 0; @@ -4208,7 +4805,7 @@ part memory "eeprom" paged = no; /* leave this "no" */ page_size = 8; /* for parallel programming */ - size = 2048; + size = 4096; min_write_delay = 9000; max_write_delay = 9000; readback_p1 = 0xff; @@ -4241,9 +4838,9 @@ part memory "flash" paged = yes; - size = 65536; + size = 131072; page_size = 256; - num_pages = 256; + num_pages = 512; min_write_delay = 4500; max_write_delay = 4500; readback_p1 = 0xff; @@ -4273,8 +4870,8 @@ part " a7 x x x x x x x", " x x x x x x x x"; - mode = 0x21; - delay = 6; + mode = 0x41; + delay = 10; blocksize = 256; readsize = 256; ; @@ -4338,20 +4935,6 @@ part ; ; -#------------------------------------------------------------ -# ATmega644P -#------------------------------------------------------------ - -# similar to ATmega164p - -part parent "m644" - id = "m644p"; - desc = "ATmega644P"; - signature = 0x1e 0x96 0x0a; - - ocdrev = 3; - ; - #------------------------------------------------------------ @@ -5963,6 +6546,13 @@ part "x x x x x x x x i i i i i i i i"; ; + # Required for Arduino IDE + # see: https://github.com/arduino/Arduino/issues/2075 + # https://github.com/arduino/Arduino/issues/2075#issuecomment-238031689 + memory "efuse" + size = 0; + ; + memory "lock" size = 1; min_write_delay = 2000; @@ -6447,7 +7037,7 @@ part "x x x x x x x x x x x i i i i i"; read = "0 1 0 1 1 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x o o o o o"; + "x x x x x x x x o o o o o o o o"; min_write_delay = 9000; max_write_delay = 9000; ; @@ -6638,7 +7228,7 @@ part "x x x x x x x x x x x x x x x i"; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; + "x x x x x x x x o o o o o o o o"; min_write_delay = 4500; max_write_delay = 4500; ; @@ -6829,7 +7419,7 @@ part "x x x x x x x x x x x x x x x i"; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; + "x x x x x x x x o o o o o o o o"; min_write_delay = 4500; max_write_delay = 4500; ; @@ -7020,7 +7610,7 @@ part "x x x x x x x x x x x x x x x i"; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; + "x x x x x x x x o o o o o o o o"; min_write_delay = 4500; max_write_delay = 4500; ; @@ -7034,6 +7624,66 @@ part ; +#------------------------------------------------------------ +# ATtiny28 +#------------------------------------------------------------ + +# This is an HVPP-only device. + +part + id = "t28"; + desc = "ATtiny28"; + stk500_devcode = 0x22; + avr910_devcode = 0x5c; + signature = 0x1e 0x91 0x07; + + pp_controlstack = + 0x0E, 0x1E, 0x0F, 0x1F, 0x2E, 0x3E, 0x2F, 0x3F, + 0x4E, 0x5E, 0x4F, 0x5F, 0x6E, 0x7E, 0x6F, 0x7F, + 0x66, 0x76, 0x67, 0x77, 0x6A, 0x7A, 0x6B, 0x7B, + 0xBE, 0xFD, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00; + hventerstabdelay = 100; + progmodedelay = 0; + latchcycles = 0; + togglevtg = 0; + poweroffdelay = 0; + resetdelayms = 0; + resetdelayus = 0; + hvleavestabdelay = 15; + resetdelay = 15; + chiperasepulsewidth = 0; + chiperasepolltimeout = 10; + programfusepulsewidth = 0; + programfusepolltimeout = 5; + programlockpulsewidth = 0; + programlockpolltimeout = 5; + + memory "flash" + size = 2048; + page_size = 2; + readsize = 256; + delay = 5; + ; + + memory "signature" + size = 3; + ; + + memory "lock" + size = 1; + ; + + memory "calibration" + size = 1; + ; + + memory "fuse" + size = 1; + ; +; + + + #------------------------------------------------------------ # ATmega48 #------------------------------------------------------------ @@ -7192,7 +7842,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x x x o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x x x x x i"; @@ -7234,6 +7884,18 @@ part parent "m48" ocdrev = 1; ; +#------------------------------------------------------------ +# ATmega48PB +#------------------------------------------------------------ + +part parent "m48" + id = "m48pb"; + desc = "ATmega48PB"; + signature = 0x1e 0x92 0x10; + + ocdrev = 1; + ; + #------------------------------------------------------------ # ATmega88 #------------------------------------------------------------ @@ -7392,7 +8054,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x x x i i i"; @@ -7434,6 +8096,18 @@ part parent "m88" ocdrev = 1; ; +#------------------------------------------------------------ +# ATmega88PB +#------------------------------------------------------------ + +part parent "m88" + id = "m88pb"; + desc = "ATmega88PB"; + signature = 0x1e 0x93 0x16; + + ocdrev = 1; + ; + #------------------------------------------------------------ # ATmega168 #------------------------------------------------------------ @@ -7594,7 +8268,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x x x i i i"; @@ -7636,6 +8310,18 @@ part parent "m168" ocdrev = 1; ; +#------------------------------------------------------------ +# ATmega168PB +#------------------------------------------------------------ + +part parent "m168" + id = "m168pb"; + desc = "ATmega168PB"; + signature = 0x1e 0x94 0x15; + + ocdrev = 1; +; + #------------------------------------------------------------ # ATtiny88 #------------------------------------------------------------ @@ -7794,7 +8480,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x x x x x i"; @@ -7984,7 +8670,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x x x o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x x x i i i"; @@ -8022,6 +8708,26 @@ part parent "m328" ocdrev = 1; ; +#------------------------------------------------------------ +# ATmega32m1 +#------------------------------------------------------------ + +part parent "m328" + id = "m32m1"; + desc = "ATmega32M1"; + # stk500_devcode = 0x; + # avr910_devcode = 0x; + signature = 0x1e 0x95 0x84; + bs2 = 0xe2; + + memory "efuse" + read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", + "x x x x x x x x o o o o o o o o"; + write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", + "x x x x x x x x x x i i i i i i"; + ; +; + #------------------------------------------------------------ # ATtiny2313 #------------------------------------------------------------ @@ -8668,6 +9374,16 @@ part parent "pwm3b" ; ; +#------------------------------------------------------------ +# AT90PWM216 +#------------------------------------------------------------ +# Completely identical to AT90PWM316 (including the signature!) + +part parent "pwm316" + id = "pwm216"; + desc = "AT90PWM216"; + ; + #------------------------------------------------------------ # ATtiny25 #------------------------------------------------------------ @@ -8806,6 +9522,8 @@ part size = 1; write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; min_write_delay = 9000; max_write_delay = 9000; ; @@ -8844,7 +9562,7 @@ part ; memory "calibration" - size = 2; + size = 1; read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", "0 0 0 0 0 0 0 a0 o o o o o o o o"; ; @@ -8987,6 +9705,8 @@ part size = 1; write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; min_write_delay = 9000; max_write_delay = 9000; ; @@ -9025,7 +9745,7 @@ part ; memory "calibration" - size = 2; + size = 1; read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", "0 0 0 0 0 0 0 a0 o o o o o o o o"; ; @@ -9169,6 +9889,8 @@ part size = 1; write = "1 0 1 0 1 1 0 0 1 1 1 x x x x x", "x x x x x x x x 1 1 i i i i i i"; + read = "0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0", + "0 0 0 0 0 0 0 0 o o o o o o o o"; min_write_delay = 9000; max_write_delay = 9000; ; @@ -9207,7 +9929,7 @@ part ; memory "calibration" - size = 2; + size = 1; read = "0 0 1 1 1 0 0 0 0 0 0 x x x x x", "0 0 0 0 0 0 0 a0 o o o o o o o o"; ; @@ -9616,7 +10338,7 @@ part desc = "ATmega2560"; signature = 0x1e 0x98 0x01; has_jtag = yes; -# stk500_devcode = 0xB2; + stk500_devcode = 0xB2; # avr910_devcode = 0x43; chip_erase_delay = 9000; pagel = 0xD7; @@ -9877,9 +10599,43 @@ part parent "m2561" id = "m256rfr2"; desc = "ATmega256RFR2"; signature = 0x1e 0xa8 0x02; - chip_erase_delay = 55000; + chip_erase_delay = 18500; bs2 = 0xE2; + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 8192; + min_write_delay = 13000; + max_write_delay = 13000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x a12 a11 a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + ocdrev = 4; ; @@ -9948,6 +10704,42 @@ part parent "m128rfa1" blocksize = 256; readsize = 256; ; + + memory "eeprom" + paged = no; /* leave this "no" */ + page_size = 8; /* for parallel programming */ + size = 2048; + min_write_delay = 13000; + max_write_delay = 13000; + readback_p1 = 0x00; + readback_p2 = 0x00; + read = " 1 0 1 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " o o o o o o o o"; + + write = " 1 1 0 0 0 0 0 0", + " x x x x x a10 a9 a8", + " a7 a6 a5 a4 a3 a2 a1 a0", + " i i i i i i i i"; + + loadpage_lo = " 1 1 0 0 0 0 0 1", + " 0 0 0 0 0 0 0 0", + " 0 0 0 0 0 a2 a1 a0", + " i i i i i i i i"; + + writepage = " 1 1 0 0 0 0 1 0", + " 0 0 x x x a10 a9 a8", + " a7 a6 a5 a4 a3 0 0 0", + " x x x x x x x x"; + + mode = 0x41; + delay = 10; + blocksize = 8; + readsize = 256; + ; + + ; #------------------------------------------------------------ @@ -10720,6 +11512,7 @@ part id = "m32u4"; desc = "ATmega32U4"; signature = 0x1e 0x95 0x87; + usbpid = 0x2ff4; has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; @@ -10910,6 +11703,7 @@ part id = "usb646"; desc = "AT90USB646"; signature = 0x1e 0x96 0x82; + usbpid = 0x2ff9; has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; @@ -11113,6 +11907,7 @@ part id = "usb1286"; desc = "AT90USB1286"; signature = 0x1e 0x97 0x82; + usbpid = 0x2ffb; has_jtag = yes; # stk500_devcode = 0xB2; # avr910_devcode = 0x43; @@ -11318,6 +12113,7 @@ part has_jtag = no; has_debugwire = yes; signature = 0x1e 0x94 0x82; + usbpid = 0x2ffa; chip_erase_delay = 9000; reset = io; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", @@ -11504,6 +12300,7 @@ part has_jtag = no; has_debugwire = yes; signature = 0x1e 0x93 0x82; + usbpid = 0x2ff7; chip_erase_delay = 9000; reset = io; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", @@ -11692,6 +12489,7 @@ part has_jtag = no; has_debugwire = yes; signature = 0x1e 0x95 0x8a; + usbpid = 0x2ff0; chip_erase_delay = 9000; reset = io; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", @@ -11879,6 +12677,7 @@ part has_jtag = no; has_debugwire = yes; signature = 0x1e 0x94 0x89; + usbpid = 0x2fef; chip_erase_delay = 9000; reset = io; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", @@ -12066,6 +12865,7 @@ part has_jtag = no; has_debugwire = yes; signature = 0x1e 0x93 0x89; + usbpid = 0x2fee; chip_erase_delay = 9000; reset = io; pgm_enable = "1 0 1 0 1 1 0 0 0 1 0 1 0 0 1 1", @@ -12145,8 +12945,8 @@ part memory "flash" paged = yes; size = 8192; - page_size = 64; - num_pages = 128; + page_size = 128; + num_pages = 64; min_write_delay = 4500; max_write_delay = 4500; readback_p1 = 0x00; @@ -12178,7 +12978,7 @@ part mode = 0x41; delay = 6; - blocksize = 64; + blocksize = 128; readsize = 256; ; @@ -12705,6 +13505,7 @@ part parent ".xmega" id = "x16a4u"; desc = "ATxmega16A4U"; signature = 0x1e 0x94 0x41; + usbpid = 0x2fe3; memory "eeprom" size = 0x400; @@ -12793,6 +13594,7 @@ part parent ".xmega" id = "x32a4u"; desc = "ATxmega32A4U"; signature = 0x1e 0x95 0x41; + usbpid = 0x2fe4; memory "eeprom" size = 0x400; @@ -12881,6 +13683,7 @@ part parent ".xmega" id = "x64a4u"; desc = "ATxmega64A4U"; signature = 0x1e 0x96 0x46; + usbpid = 0x2fe5; memory "eeprom" size = 0x800; @@ -12933,6 +13736,7 @@ part parent "x64a4u" id = "x64c3"; desc = "ATxmega64C3"; signature = 0x1e 0x96 0x49; + usbpid = 0x2fd6; ; #------------------------------------------------------------ @@ -12979,6 +13783,7 @@ part parent "x64a1" id = "x64a1u"; desc = "ATxmega64A1U"; signature = 0x1e 0x96 0x4e; + usbpid = 0x2fe8; ; #------------------------------------------------------------ @@ -12999,6 +13804,7 @@ part parent "x64a1" id = "x64a3u"; desc = "ATxmega64A3U"; signature = 0x1e 0x96 0x42; + usbpid = 0x2fe5; ; #------------------------------------------------------------ @@ -13019,6 +13825,7 @@ part parent "x64a1" id = "x64b1"; desc = "ATxmega64B1"; signature = 0x1e 0x96 0x52; + usbpid = 0x2fe1; ; #------------------------------------------------------------ @@ -13029,6 +13836,7 @@ part parent "x64a1" id = "x64b3"; desc = "ATxmega64B3"; signature = 0x1e 0x96 0x51; + usbpid = 0x2fdf; ; #------------------------------------------------------------ @@ -13039,6 +13847,7 @@ part parent ".xmega" id = "x128c3"; desc = "ATxmega128C3"; signature = 0x1e 0x97 0x52; + usbpid = 0x2fd7; memory "eeprom" size = 0x800; @@ -13137,6 +13946,7 @@ part parent "x128a1" id = "x128a1u"; desc = "ATxmega128A1U"; signature = 0x1e 0x97 0x4c; + usbpid = 0x2fed; ; #------------------------------------------------------------ @@ -13157,6 +13967,7 @@ part parent "x128a1" id = "x128a3u"; desc = "ATxmega128A3U"; signature = 0x1e 0x97 0x42; + usbpid = 0x2fe6; ; #------------------------------------------------------------ @@ -13225,6 +14036,7 @@ part parent ".xmega" id = "x128a4u"; desc = "ATxmega128A4U"; signature = 0x1e 0x97 0x46; + usbpid = 0x2fde; memory "eeprom" size = 0x800; @@ -13277,6 +14089,7 @@ part parent ".xmega" id = "x128b1"; desc = "ATxmega128B1"; signature = 0x1e 0x97 0x4d; + usbpid = 0x2fea; has_jtag = yes; memory "eeprom" @@ -13335,6 +14148,7 @@ part parent "x128b1" id = "x128b3"; desc = "ATxmega128B3"; signature = 0x1e 0x97 0x4b; + usbpid = 0x2fe0; ; #------------------------------------------------------------ @@ -13345,6 +14159,7 @@ part parent ".xmega" id = "x192c3"; desc = "ATxmega192C3"; signature = 0x1e 0x97 0x51; + # usbpid = 0x2f??; memory "eeprom" size = 0x800; @@ -13433,6 +14248,7 @@ part parent "x192a1" id = "x192a3u"; desc = "ATxmega192A3U"; signature = 0x1e 0x97 0x44; + usbpid = 0x2fe7; ; #------------------------------------------------------------ @@ -13443,6 +14259,7 @@ part parent ".xmega" id = "x256c3"; desc = "ATxmega256C3"; signature = 0x1e 0x98 0x46; + usbpid = 0x2fda; memory "eeprom" size = 0x1000; @@ -13531,6 +14348,7 @@ part parent "x256a1" id = "x256a3u"; desc = "ATxmega256A3U"; signature = 0x1e 0x98 0x42; + usbpid = 0x2fec; ; #------------------------------------------------------------ @@ -13551,6 +14369,7 @@ part parent "x256a1" id = "x256a3bu"; desc = "ATxmega256A3BU"; signature = 0x1e 0x98 0x43; + usbpid = 0x2fe2; ; #------------------------------------------------------------ @@ -13561,6 +14380,7 @@ part parent ".xmega" id = "x384c3"; desc = "ATxmega384C3"; signature = 0x1e 0x98 0x45; + usbpid = 0x2fdb; memory "eeprom" size = 0x1000; @@ -13647,7 +14467,7 @@ part parent ".xmega" memory "boot" size = 0x800; - offset = 0x00804000; + offset = 0x00802000; page_size = 0x80; readsize = 0x100; ; @@ -13751,7 +14571,7 @@ part parent ".xmega" memory "boot" size = 0x1000; - offset = 0x00804000; + offset = 0x00808000; page_size = 0x80; readsize = 0x100; ; @@ -13956,7 +14776,7 @@ part min_write_delay = 4500; max_write_delay = 4500; read = "0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0", - "x x x x x x x x x x x o o o o o"; + "x x x x x x x x o o o o o o o o"; write = "1 0 1 0 1 1 0 0 1 0 1 0 0 1 0 0", "x x x x x x x x x x x i i i i i"; diff --git a/sparkfun/avr/boards.txt b/sparkfun/avr/boards.txt index e870abde..aaef557c 100644 --- a/sparkfun/avr/boards.txt +++ b/sparkfun/avr/boards.txt @@ -380,3 +380,29 @@ LilyPadProtoUSB.build.board=AVR_LILYPAD_ARDUINO_USB_PLUS_BOARD LilyPadProtoUSB.build.core=arduino:arduino LilyPadProtoUSB.build.variant=lilypadusbplus LilyPadProtoUSB.build.extra_flags={build.usb_flags} + + +################################################################################ +################################### SerLCD ##################################### +################################################################################ +SerLCD.name=SparkFun SerLCD + +SerLCD.upload.tool=avrdude +SerLCD.upload.protocol=arduino +SerLCD.upload.maximum_size=32256 +SerLCD.upload.maximum_data_size=2048 +SerLCD.upload.speed=115200 + +SerLCD.bootloader.tool=avrdude +SerLCD.bootloader.low_fuses=0xFF +SerLCD.bootloader.high_fuses=0xDE +SerLCD.bootloader.extended_fuses=0xFD +SerLCD.bootloader.unlock_bits=0x3F +SerLCD.bootloader.lock_bits=0x0F +SerLCD.bootloader.file=optiboot/optiboot_SerLCD.hex + +SerLCD.build.mcu=atmega328p +SerLCD.build.f_cpu=11059200L +SerLCD.build.board=AVR_UNO +SerLCD.build.core=arduino:arduino +SerLCD.build.variant=arduino:standard diff --git a/sparkfun/avr/bootloaders/optiboot/Makefile b/sparkfun/avr/bootloaders/optiboot/Makefile index f2e99ac9..14ea68df 100644 --- a/sparkfun/avr/bootloaders/optiboot/Makefile +++ b/sparkfun/avr/bootloaders/optiboot/Makefile @@ -24,10 +24,10 @@ PROGRAM = optiboot # Arduino user IDE setup, or the Arduino source tree. # Uncomment this next lines to build within the arduino environment, # using the arduino-included avrgcc toolset (mac and pc) -# ENV ?= arduino +ENV ?= arduino # ENV ?= arduinodev # OS ?= macosx -# OS ?= windows +OS ?= windows # enter the parameters for the avrdude isp tool @@ -53,6 +53,7 @@ ifeq ($(ENV), arduino) TOOLROOT = ../../../tools GCCROOT = $(TOOLROOT)/avr/bin/ AVRDUDE_CONF = -C$(TOOLROOT)/avr/etc/avrdude.conf +endif ifeq ($(OS), windows) # On windows, SOME of the tool paths will need to have backslashes instead @@ -63,7 +64,7 @@ fixpath = $(subst /,\,$1) SHELL = cmd.exe endif -else ifeq ($(ENV), arduinodev) +ifeq ($(ENV), arduinodev) # Arduino IDE source code environment. Use the unpacked compilers created # by the build (you'll need to do "ant build" first.) ifeq ($(OS), macosx) diff --git a/sparkfun/avr/bootloaders/optiboot/optiboot_SerLCD.hex b/sparkfun/avr/bootloaders/optiboot/optiboot_SerLCD.hex new file mode 100644 index 00000000..6cac620c --- /dev/null +++ b/sparkfun/avr/bootloaders/optiboot/optiboot_SerLCD.hex @@ -0,0 +1,35 @@ +:107E0000112484B714BE81FFF0D085E080938100F7 +:107E100082E08093C00088E18093C10086E0809377 +:107E2000C2008BE08093C4008EE0C9D0259A86E022 +:107E30002DE53DEF91E0309385002093840096BBC3 +:107E4000B09BFECF1D9AA8958150A9F7CC24DD24C4 +:107E500088248394B5E0AB2EA1E19A2EF3E0BF2EE7 +:107E6000A2D0813461F49FD0082FAFD0023811F036 +:107E7000013811F484E001C083E08DD089C08234E0 +:107E800011F484E103C0853419F485E0A6D080C0E4 +:107E9000853579F488D0E82EFF2485D0082F10E0AE +:107EA000102F00270E291F29000F111F8ED06801E7 +:107EB0006FC0863521F484E090D080E0DECF843638 +:107EC00009F040C070D06FD0082F6DD080E0C81688 +:107ED00080E7D80618F4F601B7BEE895C0E0D1E017 +:107EE00062D089930C17E1F7F0E0CF16F0E7DF06D8 +:107EF00018F0F601B7BEE89568D007B600FCFDCFD4 +:107F0000A601A0E0B1E02C9130E011968C91119780 +:107F100090E0982F8827822B932B1296FA010C0160 +:107F200087BEE89511244E5F5F4FF1E0A038BF0790 +:107F300051F7F601A7BEE89507B600FCFDCF97BE46 +:107F4000E89526C08437B1F42ED02DD0F82E2BD052 +:107F50003CD0F601EF2C8F010F5F1F4F84911BD097 +:107F6000EA94F801C1F70894C11CD11CFA94CF0C13 +:107F7000D11C0EC0853739F428D08EE10CD085E9AC +:107F80000AD08FE07ACF813511F488E018D01DD067 +:107F900080E101D065CF982F8091C00085FFFCCF94 +:107FA0009093C60008958091C00087FFFCCF809118 +:107FB000C00084FD01C0A8958091C6000895E0E648 +:107FC000F0E098E1908380830895EDDF803219F02E +:107FD00088E0F5DFFFCF84E1DECF1F93182FE3DFCA +:107FE0001150E9F7F2DF1F91089580E0E8DFEE27F6 +:047FF000FF270994CA +:027FFE00040479 +:0400000300007E007B +:00000001FF diff --git a/sparkfun/avr/libraries/Qduino/Qduino.cpp b/sparkfun/avr/libraries/Qduino/Qduino.cpp index 2e2c1f4c..3573ff56 100755 --- a/sparkfun/avr/libraries/Qduino/Qduino.cpp +++ b/sparkfun/avr/libraries/Qduino/Qduino.cpp @@ -7,7 +7,7 @@ * mattnewberry@me.com * * * *************************************************************************** - * * + * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU License. * * This program is distributed in the hope that it will be useful, * @@ -22,7 +22,7 @@ #include "Wire.h" void qduino::setup(){ - + pinMode(13, OUTPUT); digitalWrite(13, HIGH); pinMode(11, OUTPUT); @@ -32,21 +32,21 @@ void qduino::setup(){ } void qduino::setRGB(uint8_t r, uint8_t g, uint8_t b){ - + // ratio for R:G:B is 4:7:7 for forward voltage - + r = 255 - r; // set all values to opposite values g = 255 - g; // because LED is common anode b = 255 - b; - + int newr = map(r, 0, 255, 0, 146); - + analogWrite(10, newr); analogWrite(11, g); analogWrite(13, b); } -void qduino::setRGB(COLORS color){ +void qduino::setRGB(COLORS color){ switch (color) { case RED: analogWrite(10, 0); @@ -97,31 +97,31 @@ void qduino::setRGB(COLORS color){ } void qduino::rainbow(uint8_t duration) -{ +{ uint8_t rgbColor[3]; // Keep values for duration bounded if (duration < 1) duration = 1; if (duration > 5) duration = 5; - + int newDuration = map(duration, 1, 5, 500, 3000); - + // Start off with red. rgbColor[0] = 255; rgbColor[1] = 0; - rgbColor[2] = 0; - + rgbColor[2] = 0; + // Choose the colours to increment and decrement. for (uint8_t decColor = 0; decColor < 3; decColor += 1) { int incColor = decColor == 2 ? 0 : decColor + 1; - + // cross-fade the two colours. for(uint8_t i = 0; i < 255; i += 1) { rgbColor[decColor] -= 1; rgbColor[incColor] += 1; - + analogWrite(10, rgbColor[0]); analogWrite(11, rgbColor[1]); analogWrite(13, rgbColor[2]); @@ -131,7 +131,7 @@ void qduino::rainbow(uint8_t duration) } void qduino::ledOff() -{ +{ analogWrite(10, 255); analogWrite(11, 255); analogWrite(13, 255); @@ -167,7 +167,7 @@ char fuelGauge::getVersion() byte msb = 0; byte lsb = 0; readFrom(MAX1704_VERSION, msb, lsb); - + value = 0xFF00 & (msb<<8); value |= 0xFF & lsb; @@ -211,7 +211,7 @@ boolean fuelGauge::inSleep() byte lsb = 0; readFrom(MAX1704_CONFIG,msb,lsb); - byte sleep = (lsb >>7) & 0x01; + byte sleep = (lsb >>7) & 0x01; return int(sleep) == 1; } @@ -256,7 +256,7 @@ void fuelGauge::wakeUp() Wire.endTransmission(); // This delay is here to ensure it's fully awake before moving on - delay(150); + delay(150); } void fuelGauge::performCommand(byte address, int value) @@ -281,6 +281,5 @@ void fuelGauge::readFrom(byte address, byte &msb, byte &lsb) msb = Wire.read(); lsb = Wire.read(); } - Wire.endTransmission(); + //Wire.endTransmission(); } - diff --git a/sparkfun/avr/platform.txt b/sparkfun/avr/platform.txt index 0a282020..b42b6a77 100644 --- a/sparkfun/avr/platform.txt +++ b/sparkfun/avr/platform.txt @@ -5,7 +5,7 @@ # For more info: # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification -name=Arduino AVR Boards +name=SparkFun AVR Boards version=1.6.19 # AVR compile variables diff --git a/sparkfun/esp8266/LICENSE b/sparkfun/esp8266/LICENSE deleted file mode 100644 index 2efec221..00000000 --- a/sparkfun/esp8266/LICENSE +++ /dev/null @@ -1,11 +0,0 @@ -### License and credits - -Arduino IDE is based on Wiring and Processing. It is developed and maintained by the Arduino team. The IDE is licensed under GPL, and the core libraries are licensed under LGPL. - -This build includes an xtensa gcc toolchain, which is also under GPL. - -Espressif SDK included in this build is under Espressif Public License. - -Esptool written by Christian Klippel is licensed under GPLv2, currently maintained by Ivan Grokhotkov: https://github.com/igrr/esptool-ck. - -ESP8266 core support, ESP8266WiFi, Ticker, ESP8266WebServer libraries were written by Ivan Grokhotkov, ivan@esp8266.com. \ No newline at end of file diff --git a/sparkfun/esp8266/boards.txt b/sparkfun/esp8266/boards.txt deleted file mode 100644 index ae65474d..00000000 --- a/sparkfun/esp8266/boards.txt +++ /dev/null @@ -1,279 +0,0 @@ -menu.UploadSpeed=Upload Speed -menu.CpuFrequency=CPU Frequency -menu.FlashSize=Flash Size -menu.FlashFreq=Flash Frequency - -############################################################## -generic.name=Generic ESP8266 Module - -generic.upload.tool=esptool -generic.upload.speed=115200 -generic.upload.resetmethod=ck -generic.upload.maximum_size=524288 -generic.upload.wait_for_upload_port=true -generic.serial.disableDTR=true -generic.serial.disableRTS=true - -generic.build.mcu=esp8266 -generic.build.f_cpu=80000000L -generic.build.board=ESP8266_ESP01 -generic.build.core=esp8266 -generic.build.variant=generic -generic.build.flash_mode=qio -generic.build.flash_size=512K -generic.build.flash_freq=40 -generic.build.flash_ld=eagle.flash.512k.ld -generic.build.spiffs_start=0x6B000 -generic.build.spiffs_end=0x7B000 - -generic.menu.CpuFrequency.80=80 MHz -generic.menu.CpuFrequency.80.build.f_cpu=80000000L -generic.menu.CpuFrequency.160=160 MHz -generic.menu.CpuFrequency.160.build.f_cpu=160000000L - -generic.menu.UploadSpeed.115200=115200 -generic.menu.UploadSpeed.115200.upload.speed=115200 -generic.menu.UploadSpeed.9600=9600 -generic.menu.UploadSpeed.9600.upload.speed=9600 -generic.menu.UploadSpeed.57600=57600 -generic.menu.UploadSpeed.57600.upload.speed=57600 -generic.menu.UploadSpeed.256000.windows=256000 -generic.menu.UploadSpeed.256000.upload.speed=256000 -generic.menu.UploadSpeed.230400.linux=230400 -generic.menu.UploadSpeed.230400.macosx=230400 -generic.menu.UploadSpeed.230400.upload.speed=230400 -generic.menu.UploadSpeed.460800.linux=460800 -generic.menu.UploadSpeed.460800.macosx=460800 -generic.menu.UploadSpeed.460800.upload.speed=460800 -generic.menu.UploadSpeed.512000.windows=512000 -generic.menu.UploadSpeed.512000.upload.speed=512000 -generic.menu.UploadSpeed.921600=921600 -generic.menu.UploadSpeed.921600.upload.speed=921600 - -generic.menu.FlashSize.512K=512K (64K SPIFFS) -generic.menu.FlashSize.512K.build.flash_size=512K -generic.menu.FlashSize.512K.build.flash_ld=eagle.flash.512k.ld -generic.menu.FlashSize.512K.build.spiffs_start=0x6B000 -generic.menu.FlashSize.512K.build.spiffs_end=0x7B000 -generic.menu.FlashSize.1M512=1M (512K SPIFFS) -generic.menu.FlashSize.1M512.build.flash_size=1M -generic.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld -generic.menu.FlashSize.1M512.build.spiffs_start=0x6B000 -generic.menu.FlashSize.1M512.build.spiffs_end=0xFB000 -generic.menu.FlashSize.1M256=1M (256K SPIFFS) -generic.menu.FlashSize.1M256.build.flash_size=1M -generic.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld -generic.menu.FlashSize.1M256.build.spiffs_start=0xAB000 -generic.menu.FlashSize.1M256.build.spiffs_end=0xFB000 -generic.menu.FlashSize.1M128=1M (128K SPIFFS) -generic.menu.FlashSize.1M128.build.flash_size=1M -generic.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld -generic.menu.FlashSize.1M128.build.spiffs_start=0xCB000 -generic.menu.FlashSize.1M128.build.spiffs_end=0xFB000 -generic.menu.FlashSize.1M64=1M (64K SPIFFS) -generic.menu.FlashSize.1M64.build.flash_size=1M -generic.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld -generic.menu.FlashSize.1M64.build.spiffs_start=0xEB000 -generic.menu.FlashSize.1M64.build.spiffs_end=0xFB000 -generic.menu.FlashSize.2M=2M (1M SPIFFS) -generic.menu.FlashSize.2M.build.flash_size=2M -generic.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld -generic.menu.FlashSize.2M.build.spiffs_start=0x100000 -generic.menu.FlashSize.2M.build.spiffs_end=0x1FB000 -generic.menu.FlashSize.4M=4M (3M SPIFFS) -generic.menu.FlashSize.4M.build.flash_size=4M -generic.menu.FlashSize.4M.build.flash_ld=eagle.flash.4m.ld -generic.menu.FlashSize.4M.build.spiffs_start=0x100000 -generic.menu.FlashSize.4M.build.spiffs_end=0x3FB000 -generic.menu.FlashSize.8M=8M (7M SPIFFS) -generic.menu.FlashSize.8M.build.flash_size=1M -generic.menu.FlashSize.8M.build.flash_ld=eagle.flash.8m.ld -generic.menu.FlashSize.8M.build.spiffs_start=0x100000 -generic.menu.FlashSize.8M.build.spiffs_end=0x800000 -generic.menu.FlashSize.16M=16M (15M SPIFFS) -generic.menu.FlashSize.16M.build.flash_size=1M -generic.menu.FlashSize.16M.build.flash_ld=eagle.flash.16m.ld -generic.menu.FlashSize.16M.build.spiffs_start=0x100000 -generic.menu.FlashSize.16M.build.spiffs_end=0x1000000 - -# generic.menu.FlashFreq.40=40MHz -# generic.menu.FlashFreq.40.build.flash_freq=40 -# generic.menu.FlashFreq.80=80MHz -# generic.menu.FlashFreq.80.build.flash_freq=80 - -############################################################## -thing.name=SparkFun ESP8266 Thing - -thing.upload.tool=esptool -thing.upload.speed=921600 -thing.upload.resetmethod=ck -thing.upload.maximum_size=524288 -thing.upload.wait_for_upload_port=true -thing.serial.disableDTR=true -thing.serial.disableRTS=true - -thing.build.mcu=esp8266 -thing.build.f_cpu=80000000L -thing.build.board=ESP8266_ESP01 -thing.build.core=esp8266 -thing.build.variant=thing -thing.build.flash_mode=qio -thing.build.flash_size=4M -thing.build.flash_freq=40 -thing.build.flash_ld=eagle.flash.4m.ld -thing.build.spiffs_start=0x100000 -thing.build.spiffs_end=0x3FB000 - -thing.menu.CpuFrequency.80=80 MHz -thing.menu.CpuFrequency.80.build.f_cpu=80000000L - -thing.menu.UploadSpeed.115200=115200 -thing.menu.UploadSpeed.115200.upload.speed=115200 -thing.menu.UploadSpeed.9600=9600 -thing.menu.UploadSpeed.9600.upload.speed=9600 -thing.menu.UploadSpeed.57600=57600 -thing.menu.UploadSpeed.57600.upload.speed=57600 -thing.menu.UploadSpeed.256000.windows=256000 -thing.menu.UploadSpeed.256000.upload.speed=256000 -thing.menu.UploadSpeed.230400.linux=230400 -thing.menu.UploadSpeed.230400.macosx=230400 -thing.menu.UploadSpeed.230400.upload.speed=230400 -thing.menu.UploadSpeed.460800.linux=460800 -thing.menu.UploadSpeed.460800.macosx=460800 -thing.menu.UploadSpeed.460800.upload.speed=460800 -thing.menu.UploadSpeed.512000.windows=512000 -thing.menu.UploadSpeed.512000.upload.speed=512000 -thing.menu.UploadSpeed.921600=921600 -thing.menu.UploadSpeed.921600.upload.speed=921600 - -thing.menu.FlashSize.4M=4M (3M SPIFFS) -thing.menu.FlashSize.4M.build.flash_size=4M -thing.menu.FlashSize.4M.build.flash_ld=eagle.flash.4m.ld -thing.menu.FlashSize.4M.build.spiffs_start=0x100000 -thing.menu.FlashSize.4M.build.spiffs_end=0x3FB000 - -############################################################## -modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV) - -modwifi.upload.tool=esptool -modwifi.upload.speed=115200 -modwifi.upload.resetmethod=ck -modwifi.upload.maximum_size=2097152 -modwifi.upload.wait_for_upload_port=true -modwifi.serial.disableDTR=true -modwifi.serial.disableRTS=true - -modwifi.build.mcu=esp8266 -modwifi.build.f_cpu=80000000L -modwifi.build.board=MOD_WIFI_ESP8266 -modwifi.build.core=esp8266 -modwifi.build.variant=generic -# Winbond W25Q16 flash -modwifi.build.flash_mode=qio -modwifi.build.flash_size=2M -modwifi.build.flash_freq=40 -modwifi.build.flash_ld=eagle.flash.2m.ld -modwifi.build.spiffs_start=0x100000 -modwifi.build.spiffs_end=0x1FB000 - -modwifi.menu.CpuFrequency.80=80 MHz -modwifi.menu.CpuFrequency.80.build.f_cpu=80000000L -modwifi.menu.CpuFrequency.160=160 MHz -modwifi.menu.CpuFrequency.160.build.f_cpu=160000000L - -modwifi.menu.UploadSpeed.115200=115200 -modwifi.menu.UploadSpeed.115200.upload.speed=115200 -modwifi.menu.UploadSpeed.9600=9600 -modwifi.menu.UploadSpeed.9600.upload.speed=9600 -modwifi.menu.UploadSpeed.57600=57600 -modwifi.menu.UploadSpeed.57600.upload.speed=57600 -modwifi.menu.UploadSpeed.256000.windows=256000 -modwifi.menu.UploadSpeed.256000.upload.speed=256000 -modwifi.menu.UploadSpeed.230400.linux=230400 -modwifi.menu.UploadSpeed.230400.macosx=230400 -modwifi.menu.UploadSpeed.230400.macosx=230400 -modwifi.menu.UploadSpeed.230400.upload.speed=230400 -modwifi.menu.UploadSpeed.460800.linux=460800 -modwifi.menu.UploadSpeed.460800.macosx=460800 -modwifi.menu.UploadSpeed.460800.upload.speed=460800 -modwifi.menu.UploadSpeed.512000.windows=512000 -modwifi.menu.UploadSpeed.512000.upload.speed=512000 -modwifi.menu.UploadSpeed.921600=921600 -modwifi.menu.UploadSpeed.921600.upload.speed=921600 - -############################################################## -nodemcu.name=NodeMCU (ESP8266 ESP-12 Module) - -nodemcu.upload.tool=esptool -nodemcu.upload.speed=115200 -nodemcu.upload.resetmethod=ck -nodemcu.upload.maximum_size=4194304 -nodemcu.upload.wait_for_upload_port=true -nodemcu.serial.disableDTR=true -nodemcu.serial.disableRTS=true - -nodemcu.build.mcu=esp8266 -nodemcu.build.f_cpu=80000000L -nodemcu.build.board=ESP8266_ESP12 -nodemcu.build.core=esp8266 -nodemcu.build.variant=nodemcu -nodemcu.build.flash_mode=qio -nodemcu.build.flash_size=4M -nodemcu.build.flash_freq=40 -nodemcu.build.flash_ld=eagle.flash.4m.ld -nodemcu.build.spiffs_start=0x100000 -nodemcu.build.spiffs_end=0x3FB000 - -nodemcu.menu.CpuFrequency.80=80 MHz -nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L -nodemcu.menu.CpuFrequency.160=160 MHz -nodemcu.menu.CpuFrequency.160.build.f_cpu=160000000L - -nodemcu.menu.UploadSpeed.115200=115200 -nodemcu.menu.UploadSpeed.115200.upload.speed=115200 -nodemcu.menu.UploadSpeed.9600=9600 -nodemcu.menu.UploadSpeed.9600.upload.speed=9600 -nodemcu.menu.UploadSpeed.57600=57600 -nodemcu.menu.UploadSpeed.57600.upload.speed=57600 -nodemcu.menu.UploadSpeed.256000.windows=256000 -nodemcu.menu.UploadSpeed.256000.upload.speed=256000 -nodemcu.menu.UploadSpeed.230400.linux=230400 -nodemcu.menu.UploadSpeed.230400.macosx=230400 -nodemcu.menu.UploadSpeed.230400.macosx=230400 -nodemcu.menu.UploadSpeed.230400.upload.speed=230400 -nodemcu.menu.UploadSpeed.460800.linux=460800 -nodemcu.menu.UploadSpeed.460800.macosx=460800 -nodemcu.menu.UploadSpeed.460800.upload.speed=460800 -nodemcu.menu.UploadSpeed.512000.windows=512000 -nodemcu.menu.UploadSpeed.512000.upload.speed=512000 -nodemcu.menu.UploadSpeed.921600=921600 -nodemcu.menu.UploadSpeed.921600.upload.speed=921600 - -############################################################## -# wifio.name=Wifio -# -# wifio.upload.tool=esptool -# wifio.upload.speed=115200 -# wifio.upload.resetmethod=wifio -# wifio.upload.maximum_size=524288 -# wifio.upload.wait_for_upload_port=true -# -# wifio.build.mcu=esp8266 -# wifio.build.f_cpu=80000000L -# wifio.build.board=ESP8266_WIFIO -# wifio.build.core=esp8266 -# wifio.build.variant=wifio -# wifio.build.flash_mode=qio -# wifio.build.flash_size=512K -# wifio.build.flash_freq=40 -# wifio.build.flash_ld=eagle.flash.512k.ld -# wifio.build.spiffs_start=0x6B000 -# wifio.build.spiffs_end=0x7B000 -# -# wifio.menu.CpuFrequency.80=80MHz -# wifio.menu.CpuFrequency.80.build.f_cpu=80000000L -# wifio.menu.CpuFrequency.160=160MHz -# wifio.menu.CpuFrequency.160.build.f_cpu=160000000L -# -# wifio.upload.tool=esptool -# diff --git a/sparkfun/esp8266/bootloaders/.DS_Store b/sparkfun/esp8266/bootloaders/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/sparkfun/esp8266/bootloaders/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/cores/.DS_Store b/sparkfun/esp8266/cores/.DS_Store deleted file mode 100644 index 8554222f..00000000 Binary files a/sparkfun/esp8266/cores/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/cores/esp8266/Arduino.h b/sparkfun/esp8266/cores/esp8266/Arduino.h deleted file mode 100644 index 767ea4f2..00000000 --- a/sparkfun/esp8266/cores/esp8266/Arduino.h +++ /dev/null @@ -1,240 +0,0 @@ -/* - Arduino.h - Main include file for the Arduino SDK - Copyright (c) 2005-2013 Arduino Team. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Arduino_h -#define Arduino_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "stdlib_noniso.h" -#include "binary.h" -#include "pgmspace.h" -#include "esp8266_peri.h" -#include "twi.h" - -void yield(void); - -#define HIGH 0x1 -#define LOW 0x0 - -#define PWMRANGE 1023 - -//GPIO FUNCTIONS -#define INPUT 0x00 -#define INPUT_PULLUP 0x02 -#define INPUT_PULLDOWN 0x04 -#define OUTPUT 0x01 -#define OUTPUT_OPEN_DRAIN 0x03 -#define SPECIAL 0xF8 //defaults to the usable BUSes uart0rx/tx uart1tx and hspi -#define FUNCTION_0 0x08 -#define FUNCTION_1 0x18 -#define FUNCTION_2 0x28 -#define FUNCTION_3 0x38 -#define FUNCTION_4 0x48 - -#define PI 3.1415926535897932384626433832795 -#define HALF_PI 1.5707963267948966192313216916398 -#define TWO_PI 6.283185307179586476925286766559 -#define DEG_TO_RAD 0.017453292519943295769236907684886 -#define RAD_TO_DEG 57.295779513082320876798154814105 -#define EULER 2.718281828459045235360287471352 - -#define SERIAL 0x0 -#define DISPLAY 0x1 - -#define LSBFIRST 0 -#define MSBFIRST 1 - -//Interrupt Modes -#define DISABLED 0x00 -#define RISING 0x01 -#define FALLING 0x02 -#define CHANGE 0x03 -#define ONLOW 0x04 -#define ONHIGH 0x05 -#define ONLOW_WE 0x0C -#define ONHIGH_WE 0x0D - -#define DEFAULT 1 -#define EXTERNAL 0 - -//timer dividers -#define TIM_DIV1 0 //80MHz (80 ticks/us - 104857.588 us max) -#define TIM_DIV16 1 //5MHz (5 ticks/us - 1677721.4 us max) -#define TIM_DIV265 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max) -//timer int_types -#define TIM_EDGE 0 -#define TIM_LEVEL 1 -//timer reload values -#define TIM_SINGLE 0 //on interrupt routine you need to write a new value to start the timer again -#define TIM_LOOP 1 //on interrupt the counter will start with the same value again - -#define timer1_read() (T1V) -#define timer1_enabled() ((T1C & (1 << TCTE)) != 0) -#define timer1_interrupted() ((T1C & (1 << TCIS)) != 0) - -void timer1_isr_init(void); -void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload); -void timer1_disable(void); -void timer1_attachInterrupt(void (*userFunc)(void)); -void timer1_detachInterrupt(void); -void timer1_write(uint32_t ticks); //maximum ticks 8388607 - -// undefine stdlib's abs if encountered -#ifdef abs -#undef abs -#endif - -#define abs(x) ((x)>0?(x):-(x)) -#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) -#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) -#define radians(deg) ((deg)*DEG_TO_RAD) -#define degrees(rad) ((rad)*RAD_TO_DEG) -#define sq(x) ((x)*(x)) - -void ets_intr_lock(); -void ets_intr_unlock(); - -// level (0-15), -// level 15 will disable ALL interrupts, -// level 0 will disable most software interrupts -// -#define xt_disable_interrupts(state, level) __asm__ __volatile__("rsil %0," __STRINGIFY(level) "; esync; isync; dsync" : "=a" (state)) -#define xt_enable_interrupts(state) __asm__ __volatile__("wsr %0,ps; esync" :: "a" (state) : "memory") - -extern uint32_t interruptsState; - -#define interrupts() xt_enable_interrupts(interruptsState) -#define noInterrupts() __asm__ __volatile__("rsil %0,15; esync; isync; dsync" : "=a" (interruptsState)) - -#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L ) -#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() ) -#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() ) - -#define lowByte(w) ((uint8_t) ((w) & 0xff)) -#define highByte(w) ((uint8_t) ((w) >> 8)) - -#define bitRead(value, bit) (((value) >> (bit)) & 0x01) -#define bitSet(value, bit) ((value) |= (1UL << (bit))) -#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) -#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) - -// avr-libc defines _NOP() since 1.6.2 -#ifndef _NOP -#define _NOP() do { __asm__ volatile ("nop"); } while (0) -#endif - -typedef unsigned int word; - -#define bit(b) (1UL << (b)) -#define _BV(b) (1UL << (b)) - -typedef uint8_t boolean; -typedef uint8_t byte; - -void init(void); -void initVariant(void); - -int atexit(void (*func)()) __attribute__((weak)); - -void pinMode(uint8_t, uint8_t); -void digitalWrite(uint8_t, uint8_t); -int digitalRead(uint8_t); -int analogRead(uint8_t); -void analogReference(uint8_t mode); -void analogWrite(uint8_t, int); -void analogWriteFreq(uint32_t freq); - -unsigned long millis(void); -unsigned long micros(void); -void delay(unsigned long); -void delayMicroseconds(unsigned int us); -unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout); - -void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val); -uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder); - -void attachInterrupt(uint8_t, void (*)(void), int mode); -void detachInterrupt(uint8_t); - -void setup(void); -void loop(void); - -// Get the bit location within the hardware port of the given virtual pin. -// This comes from the pins_*.c file for the active board configuration. -#define digitalPinToPort(pin) (0) -#define digitalPinToBitMask(pin) (1UL << (pin)) -#define portOutputRegister(port) ((volatile uint32_t*) GPO) -#define portInputRegister(port) ((volatile uint32_t*) GPI) -#define portModeRegister(port) ((volatile uint32_t*) GPE) - -#define NOT_A_PIN -1 -#define NOT_A_PORT -1 -#define NOT_AN_INTERRUPT -1 - -#ifdef __cplusplus -} // extern "C" -#endif - -#ifdef __cplusplus - -#include "WCharacter.h" -#include "WString.h" - -#include "HardwareSerial.h" -#include "FileSystem.h" -#include "Esp.h" -#include "debug.h" - -#define min(a,b) ((a)<(b)?(a):(b)) -#define max(a,b) ((a)>(b)?(a):(b)) - -uint16_t makeWord(uint16_t w); -uint16_t makeWord(byte h, byte l); - -#define word(...) makeWord(__VA_ARGS__) - -unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); - -void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0); -void noTone(uint8_t _pin); - -// WMath prototypes -long random(long); -long random(long, long); -void randomSeed(unsigned int); -long map(long, long, long, long, long); - - -#endif - -#include "pins_arduino.h" - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Client.h b/sparkfun/esp8266/cores/esp8266/Client.h deleted file mode 100644 index d776a2e1..00000000 --- a/sparkfun/esp8266/cores/esp8266/Client.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Client.h - Base class that provides Client - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef client_h -#define client_h -#include "Print.h" -#include "Stream.h" -#include "IPAddress.h" - -class Client: public Stream { - - public: - virtual int connect(IPAddress ip, uint16_t port) =0; - virtual int connect(const char *host, uint16_t port) =0; - virtual size_t write(uint8_t) =0; - virtual size_t write(const uint8_t *buf, size_t size) =0; - virtual int available() = 0; - virtual int read() = 0; - virtual int read(uint8_t *buf, size_t size) = 0; - virtual int peek() = 0; - virtual void flush() = 0; - virtual void stop() = 0; - virtual uint8_t connected() = 0; - virtual operator bool() = 0; - protected: - uint8_t* rawIPAddress(IPAddress& addr) { - return addr.raw_address(); - } - ; -}; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Esp.cpp b/sparkfun/esp8266/cores/esp8266/Esp.cpp deleted file mode 100644 index af6d9946..00000000 --- a/sparkfun/esp8266/cores/esp8266/Esp.cpp +++ /dev/null @@ -1,268 +0,0 @@ -/* - Esp.cpp - ESP8266-specific APIs - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "Arduino.h" - -extern "C" { -#include "user_interface.h" -} - -//extern "C" void ets_wdt_init(uint32_t val); -extern "C" void ets_wdt_enable(void); -extern "C" void ets_wdt_disable(void); -extern "C" void wdt_feed(void); - -/** - * User-defined Literals - * usage: - * - * uint32_t = test = 10_MHz; // --> 10000000 - */ - -unsigned long long operator"" _kHz(unsigned long long x) { - return x * 1000; -} - -unsigned long long operator"" _MHz(unsigned long long x) { - return x * 1000 * 1000; -} - -unsigned long long operator"" _GHz(unsigned long long x) { - return x * 1000 * 1000 * 1000; -} - -unsigned long long operator"" _kBit(unsigned long long x) { - return x * 1024; -} - -unsigned long long operator"" _MBit(unsigned long long x) { - return x * 1024 * 1024; -} - -unsigned long long operator"" _GBit(unsigned long long x) { - return x * 1024 * 1024 * 1024; -} - -unsigned long long operator"" _kB(unsigned long long x) { - return x * 1024; -} - -unsigned long long operator"" _MB(unsigned long long x) { - return x * 1024 * 1024; -} - -unsigned long long operator"" _GB(unsigned long long x) { - return x * 1024 * 1024 * 1024; -} - - -EspClass ESP; - -EspClass::EspClass() -{ - -} - -void EspClass::wdtEnable(uint32_t timeout_ms) -{ - //todo find doku for ets_wdt_init may set the timeout - ets_wdt_enable(); -} - -void EspClass::wdtEnable(WDTO_t timeout_ms) -{ - wdtEnable((uint32_t) timeout_ms); -} - -void EspClass::wdtDisable(void) -{ - ets_wdt_disable(); -} - -void EspClass::wdtFeed(void) -{ - wdt_feed(); -} - -void EspClass::deepSleep(uint32_t time_us, WakeMode mode) -{ - system_deep_sleep_set_option(static_cast(mode)); - system_deep_sleep(time_us); -} - -void EspClass::reset(void) -{ - ((void (*)(void))0x40000080)(); -} - -void EspClass::restart(void) -{ - system_restart(); -} - -uint16_t EspClass::getVcc(void) -{ - return system_get_vdd33(); -} - -uint32_t EspClass::getFreeHeap(void) -{ - return system_get_free_heap_size(); -} - -uint32_t EspClass::getChipId(void) -{ - return system_get_chip_id(); -} - -const char * EspClass::getSdkVersion(void) -{ - return system_get_sdk_version(); -} - -uint8_t EspClass::getBootVersion(void) -{ - return system_get_boot_version(); -} - -uint8_t EspClass::getBootMode(void) -{ - return system_get_boot_mode(); -} - -uint8_t EspClass::getCpuFreqMHz(void) -{ - return system_get_cpu_freq(); -} - - -uint32_t EspClass::getFlashChipId(void) -{ - return spi_flash_get_id(); -} - -uint32_t EspClass::getFlashChipSize(void) -{ - uint32_t data; - uint8_t * bytes = (uint8_t *) &data; - // read first 4 byte (magic byte + flash config) - if(spi_flash_read(0x0000, &data, 4) == SPI_FLASH_RESULT_OK) { - switch((bytes[3] & 0xf0) >> 4) { - case 0x0: // 4 Mbit (512KB) - return (512_kB); - case 0x1: // 2 MBit (256KB) - return (256_kB); - case 0x2: // 8 MBit (1MB) - return (1_MB); - case 0x3: // 16 MBit (2MB) - return (2_MB); - case 0x4: // 32 MBit (4MB) - return (4_MB); - default: // fail? - return 0; - } - } - return 0; -} - -uint32_t EspClass::getFlashChipSpeed(void) -{ - uint32_t data; - uint8_t * bytes = (uint8_t *) &data; - // read first 4 byte (magic byte + flash config) - if(spi_flash_read(0x0000, &data, 4) == SPI_FLASH_RESULT_OK) { - switch(bytes[3] & 0x0F) { - case 0x0: // 40 MHz - return (40_MHz); - case 0x1: // 26 MHz - return (26_MHz); - case 0x2: // 20 MHz - return (20_MHz); - case 0xf: // 80 MHz - return (80_MHz); - default: // fail? - return 0; - } - } - return 0; -} - -FlashMode_t EspClass::getFlashChipMode(void) -{ - FlashMode_t mode = FM_UNKNOWN; - uint32_t data; - uint8_t * bytes = (uint8_t *) &data; - // read first 4 byte (magic byte + flash config) - if(spi_flash_read(0x0000, &data, 4) == SPI_FLASH_RESULT_OK) { - mode = (FlashMode_t) bytes[2]; - if(mode > FM_DOUT) { - mode = FM_UNKNOWN; - } - } - return mode; -} - -/** - * Infos from - * http://www.wlxmall.com/images/stock_item/att/A1010004.pdf - * http://www.gigadevice.com/product-series/5.html?locale=en_US - * http://www.elinux.org/images/f/f5/Winbond-w25q32.pdf - */ -uint32_t EspClass::getFlashChipSizeByChipId(void) { - uint32_t chipId = getFlashChipId(); - /** - * Chip ID - * 00 - always 00 (Chip ID use only 3 byte) - * 17 - ? looks like 2^xx is size in Byte ? //todo: find docu to this - * 40 - ? may be Speed ? //todo: find docu to this - * C8 - manufacturer ID - */ - switch(chipId) { - - // GigaDevice - case 0x1740C8: // GD25Q64B - return (8_MB); - case 0x1640C8: // GD25Q32B - return (4_MB); - case 0x1540C8: // GD25Q16B - return (2_MB); - case 0x1440C8: // GD25Q80 - return (1_MB); - case 0x1340C8: // GD25Q40 - return (512_kB); - case 0x1240C8: // GD25Q20 - return (256_kB); - case 0x1140C8: // GD25Q10 - return (128_kB); - case 0x1040C8: // GD25Q12 - return (64_kB); - - // Winbond - case 0x1640EF: // W25Q32 - return (4_MB); - case 0x1540EF: // W25Q16 - return (2_MB); - case 0x1440EF: // W25Q80 - return (1_MB); - - default: - return 0; - } -} diff --git a/sparkfun/esp8266/cores/esp8266/Esp.h b/sparkfun/esp8266/cores/esp8266/Esp.h deleted file mode 100644 index 9750dd31..00000000 --- a/sparkfun/esp8266/cores/esp8266/Esp.h +++ /dev/null @@ -1,110 +0,0 @@ -/* - Esp.h - ESP8266-specific APIs - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef ESP_H -#define ESP_H -/** - * AVR macros for WDT managment - */ -typedef enum { - WDTO_0MS = 0, //!< WDTO_0MS - WDTO_15MS = 15, //!< WDTO_15MS - WDTO_30MS = 30, //!< WDTO_30MS - WDTO_60MS = 60, //!< WDTO_60MS - WDTO_120MS = 120, //!< WDTO_120MS - WDTO_250MS = 250, //!< WDTO_250MS - WDTO_500MS = 500, //!< WDTO_500MS - WDTO_1S = 1000,//!< WDTO_1S - WDTO_2S = 2000,//!< WDTO_2S - WDTO_4S = 4000,//!< WDTO_4S - WDTO_8S = 8000 //!< WDTO_8S -} WDTO_t; - - -#define wdt_enable(time) ESP.wdtEnable(time) -#define wdt_disable() ESP.wdtDisable() -#define wdt_reset() ESP.wdtFeed() - -#define cli() ets_intr_lock() // IRQ Disable -#define sei() ets_intr_unlock() // IRQ Enable - -enum WakeMode { - WAKE_RF_DEFAULT = 0, // RF_CAL or not after deep-sleep wake up, depends on init data byte 108. - WAKE_RFCAL = 1, // RF_CAL after deep-sleep wake up, there will be large current. - WAKE_NO_RFCAL = 2, // no RF_CAL after deep-sleep wake up, there will only be small current. - WAKE_RF_DISABLED = 4 // disable RF after deep-sleep wake up, just like modem sleep, there will be the smallest current. -}; - -typedef enum { - FM_QIO = 0x00, - FM_QOUT = 0x01, - FM_DIO = 0x02, - FM_DOUT = 0x03, - FM_UNKNOWN = 0xff -} FlashMode_t; - -class EspClass { - public: - EspClass(); - - // TODO: figure out how to set WDT timeout - void wdtEnable(uint32_t timeout_ms = 0); - // note: setting the timeout value is not implemented at the moment - void wdtEnable(WDTO_t timeout_ms = WDTO_0MS); - - void wdtDisable(void); - void wdtFeed(void); - - void deepSleep(uint32_t time_us, WakeMode mode = WAKE_RF_DEFAULT); - - void reset(void); - void restart(void); - - uint16_t getVcc(void); - uint32_t getFreeHeap(void); - - uint32_t getChipId(void); - - const char * getSdkVersion(void); - - uint8_t getBootVersion(void); - uint8_t getBootMode(void); - - uint8_t getCpuFreqMHz(void); - - uint32_t getFlashChipId(void); - uint32_t getFlashChipSize(void); - uint32_t getFlashChipSpeed(void); - FlashMode_t getFlashChipMode(void); - uint32_t getFlashChipSizeByChipId(void); - - inline uint32_t getCycleCount(void); -}; - -uint32_t EspClass::getCycleCount(void) -{ - uint32_t ccount; - __asm__ __volatile__("rsr %0,ccount":"=a" (ccount)); - return ccount; -} - -extern EspClass ESP; - -#endif //ESP_H diff --git a/sparkfun/esp8266/cores/esp8266/FileSystem.cpp b/sparkfun/esp8266/cores/esp8266/FileSystem.cpp deleted file mode 100644 index 0399e4fc..00000000 --- a/sparkfun/esp8266/cores/esp8266/FileSystem.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* - FileSystem.cpp - SPIFS implementation for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "FileSystem.h" -#include "Arduino.h" -#include "spiffs/spiffs_esp8266.h" - -#define LOGICAL_PAGE_SIZE 256 -#define LOGICAL_BLOCK_SIZE 512 - - -// These addresses are defined in the linker script. -// For each flash memory size there is a linker script variant -// which sets spiffs location and size. -extern "C" uint32_t _SPIFFS_start; -extern "C" uint32_t _SPIFFS_end; - -static s32_t api_spiffs_read(u32_t addr, u32_t size, u8_t *dst); -static s32_t api_spiffs_write(u32_t addr, u32_t size, u8_t *src); -static s32_t api_spiffs_erase(u32_t addr, u32_t size); - -FSClass FS((uint32_t) &_SPIFFS_start, (uint32_t) &_SPIFFS_end, 4); - -FSClass::FSClass(uint32_t beginAddress, uint32_t endAddress, uint32_t maxOpenFiles) -: _beginAddress(beginAddress) -, _endAddress(endAddress) -, _maxOpenFiles(maxOpenFiles) -, _fs({0}) -{ -} - -int FSClass::_mountInternal(){ - if (_beginAddress == 0 || _beginAddress >= _endAddress){ - SPIFFS_API_DBG_E("Can't start file system, wrong address\r\n"); - return SPIFFS_ERR_NOT_CONFIGURED; - } - - spiffs_config cfg = {0}; - cfg.phys_addr = _beginAddress; - cfg.phys_size = _endAddress - _beginAddress; - cfg.phys_erase_block = INTERNAL_FLASH_SECTOR_SIZE; - cfg.log_block_size = LOGICAL_BLOCK_SIZE; - cfg.log_page_size = LOGICAL_PAGE_SIZE; - cfg.hal_read_f = api_spiffs_read; - cfg.hal_write_f = api_spiffs_write; - cfg.hal_erase_f = api_spiffs_erase; - - SPIFFS_API_DBG_V("FSClass::_mountInternal: start:%x, size:%d Kb\n", cfg.phys_addr, cfg.phys_size / 1024); - - _work.reset(new uint8_t[LOGICAL_BLOCK_SIZE]); - _fdsSize = 32 * _maxOpenFiles; - _fds.reset(new uint8_t[_fdsSize]); - _cacheSize = (32 + LOGICAL_PAGE_SIZE) * _maxOpenFiles; - _cache.reset(new uint8_t[_cacheSize]); - - s32_t res = SPIFFS_mount(&_fs, - &cfg, - _work.get(), - _fds.get(), - _fdsSize, - _cache.get(), - _cacheSize, - NULL); - SPIFFS_API_DBG_V("FSClass::_mountInternal: %d\n", res); - return res; -} - -bool FSClass::mount() { - if(SPIFFS_mounted(&_fs)) - return true; - - int res = _mountInternal(); - if(res != SPIFFS_OK){ - int formated = SPIFFS_format(&_fs); - if(formated != SPIFFS_OK) - return false; - res = _mountInternal(); - } - return (res == SPIFFS_OK); -} - -// TODO: need to invalidate open file objects -void FSClass::unmount() { - if(SPIFFS_mounted(&_fs)) - SPIFFS_unmount(&_fs); -} - -bool FSClass::format() { - if(!SPIFFS_mounted(&_fs)){ - _mountInternal(); - } - SPIFFS_unmount(&_fs); - int formated = SPIFFS_format(&_fs); - if(formated != SPIFFS_OK) - return false; - return (_mountInternal() == SPIFFS_OK); -} - -bool FSClass::check() { - return SPIFFS_check(&_fs) == SPIFFS_OK; -} - -bool FSClass::exists(char *filename) { - spiffs_stat stat = {0}; - if (SPIFFS_stat(&_fs, filename, &stat) < 0) - return false; - return stat.name[0] != '\0'; -} - -bool FSClass::create(char *filepath){ - return SPIFFS_creat(&_fs, filepath, 0) == SPIFFS_OK; -} - -bool FSClass::remove(char *filepath){ - return SPIFFS_remove(&_fs, filepath) == SPIFFS_OK; -} - -bool FSClass::rename(char *filename, char *newname) { - return SPIFFS_rename(&_fs, filename, newname) == SPIFFS_OK; -} - -size_t FSClass::totalBytes(){ - u32_t totalBytes; - u32_t usedBytes; - if(SPIFFS_info(&_fs, &totalBytes, &usedBytes) == SPIFFS_OK) - return totalBytes; - return 0; -} - -size_t FSClass::usedBytes(){ - u32_t totalBytes; - u32_t usedBytes; - if(SPIFFS_info(&_fs, &totalBytes, &usedBytes) == SPIFFS_OK) - return usedBytes; - return 0; -} - -FSFile FSClass::open(char *filename, uint8_t mode) { - if(strcmp(filename, "") == 0 || - strcmp(filename, "/") == 0) - return FSFile(&_fs, "/"); - - int repeats = 0; - bool notExist; - bool canRecreate = (mode & SPIFFS_CREAT) == SPIFFS_CREAT; - int res; - - do{ - notExist = false; - res = SPIFFS_open(&_fs, filename, (spiffs_flags)mode, 0); - int code = SPIFFS_errno(&_fs); - if (res < 0){ - SPIFFS_API_DBG_E("open errno %d\n", code); - notExist = (code == SPIFFS_ERR_NOT_FOUND || code == SPIFFS_ERR_DELETED || code == SPIFFS_ERR_FILE_DELETED || code == SPIFFS_ERR_IS_FREE); - if (notExist && canRecreate) - remove(filename); // fix for deleted files - } - } while (notExist && canRecreate && repeats++ < 3); - - if(res){ - return FSFile(&_fs, res); - } - return FSFile(); -} - -FSFile FSClass::open(spiffs_dirent* entry, uint8_t mode){ - int res = SPIFFS_open_by_dirent(&_fs, entry, (spiffs_flags)mode, 0); - if (res){ - return FSFile(&_fs, res); - } - return FSFile(); -} - -FSFile::FSFile() -: _file(0) -, _stats({0}) -, _fs(0) -{ -} - -FSFile::FSFile(spiffs* fs, String path) -: _fs(fs) -{ - if(path == "/"){ - _file = 0x1; - os_sprintf((char*)_stats.name, "%s", (char*)path.c_str()); - _stats.size = 0; - _stats.type = SPIFFS_TYPE_DIR; - SPIFFS_opendir(_fs, (char*)_stats.name, &_dir); - } else { - _file = SPIFFS_open(_fs, (char *)path.c_str(), (spiffs_flags)FSFILE_READ, 0); - if(SPIFFS_fstat(_fs, _file, &_stats) != 0){ - SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(_fs)); - } - //debugf("FSFile name: %s, size: %d, type: %d\n", _stats.name, _stats.size, _stats.type); - if(_stats.type == SPIFFS_TYPE_DIR){ - SPIFFS_opendir(_fs, (char*)_stats.name, &_dir); - } - } -} - -FSFile::FSFile(spiffs* fs, file_t f) -: _file(f) -, _fs(fs) -{ - if(SPIFFS_fstat(_fs, _file, &_stats) != 0){ - SPIFFS_API_DBG_E("fstat errno %d\n", SPIFFS_errno(_fs)); - } - //debugf("FSFile name: %s, size: %d, type: %d\n", _stats.name, _stats.size, _stats.type); - if(_stats.type == SPIFFS_TYPE_DIR){ - SPIFFS_opendir(_fs, (char*)_stats.name, &_dir); - } -} - -void FSFile::close() { - if (!_file) - return; - if(_stats.type == SPIFFS_TYPE_DIR){ - SPIFFS_closedir(&_dir); - } - if(os_strlen((char*)_stats.name) > 1) - SPIFFS_close(_fs, _file); - _file = 0; -} - -char * FSFile::name(){ - return (char*)_stats.name; -} - -bool FSFile::isDirectory(void) { - return _stats.type == SPIFFS_TYPE_DIR; -} - -void FSFile::rewindDirectory() { - if (!_file || !isDirectory()) - return; - SPIFFS_closedir(&_dir); - SPIFFS_opendir(_fs, (char*)_stats.name, &_dir); -} - -FSFile FSFile::openNextFile(){ - if (!_file || !isDirectory()) - return FSFile(); - struct spiffs_dirent e; - struct spiffs_dirent *pe = &e; - if ((pe = SPIFFS_readdir(&_dir, pe))){ - // TODO: store actual FS pointer - return FS.open((char *)pe->name); - } - return FSFile(); -} - -uint32_t FSFile::size() { - if(!_file) - return 0; - if(_stats.size) - return _stats.size; - uint32_t pos = SPIFFS_tell(_fs, _file); - SPIFFS_lseek(_fs, _file, 0, SPIFFS_SEEK_END); - _stats.size = SPIFFS_tell(_fs, _file); - SPIFFS_lseek(_fs, _file, pos, SPIFFS_SEEK_SET); - return _stats.size; -} - -int FSFile::available() { - if (!_file) - return 0; - uint32_t pos = SPIFFS_tell(_fs, _file); - return size() - pos; -} - -uint32_t FSFile::seek(uint32_t pos) { - if (!_file) - return 0; - return SPIFFS_lseek(_fs, _file, pos, SPIFFS_SEEK_SET); -} - -uint32_t FSFile::position() { - if (!_file) - return 0; - return SPIFFS_tell(_fs, _file); -} - -bool FSFile::eof() { - if (!_file) - return 0; - return SPIFFS_eof(_fs, _file); -} - -int FSFile::read(void *buf, uint16_t nbyte) { - if (!_file || isDirectory()) - return -1; - return SPIFFS_read(_fs, _file, buf, nbyte); -} - -int FSFile::read() { - if (! _file || isDirectory()) - return -1; - int val; - if(SPIFFS_read(_fs, _file, &val, 1) != 1) return -1; - return val; -} - -int FSFile::peek() { - if (!_file || isDirectory()) - return 0; - int c = read(); - SPIFFS_lseek(_fs, _file, -1, SPIFFS_SEEK_CUR); - return c; -} - -size_t FSFile::write(const uint8_t *buf, size_t size){ - if (!_file || isDirectory()) - return 0; - int res = SPIFFS_write(_fs, _file, (uint8_t *)buf, size); - return (res > 0)?(size_t)res:0; -} - -size_t FSFile::write(uint8_t val) { - if (!_file || isDirectory()) - return 0; - return write(&val, 1); -} - -void FSFile::flush(){ - if (!_file || isDirectory()) - return; - SPIFFS_fflush(_fs, _file); -} - -bool FSFile::remove(){ - if (!_file) - return 0; - close(); - return SPIFFS_remove(_fs, (char *)_stats.name) == 0; -} - -int FSFile::lastError(){ - return SPIFFS_errno(_fs); -} - -void FSFile::clearError(){ - _fs->err_code = SPIFFS_OK; -} - - -static s32_t api_spiffs_read(u32_t addr, u32_t size, u8_t *dst){ - SPIFFS_API_DBG_V("api_spiffs_read: 0x%08x len: %u\n", addr, size); - flashmem_read(dst, addr, size); - return SPIFFS_OK; -} - -static s32_t api_spiffs_write(u32_t addr, u32_t size, u8_t *src){ - SPIFFS_API_DBG_V("api_spiffs_write: 0x%08x len: %u\n", addr, size); - flashmem_write(src, addr, size); - return SPIFFS_OK; -} - -static s32_t api_spiffs_erase(u32_t addr, u32_t size){ - SPIFFS_API_DBG_V("api_spiffs_erase: 0x%08x len: %u\n", addr, size); - u32_t sect_first = flashmem_get_sector_of_address(addr); - u32_t sect_last = flashmem_get_sector_of_address(addr+size); - while( sect_first <= sect_last ) - if( !flashmem_erase_sector( sect_first ++ ) ) - return SPIFFS_ERR_INTERNAL; - return SPIFFS_OK; -} - - diff --git a/sparkfun/esp8266/cores/esp8266/FileSystem.h b/sparkfun/esp8266/cores/esp8266/FileSystem.h deleted file mode 100644 index 7baf0769..00000000 --- a/sparkfun/esp8266/cores/esp8266/FileSystem.h +++ /dev/null @@ -1,130 +0,0 @@ -/* - FileSystem.h - SPIFS implementation for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef _SPIFFS_CORE_FILESYSTEM_H_ -#define _SPIFFS_CORE_FILESYSTEM_H_ - -#include -#include "spiffs/spiffs.h" -#include "Arduino.h" - -#define FSFILE_READ SPIFFS_RDONLY -#define FSFILE_WRITE (SPIFFS_RDONLY | SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_APPEND ) -#define FSFILE_OVERWRITE (SPIFFS_RDONLY | SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_APPEND | SPIFFS_TRUNC ) - -class FSFile : public Stream { -private: - spiffs_stat _stats; - file_t _file; - spiffs_DIR _dir; - spiffs * _fs; - -public: - FSFile(spiffs* fs, String path); - FSFile(spiffs* fs, file_t f); - FSFile(void); - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *buf, size_t size); - virtual int read(); - virtual int peek(); - virtual int available(); - virtual void flush(); - int read(void *buf, uint16_t nbyte); - uint32_t seek(uint32_t pos); - uint32_t position(); - uint32_t size(); - bool eof(); - void close(); - bool remove(); - int lastError(); - void clearError(); - operator bool() { return _file > 0; } - char * name(); - bool isDirectory(void); - void rewindDirectory(void); - FSFile openNextFile(void); - - template size_t write(T &src){ - const size_t bufferSize = 64; - uint8_t obuf[bufferSize]; - size_t bytesWritten = 0; - while (true){ - size_t available = src.available(); - if(!available) - return bytesWritten; - size_t willWrite = (available < bufferSize) ? available : bufferSize; - src.read(obuf, willWrite); - size_t cb = write(obuf, willWrite); - if (cb != willWrite) { - return bytesWritten; - } - bytesWritten += cb; - } - return bytesWritten; - } - - using Print::write; -}; - -class FSClass { -public: - FSClass(uint32_t beginAddress, uint32_t endAddress, uint32_t maxOpenFiles); - - bool mount(); - void unmount(); - bool format(); - bool check(); - bool exists(char *filename); - bool create(char *filepath); - bool remove(char *filepath); - bool rename(char *filename, char *newname); - size_t totalBytes(); - size_t usedBytes(); - size_t size(){ return _fs.cfg.phys_size; } - size_t blockSize(){ return _fs.cfg.log_block_size; } - size_t totalBlocks(){ return _fs.block_count; } - size_t freeBlocks(){ return _fs.free_blocks; } - size_t pageSize(){ return _fs.cfg.log_page_size; } - size_t allocatedPages(){ return _fs.stats_p_allocated; } - size_t deletedPages(){ return _fs.stats_p_deleted; } - - FSFile open(char *filename, uint8_t mode = FSFILE_READ); - FSFile open(spiffs_dirent* entry, uint8_t mode = FSFILE_READ); - -protected: - int _mountInternal(); - std::unique_ptr _work; - std::unique_ptr _fds; - size_t _fdsSize; - std::unique_ptr _cache; - size_t _cacheSize; - uint32_t _beginAddress; - uint32_t _endAddress; - uint32_t _maxOpenFiles; - spiffs _fs; - - -private: - friend class FSFile; -}; - -extern FSClass FS; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/HardwareSerial.cpp b/sparkfun/esp8266/cores/esp8266/HardwareSerial.cpp deleted file mode 100644 index 4ea4be78..00000000 --- a/sparkfun/esp8266/cores/esp8266/HardwareSerial.cpp +++ /dev/null @@ -1,643 +0,0 @@ -/* - HardwareSerial.cpp - esp8266 UART support - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 31 March 2015 by Markus Sattler (rewrite the code for UART0 + UART1 support in ESP8266) - Modified 25 April 2015 by Thomas Flayols (add configuration different from 8N1 in ESP8266) - Modified 3 May 2015 by Hristo Gochkov (change register access methods) - */ - -#include -#include -#include -#include -#include "Arduino.h" -#include "cbuf.h" - -extern "C" { -#include "osapi.h" -#include "ets_sys.h" -#include "mem.h" -#include "user_interface.h" -} - -#include "HardwareSerial.h" - -#define UART_TX_FIFO_SIZE 0x80 - -struct uart_ { - int uart_nr; - int baud_rate; - bool rxEnabled; - bool txEnabled; - uint8_t rxPin; - uint8_t txPin; -}; - -static const int UART0 = 0; -static const int UART1 = 1; -static const int UART_NO = -1; - - -/** - * UART GPIOs - * - * UART0 TX: 1 or 2 - * UART0 RX: 3 - * - * UART0 SWAP TX: 15 - * UART0 SWAP RX: 13 - * - * - * UART1 TX: 7 (NC) or 2 - * UART1 RX: 8 (NC) - * - * UART1 SWAP TX: 11 (NC) - * UART1 SWAP RX: 6 (NC) - * - * NC = Not Connected to Module Pads --> No Access - * - */ - -// #################################################################################################### -// #################################################################################################### -// #################################################################################################### -HardwareSerial Serial(UART0); -HardwareSerial Serial1(UART1); - -// #################################################################################################### -// #################################################################################################### -// #################################################################################################### - -void uart_interrupt_handler(uart_t* uart); -void uart_wait_for_tx_fifo(uart_t* uart, size_t size_needed); - -size_t uart_get_tx_fifo_room(uart_t* uart); -void uart_wait_for_transmit(uart_t* uart); -void uart_transmit_char(uart_t* uart, char c); -void uart_transmit(uart_t* uart, const char* buf, size_t size); -void uart_flush(uart_t* uart); -void uart_interrupt_enable(uart_t* uart); -void uart_interrupt_disable(uart_t* uart); -void uart_arm_tx_interrupt(uart_t* uart); -void uart_disarm_tx_interrupt(uart_t* uart); -void uart_set_baudrate(uart_t* uart, int baud_rate); -int uart_get_baudrate(uart_t* uart); - -uart_t* uart_init(int uart_nr, int baudrate, byte config); -void uart_uninit(uart_t* uart); -void uart_swap(uart_t* uart); - -void uart_ignore_char(char c); -void uart0_write_char(char c); -void uart1_write_char(char c); - -void uart_set_debug(int uart_nr); -int uart_get_debug(); - -// #################################################################################################### -// #################################################################################################### -// #################################################################################################### - -void ICACHE_RAM_ATTR uart_interrupt_handler(uart_t* uart) { - - // -------------- UART 0 -------------- - if(Serial.isRxEnabled()) { - while(U0IS & (1 << UIFF)) { - Serial._rx_complete_irq((char) (U0F & 0xff)); - U0IC = (1 << UIFF); - } - } - if(Serial.isTxEnabled()) { - if(U0IS & (1 << UIFE)) { - U0IC = (1 << UIFE); - Serial._tx_empty_irq(); - } - } - - // -------------- UART 1 -------------- - - if(Serial1.isRxEnabled()) { - while(U1IS & (1 << UIFF)) { - Serial1._rx_complete_irq((char) (U1F & 0xff)); - U1IC = (1 << UIFF); - } - } - if(Serial1.isTxEnabled()) { - if(U1IS & (1 << UIFE)) { - U1IC = (1 << UIFE); - Serial1._tx_empty_irq(); - } - } -} - -// #################################################################################################### - -void uart_wait_for_tx_fifo(uart_t* uart, size_t size_needed) { - if(uart == 0) - return; - if(uart->txEnabled) { - while(true) { - size_t tx_count = (USS(uart->uart_nr) >> USTXC) & 0xff; - if(tx_count <= (UART_TX_FIFO_SIZE - size_needed)) - break; - } - } -} - -size_t uart_get_tx_fifo_room(uart_t* uart) { - if(uart == 0) - return 0; - if(uart->txEnabled) { - return UART_TX_FIFO_SIZE - ((USS(uart->uart_nr) >> USTXC) & 0xff); - } - return 0; -} - -void uart_wait_for_transmit(uart_t* uart) { - if(uart == 0) - return; - if(uart->txEnabled) { - uart_wait_for_tx_fifo(uart, UART_TX_FIFO_SIZE); - } -} - -void uart_transmit_char(uart_t* uart, char c) { - if(uart == 0) - return; - if(uart->txEnabled) { - USF(uart->uart_nr) = c; - } -} - -void uart_transmit(uart_t* uart, const char* buf, size_t size) { - if(uart == 0) - return; - if(uart->txEnabled) { - while(size) { - size_t part_size = (size > UART_TX_FIFO_SIZE) ? UART_TX_FIFO_SIZE : size; - size -= part_size; - - uart_wait_for_tx_fifo(uart, part_size); - for(; part_size; --part_size, ++buf) - USF(uart->uart_nr) = *buf; - } - } -} - -void uart_flush(uart_t* uart) { - uint32_t tmp = 0x00000000; - - if(uart == 0) - return; - - if(uart->rxEnabled) { - tmp |= (1 << UCRXRST); - } - - if(uart->txEnabled) { - tmp |= (1 << UCTXRST); - } - - USC0(uart->uart_nr) |= (tmp); - USC0(uart->uart_nr) &= ~(tmp); -} - -void uart_interrupt_enable(uart_t* uart) { - if(uart == 0) - return; - USIC(uart->uart_nr) = 0x1ff; - ETS_UART_INTR_ATTACH(&uart_interrupt_handler, uart); // uart parameter is not osed in irq function! - if(uart->rxEnabled) { - USIE(uart->uart_nr) |= (1 << UIFF); - } - ETS_UART_INTR_ENABLE(); -} - -void uart_interrupt_disable(uart_t* uart) { - if(uart == 0) - return; - if(uart->rxEnabled) { - USIE(uart->uart_nr) &= ~(1 << UIFF); - } - if(uart->txEnabled) { - USIE(uart->uart_nr) &= ~(1 << UIFE); - } - //ETS_UART_INTR_DISABLE(); // never disable irq complete may its needed by the other Serial Interface! -} - -void uart_arm_tx_interrupt(uart_t* uart) { - if(uart == 0) - return; - if(uart->txEnabled) { - USIE(uart->uart_nr) |= (1 << UIFE); - } -} - -void uart_disarm_tx_interrupt(uart_t* uart) { - if(uart == 0) - return; - if(uart->txEnabled) { - USIE(uart->uart_nr) &= ~(1 << UIFE); - } -} - -void uart_set_baudrate(uart_t* uart, int baud_rate) { - if(uart == 0) - return; - uart->baud_rate = baud_rate; - USD(uart->uart_nr) = (80000000UL / uart->baud_rate); -} - -int uart_get_baudrate(uart_t* uart) { - if(uart == 0) - return 0; - return uart->baud_rate; -} - -uart_t* uart_init(int uart_nr, int baudrate, byte config) { - - uint32_t conf1 = 0x00000000; - uart_t* uart = (uart_t*) os_malloc(sizeof(uart_t)); - - if(uart == 0) { - return 0; - } - - uart->uart_nr = uart_nr; - - switch(uart->uart_nr) { - case UART0: - pinMode(1, SPECIAL); - pinMode(3, SPECIAL); - uart->rxEnabled = true; - uart->txEnabled = true; - uart->rxPin = 3; - uart->txPin = 1; - break; - case UART1: - pinMode(2, SPECIAL); - uart->rxEnabled = false; - uart->txEnabled = true; - uart->rxPin = 255; - uart->txPin = 2; - break; - case UART_NO: - default: - // big fail! - break; - } - uart_set_baudrate(uart, baudrate); - USC0(uart->uart_nr) = config; - - uart_flush(uart); - uart_interrupt_enable(uart); - - if(uart->rxEnabled) { - conf1 |= (0x01 << UCFFT); - } - - if(uart->txEnabled) { - conf1 |= (0x20 << UCFET); - } - - USC1(uart->uart_nr) = conf1; - - return uart; -} - -void uart_uninit(uart_t* uart) { - if(uart == 0) - return; - uart_interrupt_disable(uart); - - switch(uart->rxPin) { - case 3: - pinMode(3, INPUT); - break; - case 13: - pinMode(13, INPUT); - break; - } - - switch(uart->txPin) { - case 1: - pinMode(1, INPUT); - break; - case 2: - pinMode(2, INPUT); - break; - case 15: - pinMode(15, INPUT); - break; - } - - os_free(uart); -} - -void uart_swap(uart_t* uart) { - if(uart == 0) - return; - switch(uart->uart_nr) { - case UART0: - if(uart->txPin == 1 && uart->rxPin == 3) { - pinMode(15, FUNCTION_4); //TX - pinMode(13, FUNCTION_4); //RX - USWAP |= (1 << USWAP0); - pinMode(1, INPUT); //TX - pinMode(3, INPUT); //RX - uart->rxPin = 13; - uart->txPin = 15; - } else { - pinMode(1, SPECIAL); //TX - pinMode(3, SPECIAL); //RX - USWAP &= ~(1 << USWAP0); - pinMode(15, INPUT); //TX - pinMode(13, INPUT); //RX - uart->rxPin = 3; - uart->txPin = 1; - } - - break; - case UART1: - // current no swap possible! see GPIO pins used by UART - break; - default: - break; - } -} - -// #################################################################################################### -// #################################################################################################### -// #################################################################################################### - -void uart_ignore_char(char c) { -} - -void uart0_write_char(char c) { - if(&Serial != NULL && Serial.isTxEnabled()) { - if(Serial.availableForWrite() > 0) { - if(c == '\n') { - Serial.write('\r'); - } - Serial.write(c); - return; - } - } - - // wait for the Hardware FIFO - while(true) { - if(((USS(0) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) { - break; - } - } - - if(c == '\n') { - USF(0) = '\r'; - } - USF(0) = c; -} - -void uart1_write_char(char c) { - if(&Serial1 != NULL && Serial1.isTxEnabled()) { - if(Serial1.availableForWrite() > 0) { - if(c == '\n') { - Serial1.write('\r'); - } - Serial1.write(c); - return; - } - } - - // wait for the Hardware FIFO - while(true) { - if(((USS(1) >> USTXC) & 0xff) <= (UART_TX_FIFO_SIZE - 2)) { - break; - } - } - - if(c == '\n') { - USF(1) = '\r'; - } - USF(1) = c; -} - -static int s_uart_debug_nr = UART0; - -void uart_set_debug(int uart_nr) { - s_uart_debug_nr = uart_nr; - switch(s_uart_debug_nr) { - case UART0: - system_set_os_print(1); - ets_install_putc1((void *) &uart0_write_char); - break; - case UART1: - system_set_os_print(1); - ets_install_putc1((void *) &uart1_write_char); - break; - case UART_NO: - default: - system_set_os_print(0); - ets_install_putc1((void *) &uart_ignore_char); - break; - } -} - -int uart_get_debug() { - return s_uart_debug_nr; -} - -// #################################################################################################### -// #################################################################################################### -// #################################################################################################### - -HardwareSerial::HardwareSerial(int uart_nr) : - _uart_nr(uart_nr), _uart(0), _tx_buffer(0), _rx_buffer(0), _written(false) { -} - -void HardwareSerial::begin(unsigned long baud, byte config) { - - // disable debug for this interface - if(uart_get_debug() == _uart_nr) { - uart_set_debug(UART_NO); - } - - _uart = uart_init(_uart_nr, baud, config); - - if(_uart == 0) { - return; - } - - if(_uart->rxEnabled) { - if(!_rx_buffer) - _rx_buffer = new cbuf(SERIAL_RX_BUFFER_SIZE); - } - if(_uart->txEnabled) { - if(!_tx_buffer) - _tx_buffer = new cbuf(SERIAL_TX_BUFFER_SIZE); - } - _written = false; - delay(1); -} - -void HardwareSerial::end() { - if(uart_get_debug() == _uart_nr) { - uart_set_debug(UART_NO); - } - uart_uninit(_uart); - delete _rx_buffer; - delete _tx_buffer; - _uart = 0; - _rx_buffer = 0; - _tx_buffer = 0; -} - -void HardwareSerial::swap() { - if(_uart == 0) - return; - uart_swap(_uart); -} - -void HardwareSerial::setDebugOutput(bool en) { - if(_uart == 0) - return; - if(en) { - uart_set_debug(_uart->uart_nr); - } else { - // disable debug for this interface - if(uart_get_debug() == _uart_nr) { - uart_set_debug(UART_NO); - } - } -} - -bool HardwareSerial::isTxEnabled(void) { - if(_uart == 0) - return false; - return _uart->txEnabled; -} - -bool HardwareSerial::isRxEnabled(void) { - if(_uart == 0) - return false; - return _uart->rxEnabled; -} - -int HardwareSerial::available(void) { - if(_uart == 0) - return 0; - if(_uart->rxEnabled) { - return static_cast(_rx_buffer->getSize()); - } else { - return 0; - } -} - -int HardwareSerial::peek(void) { - if(_uart == 0) - return -1; - if(_uart->rxEnabled) { - return _rx_buffer->peek(); - } else { - return -1; - } -} - -int HardwareSerial::read(void) { - if(_uart == 0) - return -1; - if(_uart->rxEnabled) { - return _rx_buffer->read(); - } else { - return -1; - } -} - -int HardwareSerial::availableForWrite(void) { - if(_uart == 0) - return 0; - if(_uart->txEnabled) { - return static_cast(_tx_buffer->room()); - } else { - return 0; - } -} - -void HardwareSerial::flush() { - if(_uart == 0) - return; - if(!_uart->txEnabled) - return; - if(!_written) - return; - - while(_tx_buffer->getSize() || uart_get_tx_fifo_room(_uart) < UART_TX_FIFO_SIZE) - yield(); - - _written = false; -} - -size_t HardwareSerial::write(uint8_t c) { - if(_uart == 0 || !_uart->txEnabled) - return 0; - _written = true; - size_t room = uart_get_tx_fifo_room(_uart); - if(room > 0 && _tx_buffer->empty()) { - uart_transmit_char(_uart, c); - if(room < 10) { - uart_arm_tx_interrupt(_uart); - } - return 1; - } - - while(_tx_buffer->room() == 0) { - yield(); - } - - _tx_buffer->write(c); - return 1; -} - -HardwareSerial::operator bool() const { - return _uart != 0; -} - -void HardwareSerial::_rx_complete_irq(char c) { - if(_rx_buffer) { - _rx_buffer->write(c); - } -} - -void HardwareSerial::_tx_empty_irq(void) { - if(_uart == 0) - return; - if(_tx_buffer == 0) - return; - size_t queued = _tx_buffer->getSize(); - if(!queued) { - uart_disarm_tx_interrupt(_uart); - return; - } - - size_t room = uart_get_tx_fifo_room(_uart); - int n = static_cast((queued < room) ? queued : room); - while(n--) { - uart_transmit_char(_uart, _tx_buffer->read()); - } -} diff --git a/sparkfun/esp8266/cores/esp8266/HardwareSerial.h b/sparkfun/esp8266/cores/esp8266/HardwareSerial.h deleted file mode 100644 index b196ff38..00000000 --- a/sparkfun/esp8266/cores/esp8266/HardwareSerial.h +++ /dev/null @@ -1,119 +0,0 @@ -/* - HardwareSerial.h - Hardware serial library for Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 28 September 2010 by Mark Sproul - Modified 14 August 2012 by Alarus - Modified 3 December 2013 by Matthijs Kooijman - Modified 18 December 2014 by Ivan Grokhotkov (esp8266 platform support) - Modified 31 March 2015 by Markus Sattler (rewrite the code for UART0 + UART1 support in ESP8266) - Modified 25 April 2015 by Thomas Flayols (add configuration different from 8N1 in ESP8266) - */ - -#ifndef HardwareSerial_h -#define HardwareSerial_h - -#include - -#include "Stream.h" - -#define SERIAL_TX_BUFFER_SIZE 256 -#define SERIAL_RX_BUFFER_SIZE 256 - -// Define config for Serial.begin(baud, config); -#define SERIAL_5N1 0x10 -#define SERIAL_6N1 0x14 -#define SERIAL_7N1 0x18 -#define SERIAL_8N1 0x1c -#define SERIAL_5N2 0x30 -#define SERIAL_6N2 0x34 -#define SERIAL_7N2 0x38 -#define SERIAL_8N2 0x3c -#define SERIAL_5E1 0x12 -#define SERIAL_6E1 0x16 -#define SERIAL_7E1 0x1a -#define SERIAL_8E1 0x1e -#define SERIAL_5E2 0x32 -#define SERIAL_6E2 0x36 -#define SERIAL_7E2 0x3a -#define SERIAL_8E2 0x3e -#define SERIAL_5O1 0x13 -#define SERIAL_6O1 0x17 -#define SERIAL_7O1 0x1b -#define SERIAL_8O1 0x1f -#define SERIAL_5O2 0x33 -#define SERIAL_6O2 0x37 -#define SERIAL_7O2 0x3b -#define SERIAL_8O2 0x3f - -class cbuf; - -struct uart_; -typedef struct uart_ uart_t; - -class HardwareSerial: public Stream { - public: - HardwareSerial(int uart_nr); - - void begin(unsigned long baud) { - begin(baud, SERIAL_8N1); - } - void begin(unsigned long, uint8_t); - void end(); - void swap(); //toggle between use of GPIO13/GPIO15 or GPIO3/GPIO1 as RX and TX - int available(void) override; - int peek(void) override; - int read(void) override; - int availableForWrite(void); - void flush(void) override; - size_t write(uint8_t) override; - inline size_t write(unsigned long n) { - return write((uint8_t) n); - } - inline size_t write(long n) { - return write((uint8_t) n); - } - inline size_t write(unsigned int n) { - return write((uint8_t) n); - } - inline size_t write(int n) { - return write((uint8_t) n); - } - using Print::write; // pull in write(str) and write(buf, size) from Print - operator bool() const; - - void setDebugOutput(bool); - bool isTxEnabled(void); - bool isRxEnabled(void); - - protected: - friend void uart_interrupt_handler(uart_t* uart); - void _rx_complete_irq(char c); - void _tx_empty_irq(void); - - protected: - int _uart_nr; - uart_t* _uart; - cbuf* _tx_buffer; - cbuf* _rx_buffer; - bool _written; -}; - -extern HardwareSerial Serial; -extern HardwareSerial Serial1; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/IPAddress.cpp b/sparkfun/esp8266/cores/esp8266/IPAddress.cpp deleted file mode 100644 index dea1d18a..00000000 --- a/sparkfun/esp8266/cores/esp8266/IPAddress.cpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - IPAddress.cpp - Base class that provides IPAddress - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -#include -#include - -IPAddress::IPAddress() { - _address.dword = 0; -} - -IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) { - _address.bytes[0] = first_octet; - _address.bytes[1] = second_octet; - _address.bytes[2] = third_octet; - _address.bytes[3] = fourth_octet; -} - -IPAddress::IPAddress(uint32_t address) { - _address.dword = address; -} - -IPAddress::IPAddress(const uint8_t *address) { - memcpy(_address.bytes, address, sizeof(_address.bytes)); -} - -IPAddress& IPAddress::operator=(const uint8_t *address) { - memcpy(_address.bytes, address, sizeof(_address.bytes)); - return *this; -} - -IPAddress& IPAddress::operator=(uint32_t address) { - _address.dword = address; - return *this; -} - -bool IPAddress::operator==(const uint8_t* addr) const { - return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; -} - -size_t IPAddress::printTo(Print& p) const { - size_t n = 0; - for(int i = 0; i < 3; i++) { - n += p.print(_address.bytes[i], DEC); - n += p.print('.'); - } - n += p.print(_address.bytes[3], DEC); - return n; -} - diff --git a/sparkfun/esp8266/cores/esp8266/IPAddress.h b/sparkfun/esp8266/cores/esp8266/IPAddress.h deleted file mode 100644 index 73c6cbdf..00000000 --- a/sparkfun/esp8266/cores/esp8266/IPAddress.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - IPAddress.h - Base class that provides IPAddress - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef IPAddress_h -#define IPAddress_h - -#include -#include - -// A class to make it easier to handle and pass around IP addresses - -class IPAddress: public Printable { - private: - union { - uint8_t bytes[4]; // IPv4 address - uint32_t dword; - } _address; - - // Access the raw byte array containing the address. Because this returns a pointer - // to the internal structure rather than a copy of the address this function should only - // be used when you know that the usage of the returned uint8_t* will be transient and not - // stored. - uint8_t* raw_address() { - return _address.bytes; - } - - public: - // Constructors - IPAddress(); - IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); - IPAddress(uint32_t address); - IPAddress(const uint8_t *address); - - // Overloaded cast operator to allow IPAddress objects to be used where a pointer - // to a four-byte uint8_t array is expected - operator uint32_t() const { - return _address.dword; - } - bool operator==(const IPAddress& addr) const { - return _address.dword == addr._address.dword; - } - bool operator==(const uint8_t* addr) const; - - // Overloaded index operator to allow getting and setting individual octets of the address - uint8_t operator[](int index) const { - return _address.bytes[index]; - } - uint8_t& operator[](int index) { - return _address.bytes[index]; - } - - // Overloaded copy operators to allow initialisation of IPAddress objects from other types - IPAddress& operator=(const uint8_t *address); - IPAddress& operator=(uint32_t address); - - virtual size_t printTo(Print& p) const; - - friend class EthernetClass; - friend class UDP; - friend class Client; - friend class Server; - friend class DhcpClass; - friend class DNSClient; -}; - -const IPAddress INADDR_NONE(0, 0, 0, 0); - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Print.cpp b/sparkfun/esp8266/cores/esp8266/Print.cpp deleted file mode 100644 index 1f924248..00000000 --- a/sparkfun/esp8266/cores/esp8266/Print.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* - Print.cpp - Base class that provides print() and println() - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 23 November 2006 by David A. Mellis - Modified December 2014 by Ivan Grokhotkov - Modified May 2015 by Michael C. Miller - esp8266 progmem support - */ - -#include -#include -#include -#include -#include "Arduino.h" - -#include "Print.h" -extern "C" { -#include "c_types.h" -#include "ets_sys.h" -} - -// Public Methods ////////////////////////////////////////////////////////////// - -/* default implementation: may be overridden */ -size_t ICACHE_FLASH_ATTR Print::write(const uint8_t *buffer, size_t size) { - size_t n = 0; - while(size--) { - n += write(*buffer++); - } - return n; -} - -size_t Print::printf(const char *format, ...) { - va_list arg; - va_start(arg, format); - char temp[256]; - size_t len = ets_vsnprintf(temp, 256, format, arg); - len = print(temp); - va_end(arg); - return len; -} - -size_t ICACHE_FLASH_ATTR Print::print(const __FlashStringHelper *ifsh) { - PGM_P p = reinterpret_cast(ifsh); - - size_t n = 0; - while (1) { - uint8_t c = pgm_read_byte(p++); - if (c == 0) break; - n += write(c); - } - return n; -} - -size_t ICACHE_FLASH_ATTR Print::print(const String &s) { - return write(s.c_str(), s.length()); -} - -size_t ICACHE_FLASH_ATTR Print::print(const char str[]) { - return write(str); -} - -size_t ICACHE_FLASH_ATTR Print::print(char c) { - return write(c); -} - -size_t ICACHE_FLASH_ATTR Print::print(unsigned char b, int base) { - return print((unsigned long) b, base); -} - -size_t ICACHE_FLASH_ATTR Print::print(int n, int base) { - return print((long) n, base); -} - -size_t ICACHE_FLASH_ATTR Print::print(unsigned int n, int base) { - return print((unsigned long) n, base); -} - -size_t ICACHE_FLASH_ATTR Print::print(long n, int base) { - if(base == 0) { - return write(n); - } else if(base == 10) { - if(n < 0) { - int t = print('-'); - n = -n; - return printNumber(n, 10) + t; - } - return printNumber(n, 10); - } else { - return printNumber(n, base); - } -} - -size_t ICACHE_FLASH_ATTR Print::print(unsigned long n, int base) { - if(base == 0) - return write(n); - else - return printNumber(n, base); -} - -size_t ICACHE_FLASH_ATTR Print::print(double n, int digits) { - return printFloat(n, digits); -} - -size_t ICACHE_FLASH_ATTR Print::println(const __FlashStringHelper *ifsh) { - size_t n = print(ifsh); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::print(const Printable& x) { - return x.printTo(*this); -} - -size_t ICACHE_FLASH_ATTR Print::println(void) { - size_t n = print("\r\n"); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(const String &s) { - size_t n = print(s); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(const char c[]) { - size_t n = print(c); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(char c) { - size_t n = print(c); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(unsigned char b, int base) { - size_t n = print(b, base); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(int num, int base) { - size_t n = print(num, base); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(unsigned int num, int base) { - size_t n = print(num, base); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(long num, int base) { - size_t n = print(num, base); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(unsigned long num, int base) { - size_t n = print(num, base); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(double num, int digits) { - size_t n = print(num, digits); - n += println(); - return n; -} - -size_t ICACHE_FLASH_ATTR Print::println(const Printable& x) { - size_t n = print(x); - n += println(); - return n; -} - -// Private Methods ///////////////////////////////////////////////////////////// - -size_t ICACHE_FLASH_ATTR Print::printNumber(unsigned long n, uint8_t base) { - char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte. - char *str = &buf[sizeof(buf) - 1]; - - *str = '\0'; - - // prevent crash if called with base == 1 - if(base < 2) - base = 10; - - do { - unsigned long m = n; - n /= base; - char c = m - base * n; - *--str = c < 10 ? c + '0' : c + 'A' - 10; - } while(n); - - return write(str); -} - -size_t ICACHE_FLASH_ATTR Print::printFloat(double number, uint8_t digits) { - size_t n = 0; - - if(isnan(number)) - return print("nan"); - if(isinf(number)) - return print("inf"); - if(number > 4294967040.0) - return print("ovf"); // constant determined empirically - if(number < -4294967040.0) - return print("ovf"); // constant determined empirically - - // Handle negative numbers - if(number < 0.0) { - n += print('-'); - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for(uint8_t i = 0; i < digits; ++i) - rounding /= 10.0; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long) number; - double remainder = number - (double) int_part; - n += print(int_part); - - // Print the decimal point, but only if there are digits beyond - if(digits > 0) { - n += print("."); - } - - // Extract digits from the remainder one at a time - while(digits-- > 0) { - remainder *= 10.0; - int toPrint = int(remainder); - n += print(toPrint); - remainder -= toPrint; - } - - return n; -} diff --git a/sparkfun/esp8266/cores/esp8266/Print.h b/sparkfun/esp8266/cores/esp8266/Print.h deleted file mode 100644 index 7366174f..00000000 --- a/sparkfun/esp8266/cores/esp8266/Print.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - Print.h - Base class that provides print() and println() - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Print_h -#define Print_h - -#include -#include - -#include "WString.h" -#include "Printable.h" - -#define DEC 10 -#define HEX 16 -#define OCT 8 -#define BIN 2 - -class Print { - private: - int write_error; - size_t printNumber(unsigned long, uint8_t); - size_t printFloat(double, uint8_t); - protected: - void setWriteError(int err = 1) { - write_error = err; - } - public: - Print() : - write_error(0) { - } - - int getWriteError() { - return write_error; - } - void clearWriteError() { - setWriteError(0); - } - - virtual size_t write(uint8_t) = 0; - size_t write(const char *str) { - if(str == NULL) - return 0; - return write((const uint8_t *) str, strlen(str)); - } - virtual size_t write(const uint8_t *buffer, size_t size); - size_t write(const char *buffer, size_t size) { - return write((const uint8_t *) buffer, size); - } - - size_t printf(const char * format, ...); - size_t print(const __FlashStringHelper *); - size_t print(const String &); - size_t print(const char[]); - size_t print(char); - size_t print(unsigned char, int = DEC); - size_t print(int, int = DEC); - size_t print(unsigned int, int = DEC); - size_t print(long, int = DEC); - size_t print(unsigned long, int = DEC); - size_t print(double, int = 2); - size_t print(const Printable&); - - size_t println(const __FlashStringHelper *); - size_t println(const String &s); - size_t println(const char[]); - size_t println(char); - size_t println(unsigned char, int = DEC); - size_t println(int, int = DEC); - size_t println(unsigned int, int = DEC); - size_t println(long, int = DEC); - size_t println(unsigned long, int = DEC); - size_t println(double, int = 2); - size_t println(const Printable&); - size_t println(void); -}; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Printable.h b/sparkfun/esp8266/cores/esp8266/Printable.h deleted file mode 100644 index 072b4806..00000000 --- a/sparkfun/esp8266/cores/esp8266/Printable.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - Printable.h - Interface class that allows printing of complex types - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Printable_h -#define Printable_h - -#include - -class Print; - -/** The Printable class provides a way for new classes to allow themselves to be printed. - By deriving from Printable and implementing the printTo method, it will then be possible - for users to print out instances of this class by passing them into the usual - Print::print and Print::println methods. - */ - -class Printable { - public: - virtual size_t printTo(Print& p) const = 0; -}; - -#endif - diff --git a/sparkfun/esp8266/cores/esp8266/Server.h b/sparkfun/esp8266/cores/esp8266/Server.h deleted file mode 100644 index db5369f4..00000000 --- a/sparkfun/esp8266/cores/esp8266/Server.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - Server.h - Base class that provides Server - Copyright (c) 2011 Adrian McEwen. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef server_h -#define server_h - -#include "Print.h" - -class Server: public Print { - public: - virtual void begin() =0; -}; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Stream.cpp b/sparkfun/esp8266/cores/esp8266/Stream.cpp deleted file mode 100644 index c44fc248..00000000 --- a/sparkfun/esp8266/cores/esp8266/Stream.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* - Stream.cpp - adds parsing methods to Stream class - Copyright (c) 2008 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Created July 2011 - parsing functions based on TextFinder library by Michael Margolis - */ - -#include "Arduino.h" -#include "Stream.h" -extern "C" { -#include "c_types.h" -} -#define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait -#define NO_SKIP_CHAR 1 // a magic char not found in a valid ASCII numeric field - -// private method to read stream with timeout -int ICACHE_FLASH_ATTR Stream::timedRead() { - int c; - _startMillis = millis(); - do { - c = read(); - if(c >= 0) - return c; - yield(); - } while(millis() - _startMillis < _timeout); - return -1; // -1 indicates timeout -} - -// private method to peek stream with timeout -int ICACHE_FLASH_ATTR Stream::timedPeek() { - int c; - _startMillis = millis(); - do { - c = peek(); - if(c >= 0) - return c; - yield(); - } while(millis() - _startMillis < _timeout); - return -1; // -1 indicates timeout -} - -// returns peek of the next digit in the stream or -1 if timeout -// discards non-numeric characters -int ICACHE_FLASH_ATTR Stream::peekNextDigit() { - int c; - while(1) { - c = timedPeek(); - if(c < 0) - return c; // timeout - if(c == '-') - return c; - if(c >= '0' && c <= '9') - return c; - read(); // discard non-numeric - } -} - -// Public Methods -////////////////////////////////////////////////////////////// - -void ICACHE_FLASH_ATTR Stream::setTimeout(unsigned long timeout) // sets the maximum number of milliseconds to wait -{ - _timeout = timeout; -} - -// find returns true if the target string is found -bool ICACHE_FLASH_ATTR Stream::find(const char *target) { - return findUntil(target, (char*) ""); -} - -// reads data from the stream until the target string of given length is found -// returns true if target string is found, false if timed out -bool ICACHE_FLASH_ATTR Stream::find(const char *target, size_t length) { - return findUntil(target, length, NULL, 0); -} - -// as find but search ends if the terminator string is found -bool ICACHE_FLASH_ATTR Stream::findUntil(const char *target, const char *terminator) { - return findUntil(target, strlen(target), terminator, strlen(terminator)); -} - -// reads data from the stream until the target string of the given length is found -// search terminated if the terminator string is found -// returns true if target string is found, false if terminated or timed out -bool ICACHE_FLASH_ATTR Stream::findUntil(const char *target, size_t targetLen, const char *terminator, size_t termLen) { - size_t index = 0; // maximum target string length is 64k bytes! - size_t termIndex = 0; - int c; - - if(*target == 0) - return true; // return true if target is a null string - while((c = timedRead()) > 0) { - - if(c != target[index]) - index = 0; // reset index if any char does not match - - if(c == target[index]) { - //////Serial.print("found "); Serial.write(c); Serial.print("index now"); Serial.println(index+1); - if(++index >= targetLen) { // return true if all chars in the target match - return true; - } - } - - if(termLen > 0 && c == terminator[termIndex]) { - if(++termIndex >= termLen) - return false; // return false if terminate string found before target string - } else - termIndex = 0; - } - return false; -} - -// returns the first valid (long) integer value from the current position. -// initial characters that are not digits (or the minus sign) are skipped -// function is terminated by the first character that is not a digit. -long ICACHE_FLASH_ATTR Stream::parseInt() { - return parseInt(NO_SKIP_CHAR); // terminate on first non-digit character (or timeout) -} - -// as above but a given skipChar is ignored -// this allows format characters (typically commas) in values to be ignored -long ICACHE_FLASH_ATTR Stream::parseInt(char skipChar) { - boolean isNegative = false; - long value = 0; - int c; - - c = peekNextDigit(); - // ignore non numeric leading characters - if(c < 0) - return 0; // zero returned if timeout - - do { - if(c == skipChar) - ; // ignore this charactor - else if(c == '-') - isNegative = true; - else if(c >= '0' && c <= '9') // is c a digit? - value = value * 10 + c - '0'; - read(); // consume the character we got with peek - c = timedPeek(); - } while((c >= '0' && c <= '9') || c == skipChar); - - if(isNegative) - value = -value; - return value; -} - -// as parseInt but returns a floating point value -float ICACHE_FLASH_ATTR Stream::parseFloat() { - return parseFloat(NO_SKIP_CHAR); -} - -// as above but the given skipChar is ignored -// this allows format characters (typically commas) in values to be ignored -float ICACHE_FLASH_ATTR Stream::parseFloat(char skipChar) { - boolean isNegative = false; - boolean isFraction = false; - long value = 0; - int c; - float fraction = 1.0; - - c = peekNextDigit(); - // ignore non numeric leading characters - if(c < 0) - return 0; // zero returned if timeout - - do { - if(c == skipChar) - ; // ignore - else if(c == '-') - isNegative = true; - else if(c == '.') - isFraction = true; - else if(c >= '0' && c <= '9') { // is c a digit? - value = value * 10 + c - '0'; - if(isFraction) - fraction *= 0.1; - } - read(); // consume the character we got with peek - c = timedPeek(); - } while((c >= '0' && c <= '9') || c == '.' || c == skipChar); - - if(isNegative) - value = -value; - if(isFraction) - return value * fraction; - else - return value; -} - -// read characters from stream into buffer -// terminates if length characters have been read, or timeout (see setTimeout) -// returns the number of characters placed in the buffer -// the buffer is NOT null terminated. -// -size_t ICACHE_FLASH_ATTR Stream::readBytes(char *buffer, size_t length) { - size_t count = 0; - while(count < length) { - int c = timedRead(); - if(c < 0) - break; - *buffer++ = (char) c; - count++; - } - return count; -} - -// as readBytes with terminator character -// terminates if length characters have been read, timeout, or if the terminator character detected -// returns the number of characters placed in the buffer (0 means no valid data found) - -size_t ICACHE_FLASH_ATTR Stream::readBytesUntil(char terminator, char *buffer, size_t length) { - if(length < 1) - return 0; - size_t index = 0; - while(index < length) { - int c = timedRead(); - if(c < 0 || c == terminator) - break; - *buffer++ = (char) c; - index++; - } - return index; // return number of characters, not including null terminator -} - -String ICACHE_FLASH_ATTR Stream::readString() { - String ret; - int c = timedRead(); - while(c >= 0) { - ret += (char) c; - c = timedRead(); - } - return ret; -} - -String ICACHE_FLASH_ATTR Stream::readStringUntil(char terminator) { - String ret; - int c = timedRead(); - while(c >= 0 && c != terminator) { - ret += (char) c; - c = timedRead(); - } - return ret; -} - diff --git a/sparkfun/esp8266/cores/esp8266/Stream.h b/sparkfun/esp8266/cores/esp8266/Stream.h deleted file mode 100644 index 6d08ef1d..00000000 --- a/sparkfun/esp8266/cores/esp8266/Stream.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - Stream.h - base class for character-based streams. - Copyright (c) 2010 David A. Mellis. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - parsing functions based on TextFinder library by Michael Margolis - */ - -#ifndef Stream_h -#define Stream_h - -#include -#include "Print.h" - -// compatability macros for testing -/* - #define getInt() parseInt() - #define getInt(skipChar) parseInt(skipchar) - #define getFloat() parseFloat() - #define getFloat(skipChar) parseFloat(skipChar) - #define getString( pre_string, post_string, buffer, length) - readBytesBetween( pre_string, terminator, buffer, length) - */ - -class Stream: public Print { - protected: - unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read - unsigned long _startMillis; // used for timeout measurement - int timedRead(); // private method to read stream with timeout - int timedPeek(); // private method to peek stream with timeout - int peekNextDigit(); // returns the next numeric digit in the stream or -1 if timeout - - public: - virtual int available() = 0; - virtual int read() = 0; - virtual int peek() = 0; - virtual void flush() = 0; - - Stream() { - _timeout = 1000; - } - -// parsing methods - - void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second - - bool find(const char *target); // reads data from the stream until the target string is found - bool find(uint8_t *target) { - return find((char *) target); - } - // returns true if target string is found, false if timed out (see setTimeout) - - bool find(const char *target, size_t length); // reads data from the stream until the target string of given length is found - bool find(const uint8_t *target, size_t length) { - return find((char *) target, length); - } - // returns true if target string is found, false if timed out - - bool findUntil(const char *target, const char *terminator); // as find but search ends if the terminator string is found - bool findUntil(const uint8_t *target, const char *terminator) { - return findUntil((char *) target, terminator); - } - - bool findUntil(const char *target, size_t targetLen, const char *terminate, size_t termLen); // as above but search ends if the terminate string is found - bool findUntil(const uint8_t *target, size_t targetLen, const char *terminate, size_t termLen) { - return findUntil((char *) target, targetLen, terminate, termLen); - } - - long parseInt(); // returns the first valid (long) integer value from the current position. - // initial characters that are not digits (or the minus sign) are skipped - // integer is terminated by the first character that is not a digit. - - float parseFloat(); // float version of parseInt - - size_t readBytes(char *buffer, size_t length); // read chars from stream into buffer - size_t readBytes(uint8_t *buffer, size_t length) { - return readBytes((char *) buffer, length); - } - // terminates if length characters have been read or timeout (see setTimeout) - // returns the number of characters placed in the buffer (0 means no valid data found) - - size_t readBytesUntil(char terminator, char *buffer, size_t length); // as readBytes with terminator character - size_t readBytesUntil(char terminator, uint8_t *buffer, size_t length) { - return readBytesUntil(terminator, (char *) buffer, length); - } - // terminates if length characters have been read, timeout, or if the terminator character detected - // returns the number of characters placed in the buffer (0 means no valid data found) - - // Arduino String functions to be added here - String readString(); - String readStringUntil(char terminator); - - protected: - long parseInt(char skipChar); // as above but the given skipChar is ignored - // as above but the given skipChar is ignored - // this allows format characters (typically commas) in values to be ignored - - float parseFloat(char skipChar); // as above but the given skipChar is ignored -}; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/Tone.cpp b/sparkfun/esp8266/cores/esp8266/Tone.cpp deleted file mode 100644 index f85ed404..00000000 --- a/sparkfun/esp8266/cores/esp8266/Tone.cpp +++ /dev/null @@ -1,49 +0,0 @@ -/* Tone.cpp - - A Tone Generator Library - - Written by Brett Hagman - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Version Modified By Date Comments - ------- ----------- -------- -------- - 0001 B Hagman 09/08/02 Initial coding - 0002 B Hagman 09/08/18 Multiple pins - 0003 B Hagman 09/08/18 Moved initialization from constructor to begin() - 0004 B Hagman 09/09/26 Fixed problems with ATmega8 - 0005 B Hagman 09/11/23 Scanned prescalars for best fit on 8 bit timers - 09/11/25 Changed pin toggle method to XOR - 09/11/25 Fixed timer0 from being excluded - 0006 D Mellis 09/12/29 Replaced objects with functions - 0007 M Sproul 10/08/29 Changed #ifdefs from cpu to register - 0008 S Kanemoto 12/06/22 Fixed for Leonardo by @maris_HY - *************************************************/ - -#include "Arduino.h" -#include "pins_arduino.h" - -static int8_t toneBegin(uint8_t _pin) { - //TODO implement tone - return 0; -} - -void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) { - //TODO implement tone -} - -void noTone(uint8_t _pin) { - //TODO implement tone -} diff --git a/sparkfun/esp8266/cores/esp8266/Udp.h b/sparkfun/esp8266/cores/esp8266/Udp.h deleted file mode 100644 index baf70781..00000000 --- a/sparkfun/esp8266/cores/esp8266/Udp.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Udp.cpp: Library to send/receive UDP packets. - * - * NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these) - * 1) UDP does not guarantee the order in which assembled UDP packets are received. This - * might not happen often in practice, but in larger network topologies, a UDP - * packet can be received out of sequence. - * 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being - * aware of it. Again, this may not be a concern in practice on small local networks. - * For more information, see http://www.cafeaulait.org/course/week12/35.html - * - * MIT License: - * Copyright (c) 2008 Bjoern Hartmann - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * bjoern@cs.stanford.edu 12/30/2008 - */ - -#ifndef udp_h -#define udp_h - -#include -#include - -class UDP: public Stream { - - public: - virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use - virtual void stop() =0; // Finish with the UDP socket - - // Sending UDP packets - - // Start building up a packet to send to the remote host specific in ip and port - // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port - virtual int beginPacket(IPAddress ip, uint16_t port) =0; - // Start building up a packet to send to the remote host specific in host and port - // Returns 1 if successful, 0 if there was a problem resolving the hostname or port - virtual int beginPacket(const char *host, uint16_t port) =0; - // Finish off this packet and send it - // Returns 1 if the packet was sent successfully, 0 if there was an error - virtual int endPacket() =0; - // Write a single byte into the packet - virtual size_t write(uint8_t) =0; - // Write size bytes from buffer into the packet - virtual size_t write(const uint8_t *buffer, size_t size) =0; - - // Start processing the next available incoming packet - // Returns the size of the packet in bytes, or 0 if no packets are available - virtual int parsePacket() =0; - // Number of bytes remaining in the current packet - virtual int available() =0; - // Read a single byte from the current packet - virtual int read() =0; - // Read up to len bytes from the current packet and place them into buffer - // Returns the number of bytes read, or 0 if none are available - virtual int read(unsigned char* buffer, size_t len) =0; - // Read up to len characters from the current packet and place them into buffer - // Returns the number of characters read, or 0 if none are available - virtual int read(char* buffer, size_t len) =0; - // Return the next byte from the current packet without moving on to the next byte - virtual int peek() =0; - virtual void flush() =0; // Finish reading the current packet - - // Return the IP address of the host who sent the current incoming packet - virtual IPAddress remoteIP() =0; - // Return the port of the host who sent the current incoming packet - virtual uint16_t remotePort() =0; - protected: - uint8_t* rawIPAddress(IPAddress& addr) { - return addr.raw_address(); - } -}; - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/WCharacter.h b/sparkfun/esp8266/cores/esp8266/WCharacter.h deleted file mode 100644 index f37ddb71..00000000 --- a/sparkfun/esp8266/cores/esp8266/WCharacter.h +++ /dev/null @@ -1,138 +0,0 @@ -/* - WCharacter.h - Character utility functions for Wiring & Arduino - Copyright (c) 2010 Hernando Barragan. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef Character_h -#define Character_h - -#include -#define isascii(__c) ((unsigned)(__c)<=0177) -#define toascii(__c) ((__c)&0177) - -// WCharacter.h prototypes -inline boolean isAlphaNumeric(int c) __attribute__((always_inline)); -inline boolean isAlpha(int c) __attribute__((always_inline)); -inline boolean isAscii(int c) __attribute__((always_inline)); -inline boolean isWhitespace(int c) __attribute__((always_inline)); -inline boolean isControl(int c) __attribute__((always_inline)); -inline boolean isDigit(int c) __attribute__((always_inline)); -inline boolean isGraph(int c) __attribute__((always_inline)); -inline boolean isLowerCase(int c) __attribute__((always_inline)); -inline boolean isPrintable(int c) __attribute__((always_inline)); -inline boolean isPunct(int c) __attribute__((always_inline)); -inline boolean isSpace(int c) __attribute__((always_inline)); -inline boolean isUpperCase(int c) __attribute__((always_inline)); -inline boolean isHexadecimalDigit(int c) __attribute__((always_inline)); -inline int toAscii(int c) __attribute__((always_inline)); -inline int toLowerCase(int c) __attribute__((always_inline)); -inline int toUpperCase(int c) __attribute__((always_inline)); - -// Checks for an alphanumeric character. -// It is equivalent to (isalpha(c) || isdigit(c)). -inline boolean isAlphaNumeric(int c) { - return (isalnum(c) == 0 ? false : true); -} - -// Checks for an alphabetic character. -// It is equivalent to (isupper(c) || islower(c)). -inline boolean isAlpha(int c) { - return (isalpha(c) == 0 ? false : true); -} - -// Checks whether c is a 7-bit unsigned char value -// that fits into the ASCII character set. -inline boolean isAscii(int c) { - return ( isascii (c) == 0 ? false : true); -} - -// Checks for a blank character, that is, a space or a tab. -inline boolean isWhitespace(int c) { - return (isblank(c) == 0 ? false : true); -} - -// Checks for a control character. -inline boolean isControl(int c) { - return (iscntrl(c) == 0 ? false : true); -} - -// Checks for a digit (0 through 9). -inline boolean isDigit(int c) { - return (isdigit(c) == 0 ? false : true); -} - -// Checks for any printable character except space. -inline boolean isGraph(int c) { - return (isgraph(c) == 0 ? false : true); -} - -// Checks for a lower-case character. -inline boolean isLowerCase(int c) { - return (islower(c) == 0 ? false : true); -} - -// Checks for any printable character including space. -inline boolean isPrintable(int c) { - return (isprint(c) == 0 ? false : true); -} - -// Checks for any printable character which is not a space -// or an alphanumeric character. -inline boolean isPunct(int c) { - return (ispunct(c) == 0 ? false : true); -} - -// Checks for white-space characters. For the avr-libc library, -// these are: space, formfeed ('\f'), newline ('\n'), carriage -// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). -inline boolean isSpace(int c) { - return (isspace(c) == 0 ? false : true); -} - -// Checks for an uppercase letter. -inline boolean isUpperCase(int c) { - return (isupper(c) == 0 ? false : true); -} - -// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 -// 8 9 a b c d e f A B C D E F. -inline boolean isHexadecimalDigit(int c) { - return (isxdigit(c) == 0 ? false : true); -} - -// Converts c to a 7-bit unsigned char value that fits into the -// ASCII character set, by clearing the high-order bits. -inline int toAscii(int c) { - return toascii(c); -} - -// Warning: -// Many people will be unhappy if you use this function. -// This function will convert accented letters into random -// characters. - -// Converts the letter c to lower case, if possible. -inline int toLowerCase(int c) { - return tolower(c); -} - -// Converts the letter c to upper case, if possible. -inline int toUpperCase(int c) { - return toupper(c); -} - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/WMath.cpp b/sparkfun/esp8266/cores/esp8266/WMath.cpp deleted file mode 100644 index dcd51f1f..00000000 --- a/sparkfun/esp8266/cores/esp8266/WMath.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ - -/* - Part of the Wiring project - http://wiring.org.co - Copyright (c) 2004-06 Hernando Barragan - Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id$ - */ - -extern "C" { -#include -} - -void randomSeed(unsigned int seed) { - if(seed != 0) { - srand(seed); - } -} - -long random(long howbig) { - if(howbig == 0) { - return 0; - } - return rand() % howbig; -} - -long random(long howsmall, long howbig) { - if(howsmall >= howbig) { - return howsmall; - } - long diff = howbig - howsmall; - return random(diff) + howsmall; -} - -long map(long x, long in_min, long in_max, long out_min, long out_max) { - return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; -} - -unsigned int makeWord(unsigned int w) { - return w; -} - -unsigned int makeWord(unsigned char h, unsigned char l) { - return (h << 8) | l; -} diff --git a/sparkfun/esp8266/cores/esp8266/WString.cpp b/sparkfun/esp8266/cores/esp8266/WString.cpp deleted file mode 100644 index 61fc5ac9..00000000 --- a/sparkfun/esp8266/cores/esp8266/WString.cpp +++ /dev/null @@ -1,748 +0,0 @@ -/* - WString.cpp - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All rights reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - Modified by Ivan Grokhotkov, 2014 - esp8266 support - Modified by Michael C. Miller, 2015 - esp8266 progmem support - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "WString.h" -#include "stdlib_noniso.h" -extern "C" { -#include "osapi.h" -#include "ets_sys.h" -#include "mem.h" -#include "c_types.h" -} - -/*********************************************/ -/* Constructors */ -/*********************************************/ - -ICACHE_FLASH_ATTR String::String(const char *cstr) { - init(); - if(cstr) - copy(cstr, strlen(cstr)); -} - -ICACHE_FLASH_ATTR String::String(const String &value) { - init(); - *this = value; -} - -ICACHE_FLASH_ATTR String::String(const __FlashStringHelper *pstr) { - init(); - *this = pstr; // see operator = -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -ICACHE_FLASH_ATTR String::String(String &&rval) { - init(); - move(rval); -} - -ICACHE_FLASH_ATTR String::String(StringSumHelper &&rval) { - init(); - move(rval); -} -#endif - -ICACHE_FLASH_ATTR String::String(char c) { - init(); - char buf[2]; - buf[0] = c; - buf[1] = 0; - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(unsigned char value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned char)]; - utoa(value, buf, base); - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(int value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(int)]; - itoa(value, buf, base); - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(unsigned int value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned int)]; - utoa(value, buf, base); - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(long value, unsigned char base) { - init(); - char buf[2 + 8 * sizeof(long)]; - ltoa(value, buf, base); - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(unsigned long value, unsigned char base) { - init(); - char buf[1 + 8 * sizeof(unsigned long)]; - ultoa(value, buf, base); - *this = buf; -} - -ICACHE_FLASH_ATTR String::String(float value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -ICACHE_FLASH_ATTR String::String(double value, unsigned char decimalPlaces) { - init(); - char buf[33]; - *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); -} - -ICACHE_FLASH_ATTR String::~String() { - os_free(buffer); -} - -// /*********************************************/ -// /* Memory Management */ -// /*********************************************/ - -inline void String::init(void) { - buffer = NULL; - capacity = 0; - len = 0; -} - -void ICACHE_FLASH_ATTR String::invalidate(void) { - if(buffer) - os_free(buffer); - buffer = NULL; - capacity = len = 0; -} - -unsigned char ICACHE_FLASH_ATTR String::reserve(unsigned int size) { - if(buffer && capacity >= size) - return 1; - if(changeBuffer(size)) { - if(len == 0) - buffer[0] = 0; - return 1; - } - return 0; -} - -unsigned char ICACHE_FLASH_ATTR String::changeBuffer(unsigned int maxStrLen) { - char *newbuffer = (char *) os_realloc(buffer, maxStrLen + 1); - if(newbuffer) { - buffer = newbuffer; - capacity = maxStrLen; - return 1; - } - return 0; -} - -// /*********************************************/ -// /* Copy and Move */ -// /*********************************************/ - -String & ICACHE_FLASH_ATTR String::copy(const char *cstr, unsigned int length) { - if(!reserve(length)) { - invalidate(); - return *this; - } - len = length; - strcpy(buffer, cstr); - return *this; -} - -String & ICACHE_FLASH_ATTR String::copy(const __FlashStringHelper *pstr, unsigned int length) { - if (!reserve(length)) { - invalidate(); - return *this; - } - len = length; - strcpy_P(buffer, (PGM_P)pstr); - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -void ICACHE_FLASH_ATTR String::move(String &rhs) { - if(buffer) { - if(capacity >= rhs.len) { - strcpy(buffer, rhs.buffer); - len = rhs.len; - rhs.len = 0; - return; - } else { - os_free(buffer); - } - } - buffer = rhs.buffer; - capacity = rhs.capacity; - len = rhs.len; - rhs.buffer = NULL; - rhs.capacity = 0; - rhs.len = 0; -} -#endif - -String & ICACHE_FLASH_ATTR String::operator =(const String &rhs) { - if(this == &rhs) - return *this; - - if(rhs.buffer) - copy(rhs.buffer, rhs.len); - else - invalidate(); - - return *this; -} - -#ifdef __GXX_EXPERIMENTAL_CXX0X__ -String & ICACHE_FLASH_ATTR String::operator =(String &&rval) { - if(this != &rval) - move(rval); - return *this; -} - -String & ICACHE_FLASH_ATTR String::operator =(StringSumHelper &&rval) { - if(this != &rval) - move(rval); - return *this; -} -#endif - -String & ICACHE_FLASH_ATTR String::operator =(const char *cstr) { - if(cstr) - copy(cstr, strlen(cstr)); - else - invalidate(); - - return *this; -} - -String & ICACHE_FLASH_ATTR String::operator = (const __FlashStringHelper *pstr) -{ - if (pstr) copy(pstr, strlen_P((PGM_P)pstr)); - else invalidate(); - - return *this; -} - -// /*********************************************/ -// /* concat */ -// /*********************************************/ - -unsigned char ICACHE_FLASH_ATTR String::concat(const String &s) { - return concat(s.buffer, s.len); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(const char *cstr, unsigned int length) { - unsigned int newlen = len + length; - if(!cstr) - return 0; - if(length == 0) - return 1; - if(!reserve(newlen)) - return 0; - strcpy(buffer + len, cstr); - len = newlen; - return 1; -} - -unsigned char ICACHE_FLASH_ATTR String::concat(const char *cstr) { - if(!cstr) - return 0; - return concat(cstr, strlen(cstr)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(char c) { - char buf[2]; - buf[0] = c; - buf[1] = 0; - return concat(buf, 1); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(unsigned char num) { - char buf[1 + 3 * sizeof(unsigned char)]; - itoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(int num) { - char buf[2 + 3 * sizeof(int)]; - itoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(unsigned int num) { - char buf[1 + 3 * sizeof(unsigned int)]; - utoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(long num) { - char buf[2 + 3 * sizeof(long)]; - ltoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(unsigned long num) { - char buf[1 + 3 * sizeof(unsigned long)]; - ultoa(num, buf, 10); - return concat(buf, strlen(buf)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(float num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(double num) { - char buf[20]; - char* string = dtostrf(num, 4, 2, buf); - return concat(string, strlen(string)); -} - -unsigned char ICACHE_FLASH_ATTR String::concat(const __FlashStringHelper * str) { - if (!str) return 0; - int length = strlen_P((PGM_P)str); - if (length == 0) return 1; - unsigned int newlen = len + length; - if (!reserve(newlen)) return 0; - strcpy_P(buffer + len, (PGM_P)str); - len = newlen; - return 1; -} - -/*********************************************/ -/* Concatenate */ -/*********************************************/ - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, const String &rhs) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(rhs.buffer, rhs.len)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, const char *cstr) { - StringSumHelper &a = const_cast(lhs); - if(!cstr || !a.concat(cstr, strlen(cstr))) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, char c) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(c)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, unsigned char num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, unsigned int num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, unsigned long num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, float num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator +(const StringSumHelper &lhs, double num) { - StringSumHelper &a = const_cast(lhs); - if(!a.concat(num)) - a.invalidate(); - return a; -} - -StringSumHelper & ICACHE_FLASH_ATTR operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs) -{ - StringSumHelper &a = const_cast(lhs); - if (!a.concat(rhs)) a.invalidate(); - return a; -} - -// /*********************************************/ -// /* Comparison */ -// /*********************************************/ - -int ICACHE_FLASH_ATTR String::compareTo(const String &s) const { - if(!buffer || !s.buffer) { - if(s.buffer && s.len > 0) - return 0 - *(unsigned char *) s.buffer; - if(buffer && len > 0) - return *(unsigned char *) buffer; - return 0; - } - return strcmp(buffer, s.buffer); -} - -unsigned char ICACHE_FLASH_ATTR String::equals(const String &s2) const { - return (len == s2.len && compareTo(s2) == 0); -} - -unsigned char ICACHE_FLASH_ATTR String::equals(const char *cstr) const { - if(len == 0) - return (cstr == NULL || *cstr == 0); - if(cstr == NULL) - return buffer[0] == 0; - return strcmp(buffer, cstr) == 0; -} - -unsigned char ICACHE_FLASH_ATTR String::operator<(const String &rhs) const { - return compareTo(rhs) < 0; -} - -unsigned char ICACHE_FLASH_ATTR String::operator>(const String &rhs) const { - return compareTo(rhs) > 0; -} - -unsigned char ICACHE_FLASH_ATTR String::operator<=(const String &rhs) const { - return compareTo(rhs) <= 0; -} - -unsigned char ICACHE_FLASH_ATTR String::operator>=(const String &rhs) const { - return compareTo(rhs) >= 0; -} - -unsigned char ICACHE_FLASH_ATTR String::equalsIgnoreCase(const String &s2) const { - if(this == &s2) - return 1; - if(len != s2.len) - return 0; - if(len == 0) - return 1; - const char *p1 = buffer; - const char *p2 = s2.buffer; - while(*p1) { - if(tolower(*p1++) != tolower(*p2++)) - return 0; - } - return 1; -} - -unsigned char ICACHE_FLASH_ATTR String::startsWith(const String &s2) const { - if(len < s2.len) - return 0; - return startsWith(s2, 0); -} - -unsigned char ICACHE_FLASH_ATTR String::startsWith(const String &s2, unsigned int offset) const { - if(offset > len - s2.len || !buffer || !s2.buffer) - return 0; - return strncmp(&buffer[offset], s2.buffer, s2.len) == 0; -} - -unsigned char ICACHE_FLASH_ATTR String::endsWith(const String &s2) const { - if(len < s2.len || !buffer || !s2.buffer) - return 0; - return strcmp(&buffer[len - s2.len], s2.buffer) == 0; -} - -// /*********************************************/ -// /* Character Access */ -// /*********************************************/ - -char ICACHE_FLASH_ATTR String::charAt(unsigned int loc) const { - return operator[](loc); -} - -void ICACHE_FLASH_ATTR String::setCharAt(unsigned int loc, char c) { - if(loc < len) - buffer[loc] = c; -} - -char & ICACHE_FLASH_ATTR String::operator[](unsigned int index) { - static char dummy_writable_char; - if(index >= len || !buffer) { - dummy_writable_char = 0; - return dummy_writable_char; - } - return buffer[index]; -} - -char ICACHE_FLASH_ATTR String::operator[](unsigned int index) const { - if(index >= len || !buffer) - return 0; - return buffer[index]; -} - -void ICACHE_FLASH_ATTR String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const { - if(!bufsize || !buf) - return; - if(index >= len) { - buf[0] = 0; - return; - } - unsigned int n = bufsize - 1; - if(n > len - index) - n = len - index; - strncpy((char *) buf, buffer + index, n); - buf[n] = 0; -} - -// /*********************************************/ -// /* Search */ -// /*********************************************/ -ICACHE_FLASH_ATTR ICACHE_FLASH_ATTR - -int ICACHE_FLASH_ATTR String::indexOf(char c) const { - return indexOf(c, 0); -} - -int ICACHE_FLASH_ATTR String::indexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len) - return -1; - const char* temp = strchr(buffer + fromIndex, ch); - if(temp == NULL) - return -1; - return temp - buffer; -} - -int ICACHE_FLASH_ATTR String::indexOf(const String &s2) const { - return indexOf(s2, 0); -} - -int ICACHE_FLASH_ATTR String::indexOf(const String &s2, unsigned int fromIndex) const { - if(fromIndex >= len) - return -1; - const char *found = strstr(buffer + fromIndex, s2.buffer); - if(found == NULL) - return -1; - return found - buffer; -} - -int ICACHE_FLASH_ATTR String::lastIndexOf(char theChar) const { - return lastIndexOf(theChar, len - 1); -} - -int ICACHE_FLASH_ATTR String::lastIndexOf(char ch, unsigned int fromIndex) const { - if(fromIndex >= len) - return -1; - char tempchar = buffer[fromIndex + 1]; - buffer[fromIndex + 1] = '\0'; - char* temp = strrchr(buffer, ch); - buffer[fromIndex + 1] = tempchar; - if(temp == NULL) - return -1; - return temp - buffer; -} - -int ICACHE_FLASH_ATTR String::lastIndexOf(const String &s2) const { - return lastIndexOf(s2, len - s2.len); -} - -int ICACHE_FLASH_ATTR String::lastIndexOf(const String &s2, unsigned int fromIndex) const { - if(s2.len == 0 || len == 0 || s2.len > len) - return -1; - if(fromIndex >= len) - fromIndex = len - 1; - int found = -1; - for(char *p = buffer; p <= buffer + fromIndex; p++) { - p = strstr(p, s2.buffer); - if(!p) - break; - if((unsigned int) (p - buffer) <= fromIndex) - found = p - buffer; - } - return found; -} - -String ICACHE_FLASH_ATTR String::substring(unsigned int left, unsigned int right) const { - if(left > right) { - unsigned int temp = right; - right = left; - left = temp; - } - String out; - if(left >= len) - return out; - if(right > len) - right = len; - char temp = buffer[right]; // save the replaced character - buffer[right] = '\0'; - out = buffer + left; // pointer arithmetic - buffer[right] = temp; //restore character - return out; -} - -// /*********************************************/ -// /* Modification */ -// /*********************************************/ - -void ICACHE_FLASH_ATTR String::replace(char find, char replace) { - if(!buffer) - return; - for(char *p = buffer; *p; p++) { - if(*p == find) - *p = replace; - } -} - -void ICACHE_FLASH_ATTR String::replace(const String& find, const String& replace) { - if(len == 0 || find.len == 0) - return; - int diff = replace.len - find.len; - char *readFrom = buffer; - char *foundAt; - if(diff == 0) { - while((foundAt = strstr(readFrom, find.buffer)) != NULL) { - memcpy(foundAt, replace.buffer, replace.len); - readFrom = foundAt + replace.len; - } - } else if(diff < 0) { - char *writeTo = buffer; - while((foundAt = strstr(readFrom, find.buffer)) != NULL) { - unsigned int n = foundAt - readFrom; - memcpy(writeTo, readFrom, n); - writeTo += n; - memcpy(writeTo, replace.buffer, replace.len); - writeTo += replace.len; - readFrom = foundAt + find.len; - len += diff; - } - strcpy(writeTo, readFrom); - } else { - unsigned int size = len; // compute size needed for result - while((foundAt = strstr(readFrom, find.buffer)) != NULL) { - readFrom = foundAt + find.len; - size += diff; - } - if(size == len) - return; - if(size > capacity && !changeBuffer(size)) - return; // XXX: tell user! - int index = len - 1; - while(index >= 0 && (index = lastIndexOf(find, index)) >= 0) { - readFrom = buffer + index + find.len; - memmove(readFrom + diff, readFrom, len - (readFrom - buffer)); - len += diff; - buffer[len] = 0; - memcpy(buffer + index, replace.buffer, replace.len); - index--; - } - } -} - -void ICACHE_FLASH_ATTR String::remove(unsigned int index) { - // Pass the biggest integer as the count. The remove method - // below will take care of truncating it at the end of the - // string. - remove(index, (unsigned int) -1); -} - -void ICACHE_FLASH_ATTR String::remove(unsigned int index, unsigned int count) { - if(index >= len) { - return; - } - if(count <= 0) { - return; - } - if(count > len - index) { - count = len - index; - } - char *writeTo = buffer + index; - len = len - count; - strncpy(writeTo, buffer + index + count, len - index); - buffer[len] = 0; -} - -void ICACHE_FLASH_ATTR String::toLowerCase(void) { - if(!buffer) - return; - for(char *p = buffer; *p; p++) { - *p = tolower(*p); - } -} - -void ICACHE_FLASH_ATTR String::toUpperCase(void) { - if(!buffer) - return; - for(char *p = buffer; *p; p++) { - *p = toupper(*p); - } -} - -void ICACHE_FLASH_ATTR String::trim(void) { - if(!buffer || len == 0) - return; - char *begin = buffer; - while(isspace(*begin)) - begin++; - char *end = buffer + len - 1; - while(isspace(*end) && end >= begin) - end--; - len = end + 1 - begin; - if(begin > buffer) - memcpy(buffer, begin, len); - buffer[len] = 0; -} - -// /*********************************************/ -// /* Parsing / Conversion */ -// /*********************************************/ - -long ICACHE_FLASH_ATTR String::toInt(void) const { - if(buffer) - return atol(buffer); - return 0; -} - -float ICACHE_FLASH_ATTR String::toFloat(void) const { - if(buffer) - return atof(buffer); - return 0; -} diff --git a/sparkfun/esp8266/cores/esp8266/WString.h b/sparkfun/esp8266/cores/esp8266/WString.h deleted file mode 100644 index 531fc88c..00000000 --- a/sparkfun/esp8266/cores/esp8266/WString.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - WString.h - String library for Wiring & Arduino - ...mostly rewritten by Paul Stoffregen... - Copyright (c) 2009-10 Hernando Barragan. All right reserved. - Copyright 2011, Paul Stoffregen, paul@pjrc.com - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef String_class_h -#define String_class_h -#ifdef __cplusplus - -#include -#include -#include -#include - -// An inherited class for holding the result of a concatenation. These -// result objects are assumed to be writable by subsequent concatenations. -class StringSumHelper; - -// an abstract class used as a means to proide a unique pointer type -// but really has no body -class __FlashStringHelper; -#define F(string_literal) (reinterpret_cast(PSTR(string_literal))) - - -// The string class -class String { - // use a function pointer to allow for "if (s)" without the - // complications of an operator bool(). for more information, see: - // http://www.artima.com/cppsource/safebool.html - typedef void (String::*StringIfHelperType)() const; - void StringIfHelper() const { - } - - public: - // constructors - // creates a copy of the initial value. - // if the initial value is null or invalid, or if memory allocation - // fails, the string will be marked as invalid (i.e. "if (s)" will - // be false). - String(const char *cstr = ""); - String(const String &str); - String(const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String(String &&rval); - String(StringSumHelper &&rval); -#endif - explicit String(char c); - explicit String(unsigned char, unsigned char base = 10); - explicit String(int, unsigned char base = 10); - explicit String(unsigned int, unsigned char base = 10); - explicit String(long, unsigned char base = 10); - explicit String(unsigned long, unsigned char base = 10); - explicit String(float, unsigned char decimalPlaces = 2); - explicit String(double, unsigned char decimalPlaces = 2); - ~String(void); - - // memory management - // return true on success, false on failure (in which case, the string - // is left unchanged). reserve(0), if successful, will validate an - // invalid string (i.e., "if (s)" will be true afterwards) - unsigned char reserve(unsigned int size); - inline unsigned int length(void) const { - return len; - } - - // creates a copy of the assigned value. if the value is null or - // invalid, or if the memory allocation fails, the string will be - // marked as invalid ("if (s)" will be false). - String & operator =(const String &rhs); - String & operator =(const char *cstr); - String & operator = (const __FlashStringHelper *str); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - String & operator =(String &&rval); - String & operator =(StringSumHelper &&rval); -#endif - - // concatenate (works w/ built-in types) - - // returns true on success, false on failure (in which case, the string - // is left unchanged). if the argument is null or invalid, the - // concatenation is considered unsucessful. - unsigned char concat(const String &str); - unsigned char concat(const char *cstr); - unsigned char concat(char c); - unsigned char concat(unsigned char c); - unsigned char concat(int num); - unsigned char concat(unsigned int num); - unsigned char concat(long num); - unsigned char concat(unsigned long num); - unsigned char concat(float num); - unsigned char concat(double num); - unsigned char concat(const __FlashStringHelper * str); - - // if there's not enough memory for the concatenated value, the string - // will be left unchanged (but this isn't signalled in any way) - String & operator +=(const String &rhs) { - concat(rhs); - return (*this); - } - String & operator +=(const char *cstr) { - concat(cstr); - return (*this); - } - String & operator +=(char c) { - concat(c); - return (*this); - } - String & operator +=(unsigned char num) { - concat(num); - return (*this); - } - String & operator +=(int num) { - concat(num); - return (*this); - } - String & operator +=(unsigned int num) { - concat(num); - return (*this); - } - String & operator +=(long num) { - concat(num); - return (*this); - } - String & operator +=(unsigned long num) { - concat(num); - return (*this); - } - String & operator +=(float num) { - concat(num); - return (*this); - } - String & operator +=(double num) { - concat(num); - return (*this); - } - String & operator += (const __FlashStringHelper *str){ - concat(str); - return (*this); - } - - friend StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr); - friend StringSumHelper & operator +(const StringSumHelper &lhs, char c); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, float num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, double num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs); - - // comparison (only works w/ Strings and "strings") - operator StringIfHelperType() const { - return buffer ? &String::StringIfHelper : 0; - } - int compareTo(const String &s) const; - unsigned char equals(const String &s) const; - unsigned char equals(const char *cstr) const; - unsigned char operator ==(const String &rhs) const { - return equals(rhs); - } - unsigned char operator ==(const char *cstr) const { - return equals(cstr); - } - unsigned char operator !=(const String &rhs) const { - return !equals(rhs); - } - unsigned char operator !=(const char *cstr) const { - return !equals(cstr); - } - unsigned char operator <(const String &rhs) const; - unsigned char operator >(const String &rhs) const; - unsigned char operator <=(const String &rhs) const; - unsigned char operator >=(const String &rhs) const; - unsigned char equalsIgnoreCase(const String &s) const; - unsigned char startsWith(const String &prefix) const; - unsigned char startsWith(const String &prefix, unsigned int offset) const; - unsigned char endsWith(const String &suffix) const; - - // character acccess - char charAt(unsigned int index) const; - void setCharAt(unsigned int index, char c); - char operator [](unsigned int index) const; - char& operator [](unsigned int index); - void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index = 0) const; - void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0) const { - getBytes((unsigned char *) buf, bufsize, index); - } - const char * c_str() const { - return buffer; - } - - // search - int indexOf(char ch) const; - int indexOf(char ch, unsigned int fromIndex) const; - int indexOf(const String &str) const; - int indexOf(const String &str, unsigned int fromIndex) const; - int lastIndexOf(char ch) const; - int lastIndexOf(char ch, unsigned int fromIndex) const; - int lastIndexOf(const String &str) const; - int lastIndexOf(const String &str, unsigned int fromIndex) const; - String substring(unsigned int beginIndex) const { - return substring(beginIndex, len); - } - ; - String substring(unsigned int beginIndex, unsigned int endIndex) const; - - // modification - void replace(char find, char replace); - void replace(const String& find, const String& replace); - void remove(unsigned int index); - void remove(unsigned int index, unsigned int count); - void toLowerCase(void); - void toUpperCase(void); - void trim(void); - - // parsing/conversion - long toInt(void) const; - float toFloat(void) const; - - protected: - char *buffer; // the actual char array - unsigned int capacity; // the array length minus one (for the '\0') - unsigned int len; // the String length (not counting the '\0') - protected: - void init(void); - void invalidate(void); - unsigned char changeBuffer(unsigned int maxStrLen); - unsigned char concat(const char *cstr, unsigned int length); - - // copy and move - String & copy(const char *cstr, unsigned int length); - String & copy(const __FlashStringHelper *pstr, unsigned int length); -#ifdef __GXX_EXPERIMENTAL_CXX0X__ - void move(String &rhs); -#endif -}; - -class StringSumHelper: public String { - public: - StringSumHelper(const String &s) : - String(s) { - } - StringSumHelper(const char *p) : - String(p) { - } - StringSumHelper(char c) : - String(c) { - } - StringSumHelper(unsigned char num) : - String(num) { - } - StringSumHelper(int num) : - String(num) { - } - StringSumHelper(unsigned int num) : - String(num) { - } - StringSumHelper(long num) : - String(num) { - } - StringSumHelper(unsigned long num) : - String(num) { - } - StringSumHelper(float num) : - String(num) { - } - StringSumHelper(double num) : - String(num) { - } -}; - -#endif // __cplusplus -#endif // String_class_h diff --git a/sparkfun/esp8266/cores/esp8266/abi.cpp b/sparkfun/esp8266/cores/esp8266/abi.cpp deleted file mode 100644 index b863997a..00000000 --- a/sparkfun/esp8266/cores/esp8266/abi.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - Copyright (c) 2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include -extern "C" { -#include "ets_sys.h" -#include "os_type.h" -#include "osapi.h" -#include "mem.h" -#include "user_interface.h" -} - -void *operator new(size_t size) { - size = ((size + 3) & ~((size_t)0x3)); - return os_malloc(size); -} - -void *operator new[](size_t size) { - size = ((size + 3) & ~((size_t)0x3)); - return os_malloc(size); -} - -void operator delete(void * ptr) { - os_free(ptr); -} - -void operator delete[](void * ptr) { - os_free(ptr); -} - -extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); -extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); - -void __cxa_pure_virtual(void) { - abort(); -} - -void __cxa_deleted_virtual(void) { - abort(); -} - -namespace std { -void __throw_bad_function_call() { - abort(); -} -} - -// TODO: rebuild windows toolchain to make this unnecessary: -void* __dso_handle; - diff --git a/sparkfun/esp8266/cores/esp8266/cbuf.h b/sparkfun/esp8266/cores/esp8266/cbuf.h deleted file mode 100644 index 87642510..00000000 --- a/sparkfun/esp8266/cores/esp8266/cbuf.h +++ /dev/null @@ -1,120 +0,0 @@ -/* - cbuf.h - Circular buffer implementation - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef __cbuf_h -#define __cbuf_h - -#include -class cbuf { - public: - cbuf(size_t size) : - _size(size), _buf(new char[size]), _bufend(_buf + size), _begin(_buf), _end(_begin) { - } - - ~cbuf() { - delete[] _buf; - } - - size_t getSize() const { - if(_end >= _begin) return _end - _begin; - - return _size - (_begin - _end); - } - - size_t room() const { - if(_end >= _begin) return _size - (_end - _begin) - 1; - - return _begin - _end - 1; - } - - bool empty() const { - return _begin == _end; - } - - int peek() { - if(_end == _begin) return -1; - - return static_cast(*_begin); - } - - int read() { - if(getSize() == 0) return -1; - - char result = *_begin; - if(++_begin == _bufend) _begin = _buf; - return static_cast(result); - } - - size_t read(char* dst, size_t size) { - size_t bytes_available = getSize(); - size_t size_to_read = (size < bytes_available) ? size : bytes_available; - size_t size_read = size_to_read; - if(_end < _begin && size_to_read > _bufend - _begin) { - size_t top_size = _bufend - _begin; - memcpy(dst, _begin, top_size); - _begin = _buf; - size_to_read -= top_size; - dst += top_size; - } - memcpy(dst, _begin, size_to_read); - _begin += size_to_read; - if(_begin == _bufend) _begin = _buf; - return size_read; - } - - size_t write(char c) { - if(room() == 0) return 0; - - *_end = c; - if(++_end == _bufend) _end = _buf; - return 1; - } - - size_t write(const char* src, size_t size) { - size_t bytes_available = room(); - size_t size_to_write = (size < bytes_available) ? size : bytes_available; - size_t size_written = size_to_write; - if(_end > _begin && size_to_write > _bufend - _end) { - size_t top_size = _bufend - _end; - memcpy(_end, src, top_size); - _end = _buf; - size_to_write -= top_size; - src += top_size; - } - memcpy(_end, src, size_to_write); - _end += size_to_write; - if(_end == _bufend) _end = _buf; - return size_written; - } - - void flush() { - _begin = _buf; - _end = _buf; - } - - private: - size_t _size; - char* _buf; - char* _bufend; - char* _begin; - char* _end; -}; - -#endif//__cbuf_h diff --git a/sparkfun/esp8266/cores/esp8266/cont.S b/sparkfun/esp8266/cores/esp8266/cont.S deleted file mode 100644 index 0ec47a0a..00000000 --- a/sparkfun/esp8266/cores/esp8266/cont.S +++ /dev/null @@ -1,123 +0,0 @@ -/* - cont.S - continuations support for Xtensa call0 ABI - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - .text - .align 4 - .literal_position - .global cont_yield - .type cont_yield, @function -cont_yield: - /* a1: sp */ - /* a2: void* cont_ctx */ - /* adjust stack and save registers */ - addi a1, a1, -24 - s32i a12, a1, 0 - s32i a13, a1, 4 - s32i a14, a1, 8 - s32i a15, a1, 12 - s32i a0, a1, 16 - s32i a2, a1, 20 - - /* &cont_continue -> cont_ctx.pc_yield */ - movi a3, cont_continue - s32i a3, a2, 8 - /* sp -> cont_ctx.sp_yield */ - s32i a1, a2, 12 - - /* a0 <- cont_ctx.pc_ret */ - l32i a0, a2, 0 - /* sp <- cont_ctx.sp_ret */ - l32i a1, a2, 4 - jx a0 - -cont_continue: - l32i a12, a1, 0 - l32i a13, a1, 4 - l32i a14, a1, 8 - l32i a15, a1, 12 - l32i a0, a1, 16 - l32i a2, a1, 20 - addi a1, a1, 24 - ret - .size cont_yield, . - cont_yield - -//////////////////////////////////////////////////// - - .text - .align 4 - .literal_position - .global cont_run - .type cont_run, @function -cont_run: - /* a1: sp */ - /* a2: void* cont_ctx */ - /* a3: void (*pfn) */ - - /* adjust stack and save registers */ - addi a1, a1, -20 - s32i a12, a1, 0 - s32i a13, a1, 4 - s32i a14, a1, 8 - s32i a15, a1, 12 - s32i a0, a1, 16 - - /* cont_ret -> a4 -> cont_ctx.pc_ret*/ - movi a4, cont_ret - s32i a4, a2, 0 - /* sp -> cont_ctx.sp_ret */ - s32i a1, a2, 4 - - /* if cont_ctx.pc_yield != 0, goto cont_resume */ - l32i a4, a2, 8 - bnez a4, cont_resume - /* else */ - /* set new stack*/ - l32i a1, a2, 16; - /* goto pfn */ - movi a0, cont_norm - jx a3 - -cont_resume: - /* a1 <- cont_ctx.sp_yield */ - l32i a1, a2, 12 - /* reset yield flag, 0 -> cont_ctx.pc_yield */ - movi a3, 0 - s32i a3, a2, 8 - /* jump to saved cont_ctx.pc_yield */ - movi a0, cont_ret - jx a4 - -cont_norm: - /* calculate pointer to cont_ctx.struct_start from sp */ - l32i a2, a1, 8 - /* sp <- cont_ctx.sp_ret */ - l32i a1, a2, 4 - -cont_ret: - /* restore registers */ - l32i a12, a1, 0 - l32i a13, a1, 4 - l32i a14, a1, 8 - l32i a15, a1, 12 - l32i a0, a1, 16 - /* adjust stack and return */ - addi a1, a1, 20 - ret - .size cont_run, . - cont_run diff --git a/sparkfun/esp8266/cores/esp8266/cont.h b/sparkfun/esp8266/cores/esp8266/cont.h deleted file mode 100644 index 52923774..00000000 --- a/sparkfun/esp8266/cores/esp8266/cont.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - cont.h - continuations support for Xtensa call0 ABI - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef CONT_H_ -#define CONT_H_ - -#ifndef CONT_STACKSIZE -#define CONT_STACKSIZE 4096 -#endif - -typedef struct cont_ { - void (*pc_ret)(void); - unsigned* sp_ret; - - void (*pc_yield)(void); - unsigned* sp_yield; - - unsigned* stack_end; - unsigned stack_guard1; - - unsigned stack[CONT_STACKSIZE / 4]; - - unsigned stack_guard2; - unsigned* struct_start; -} cont_t; - -// Initialize the cont_t structure before calling cont_run -void cont_init(cont_t*); - -// Run function pfn in a separate stack, or continue execution -// at the point where cont_yield was called -void cont_run(cont_t*, void (*pfn)(void)); - -// Return to the point where cont_run was called, saving the -// execution state (registers and stack) -void cont_yield(cont_t*); - -// Check guard bytes around the stack. Return 0 in case everything is ok, -// return 1 if guard bytes were overwritten. -int cont_check(cont_t* cont); - -#endif /* CONT_H_ */ diff --git a/sparkfun/esp8266/cores/esp8266/cont_util.c b/sparkfun/esp8266/cores/esp8266/cont_util.c deleted file mode 100644 index fcb6f024..00000000 --- a/sparkfun/esp8266/cores/esp8266/cont_util.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - cont_util.s - continuations support for Xtensa call0 ABI - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "cont.h" - -#define CONT_STACKGUARD 0xfeefeffe - -void cont_init(cont_t* cont) { - cont->stack_guard1 = CONT_STACKGUARD; - cont->stack_guard2 = CONT_STACKGUARD; - cont->stack_end = cont->stack + (sizeof(cont->stack) / 4 - 1); - cont->struct_start = (unsigned*) cont; -} - -int cont_check(cont_t* cont) { - if(cont->stack_guard1 != CONT_STACKGUARD || cont->stack_guard2 != CONT_STACKGUARD) return 1; - - return 0; -} diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_main.cpp b/sparkfun/esp8266/cores/esp8266/core_esp8266_main.cpp deleted file mode 100644 index d4516544..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_main.cpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - main.cpp - platform initialization and context switching - emulation - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -//This may be used to change user task stack size: -//#define CONT_STACKSIZE 4096 -#include -extern "C" { -#include "ets_sys.h" -#include "os_type.h" -#include "osapi.h" -#include "mem.h" -#include "user_interface.h" -#include "cont.h" -} -#define LOOP_TASK_PRIORITY 0 -#define LOOP_QUEUE_SIZE 1 - -int atexit(void (*func)()) { - return 0; -} - -extern "C" void ets_update_cpu_frequency(int freqmhz); -void initVariant() __attribute__((weak)); -void initVariant() { -} - -extern void loop(); -extern void setup(); - -void preloop_update_frequency() __attribute__((weak)); -void preloop_update_frequency() { -#if defined(F_CPU) && (F_CPU == 160000000L) - REG_SET_BIT(0x3ff00014, BIT(0)); - ets_update_cpu_frequency(160); -#endif -} - -extern void (*__init_array_start)(void); -extern void (*__init_array_end)(void); - -static cont_t g_cont; -static os_event_t g_loop_queue[LOOP_QUEUE_SIZE]; - -static uint32_t g_micros_at_task_start; - -extern "C" uint32_t esp_micros_at_task_start() { - return g_micros_at_task_start; -} - -extern "C" void abort() { - while(1) { - } -} - -extern "C" void esp_yield() { - cont_yield(&g_cont); -} - -extern "C" void esp_schedule() { - system_os_post(LOOP_TASK_PRIORITY, 0, 0); -} - -extern "C" void __yield() { - esp_schedule(); - esp_yield(); -} -extern "C" void yield(void) __attribute__ ((weak, alias("__yield"))); - -static void loop_wrapper() { - static bool setup_done = false; - if(!setup_done) { - setup(); - setup_done = true; - } - preloop_update_frequency(); - loop(); - esp_schedule(); -} - -static void loop_task(os_event_t *events) { - g_micros_at_task_start = system_get_time(); - cont_run(&g_cont, &loop_wrapper); - if(cont_check(&g_cont) != 0) { - ets_printf("\r\nheap collided with sketch stack\r\n"); - abort(); - } -} - -static void do_global_ctors(void) { - void (**p)(void); - for(p = &__init_array_start; p != &__init_array_end; ++p) - (*p)(); -} - -void init_done() { - do_global_ctors(); - esp_schedule(); -} - -extern "C" { -void user_init(void) { - uart_div_modify(0, UART_CLK_FREQ / (115200)); - - init(); - - initVariant(); - - cont_init(&g_cont); - - system_os_task(loop_task, - LOOP_TASK_PRIORITY, g_loop_queue, - LOOP_QUEUE_SIZE); - - system_init_done_cb(&init_done); -} -} - diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c deleted file mode 100644 index eafe4fa7..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c +++ /dev/null @@ -1,198 +0,0 @@ -/* - core_esp8266_noniso.c - nonstandard (but usefull) conversion functions - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 03 April 2015 by Markus Sattler - - */ - -#include -#include "stdlib_noniso.h" -#include "ets_sys.h" - -#define sprintf ets_sprintf -#define strcpy ets_strcpy - -int atoi(const char* s) { - return (int) atol(s); -} - -long atol(const char* s) { - char * tmp; - return strtol(s, &tmp, 10); -} - -double atof(const char* s) { - char * tmp; - return strtod(s, &tmp); -} - -void reverse(char* begin, char* end) { - char *is = begin; - char *ie = end - 1; - while(is < ie) { - char tmp = *ie; - *ie = *is; - *is = tmp; - ++is; - --ie; - } -} - -char* itoa(int value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - int quotient = abs(value); - - do { - const int tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - // Apply negative sign - if(value < 0) - *out++ = '-'; - - reverse(result, out); - *out = 0; - return result; -} - -char* ltoa(long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - long quotient = abs(value); - - do { - const long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - // Apply negative sign - if(value < 0) - *out++ = '-'; - - reverse(result, out); - *out = 0; - return result; -} - -char* utoa(unsigned value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - unsigned quotient = value; - - do { - const unsigned tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - reverse(result, out); - *out = 0; - return result; -} - -char* ultoa(unsigned long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - unsigned long quotient = value; - - do { - const unsigned long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - reverse(result, out); - *out = 0; - return result; -} - -char * dtostrf(double number, signed char width, unsigned char prec, char *s) { - - if(isnan(number)) { - strcpy(s, "nan"); - return s; - } - if(isinf(number)) { - strcpy(s, "inf"); - return s; - } - - if(number > 4294967040.0 || number < -4294967040.0) { - strcpy(s, "ovf"); - return s; - } - char* out = s; - // Handle negative numbers - if(number < 0.0) { - *out = '-'; - ++out; - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for(uint8_t i = 0; i < prec; ++i) - rounding /= 10.0; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long) number; - double remainder = number - (double) int_part; - out += sprintf(out, "%ld", int_part); - - // Print the decimal point, but only if there are digits beyond - if(prec > 0) { - *out = '.'; - ++out; - } - - for (unsigned char decShift = prec; decShift > 0; decShift--) { - remainder *= 10.0; - } - sprintf(out, "%0*d", prec, (int)remainder); - - return s; -} - diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c.orig b/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c.orig deleted file mode 100644 index 01795335..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_noniso.c.orig +++ /dev/null @@ -1,286 +0,0 @@ -/* - core_esp8266_noniso.c - nonstandard (but usefull) conversion functions - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 03 April 2015 by Markus Sattler - - */ - -#include -#include "stdlib_noniso.h" -#include "ets_sys.h" - -#define sprintf ets_sprintf -#define strcpy ets_strcpy - -int atoi(const char* s) { - return (int) atol(s); -} - -long atol(const char* s) { - long int result = 0; - int i; - const char* b = s; - int sign = 1; - for(i = 0; *b; ++i, ++b) { - if(i == 0 && *b == '-') sign = -1; - int x = *b - '0'; - if(x < 0 || x > 9) break; - result = result * 10 + x; - } - return sign * result; -} - -// Source: -// https://github.com/anakod/Sming/blob/master/Sming/system/stringconversion.cpp#L93 -<<<<<<< HEAD -double atof(const char* s) -{ - double result = 0; - double factor = 1.0; - - while (*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n') - ++s; - - if (*s == 0) - return 0; - - if (*s == '-') - { - factor = -1.0; - ++s; - } - if (*s == '+') - { - ++s; - } - - bool decimals = false; - char c; - while((c = *s)) - { - if (c == '.') - { - decimals = true; - ++s; - continue; - } - - int d = c - '0'; - if (d < 0 || d > 9) - break; - - result = 10.0 * result + d; - if (decimals) - factor *= 0.1; - ++s; - } - - return result * factor; -======= -double atof(const char* s) { - double result = 0; - double sign = 1; - - while(*s == ' ' || *s == '\t' || *s == '\r' || *s == '\n') - ++s; - - if(*s == 0) return 0; - - if(*s == '-') { - sign = -1; - ++s; - } - if(*s == '+') { - ++s; - } - - bool decimals = false; - double factor = 1.0; - char c; - while((c = *s)) { - if(c == '.') { - decimals = true; - ++s; - continue; - } - - int d = c - '0'; - if(d < 0 || d > 9) break; - - result = 10.0 * result + d; - if(decimals) factor *= 0.1; - ++s; - } - - return result * factor; ->>>>>>> 792737555e6ae51a9dbebc60e33b4e9424c39fcf -} - -void reverse(char* begin, char* end) { - char *is = begin; - char *ie = end - 1; - while(is < ie) { - char tmp = *ie; - *ie = *is; - *is = tmp; - ++is; - --ie; - } -} - -char* itoa(int value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - int quotient = abs(value); - - do { - const int tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - // Apply negative sign - if(value < 0) *out++ = '-'; - - reverse(result, out); - *out = 0; - return result; -} - -char* ltoa(long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - long quotient = abs(value); - - do { - const long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - // Apply negative sign - if(value < 0) *out++ = '-'; - - reverse(result, out); - *out = 0; - return result; -} - -char* utoa(unsigned value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - unsigned quotient = value; - - do { - const unsigned tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - reverse(result, out); - *out = 0; - return result; -} - -char* ultoa(unsigned long value, char* result, int base) { - if(base < 2 || base > 16) { - *result = 0; - return result; - } - - char* out = result; - unsigned long quotient = value; - - do { - const unsigned long tmp = quotient / base; - *out = "0123456789abcdef"[quotient - (tmp * base)]; - ++out; - quotient = tmp; - } while(quotient); - - reverse(result, out); - *out = 0; - return result; -} - -char * dtostrf(double number, signed char width, unsigned char prec, char *s) { - size_t n = 0; - - if(isnan(number)) { - strcpy(s, "nan"); - return s; - } - if(isinf(number)) { - strcpy(s, "inf"); - return s; - } - - if(number > 4294967040.0 || number < -4294967040.0) { - strcpy(s, "ovf"); - return s; - } - char* out = s; - // Handle negative numbers - if(number < 0.0) { - *out = '-'; - ++out; - number = -number; - } - - // Round correctly so that print(1.999, 2) prints as "2.00" - double rounding = 0.5; - for(uint8_t i = 0; i < prec; ++i) - rounding /= 10.0; - - number += rounding; - - // Extract the integer part of the number and print it - unsigned long int_part = (unsigned long) number; - double remainder = number - (double) int_part; - out += sprintf(out, "%d", int_part); - - // Print the decimal point, but only if there are digits beyond - if(prec > 0) { - *out = '.'; - ++out; - } - - while(prec-- > 0) { - remainder *= 10.0; - } - sprintf(out, "%d", (int) remainder); - - return s; -} diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_si2c.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_si2c.c deleted file mode 100644 index 29149aa0..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_si2c.c +++ /dev/null @@ -1,172 +0,0 @@ -/* - si2c.c - Software I2C library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "twi.h" -#include "pins_arduino.h" -#include "wiring_private.h" - -unsigned char twi_dcount = 18; -static unsigned char twi_sda, twi_scl; - -#define SDA_LOW() (GPES = (1 << twi_sda)) //Enable SDA (becomes output and since GPO is 0 for the pin, it will pull the line low) -#define SDA_HIGH() (GPEC = (1 << twi_sda)) //Disable SDA (becomes input and since it has pullup it will go high) -#define SDA_READ() ((GPI & (1 << twi_sda)) != 0) -#define SCL_LOW() (GPES = (1 << twi_scl)) -#define SCL_HIGH() (GPEC = (1 << twi_scl)) -#define SCL_READ() ((GPI & (1 << twi_scl)) != 0) - -#ifndef FCPU80 -#define FCPU80 80000000L -#endif - -#if F_CPU == FCPU80 -#define TWI_CLOCK_STRETCH 200 -#else -#define TWI_CLOCK_STRETCH 400 -#endif - -void twi_setClock(unsigned int freq){ -#if F_CPU == FCPU80 - if(freq <= 100000) twi_dcount = 18;//about 100KHz - else if(freq <= 200000) twi_dcount = 8;//about 200KHz - else if(freq <= 300000) twi_dcount = 4;//about 300KHz - else if(freq <= 400000) twi_dcount = 2;//about 370KHz - else twi_dcount = 1;//about 450KHz -#else - if(freq <= 100000) twi_dcount = 32;//about 100KHz - else if(freq <= 200000) twi_dcount = 16;//about 200KHz - else if(freq <= 300000) twi_dcount = 8;//about 300KHz - else if(freq <= 400000) twi_dcount = 4;//about 370KHz - else twi_dcount = 2;//about 450KHz -#endif -} - -void twi_init(unsigned char sda, unsigned char scl){ - twi_sda = sda; - twi_scl = scl; - pinMode(twi_sda, INPUT_PULLUP); - pinMode(twi_scl, INPUT_PULLUP); - twi_setClock(100000); -} - -void twi_stop(void){ - pinMode(twi_sda, INPUT); - pinMode(twi_scl, INPUT); -} - -static void twi_delay(unsigned char v){ - unsigned int i; - unsigned int reg; - for(i=0;i> GPIO_SIGMA_DELTA_LSB) -#define GPIO_SIGMA_DELTA_SET(x) (((x) << GPIO_SIGMA_DELTA_LSB) & GPIO_SIGMA_DELTA_MASK) - - -#define GPIO_SIGMA_DELTA_TARGET_MSB 7 -#define GPIO_SIGMA_DELTA_TARGET_LSB 0 -#define GPIO_SIGMA_DELTA_TARGET_MASK (0x000000FF<> GPIO_SIGMA_DELTA_TARGET_LSB) -#define GPIO_SIGMA_DELTA_TARGET_SET(x) (((x) << GPIO_SIGMA_DELTA_TARGET_LSB) & GPIO_SIGMA_DELTA_TARGET_MASK) - - -#define GPIO_SIGMA_DELTA_PRESCALE_MSB 15 -#define GPIO_SIGMA_DELTA_PRESCALE_LSB 8 -#define GPIO_SIGMA_DELTA_PRESCALE_MASK (0x000000FF<> GPIO_SIGMA_DELTA_PRESCALE_LSB) -#define GPIO_SIGMA_DELTA_PRESCALE_SET(x) (((x) << GPIO_SIGMA_DELTA_PRESCALE_LSB) & GPIO_SIGMA_DELTA_PRESCALE_MASK) - - -/****************************************************************************** - * FunctionName : sigma_delta_setup - * Description : Init Pin Config for Sigma_delta , change pin source to sigma-delta - * Parameters : uint32 GPIO_MUX, GPIO MUX REG ,DEFINED IN EAGLE_SOC.H, e.g.: PERIPHS_IO_MUX_MTCK_U - uint32 GPIO_NUM, GPIO NUM ACCORDING TO THE MUX NUM , e.g.: 13 for MTCK - uint32 GPIO_FUNC, GPIO PIN FUNC , DEFINED IN EAGLE_SOC.H , e.g.: FUNC_GPIO13 - * Returns : none -*******************************************************************************/ -void ICACHE_FLASH_ATTR -sigma_delta_setup(uint32 GPIO_MUX,uint32 GPIO_NUM,uint32 GPIO_FUNC) -{ - //============================================================================ - //STEP 1: SIGMA-DELTA CONFIG;REG SETUP - GPIO_REG_WRITE(GPIO_SIGMA_DELTA, - (GPIO_REG_READ(GPIO_PIN_ADDR(GPIO_ID_PIN(GPIO_SIGMA_DELTA_NUM))) &(~GPIO_SIGMA_DELTA_SETTING_MASK))| - GPIO_SIGMA_DELTA_SET(GPIO_SIGMA_DELTA_ENABLE)| - GPIO_SIGMA_DELTA_TARGET_SET(0x00)| - GPIO_SIGMA_DELTA_PRESCALE_SET(0x00) ); - - //============================================================================ - - //STEP 2: PIN FUNC CONFIG :SET PIN TO GPIO MODE AND ENABLE OUTPUT - PIN_FUNC_SELECT(GPIO_MUX, GPIO_FUNC); - gpio_output_set(0,0,0x1<128)?(256-duty):duty; - prescale = (target==0)?0:(target-1); - - //freq = 80000 (khz) /256 /duty_target * (prescale+1) - set_sigma_target(duty);//SET DUTY TARGET - set_sigma_prescale(prescale);//SET CLK DIV - -} - diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_timer.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_timer.c deleted file mode 100644 index bfdd3692..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_timer.c +++ /dev/null @@ -1,61 +0,0 @@ -/* - timer.c - Timer1 library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "wiring_private.h" -#include "pins_arduino.h" -#include "c_types.h" - -void (*timer1_user_cb)(void); - -void timer1_isr_handler(void *para){ - if((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable - T1I = 0; - if(timer1_user_cb) timer1_user_cb(); -} - -void timer1_isr_init(){ - ETS_FRC_TIMER1_INTR_ATTACH(timer1_isr_handler, NULL); -} - -void timer1_attachInterrupt(void (*userFunc)(void)) { - timer1_user_cb = userFunc; - ETS_FRC1_INTR_ENABLE(); -} - -void timer1_detachInterrupt() { - timer1_user_cb = 0; - TEIE &= ~TEIE1;//edge int disable - ETS_FRC1_INTR_DISABLE(); -} - -void timer1_enable(uint8_t divider, uint8_t int_type, uint8_t reload){ - T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR); - T1I = 0; -} - -void timer1_write(uint32_t ticks){ - T1L = ((ticks) & 0x7FFFFF); - if((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable -} - -void timer1_disable(){ - T1C = 0; - T1I = 0; -} diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring.c deleted file mode 100644 index 0170b4bc..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - core_esp8266_wiring.c - implementation of Wiring API for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "wiring_private.h" -#include "ets_sys.h" -#include "osapi.h" -#include "user_interface.h" -#include "cont.h" - -extern void esp_schedule(); -extern void esp_yield(); - -static os_timer_t delay_timer; -static os_timer_t micros_overflow_timer; -static uint32_t micros_at_last_overflow_tick = 0; -static uint32_t micros_overflow_count = 0; -#define ONCE 0 -#define REPEAT 1 - -void delay_end(void* arg) { - esp_schedule(); -} - -void delay(unsigned long ms) { - if(ms) { - os_timer_setfn(&delay_timer, (os_timer_func_t*) &delay_end, 0); - os_timer_arm(&delay_timer, ms, ONCE); - } else { - esp_schedule(); - } - esp_yield(); - if(ms) { - os_timer_disarm(&delay_timer); - } -} - -void micros_overflow_tick(void* arg) { - uint32_t m = system_get_time(); - if(m < micros_at_last_overflow_tick) - ++micros_overflow_count; - micros_at_last_overflow_tick = m; -} - -unsigned long millis() { - uint32_t m = system_get_time(); - uint32_t c = micros_overflow_count + ((m < micros_at_last_overflow_tick) ? 1 : 0); - return c * 4294967 + m / 1000; -} - -unsigned long micros() { - return system_get_time(); -} - -void delayMicroseconds(unsigned int us) { - os_delay_us(us); -} - -void init() { - initPins(); - timer1_isr_init(); - os_timer_setfn(µs_overflow_timer, (os_timer_func_t*) µs_overflow_tick, 0); - os_timer_arm(µs_overflow_timer, 60000, REPEAT); -} diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_analog.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_analog.c deleted file mode 100644 index bb515101..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_analog.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - analog.c - analogRead implementation for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "wiring_private.h" -#include "pins_arduino.h" - -void analogReference(uint8_t mode) {} - -extern int __analogRead(uint8_t pin) { - if(pin == 17){ - //return system_adc_read(); - uint8_t i; - uint16_t data[8]; - - rom_i2c_writeReg_Mask(0x6C,2,0,5,5,1); - - ESP8266_REG(0xD5C) |= (1 << 21); - while ((ESP8266_REG(0xD50) & (7 << 24)) > 0); - ESP8266_REG(0xD50) &= ~(1 << 1); - ESP8266_REG(0xD50) |= (1 << 1); - delayMicroseconds(2); - while ((ESP8266_REG(0xD50) & (7 << 24)) > 0); - - read_sar_dout(data); - rom_i2c_writeReg_Mask(0x6C,2,0,5,5,1); - - while ((ESP8266_REG(0xD50) & (7 << 24)) > 0); - ESP8266_REG(0xD5C) &= ~(1 << 21); - ESP8266_REG(0xD60) |= (1 << 0); - ESP8266_REG(0xD60) &= ~(1 << 0); - - uint16_t tout = 0; - for (i = 0; i < 8; i++) tout += data[i]; - return tout >> 4;//tout is 10 bits fraction - } - return digitalRead(pin) * 1023; -} - -extern int analogRead(uint8_t pin) __attribute__ ((weak, alias("__analogRead"))); diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_digital.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_digital.c deleted file mode 100644 index 54c2b557..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_digital.c +++ /dev/null @@ -1,168 +0,0 @@ -/* - digital.c - wiring digital implementation for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#define ARDUINO_MAIN -#include "wiring_private.h" -#include "pins_arduino.h" -#include "c_types.h" -#include "eagle_soc.h" -#include "ets_sys.h" - -extern void __pinMode(uint8_t pin, uint8_t mode) { - if(pin < 16){ - if(mode == SPECIAL){ - GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED) - GPEC = (1 << pin); //Disable - GPF(pin) = GPFFS(GPFFS_BUS(pin));//Set mode to BUS (RX0, TX0, TX1, SPI, HSPI or CLK depending in the pin) - if(pin == 3) GPF(pin) |= (1 << GPFPU);//enable pullup on RX - } else if(mode & FUNCTION_0){ - GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED) - GPEC = (1 << pin); //Disable - GPF(pin) = GPFFS((mode >> 4) & 0x07); - if(pin == 13 && mode == FUNCTION_4) GPF(pin) |= (1 << GPFPU);//enable pullup on RX - } else if(mode == OUTPUT || mode == OUTPUT_OPEN_DRAIN){ - GPF(pin) = GPFFS(GPFFS_GPIO(pin));//Set mode to GPIO - GPC(pin) = (GPC(pin) & (0xF << GPCI)); //SOURCE(GPIO) | DRIVER(NORMAL) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED) - if(mode == OUTPUT_OPEN_DRAIN) GPC(pin) |= (1 << GPCD); - GPES = (1 << pin); //Enable - } else if(mode == INPUT || mode == INPUT_PULLUP || mode == INPUT_PULLDOWN){ - GPF(pin) = GPFFS(GPFFS_GPIO(pin));//Set mode to GPIO - GPEC = (1 << pin); //Disable - GPC(pin) = (GPC(pin) & (0xF << GPCI)) | (1 << GPCD); //SOURCE(GPIO) | DRIVER(OPEN_DRAIN) | INT_TYPE(UNCHANGED) | WAKEUP_ENABLE(DISABLED) - if(mode == INPUT_PULLUP) { - GPF(pin) |= (1 << GPFPU); // Enable Pullup - } else if(mode == INPUT_PULLDOWN) { - GPF(pin) |= (1 << GPFPD); // Enable Pulldown - } - } - } else if(pin == 16){ - GPF16 = GP16FFS(GPFFS_GPIO(pin));//Set mode to GPIO - GPC16 = 0; - if(mode == INPUT || mode == INPUT_PULLDOWN){ - if(mode == INPUT_PULLDOWN){ - GPF16 |= (1 << GP16FPD);//Enable Pulldown - } - GP16E &= ~1; - } else if(mode == OUTPUT){ - GP16E |= 1; - } - } -} - -extern void ICACHE_RAM_ATTR __digitalWrite(uint8_t pin, uint8_t val) { - val &= 0x01; - if(pin < 16){ - if(val) GPOS = (1 << pin); - else GPOC = (1 << pin); - } else if(pin == 16){ - if(val) GP16O |= 1; - else GP16O &= ~1; - } -} - -extern int ICACHE_RAM_ATTR __digitalRead(uint8_t pin) { - if(pin < 16){ - return GPIP(pin); - } else if(pin == 16){ - return GP16I & 0x01; - } - return 0; -} - -/* - GPIO INTERRUPTS -*/ - -typedef void (*voidFuncPtr)(void); - -typedef struct { - uint8_t mode; - void (*fn)(void); -} interrupt_handler_t; - -static interrupt_handler_t interrupt_handlers[16]; -static uint32_t interrupt_reg = 0; - -void interrupt_handler(void *arg) { - uint32_t status = GPIE; - GPIEC = status;//clear them interrupts - if(status == 0 || interrupt_reg == 0) return; - ETS_GPIO_INTR_DISABLE(); - int i = 0; - uint32_t changedbits = status & interrupt_reg; - while(changedbits){ - while(!(changedbits & (1 << i))) i++; - changedbits &= ~(1 << i); - interrupt_handler_t *handler = &interrupt_handlers[i]; - if(((handler->mode & 1) == digitalRead(i)) && handler->fn) handler->fn(); - } - ETS_GPIO_INTR_ENABLE(); -} - -extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode) { - if(pin < 16) { - interrupt_handler_t *handler = &interrupt_handlers[pin]; - handler->mode = mode; - handler->fn = userFunc; - interrupt_reg |= (1 << pin); - GPC(pin) &= ~(0xF << GPCI);//INT mode disabled - GPIEC = (1 << pin); //Clear Interrupt for this pin - GPC(pin) |= ((mode & 0xF) << GPCI);//INT mode "mode" - } -} - -extern void __detachInterrupt(uint8_t pin) { - if(pin < 16) { - GPC(pin) &= ~(0xF << GPCI);//INT mode disabled - GPIEC = (1 << pin); //Clear Interrupt for this pin - interrupt_reg &= ~(1 << pin); - interrupt_handler_t *handler = &interrupt_handlers[pin]; - handler->mode = 0; - handler->fn = 0; - } -} - -// stored state for the noInterrupts/interrupts methods -uint32_t interruptsState = 0; - -void initPins() { - //Disable UART interrupts - system_set_os_print(0); - U0IE = 0; - U1IE = 0; - - for (int i = 0; i <= 5; ++i) { - pinMode(i, INPUT); - } - // pins 6-11 are used for the SPI flash interface - for (int i = 12; i <= 16; ++i) { - pinMode(i, INPUT); - } - - ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg); - ETS_GPIO_INTR_ENABLE(); -} - -extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pinMode"))); -extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite"))); -extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"))); -extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt"))); -extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt"))); - diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pwm.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pwm.c deleted file mode 100644 index b175f6e5..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pwm.c +++ /dev/null @@ -1,149 +0,0 @@ -/* - pwm.c - analogWrite implementation for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include "wiring_private.h" -#include "pins_arduino.h" -#include "c_types.h" -#include "eagle_soc.h" -#include "ets_sys.h" - -uint32_t pwm_mask = 0; -uint16_t pwm_values[17] = {0,}; -uint32_t pwm_freq = 1000; - -uint32_t pwm_multiplier = 0; -uint16_t pwm_steps[17]; -uint8_t pwm_steps_len = 0; -uint32_t pwm_steps_mask[17]; - -int pwm_sort_array(uint16_t a[], uint16_t al){ - uint16_t i, j; - for (i = 1; i < al; i++) { - uint16_t tmp = a[i]; - for (j = i; j >= 1 && tmp < a[j-1]; j--) - a[j] = a[j-1]; - a[j] = tmp; - } - int bl = 1; - for(i = 1; i < al; i++){ - if(a[i] != a[i-1]) a[bl++] = a[i]; - } - return bl; -} - -uint32_t pwm_get_mask(uint16_t value){ - uint32_t mask = 0; - int i; - for(i=0; i<17; i++){ - if((pwm_mask & (1 << i)) != 0 && pwm_values[i] == value) mask |= (1 << i); - } - return mask; -} - -void prep_pwm_steps(){ - if(pwm_mask == 0){ - pwm_steps_len = 0; - return; - } - - int pwm_temp_steps_len = 0; - uint16_t pwm_temp_steps[17]; - uint32_t pwm_temp_masks[17]; - - int i; - for(i=0; i<17; i++){ - if((pwm_mask & (1 << i)) != 0 && pwm_values[i] != 0) pwm_temp_steps[pwm_temp_steps_len++] = pwm_values[i]; - } - pwm_temp_steps[pwm_temp_steps_len++] = PWMRANGE; - pwm_temp_steps_len = pwm_sort_array(pwm_temp_steps, pwm_temp_steps_len) - 1; - for(i=0; i0; i--){ - pwm_temp_steps[i] = pwm_temp_steps[i] - pwm_temp_steps[i-1]; - } - ETS_FRC1_INTR_DISABLE(); - pwm_steps_len = pwm_temp_steps_len; - os_memcpy(pwm_steps, pwm_temp_steps, (pwm_temp_steps_len + 1) * 2); - os_memcpy(pwm_steps_mask, pwm_temp_masks, pwm_temp_steps_len * 4); - pwm_multiplier = F_CPU/(PWMRANGE * pwm_freq); - ETS_FRC1_INTR_ENABLE(); -} - -void pwm_timer_isr(){ - static uint8_t current_step = 0; - static uint8_t stepcount = 0; - static uint16_t steps[17]; - static uint32_t masks[17]; - if(current_step < stepcount){ - GPOC = masks[current_step] & 0xFFFF; - if(masks[current_step] & 0x10000) GP16O &= ~1; - current_step++; - timer1_write(pwm_steps[current_step] * pwm_multiplier); - } else { - - current_step = 0; - stepcount = 0; - if(pwm_mask == 0) return; - GPOS = pwm_mask & 0xFFFF; - if(pwm_mask & 0x10000) GP16O |= 1; - timer1_write(pwm_steps[0] * pwm_multiplier); - stepcount = pwm_steps_len; - memcpy(steps, pwm_steps, (stepcount + 1) * 2); - memcpy(masks, pwm_steps_mask, stepcount * 4); - } -} - -void pwm_start_timer(){ - timer1_disable(); - timer1_attachInterrupt(pwm_timer_isr); - timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE); - timer1_write(1); -} - -extern void __analogWrite(uint8_t pin, int value) { - bool start_timer = false; - if(value == 0){ - pwm_mask &= ~(1 << pin); - prep_pwm_steps(); - digitalWrite(pin, LOW); - if(pwm_mask == 0) timer1_disable(); - return; - } - if((pwm_mask & (1 << pin)) == 0){ - if(pwm_mask == 0) start_timer = true; - pwm_mask |= (1 << pin); - pinMode(pin, OUTPUT); - digitalWrite(pin, LOW); - } - pwm_values[pin] = value % (PWMRANGE + 1); - prep_pwm_steps(); - if(start_timer){ - pwm_start_timer(); - } -} - -extern void __analogWriteFreq(uint32_t freq){ - pwm_freq = freq; - prep_pwm_steps(); -} - -extern void analogWrite(uint8_t pin, int val) __attribute__ ((weak, alias("__analogWrite"))); -extern void analogWriteFreq(uint32_t freq) __attribute__ ((weak, alias("__analogWriteFreq"))); diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_shift.c b/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_shift.c deleted file mode 100644 index 673db906..00000000 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_shift.c +++ /dev/null @@ -1,57 +0,0 @@ -/* - wiring_shift.c - shiftOut() function - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2005-2006 David A. Mellis - - Note: file renamed with a core_esp8266_ prefix to simplify linker - script rules for moving code into irom0_text section. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ - */ - -#include "wiring_private.h" - -uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { - uint8_t value = 0; - uint8_t i; - - for(i = 0; i < 8; ++i) { - digitalWrite(clockPin, HIGH); - if(bitOrder == LSBFIRST) - value |= digitalRead(dataPin) << i; - else - value |= digitalRead(dataPin) << (7 - i); - digitalWrite(clockPin, LOW); - } - return value; -} - -void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) { - uint8_t i; - - for(i = 0; i < 8; i++) { - if(bitOrder == LSBFIRST) - digitalWrite(dataPin, !!(val & (1 << i))); - else - digitalWrite(dataPin, !!(val & (1 << (7 - i)))); - - digitalWrite(clockPin, HIGH); - digitalWrite(clockPin, LOW); - } -} diff --git a/sparkfun/esp8266/cores/esp8266/debug.cpp b/sparkfun/esp8266/cores/esp8266/debug.cpp deleted file mode 100644 index 804d8fb8..00000000 --- a/sparkfun/esp8266/cores/esp8266/debug.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - debug.cpp - debug helper functions - Copyright (c) 2015 Markus Sattler. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "Arduino.h" -#include "debug.h" - -void ICACHE_RAM_ATTR hexdump(uint8_t *mem, uint32_t len, uint8_t cols) { - os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", mem, len, len); - for(uint32_t i = 0; i < len; i++) { - if(i % cols == 0) { - os_printf("\n[0x%08X] 0x%08X: ", mem, i); - } - os_printf("%02X ", *mem); - mem++; - } - os_printf("\n"); -} - diff --git a/sparkfun/esp8266/cores/esp8266/debug.h b/sparkfun/esp8266/cores/esp8266/debug.h deleted file mode 100644 index cf0830d3..00000000 --- a/sparkfun/esp8266/cores/esp8266/debug.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef ARD_DEBUG_H -#define ARD_DEBUG_H - -#include -// #define DEBUGV(...) ets_printf(__VA_ARGS__) -#define DEBUGV(...) - -void hexdump(uint8_t *mem, uint32_t len, uint8_t cols = 16); - - -#endif//ARD_DEBUG_H diff --git a/sparkfun/esp8266/cores/esp8266/esp8266_peri.h b/sparkfun/esp8266/cores/esp8266/esp8266_peri.h deleted file mode 100644 index d3841740..00000000 --- a/sparkfun/esp8266/cores/esp8266/esp8266_peri.h +++ /dev/null @@ -1,552 +0,0 @@ -/* - esp8266_peri.h - Peripheral registers exposed in more AVR style for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef ESP8266_PERI_H_INCLUDED -#define ESP8266_PERI_H_INCLUDED - -#include "c_types.h" - -#define ESP8266_REG(addr) *((volatile uint32_t *)(0x60000000+(addr))) -#define ESP8266_DREG(addr) *((volatile uint32_t *)(0x3FF00000+(addr))) - -//GPIO (0-15) Control Registers -#define GPO ESP8266_REG(0x300) //GPIO_OUT R/W (Output Level) -#define GPOS ESP8266_REG(0x304) //GPIO_OUT_SET WO -#define GPOC ESP8266_REG(0x308) //GPIO_OUT_CLR WO -#define GPE ESP8266_REG(0x30C) //GPIO_ENABLE R/W (Enable) -#define GPES ESP8266_REG(0x310) //GPIO_ENABLE_SET WO -#define GPEC ESP8266_REG(0x314) //GPIO_ENABLE_CLR WO -#define GPI ESP8266_REG(0x318) //GPIO_IN RO (Read Input Level) -#define GPIE ESP8266_REG(0x31C) //GPIO_STATUS R/W (Interrupt Enable) -#define GPIES ESP8266_REG(0x320) //GPIO_STATUS_SET WO -#define GPIEC ESP8266_REG(0x324) //GPIO_STATUS_CLR WO - -#define GPOP(p) ((GPO & (1 << ((p) & 0xF))) != 0) -#define GPEP(p) ((GPE & (1 << ((p) & 0xF))) != 0) -#define GPIP(p) ((GPI & (1 << ((p) & 0xF))) != 0) -#define GPIEP(p) ((GPIE & (1 << ((p) & 0xF))) != 0) - -//GPIO (0-15) PIN Control Registers -#define GPC(p) ESP8266_REG(0x328 + ((p & 0xF) * 4)) -#define GPC0 ESP8266_REG(0x328) //GPIO_PIN0 -#define GPC1 ESP8266_REG(0x32C) //GPIO_PIN1 -#define GPC2 ESP8266_REG(0x330) //GPIO_PIN2 -#define GPC3 ESP8266_REG(0x334) //GPIO_PIN3 -#define GPC4 ESP8266_REG(0x338) //GPIO_PIN4 -#define GPC5 ESP8266_REG(0x33C) //GPIO_PIN5 -#define GPC6 ESP8266_REG(0x340) //GPIO_PIN6 -#define GPC7 ESP8266_REG(0x344) //GPIO_PIN7 -#define GPC8 ESP8266_REG(0x348) //GPIO_PIN8 -#define GPC9 ESP8266_REG(0x34C) //GPIO_PIN9 -#define GPC10 ESP8266_REG(0x350) //GPIO_PIN10 -#define GPC11 ESP8266_REG(0x354) //GPIO_PIN11 -#define GPC12 ESP8266_REG(0x358) //GPIO_PIN12 -#define GPC13 ESP8266_REG(0x35C) //GPIO_PIN13 -#define GPC14 ESP8266_REG(0x360) //GPIO_PIN14 -#define GPC15 ESP8266_REG(0x364) //GPIO_PIN15 - -//GPIO (0-15) PIN Control Bits -#define GPCWE 10 //WAKEUP_ENABLE (can be 1 only when INT_TYPE is high or low) -#define GPCI 7 //INT_TYPE (3bits) 0:disable,1:rising,2:falling,3:change,4:low,5:high -#define GPCD 2 //DRIVER 0:normal,1:open drain -#define GPCS 0 //SOURCE 0:GPIO_DATA,1:SigmaDelta - -static uint8_t esp8266_gpioToFn[16] = {0x34, 0x18, 0x38, 0x14, 0x3C, 0x40, 0x1C, 0x20, 0x24, 0x28, 0x2C, 0x30, 0x04, 0x08, 0x0C, 0x10}; -#define GPF(p) ESP8266_REG(0x800 + esp8266_gpioToFn[(p & 0xF)]) - -#define GPMUX ESP8266_REG(0x800) -//GPIO (0-15) PIN Function Registers -#define GPF0 ESP8266_REG(0x834) -#define GPF1 ESP8266_REG(0x818) -#define GPF2 ESP8266_REG(0x838) -#define GPF3 ESP8266_REG(0x814) -#define GPF4 ESP8266_REG(0x83C) -#define GPF5 ESP8266_REG(0x840) -#define GPF6 ESP8266_REG(0x81C) -#define GPF7 ESP8266_REG(0x820) -#define GPF8 ESP8266_REG(0x824) -#define GPF9 ESP8266_REG(0x828) -#define GPF10 ESP8266_REG(0x82C) -#define GPF11 ESP8266_REG(0x830) -#define GPF12 ESP8266_REG(0x804) -#define GPF13 ESP8266_REG(0x808) -#define GPF14 ESP8266_REG(0x80C) -#define GPF15 ESP8266_REG(0x810) - -//GPIO (0-15) PIN Function Bits -#define GPFSOE 0 //Sleep OE -#define GPFSS 1 //Sleep Sel -#define GPFSPD 2 //Sleep Pulldown -#define GPFSPU 3 //Sleep Pullup -#define GPFFS0 4 //Function Select bit 0 -#define GPFFS1 5 //Function Select bit 1 -#define GPFPD 6 //Pulldown -#define GPFPU 7 //Pullup -#define GPFFS2 8 //Function Select bit 2 -#define GPFFS(f) (((((f) & 4) != 0) << GPFFS2) | ((((f) & 2) != 0) << GPFFS1) | ((((f) & 1) != 0) << GPFFS0)) -#define GPFFS_GPIO(p) (((p)==0||(p)==2||(p)==4||(p)==5)?0:((p)==16)?1:3) -#define GPFFS_BUS(p) (((p)==1||(p)==3)?0:((p)==2||(p)==12||(p)==13||(p)==14||(p)==15)?2:((p)==0)?4:1) - -//GPIO 16 Control Registers -#define GP16O ESP8266_REG(0x768) -#define GP16E ESP8266_REG(0x774) -#define GP16I ESP8266_REG(0x78C) - -//GPIO 16 PIN Control Register -#define GP16C ESP8266_REG(0x790) -#define GPC16 GP16C - -//GPIO 16 PIN Function Register -#define GP16F ESP8266_REG(0x7A0) -#define GPF16 GP16F - -//GPIO 16 PIN Function Bits -#define GP16FFS0 0 //Function Select bit 0 -#define GP16FFS1 1 //Function Select bit 1 -#define GP16FPD 3 //Pulldown -#define GP16FSPD 5 //Sleep Pulldown -#define GP16FFS2 6 //Function Select bit 2 -#define GP16FFS(f) (((f) & 0x03) | (((f) & 0x04) << 4)) - -//Timer 1 Registers (23bit CountDown Timer) -#define T1L ESP8266_REG(0x600) //Load Value (Starting Value of Counter) 23bit (0-8388607) -#define T1V ESP8266_REG(0x604) //(RO) Current Value -#define T1C ESP8266_REG(0x608) //Control Register -#define T1I ESP8266_REG(0x60C) //Interrupt Status Register (1bit) write to clear -//edge interrupt enable register -#define TEIE ESP8266_DREG(0x04) -#define TEIE1 0x02 //bit for timer 1 - -//Timer 2 Registers (32bit CountUp Timer) -#define T2L ESP8266_REG(0x620) //Load Value (Starting Value of Counter) -#define T2V ESP8266_REG(0x624) //(RO) Current Value -#define T2C ESP8266_REG(0x628) //Control Register -#define T2I ESP8266_REG(0x62C) //Interrupt Status Register (1bit) write to clear -#define T2A ESP8266_REG(0x630) //Alarm Value - -//Timer Control Bits -#define TCIS 8 //Interrupt Status -#define TCTE 7 //Timer Enable -#define TCAR 6 //AutoReload (restart timer when condition is reached) -#define TCPD 2 //Prescale Devider (2bit) 0:1(12.5ns/tick), 1:16(0.2us/tick), 2/3:256(3.2us/tick) -#define TCIT 0 //Interrupt Type 0:edge, 1:level - - -//UART SWAP Register -#define USWAP ESP8266_DREG(0x28) -#define USWAP0 2 //BIT 2 swaps UART 0 - -//UART 0 Registers -#define U0F ESP8266_REG(0x000) //UART FIFO -#define U0IR ESP8266_REG(0x004) //INT_RAW -#define U0IS ESP8266_REG(0x008) //INT_STATUS -#define U0IE ESP8266_REG(0x00c) //INT_ENABLE -#define U0IC ESP8266_REG(0x010) //INT_CLEAR -#define U0D ESP8266_REG(0x014) //CLKDIV -#define U0A ESP8266_REG(0x018) //AUTOBAUD -#define U0S ESP8266_REG(0x01C) //STATUS -#define U0C0 ESP8266_REG(0x020) //CONF0 -#define U0C1 ESP8266_REG(0x024) //CONF1 -#define U0LP ESP8266_REG(0x028) //LOW_PULSE -#define U0HP ESP8266_REG(0x02C) //HIGH_PULSE -#define U0PN ESP8266_REG(0x030) //PULSE_NUM -#define U0DT ESP8266_REG(0x078) //DATE -#define U0ID ESP8266_REG(0x07C) //ID - -//UART 1 Registers -#define U1F ESP8266_REG(0xF00) //UART FIFO -#define U1IR ESP8266_REG(0xF04) //INT_RAW -#define U1IS ESP8266_REG(0xF08) //INT_STATUS -#define U1IE ESP8266_REG(0xF0c) //INT_ENABLE -#define U1IC ESP8266_REG(0xF10) //INT_CLEAR -#define U1D ESP8266_REG(0xF14) //CLKDIV -#define U1A ESP8266_REG(0xF18) //AUTOBAUD -#define U1S ESP8266_REG(0xF1C) //STATUS -#define U1C0 ESP8266_REG(0xF20) //CONF0 -#define U1C1 ESP8266_REG(0xF24) //CONF1 -#define U1LP ESP8266_REG(0xF28) //LOW_PULSE -#define U1HP ESP8266_REG(0xF2C) //HIGH_PULSE -#define U1PN ESP8266_REG(0xF30) //PULSE_NUM -#define U1DT ESP8266_REG(0xF78) //DATE -#define U1ID ESP8266_REG(0xF7C) //ID - -//UART(uart) Registers -#define USF(u) ESP8266_REG(0x000+(0xF00*(u&1))) //UART FIFO -#define USIR(u) ESP8266_REG(0x004+(0xF00*(u&1))) //INT_RAW -#define USIS(u) ESP8266_REG(0x008+(0xF00*(u&1))) //INT_STATUS -#define USIE(u) ESP8266_REG(0x00c+(0xF00*(u&1))) //INT_ENABLE -#define USIC(u) ESP8266_REG(0x010+(0xF00*(u&1))) //INT_CLEAR -#define USD(u) ESP8266_REG(0x014+(0xF00*(u&1))) //CLKDIV -#define USA(u) ESP8266_REG(0x018+(0xF00*(u&1))) //AUTOBAUD -#define USS(u) ESP8266_REG(0x01C+(0xF00*(u&1))) //STATUS -#define USC0(u) ESP8266_REG(0x020+(0xF00*(u&1))) //CONF0 -#define USC1(u) ESP8266_REG(0x024+(0xF00*(u&1))) //CONF1 -#define USLP(u) ESP8266_REG(0x028+(0xF00*(u&1))) //LOW_PULSE -#define USHP(u) ESP8266_REG(0x02C+(0xF00*(u&1))) //HIGH_PULSE -#define USPN(u) ESP8266_REG(0x030+(0xF00*(u&1))) //PULSE_NUM -#define USDT(u) ESP8266_REG(0x078+(0xF00*(u&1))) //DATE -#define USID(u) ESP8266_REG(0x07C+(0xF00*(u&1))) //ID - -//UART INT Registers Bits -#define UITO 8 //RX FIFO TimeOut -#define UIBD 7 //Break Detected -#define UICTS 6 //CTS Changed -#define UIDSR 5 //DSR Change -#define UIOF 4 //RX FIFO OverFlow -#define UIFR 3 //Frame Error -#define UIPE 2 //Parity Error -#define UIFE 1 //TX FIFO Empty -#define UIFF 0 //RX FIFO Full - -//UART STATUS Registers Bits -#define USTX 31 //TX PIN Level -#define USRTS 30 //RTS PIN Level -#define USDTR 39 //DTR PIN Level -#define USTXC 16 //TX FIFO COUNT (8bit) -#define USRXD 15 //RX PIN Level -#define USCTS 14 //CTS PIN Level -#define USDSR 13 //DSR PIN Level -#define USRXC 0 //RX FIFO COUNT (8bit) - -//UART CONF0 Registers Bits -#define UCDTRI 24 //Invert DTR -#define UCRTSI 23 //Invert RTS -#define UCTXI 22 //Invert TX -#define UCDSRI 21 //Invert DSR -#define UCCTSI 20 //Invert CTS -#define UCRXI 19 //Invert RX -#define UCTXRST 18 //Reset TX FIFO -#define UCRXRST 17 //Reset RX FIFO -#define UCTXHFE 15 //TX Harware Flow Enable -#define UCLBE 14 //LoopBack Enable -#define UCBRK 8 //Send Break on the TX line -#define UCSWDTR 7 //Set this bit to assert DTR -#define UCSWRTS 6 //Set this bit to assert RTS -#define UCSBN 4 //StopBits Count (2bit) 0:disable, 1:1bit, 2:1.5bit, 3:2bit -#define UCBN 2 //DataBits Count (2bin) 0:5bit, 1:6bit, 2:7bit, 3:8bit -#define UCPAE 1 //Parity Enable -#define UCPA 0 //Parity 0:even, 1:odd - -//UART CONF1 Registers Bits -#define UCTOE 31 //RX TimeOut Enable -#define UCTOT 24 //RX TimeOut Treshold (7bit) -#define UCRXHFE 23 //RX Harware Flow Enable -#define UCRXHFT 16 //RX Harware Flow Treshold (7bit) -#define UCFET 8 //TX FIFO Empty Treshold (7bit) -#define UCFFT 0 //RX FIFO Full Treshold (7bit) - -//WDT Register used for UART -#define WDTRST ESP8266_REG(0x914) -#define WDT_RESET() (WDTRST = 0x73) - -//SPI0 Registers (SPI0 is used for the flash) -#define SPI0CMD ESP8266_REG(0x200) -#define SPI0A ESP8266_REG(0x204) -#define SPI0C ESP8266_REG(0x208) -#define SPI0C1 ESP8266_REG(0x20C) -#define SPI0RS ESP8266_REG(0x210) -#define SPI0C2 ESP8266_REG(0x214) -#define SPI0CLK ESP8266_REG(0x218) -#define SPI0U ESP8266_REG(0x21C) -#define SPI0U1 ESP8266_REG(0x220) -#define SPI0U2 ESP8266_REG(0x224) -#define SPI0WS ESP8266_REG(0x228) -#define SPI0P ESP8266_REG(0x22C) -#define SPI0S ESP8266_REG(0x230) -#define SPI0S1 ESP8266_REG(0x234) -#define SPI0S2 ESP8266_REG(0x238) -#define SPI0S3 ESP8266_REG(0x23C) -#define SPI0W0 ESP8266_REG(0x240) -#define SPI0W1 ESP8266_REG(0x244) -#define SPI0W2 ESP8266_REG(0x248) -#define SPI0W3 ESP8266_REG(0x24C) -#define SPI0W4 ESP8266_REG(0x250) -#define SPI0W5 ESP8266_REG(0x254) -#define SPI0W6 ESP8266_REG(0x258) -#define SPI0W7 ESP8266_REG(0x25C) -#define SPI0W8 ESP8266_REG(0x260) -#define SPI0W9 ESP8266_REG(0x264) -#define SPI0W10 ESP8266_REG(0x268) -#define SPI0W11 ESP8266_REG(0x26C) -#define SPI0W12 ESP8266_REG(0x270) -#define SPI0W13 ESP8266_REG(0x274) -#define SPI0W14 ESP8266_REG(0x278) -#define SPI0W15 ESP8266_REG(0x27C) -#define SPI0E3 ESP8266_REG(0x2FC) -#define SPI0W(p) ESP8266_REG(0x240 + ((p & 0xF) * 4)) - -//SPI1 Registers -#define SPI1CMD ESP8266_REG(0x100) -#define SPI1A ESP8266_REG(0x104) -#define SPI1C ESP8266_REG(0x108) -#define SPI1C1 ESP8266_REG(0x10C) -#define SPI1RS ESP8266_REG(0x110) -#define SPI1C2 ESP8266_REG(0x114) -#define SPI1CLK ESP8266_REG(0x118) -#define SPI1U ESP8266_REG(0x11C) -#define SPI1U1 ESP8266_REG(0x120) -#define SPI1U2 ESP8266_REG(0x124) -#define SPI1WS ESP8266_REG(0x128) -#define SPI1P ESP8266_REG(0x12C) -#define SPI1S ESP8266_REG(0x130) -#define SPI1S1 ESP8266_REG(0x134) -#define SPI1S2 ESP8266_REG(0x138) -#define SPI1S3 ESP8266_REG(0x13C) -#define SPI1W0 ESP8266_REG(0x140) -#define SPI1W1 ESP8266_REG(0x144) -#define SPI1W2 ESP8266_REG(0x148) -#define SPI1W3 ESP8266_REG(0x14C) -#define SPI1W4 ESP8266_REG(0x150) -#define SPI1W5 ESP8266_REG(0x154) -#define SPI1W6 ESP8266_REG(0x158) -#define SPI1W7 ESP8266_REG(0x15C) -#define SPI1W8 ESP8266_REG(0x160) -#define SPI1W9 ESP8266_REG(0x164) -#define SPI1W10 ESP8266_REG(0x168) -#define SPI1W11 ESP8266_REG(0x16C) -#define SPI1W12 ESP8266_REG(0x170) -#define SPI1W13 ESP8266_REG(0x174) -#define SPI1W14 ESP8266_REG(0x178) -#define SPI1W15 ESP8266_REG(0x17C) -#define SPI1E0 ESP8266_REG(0x1F0) -#define SPI1E1 ESP8266_REG(0x1F4) -#define SPI1E2 ESP8266_REG(0x1F8) -#define SPI1E3 ESP8266_REG(0x1FC) -#define SPI1W(p) ESP8266_REG(0x140 + ((p & 0xF) * 4)) - -//SPI0, SPI1 & I2S Interupt Register -#define SPIIR ESP8266_DREG(0x20) -#define SPII0 4 //SPI0 Interrupt -#define SPII1 7 //SPI1 Interrupt -#define SPII2 9 //I2S Interrupt - -//SPI CMD -#define SPICMDREAD (1 << 31) //SPI_FLASH_READ -#define SPICMDWREN (1 << 30) //SPI_FLASH_WREN -#define SPICMDWRDI (1 << 29) //SPI_FLASH_WRDI -#define SPICMDRDID (1 << 28) //SPI_FLASH_RDID -#define SPICMDRDSR (1 << 27) //SPI_FLASH_RDSR -#define SPICMDWRSR (1 << 26) //SPI_FLASH_WRSR -#define SPICMDPP (1 << 25) //SPI_FLASH_PP -#define SPICMDSE (1 << 24) //SPI_FLASH_SE -#define SPICMDBE (1 << 23) //SPI_FLASH_BE -#define SPICMDCE (1 << 22) //SPI_FLASH_CE -#define SPICMDDP (1 << 21) //SPI_FLASH_DP -#define SPICMDRES (1 << 20) //SPI_FLASH_RES -#define SPICMDHPM (1 << 19) //SPI_FLASH_HPM -#define SPICMDUSR (1 << 18) //SPI_FLASH_USR -#define SPIBUSY (1 << 18) //SPI_USR - -//SPI CTRL (SPIxC) -#define SPICWBO (1 << 26) //SPI_WR_BIT_ODER -#define SPICRBO (1 << 25) //SPI_RD_BIT_ODER -#define SPICQIO (1 << 24) //SPI_QIO_MODE -#define SPICDIO (1 << 23) //SPI_DIO_MODE -#define SPIC2BSE (1 << 22) //SPI_TWO_BYTE_STATUS_EN -#define SPICWPR (1 << 21) //SPI_WP_REG -#define SPICQOUT (1 << 20) //SPI_QOUT_MODE -#define SPICSHARE (1 << 19) //SPI_SHARE_BUS -#define SPICHOLD (1 << 18) //SPI_HOLD_MODE -#define SPICAHB (1 << 17) //SPI_ENABLE_AHB -#define SPICSSTAAI (1 << 16) //SPI_SST_AAI -#define SPICRESANDRES (1 << 15) //SPI_RESANDRES -#define SPICDOUT (1 << 14) //SPI_DOUT_MODE -#define SPICFASTRD (1 << 13) //SPI_FASTRD_MODE - -//SPI CTRL1 (SPIxC1) -#define SPIC1TCSH 0xF //SPI_T_CSH -#define SPIC1TCSH_S 28 //SPI_T_CSH_S -#define SPIC1TRES 0xFFF //SPI_T_RES -#define SPIC1TRES_S 16 //SPI_T_RES_S -#define SPIC1BTL 0xFFFF //SPI_BUS_TIMER_LIMIT -#define SPIC1BTL_S 0 //SPI_BUS_TIMER_LIMIT_S - -//SPI Status (SPIxRS) -#define SPIRSEXT 0xFF //SPI_STATUS_EXT -#define SPIRSEXT_S 24 //SPI_STATUS_EXT_S -#define SPIRSWB 0xFF //SPI_WB_MODE -#define SPIRSWB_S 16 //SPI_WB_MODE_S -#define SPIRSSP (1 << 7) //SPI_FLASH_STATUS_PRO_FLAG -#define SPIRSTBP (1 << 5) //SPI_FLASH_TOP_BOT_PRO_FLAG -#define SPIRSBP2 (1 << 4) //SPI_FLASH_BP2 -#define SPIRSBP1 (1 << 3) //SPI_FLASH_BP1 -#define SPIRSBP0 (1 << 2) //SPI_FLASH_BP0 -#define SPIRSWRE (1 << 1) //SPI_FLASH_WRENABLE_FLAG -#define SPIRSBUSY (1 << 0) //SPI_FLASH_BUSY_FLAG - -//SPI CTRL2 (SPIxC2) -#define SPIC2CSDN 0xF //SPI_CS_DELAY_NUM -#define SPIC2CSDN_S 28 //SPI_CS_DELAY_NUM_S -#define SPIC2CSDM 0x3 //SPI_CS_DELAY_MODE -#define SPIC2CSDM_S 26 //SPI_CS_DELAY_MODE_S -#define SPIC2MOSIDN 0x7 //SPI_MOSI_DELAY_NUM -#define SPIC2MOSIDN_S 23 //SPI_MOSI_DELAY_NUM_S -#define SPIC2MOSIDM 0x3 //SPI_MOSI_DELAY_MODE -#define SPIC2MOSIDM_S 21 //SPI_MOSI_DELAY_MODE_S -#define SPIC2MISODN 0x7 //SPI_MISO_DELAY_NUM -#define SPIC2MISODN_S 18 //SPI_MISO_DELAY_NUM_S -#define SPIC2MISODM 0x3 //SPI_MISO_DELAY_MODE -#define SPIC2MISODM_S 16 //SPI_MISO_DELAY_MODE_S -#define SPIC2CKOHM 0xF //SPI_CK_OUT_HIGH_MODE -#define SPIC2CKOHM_S 12 //SPI_CK_OUT_HIGH_MODE_S -#define SPIC2CKOLM 0xF //SPI_CK_OUT_LOW_MODE -#define SPIC2CKOLM_S 8 //SPI_CK_OUT_LOW_MODE_S -#define SPIC2HT 0xF //SPI_HOLD_TIME -#define SPIC2HT_S 4 //SPI_HOLD_TIME_S -#define SPIC2ST 0xF //SPI_SETUP_TIME -#define SPIC2ST_S 0 //SPI_SETUP_TIME_S - -//SPI CLK (SPIxCLK) -#define SPICLK_EQU_SYSCLK (1 << 31) //SPI_CLK_EQU_SYSCLK -#define SPICLKDIVPRE 0x1FFF //SPI_CLKDIV_PRE -#define SPICLKDIVPRE_S 18 //SPI_CLKDIV_PRE_S -#define SPICLKCN 0x3F //SPI_CLKCNT_N -#define SPICLKCN_S 12 //SPI_CLKCNT_N_S -#define SPICLKCH 0x3F //SPI_CLKCNT_H -#define SPICLKCH_S 6 //SPI_CLKCNT_H_S -#define SPICLKCL 0x3F //SPI_CLKCNT_L -#define SPICLKCL_S 0 //SPI_CLKCNT_L_S - -//SPI Phases (SPIxU) -#define SPIUCOMMAND (1 << 31) //COMMAND pahse, SPI_USR_COMMAND -#define SPIUADDR (1 << 30) //ADDRESS phase, SPI_FLASH_USR_ADDR -#define SPIUDUMMY (1 << 29) //DUMMY phase, SPI_FLASH_USR_DUMMY -#define SPIUMISO (1 << 28) //MISO phase, SPI_FLASH_USR_DIN -#define SPIUMOSI (1 << 27) //MOSI phase, SPI_FLASH_DOUT -#define SPIUDUMMYIDLE (1 << 26) //SPI_USR_DUMMY_IDLE -#define SPIUMOSIH (1 << 25) //MOSI phase uses W8-W15, SPI_USR_DOUT_HIGHPART -#define SPIUMISOH (1 << 24) //MISO pahse uses W8-W15, SPI_USR_DIN_HIGHPART -#define SPIUPREPHOLD (1 << 23) //SPI_USR_PREP_HOLD -#define SPIUCMDHOLD (1 << 22) //SPI_USR_CMD_HOLD -#define SPIUADDRHOLD (1 << 21) //SPI_USR_ADDR_HOLD -#define SPIUDUMMYHOLD (1 << 20) //SPI_USR_DUMMY_HOLD -#define SPIUMISOHOLD (1 << 19) //SPI_USR_DIN_HOLD -#define SPIUMOSIHOLD (1 << 18) //SPI_USR_DOUT_HOLD -#define SPIUHOLDPOL (1 << 17) //SPI_USR_HOLD_POL -#define SPIUSIO (1 << 16) //SPI_SIO -#define SPIUFWQIO (1 << 15) //SPI_FWRITE_QIO -#define SPIUFWDIO (1 << 14) //SPI_FWRITE_DIO -#define SPIUFWQUAD (1 << 13) //SPI_FWRITE_QUAD -#define SPIUFWDUAL (1 << 12) //SPI_FWRITE_DUAL -#define SPIUWRBYO (1 << 11) //SPI_WR_BYTE_ORDER -#define SPIURDBYO (1 << 10) //SPI_RD_BYTE_ORDER -#define SPIUAHBEM 0x3 //SPI_AHB_ENDIAN_MODE -#define SPIUAHBEM_S 8 //SPI_AHB_ENDIAN_MODE_S -#define SPIUSME (1 << 7) //SPI Master Edge (0:falling, 1:rising), SPI_CK_OUT_EDGE -#define SPIUSSE (1 << 6) //SPI Slave Edge (0:falling, 1:rising), SPI_CK_I_EDGE -#define SPIUCSSETUP (1 << 5) //SPI_CS_SETUP -#define SPIUCSHOLD (1 << 4) //SPI_CS_HOLD -#define SPIUAHBUCMD (1 << 3) //SPI_AHB_USR_COMMAND -#define SPIUAHBUCMD4B (1 << 1) //SPI_AHB_USR_COMMAND_4BYTE -#define SPIUDUPLEX (1 << 0) //SPI_DOUTDIN - -//SPI Phase Length Locations -#define SPILCOMMAND 28 //4 bit in SPIxU2 default 7 (8bit) -#define SPILADDR 16 //6 bit in SPIxU1 default:23 (24bit) -#define SPILDUMMY 0 //8 bit in SPIxU1 default:0 (0 cycles) -#define SPILMISO 8 //9 bit in SPIxU1 default:0 (1bit) -#define SPILMOSI 17 //9 bit in SPIxU1 default:0 (1bit) -//SPI Phase Length Masks -#define SPIMCOMMAND 0xF -#define SPIMADDR 0x3F -#define SPIMDUMMY 0xFF -#define SPIMMISO 0x1FF -#define SPIMMOSI 0x1FF - -//SPI Slave (SPIxS) -#define SPISSRES (1 << 31) //SYNC RESET, SPI_SYNC_RESET -#define SPISE (1 << 30) //Slave Enable, SPI_SLAVE_MODE -#define SPISBE (1 << 29) //WR/RD BUF enable, SPI_SLV_WR_RD_BUF_EN -#define SPISSE (1 << 28) //STA enable, SPI_SLV_WR_RD_STA_EN -#define SPISCD (1 << 27) //CMD define, SPI_SLV_CMD_DEFINE -#define SPISTRCNT 0xF //SPI_TRANS_CNT -#define SPISTRCNT_S 23 //SPI_TRANS_CNT_S -#define SPISSLS 0x7 //SPI_SLV_LAST_STATE -#define SPISSLS_S 20 //SPI_SLV_LAST_STATE_S -#define SPISSLC 0x7 //SPI_SLV_LAST_COMMAND -#define SPISSLC_S 17 //SPI_SLV_LAST_COMMAND_S -#define SPISCSIM 0x3 //SPI_CS_I_MODE -#define SPIDCSIM_S 10 //SPI_CS_I_MODE_S -#define SPISTRIE (1 << 9) //TRANS interrupt enable -#define SPISWSIE (1 << 8) //WR_STA interrupt enable -#define SPISRSIE (1 << 7) //RD_STA interrupt enable -#define SPISWBIE (1 << 6) //WR_BUF interrupt enable -#define SPISRBIE (1 << 5) //RD_BUF interrupt enable -#define SPISTRIS (1 << 4) //TRANS interrupt status -#define SPISWSIS (1 << 3) //WR_STA interrupt status -#define SPISRSIS (1 << 2) //RD_STA interrupt status -#define SPISWBIS (1 << 1) //WR_BUF interrupt status -#define SPISRBIS (1 << 0) //RD_BUF interrupt status - -//SPI Slave1 (SPIxS1) -#define SPIS1LSTA 27 //5 bit in SPIxS1 default:0 (1bit), SPI_SLV_STATUS_BITLEN -#define SPIS1FE (1 << 26) //SPI_SLV_STATUS_FAST_EN -#define SPIS1RSTA (1 << 25) //default:0 enable STA read from Master, SPI_SLV_STATUS_READBACK -#define SPIS1LBUF 16 //9 bit in SPIxS1 default:0 (1bit), SPI_SLV_BUF_BITLEN -#define SPIS1LRBA 10 //6 bit in SPIxS1 default:0 (1bit), SPI_SLV_RD_ADDR_BITLEN -#define SPIS1LWBA 4 //6 bit in SPIxS1 default:0 (1bit), SPI_SLV_WR_ADDR_BITLEN -#define SPIS1WSDE (1 << 3) //SPI_SLV_WRSTA_DUMMY_EN -#define SPIS1RSDE (1 << 2) //SPI_SLV_RDSTA_DUMMY_EN -#define SPIS1WBDE (1 << 1) //SPI_SLV_WRBUF_DUMMY_EN -#define SPIS1RBDE (1 << 0) //SPI_SLV_RDBUF_DUMMY_EN - -//SPI Slave2 (SPIxS2) -#define SPIS2WBDL 0xFF //SPI_SLV_WRBUF_DUMMY_CYCLELEN -#define SPIS2WBDL_S 24 //SPI_SLV_WRBUF_DUMMY_CYCLELEN_S -#define SPIS2RBDL 0xFF //SPI_SLV_RDBUF_DUMMY_CYCLELEN -#define SPIS2RBDL_S 16 //SPI_SLV_RDBUF_DUMMY_CYCLELEN_S -#define SPIS2WSDL 0xFF //SPI_SLV_WRSTA_DUMMY_CYCLELEN -#define SPIS2WSDL_S 8 //SPI_SLV_WRSTA_DUMMY_CYCLELEN_S -#define SPIS2RSDL 0xFF //SPI_SLV_RDSTA_DUMMY_CYCLELEN -#define SPIS2RSDL_S 0 //SPI_SLV_RDSTA_DUMMY_CYCLELEN_S - -//SPI Slave3 (SPIxS3) -#define SPIS3WSCV 0xFF //SPI_SLV_WRSTA_CMD_VALUE -#define SPIS3WSCV_S 24 //SPI_SLV_WRSTA_CMD_VALUE_S -#define SPIS3RSCV 0xFF //SPI_SLV_RDSTA_CMD_VALUE -#define SPIS3RSCV_S 16 //SPI_SLV_RDSTA_CMD_VALUE_S -#define SPIS3WBCV 0xFF //SPI_SLV_WRBUF_CMD_VALUE -#define SPIS3WBCV_S 8 //SPI_SLV_WRBUF_CMD_VALUE_S -#define SPIS3RBCV 0xFF //SPI_SLV_RDBUF_CMD_VALUE -#define SPIS3RBCV_S 0 //SPI_SLV_RDBUF_CMD_VALUE_S - -//SPI EXT0 (SPIxE0) -#define SPIE0TPPEN (1 << 31) //SPI_T_PP_ENA -#define SPIE0TPPS 0xF //SPI_T_PP_SHIFT -#define SPIE0TPPS_S 16 //SPI_T_PP_SHIFT_S -#define SPIE0TPPT 0xFFF //SPI_T_PP_TIME -#define SPIE0TPPT_S 0 //SPI_T_PP_TIME_S - -//SPI EXT1 (SPIxE1) -#define SPIE1TEREN (1 << 31) //SPI_T_ERASE_ENA -#define SPIE1TERS 0xF //SPI_T_ERASE_SHIFT -#define SPIE1TERS_S 16 //SPI_T_ERASE_SHIFT_S -#define SPIE1TERT 0xFFF //SPI_T_ERASE_TIME -#define SPIE1TERT_S 0 //SPI_T_ERASE_TIME_S - -//SPI EXT2 (SPIxE2) -#define SPIE2ST 0x7 //SPI_ST -#define SPIE2ST_S 0 //SPI_ST_S - -//SPI EXT3 (SPIxE3) -#define SPIE2IHEN 0x3 //SPI_INT_HOLD_ENA -#define SPIE2IHEN_S 0 //SPI_INT_HOLD_ENA_S - -#endif diff --git a/sparkfun/esp8266/cores/esp8266/libc_replacements.c b/sparkfun/esp8266/cores/esp8266/libc_replacements.c deleted file mode 100644 index 519ea233..00000000 --- a/sparkfun/esp8266/cores/esp8266/libc_replacements.c +++ /dev/null @@ -1,540 +0,0 @@ -/* - libc_replacements.c - replaces libc functions with functions - from Espressif SDK - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 03 April 2015 by Markus Sattler - - */ - -#include -#include -#include -#include -#include -#include -#include - -#include "ets_sys.h" -#include "os_type.h" -#include "osapi.h" -#include "mem.h" -#include "user_interface.h" - -void* malloc(size_t size) { - size = ((size + 3) & ~((size_t)0x3)); - return os_malloc(size); -} - -void free(void* ptr) { - os_free(ptr); -} - -void* realloc(void* ptr, size_t size) { - size = ((size + 3) & ~((size_t)0x3)); - return os_realloc(ptr, size); -} - -int puts(const char * str) { - return os_printf("%s", str); -} - -int printf(const char* format, ...) { - int ret; - va_list arglist; - va_start(arglist, format); - ret = ets_vprintf(format, arglist); - va_end(arglist); - return ret; -} - -int sprintf(char* buffer, const char* format, ...) { - int ret; - va_list arglist; - va_start(arglist, format); - ret = ets_vsprintf(buffer, format, arglist); - va_end(arglist); - return ret; -} - -int snprintf(char* buffer, size_t size, const char* format, ...) { - int ret; - va_list arglist; - va_start(arglist, format); - ret = ets_vsnprintf(buffer, size, format, arglist); - va_end(arglist); - return ret; -} - -int vsnprintf(char * buffer, size_t size, const char * format, va_list arg) { - return ets_vsnprintf(buffer, size, format, arg); -} - -int memcmp(const void *s1, const void *s2, size_t n) { - return ets_memcmp(s1, s2, n); -} - -void* memcpy(void *dest, const void *src, size_t n) { - return ets_memcpy(dest, src, n); -} - -void* memset(void *s, int c, size_t n) { - return ets_memset(s, c, n); -} - -int strcmp(const char *s1, const char *s2) { - return ets_strcmp(s1, s2); -} - -char* strcpy(char *dest, const char *src) { - return ets_strcpy(dest, src); -} - -size_t strlen(const char *s) { - return ets_strlen(s); -} - -int strncmp(const char *s1, const char *s2, size_t len) { - return ets_strncmp(s1, s2, len); -} - -char* strncpy(char * dest, const char * src, size_t n) { - return ets_strncpy(dest, src, n); -} - -size_t ICACHE_FLASH_ATTR strnlen(const char *s, size_t len) { - // there is no ets_strnlen - const char *cp; - for (cp = s; len != 0 && *cp != '\0'; cp++, len--); - return (size_t)(cp - s); -} - -char* strstr(const char *haystack, const char *needle) { - return ets_strstr(haystack, needle); -} - -char* ICACHE_FLASH_ATTR strchr(const char * str, int character) { - while(1) { - if(*str == 0x00) { - return NULL; - } - if(*str == (char) character) { - return (char *) str; - } - str++; - } -} - -char * ICACHE_FLASH_ATTR strrchr(const char * str, int character) { - char * ret = NULL; - while(1) { - if(*str == 0x00) { - return ret; - } - if(*str == (char) character) { - ret = (char *) str; - } - str++; - } -} - -char* ICACHE_FLASH_ATTR strcat(char * dest, const char * src) { - return strncat(dest, src, strlen(src)); -} - -char* ICACHE_FLASH_ATTR strncat(char * dest, const char * src, size_t n) { - uint32_t offset = strlen(dest); - for(uint32_t i = 0; i < n; i++) { - *(dest + i + offset) = *(src + i); - if(*(src + i) == 0x00) { - break; - } - } - return dest; -} - - -char* ICACHE_FLASH_ATTR strtok_r(char * str, const char * delimiters, char ** temp) { - static char * ret = NULL; - char * start = NULL; - char * end = NULL; - uint32_t size = 0; - - if(str == NULL) { - if(temp == NULL) { - return NULL; - } - start = *temp; - } else { - start = str; - } - - if(start == NULL) { - return NULL; - } - - if(delimiters == NULL) { - return NULL; - } - - end = start; - - while(1) { - for(uint16_t i = 0; i < strlen(delimiters); i++) { - if(*end == *(delimiters + i)) { - break; - } - } - end++; - if(*end == 0x00) { - break; - } - } - - *temp = end; - - if(ret != NULL) { - free(ret); - } - - size = (end - start); - ret = (char *) malloc(size); - strncpy(ret, start, size); - return ret; -} - -char* ICACHE_FLASH_ATTR strtok(char * str, const char * delimiters) { - static char * ret = NULL; - ret = strtok_r(str, delimiters, &ret); - return ret; -} - -int ICACHE_FLASH_ATTR strcasecmp(const char * str1, const char * str2) { - int d = 0; - while(1) { - int c1 = tolower(*str1++); - int c2 = tolower(*str2++); - if(((d = c1 - c2) != 0) || (c2 == '\0')) { - break; - } - } - return d; -} - -char* ICACHE_FLASH_ATTR strdup(const char *str) { - size_t len = strlen(str) + 1; - char *cstr = malloc(len); - if(cstr) { - memcpy(cstr, str, len); - } - return cstr; -} - -long int ICACHE_FLASH_ATTR strtol(const char* str, char** endptr, int base) { - long int result = 0; - int sign = 1; - - while(isspace(*str)) { - str++; - } - - if(*str == 0x00) { - // only space in str? - *endptr = (char*) str; - return result; - } - - switch(base) { - case 10: - - if(*str == '-') { - sign = -1; - str++; - } else if(*str == '+') { - str++; - } - - for(uint8_t i = 0; *str; i++, str++) { - int x = *str - '0'; - if(x < 0 || x > 9) { - break; - } - result = result * 10 + x; - } - break; - case 2: - for(uint8_t i = 0; *str; i++, str++) { - int x = *str - '0'; - if(x < 0 || x > 1) { - break; - } - result = result * 2 + x; - } - break; - case 16: - default: - os_printf("fnk: strtol() only supports base 10 and 2 ATM!\n"); - break; - - } - *endptr = (char*) str; - return sign * result; -} - -// based on Source: -// https://github.com/anakod/Sming/blob/master/Sming/system/stringconversion.cpp#L93 -double ICACHE_FLASH_ATTR strtod(const char* str, char** endptr) { - double result = 0.0; - double factor = 1.0; - bool decimals = false; - char c; - - while(isspace(*str)) { - str++; - } - - if(*str == 0x00) { - // only space in str? - *endptr = (char*) str; - return result; - } - - if(*str == '-') { - factor = -1; - str++; - } else if(*str == '+') { - str++; - } - - while((c = *str)) { - if(c == '.') { - decimals = true; - str++; - continue; - } - - int d = c - '0'; - if(d < 0 || d > 9) { - break; - } - - result = 10.0 * result + d; - if(decimals) { - factor *= 0.1; - } - - str++; - } - *endptr = (char*) str; - return result * factor; -} - -// ########################################################################## -// ctype functions -// ########################################################################## - -int isalnum(int c) { - if(isalpha(c) || isdigit(c)) { - return 1; - } - return 0; -} - -int isalpha(int c) { - if(islower(c) || isupper(c)) { - return 1; - } - return 0; -} - -int iscntrl(int c) { - if(c <= 0x1F || c == 0x7F) { - return 1; - } - return 0; -} - -int isdigit(int c) { - if(c >= '0' && c <= '9') { - return 1; - } - return 0; -} - -int isgraph(int c) { - if(isprint(c) && c != ' ') { - return 1; - } - return 0; -} - -int islower(int c) { - if(c >= 'a' && c <= 'z') { - return 1; - } - return 0; -} - -int isprint(int c) { - if(!iscntrl(c)) { - return 1; - } - return 0; -} - -int ispunct(int c) { - if(isgraph(c) && !isalnum(c)) { - return 1; - } - return 0; -} - -int isspace(int c) { - switch(c) { - case 0x20: // ' ' - case 0x09: // '\t' - case 0x0a: // '\n' - case 0x0b: // '\v' - case 0x0c: // '\f' - case 0x0d: // '\r' - return 1; - } - return 0; -} - -int isupper(int c) { - if(c >= 'A' && c <= 'Z') { - return 1; - } - return 0; -} - -int isxdigit(int c) { - if(c >= 'A' && c <= 'F') { - return 1; - } - if(c >= 'a' && c <= 'f') { - return 1; - } - if(isdigit(c)) { - return 1; - } - return 0; -} - -int tolower(int c) { - if(isupper(c)) { - c += 0x20; - } - return c; -} - -int toupper(int c) { - if(islower(c)) { - c -= 0x20; - } - return c; -} - -int isblank(int c) { - switch(c) { - case 0x20: // ' ' - case 0x09: // '\t' - return 1; - } - return 0; -} - -// ########################################################################## - -static int errno_var = 0; - -int* ICACHE_FLASH_ATTR __errno(void) { - os_printf("__errno is called last error: %d (not current)\n", errno_var); - return &errno_var; -} - -// ########################################################################## -// __ieee754 functions -// ########################################################################## - -double ICACHE_FLASH_ATTR __ieee754_sinh(double x) { - return sinh(x); -} - -double ICACHE_FLASH_ATTR __ieee754_hypot(double x, double y) { - return hypot(x, y); -} - -float ICACHE_FLASH_ATTR __ieee754_hypotf(float x, float y) { - return hypotf(x, y); -} - -float ICACHE_FLASH_ATTR __ieee754_logf(float x) { - return logf(x); -} - -double ICACHE_FLASH_ATTR __ieee754_log10(double x) { - return log10(x); -} - -double ICACHE_FLASH_ATTR __ieee754_exp(double x) { - return exp(x); -} - -double ICACHE_FLASH_ATTR __ieee754_cosh(double x) { - return cosh(x); -} - -float ICACHE_FLASH_ATTR __ieee754_expf(float x) { - return expf(x); -} - -float ICACHE_FLASH_ATTR __ieee754_log10f(float x) { - return log10f(x); -} - -double ICACHE_FLASH_ATTR __ieee754_atan2(double x, double y) { - return atan2(x, y); -} - -float ICACHE_FLASH_ATTR __ieee754_sqrtf(float x) { - return sqrtf(x); -} - -float ICACHE_FLASH_ATTR __ieee754_sinhf(float x) { - return sinhf(x); -} - -double ICACHE_FLASH_ATTR __ieee754_log(double x) { - return log(x); -} - -double ICACHE_FLASH_ATTR __ieee754_sqrt(double x) { - return sqrt(x); -} - -float ICACHE_FLASH_ATTR __ieee754_coshf(float x) { - return coshf(x); -} - -float ICACHE_FLASH_ATTR __ieee754_atan2f(float x, float y) { - return atan2f(x, y); -} - diff --git a/sparkfun/esp8266/cores/esp8266/pgmspace.cpp b/sparkfun/esp8266/cores/esp8266/pgmspace.cpp deleted file mode 100644 index 84af6264..00000000 --- a/sparkfun/esp8266/cores/esp8266/pgmspace.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* -pgmspace.cpp - string functions that support PROGMEM -Copyright (c) 2015 Michael C. Miller. All right reserved. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Lesser General Public -License as published by the Free Software Foundation; either -version 2.1 of the License, or (at your option) any later version. - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include -#include "pgmspace.h" - -size_t ICACHE_FLASH_ATTR strnlen_P(const char* s, size_t size) { - const char* cp; - for (cp = s; size != 0 && pgm_read_byte(cp) != '\0'; cp++, size--); - return (size_t)(cp - s); -} - -void* ICACHE_FLASH_ATTR memcpy_P(void* dest, const void* src, size_t count) { - const uint8_t* read = reinterpret_cast(src); - uint8_t* write = reinterpret_cast(dest); - - while (count) - { - *write++ = pgm_read_byte(read++); - count--; - } - - return dest; -} - -char* ICACHE_FLASH_ATTR strncpy_P(char* dest, const char* src, size_t size) { - const char* read = src; - char* write = dest; - char ch = '.'; - while (size > 0 && ch != '\0') - { - ch = pgm_read_byte(read++); - *write++ = ch; - size--; - } - - return dest; -} - -char* ICACHE_FLASH_ATTR strncat_P(char* dest, const char* src, size_t size) { - char* write = dest; - - while (*write != '\0') - { - write++; - } - - const char* read = src; - char ch = '.'; - - while (size > 0 && ch != '\0') - { - ch = pgm_read_byte(read++); - *write++ = ch; - - size--; - } - - if (ch != '\0') - { - *write = '\0'; - } - - return dest; -} - -int ICACHE_FLASH_ATTR strncmp_P(const char* str1, const char* str2P, size_t size) { - int result = 0; - - while (size > 0) - { - char ch1 = *str1++; - char ch2 = pgm_read_byte(str2P++); - result = ch1 - ch2; - if (result != 0 || ch2 == '\0') - { - break; - } - - size--; - } - - return result; -} - -int ICACHE_FLASH_ATTR strncasecmp_P(const char* str1, const char* str2P, size_t size) { - int result = 0; - - while (size > 0) - { - char ch1 = tolower(*str1++); - char ch2 = tolower(pgm_read_byte(str2P++)); - result = ch1 - ch2; - if (result != 0 || ch2 == '\0') - { - break; - } - - size--; - } - - return result; -} - -int ICACHE_FLASH_ATTR printf_P(const char* formatP, ...) { - int ret; - va_list arglist; - va_start(arglist, formatP); - - size_t fmtLen = strlen_P(formatP); - char* format = new char[fmtLen + 1]; - strcpy_P(format, formatP); - - ret = os_printf(format, arglist); - - delete [] format; - - va_end(arglist); - return ret; -} - -int ICACHE_FLASH_ATTR snprintf_P(char* str, size_t strSize, const char* formatP, ...) { - int ret; - va_list arglist; - va_start(arglist, formatP); - - ret = vsnprintf_P(str, strSize, formatP, arglist); - - va_end(arglist); - return ret; -} - -int ICACHE_FLASH_ATTR vsnprintf_P(char* str, size_t strSize, const char* formatP, va_list ap) { - int ret; - - size_t fmtLen = strlen_P(formatP); - char* format = new char[fmtLen + 1]; - strcpy_P(format, formatP); - - ret = ets_vsnprintf(str, strSize, format, ap); - - delete [] format; - - return ret; -} \ No newline at end of file diff --git a/sparkfun/esp8266/cores/esp8266/pgmspace.h b/sparkfun/esp8266/cores/esp8266/pgmspace.h deleted file mode 100644 index 695f2a50..00000000 --- a/sparkfun/esp8266/cores/esp8266/pgmspace.h +++ /dev/null @@ -1,93 +0,0 @@ -#ifndef __PGMSPACE_H_ -#define __PGMSPACE_H_ - -#ifdef __cplusplus -extern "C" { -#endif -#include -#include -#include "ets_sys.h" -#include "osapi.h" -#ifdef __cplusplus -} -#endif - -#define PROGMEM ICACHE_RODATA_ATTR -#define PGM_P const char * -#define PGM_VOID_P const void * -#define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];})) - - -#define _SFR_BYTE(n) (n) - -typedef void prog_void; -typedef char prog_char; -typedef unsigned char prog_uchar; -typedef int8_t prog_int8_t; -typedef uint8_t prog_uint8_t; -typedef int16_t prog_int16_t; -typedef uint16_t prog_uint16_t; -typedef int32_t prog_int32_t; -typedef uint32_t prog_uint32_t; - -#define SIZE_IRRELEVANT 0x7fffffff - -extern void* memcpy_P(void* dest, const void* src, size_t count); - -extern char* strncpy_P(char* dest, const char* src, size_t size); -#define strcpy_P(dest, src) strncpy_P((dest), (src), SIZE_IRRELEVANT) - -extern char* strncat_P(char* dest, const char* src, size_t size); -#define strcat_P(dest, src) strncat_P((dest), (src), SIZE_IRRELEVANT) - -extern int strncmp_P(const char* str1, const char* str2P, size_t size); -#define strcmp_P(str1, str2P) strncmp_P((str1), (str2P), SIZE_IRRELEVANT) - -extern int strncasecmp_P(const char* str1, const char* str2P, size_t size); -#define strcasecmp_P(str1, str2P) strncasecmp_P((str1), (str2P), SIZE_IRRELEVANT) - -extern size_t strnlen_P(const char *s, size_t size); -#define strlen_P(strP) strnlen_P((strP), SIZE_IRRELEVANT) - -extern int printf_P(const char *formatP, ...); -extern int snprintf_P(char *str, size_t strSize, const char *formatP, ...); -extern int vsnprintf_P(char *str, size_t strSize, const char *formatP, va_list ap); - -// flash memory must be read using 32 bit aligned addresses else a processor -// exception will be triggered -// order within the 32 bit values are -// -------------- -// b3, b2, b1, b0 -// w1, w0 - -#define pgm_read_byte(addr) \ -(__extension__({ \ - PGM_P __local = (PGM_P)(addr); /* isolate varible for macro expansion */ \ - ptrdiff_t __offset = ((uint32_t)__local & 0x00000003); /* byte aligned mask */ \ - const uint32_t* __addr32 = reinterpret_cast(reinterpret_cast(__local)-__offset); \ - uint8_t __result = ((*__addr32) >> (__offset * 8)); \ - __result; \ -})) - -#define pgm_read_word(addr) \ -(__extension__({ \ - PGM_P __local = (PGM_P)(addr); /* isolate varible for macro expansion */ \ - ptrdiff_t __offset = ((uint32_t)__local & 0x00000002); /* word aligned mask */ \ - const uint32_t* __addr32 = reinterpret_cast(reinterpret_cast(__local) - __offset); \ - uint16_t __result = ((*__addr32) >> (__offset * 8)); \ - __result; \ -})) - -#define pgm_read_dword(addr) (*reinterpret_cast(addr)) -#define pgm_read_float(addr) (*reinterpret_cast(addr)) - -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#define pgm_read_word_near(addr) pgm_read_word(addr) -#define pgm_read_dword_near(addr) pgm_read_dword(addr) -#define pgm_read_float_near(addr) pgm_read_float(addr) -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#define pgm_read_word_far(addr) pgm_read_word(addr) -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#define pgm_read_float_far(addr) pgm_read_float(addr) - -#endif //__PGMSPACE_H_ diff --git a/sparkfun/esp8266/cores/esp8266/sigma_delta.h b/sparkfun/esp8266/cores/esp8266/sigma_delta.h deleted file mode 100644 index 2e8bdc09..00000000 --- a/sparkfun/esp8266/cores/esp8266/sigma_delta.h +++ /dev/null @@ -1,32 +0,0 @@ -/* - sigma_delta.h - esp8266 sigma-delta source - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#ifndef SIGMA_DELTA_H -#define SIGMA_DELTA_H - -#include - -void sigma_delta_close(uint32_t gpio); -void set_sigma_target(uint8_t target); -void set_sigma_prescale(uint8_t prescale); -void set_sigma_duty_312KHz(uint8_t duty); - -#endif//SIGMA_DELTA_H diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/INTEGRATION b/sparkfun/esp8266/cores/esp8266/spiffs/INTEGRATION deleted file mode 100644 index 20ff70d0..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/INTEGRATION +++ /dev/null @@ -1,306 +0,0 @@ -* QUICK AND DIRTY INTEGRATION EXAMPLE - -So, assume you're running a Cortex-M3 board with a 2 MB SPI flash on it. The -SPI flash has 64kB blocks. Your project is built using gnumake, and now you -want to try things out. - -First, you simply copy the files in src/ to your own source folder. Exclude -all files in test folder. Then you point out these files in your make script -for compilation. - -Also copy the spiffs_config.h over from the src/default/ folder. - -Try building. This fails, nagging about inclusions and u32_t and whatnot. Open -the spiffs_config.h and delete the bad inclusions. Also, add following -typedefs: - - typedef signed int s32_t; - typedef unsigned int u32_t; - typedef signed short s16_t; - typedef unsigned short u16_t; - typedef signed char s8_t; - typedef unsigned char u8_t; - -Now it should build. Over to the mounting business. Assume you already -implemented the read, write and erase functions to your SPI flash: - - void my_spi_read(int addr, int size, char *buf) - void my_spi_write(int addr, int size, char *buf) - void my_spi_erase(int addr, int size) - -In your main.c or similar, include the spiffs.h and do that spiffs struct: - - #include - - static spiffs fs; - -Also, toss up some of the needed buffers: - - #define LOG_PAGE_SIZE 256 - - static u8_t spiffs_work_buf[LOG_PAGE_SIZE*2]; - static u8_t spiffs_fds[32*4]; - static u8_t spiffs_cache_buf[(LOG_PAGE_SIZE+32)*4]; - -Now, write the my_spiffs_mount function: - - void my_spiffs_mount() { - spiffs_config cfg; - cfg.phys_size = 2*1024*1024; // use all spi flash - cfg.phys_addr = 0; // start spiffs at start of spi flash - cfg.phys_erase_block = 65536; // according to datasheet - cfg.log_block_size = 65536; // let us not complicate things - cfg.log_page_size = LOG_PAGE_SIZE; // as we said - - cfg.hal_read_f = my_spi_read; - cfg.hal_write_f = my_spi_write; - cfg.hal_erase_f = my_spi_erase; - - int res = SPIFFS_mount(&fs, - &cfg, - spiffs_work_buf, - spiffs_fds, - sizeof(spiffs_fds), - spiffs_cache_buf, - sizeof(spiffs_cache_buf), - 0); - printf("mount res: %i\n", res); - } - -Now, build warns about the my_spi_read, write and erase functions. Wrong -signatures, so go wrap them: - - static s32_t my_spiffs_read(u32_t addr, u32_t size, u8_t *dst) { - my_spi_read(addr, size, dst); - return SPIFFS_OK; - } - - static s32_t my_spiffs_write(u32_t addr, u32_t size, u8_t *src) { - my_spi_write(addr, size, dst); - return SPIFFS_OK; - } - - static s32_t my_spiffs_erase(u32_t addr, u32_t size) { - my_spi_erase(addr, size); - return SPIFFS_OK; - } - -Redirect the config in my_spiffs_mount to the wrappers instead: - - cfg.hal_read_f = my_spiffs_read; - cfg.hal_write_f = my_spiffs_write; - cfg.hal_erase_f = my_spiffs_erase; - -Ok, now you should be able to build and run. However, you get this output: - - mount res: -1 - -but you wanted - - mount res: 0 - -This is probably due to you having experimented with your SPI flash, so it -contains rubbish from spiffs's point of view. Do a mass erase and run again. - -If all is ok now, you're good to go. Try creating a file and read it back: - - static void test_spiffs() { - char buf[12]; - - // Surely, I've mounted spiffs before entering here - - spiffs_file fd = SPIFFS_open(&fs, "my_file", SPIFFS_CREAT | SPIFFS_TRUNC | SPIFFS_RDWR, 0); - if (SPIFFS_write(&fs, fd, (u8_t *)"Hello world", 12) < 0) printf("errno %i\n", SPIFFS_errno(&fs)); - SPIFFS_close(&fs, fd); - - fd = SPIFFS_open(&fs, "my_file", SPIFFS_RDWR, 0); - if (SPIFFS_read(&fs, fd, (u8_t *)buf, 12) < 0) printf("errno %i\n", SPIFFS_errno(&fs)); - SPIFFS_close(&fs, fd); - - printf("--> %s <--\n", buf); - } - -Compile, run, cross fingers hard, and you'll get the output: - - --> Hello world <-- - -Got errors? Check spiffs.h for error definitions to get a clue what went voodoo. - - -* THINGS TO CHECK - -When you alter the spiffs_config values, make sure you also check the typedefs -in spiffs_config.h: - - - spiffs_block_ix - - spiffs_page_ix - - spiffs_obj_id - - spiffs_span_ix - -The sizes of these typedefs must not underflow, else spiffs might end up in -eternal loops. Each typedef is commented what check for. - -Also, if you alter the code or just want to verify your configuration, you can -run - - > make test - -in the spiffs folder. This will run all testcases using the configuration in -default/spiffs_config.h and test/params_test.h. The tests are written for linux -but should run under cygwin also. - - -* INTEGRATING SPIFFS - -In order to integrate spiffs to your embedded target, you will basically need: - - A SPI flash device which your processor can communicate with - - An implementation for reading, writing and erasing the flash - - Memory (flash or ram) for the code - - Memory (ram) for the stack - -Other stuff may be needed, threaded systems might need mutexes and so on. - -** Logical structure - -First and foremost, one must decide how to divide up the SPI flash for spiffs. -Having the datasheet for the actual SPI flash in hand will help. Spiffs can be -defined to use all or only parts of the SPI flash. - -If following seems arcane, read the "HOW TO CONFIG" chapter first. - - - Decide the logical size of blocks. This must be a multiple of the biggest - physical SPI flash block size. To go safe, use the physical block size - - which in many cases is 65536 bytes. - - Decide the logical size of pages. This must be a 2nd logarithm part of the - logical block size. To go safe, use 256 bytes to start with. - - Decide how much of the SPI flash memory to be used for spiffs. This must be - on logical block boundary. If unsafe, use 1 megabyte to start with. - - Decide where on the SPI flash memory the spiffs area should start. This must - be on physical block/sector boundary. If unsafe, use address 0. - -** SPI flash API - -The target must provide three functions to spiffs: - - - s32_t (*spiffs_read)(u32_t addr, u32_t size, u8_t *dst) - - s32_t (*spiffs_write)(u32_t addr, u32_t size, u8_t *src) - - s32_t (*spiffs_erase)(u32_t addr, u32_t size) - -These functions define the only communication between the SPI flash and the -spiffs stack. - -On success these must return 0 (or SPIFFS_OK). Anything else will be considered -an error. - -The size for read and write requests will never exceed the logical page size, -but it may be less. - -The address and size on erase requests will always be on physical block size -boundaries. - -** Mount specification - -In spiffs.h, there is a SPIFFS_mount function defined, used to mount spiffs on -the SPI flash. - -s32_t SPIFFS_mount( - spiffs *fs, - spiffs_config *config, - u8_t *work, - u8_t *fd_space, - u32_t fd_space_size, - void *cache, - u32_t cache_size, - spiffs_check_callback check_cb_f) - - - fs Points to a spiffs struct. This may be totally uninitialized. - - config Points to a spiffs_config struct. This struct must be - initialized when mounting. See below. - - work A ram memory buffer being double the size of the logical page - size. This buffer is used excessively by the spiffs stack. If - logical page size is 256, this buffer must be 512 bytes. - - fd_space A ram memory buffer used for file descriptors. - - fd_space_size The size of the file descriptor buffer. A file descriptor - normally is around 32 bytes depending on the build config - - the bigger the buffer, the more file descriptors are - available. - - cache A ram memory buffer used for cache. Ignored if cache is - disabled in build config. - - cache_size The size of the cache buffer. Ignored if cache is disabled in - build config. One cache page will be slightly larger than the - logical page size. The more ram, the more cache pages, the - quicker the system. - - check_cb_f Callback function for monitoring spiffs consistency checks and - mending operations. May be null. - -The config struct must be initialized prior to mounting. One must always -define the SPI flash access functions: - - spiffs_config.hal_read_f - pointing to the function reading the SPI flash - - spiffs_config.hal_write_f - pointing to the function writing the SPI flash - - spiffs_config.hal_erase_f - pointing to the function erasing the SPI flash - -Depending on the build config - if SPIFFS_SINGLETON is set to zero - following -parameters must be defined: - - spiffs_config.phys_size - the physical number of bytes accounted for - spiffs on the SPI flash - - spiffs_config.phys_addr - the physical starting address on the SPI flash - - spiffs_config.phys_erase_block - the physical size of the largest block/sector - on the SPI flash found within the spiffs - usage address space - - spiffs_config.log_block_size - the logical size of a spiffs block - - spiffs_config.log_page_size - the logical size of a spiffs page - -If SPIFFS_SINGLETON is set to one, above parameters must be set ny defines in -the config header file, spiffs_config.h. - - -** Build config - -makefile: The files needed to be compiled to your target resides in files.mk to -be included in your makefile, either by cut and paste or by inclusion. - -Types: spiffs uses the types u8_t, s8_t, u16_t, s16_t, u32_t, s32_t; these must -be typedeffed. - -spiffs_config.h: you also need to define a spiffs_config.h header. Example of -this is found in the default/ directory. - - -** RAM - -Spiffs needs ram. It needs a working buffer being double the size of the -logical page size. It also needs at least one file descriptor. If cache is -enabled (highly recommended), it will also need a bunch of cache pages. - -Say you have a logical page size of 256 bytes. You want to be able to have four -files open simultaneously, and you can give spiffs four cache pages. This -roughly sums up to: - -256*2 (work buffer) + -32*4 (file descriptors) + -(256+32)*4 (cache pages) + 40 (cache metadata) - -i.e. 1832 bytes. - -This is apart from call stack usage. - -To get the exact amount of bytes needed on your specific target, enable -SPIFFS_BUFFER_HELP in spiffs_config.h, rebuild and call: - - SPIFFS_buffer_bytes_for_filedescs - SPIFFS_buffer_bytes_for_cache - -Having these figures you can disable SPIFFS_BUFFER_HELP again to save flash. - - -* HOW TO CONFIG - -TODO diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/LICENSE b/sparkfun/esp8266/cores/esp8266/spiffs/LICENSE deleted file mode 100644 index e9b0c677..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015 Peter Andersson (pelleplutt1976gmail.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/README b/sparkfun/esp8266/cores/esp8266/spiffs/README deleted file mode 100644 index 6efd656c..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/README +++ /dev/null @@ -1,86 +0,0 @@ -SPIFFS (SPI Flash File System) -V0.3.0 - -Copyright (c) 2013-2015 Peter Andersson (pelleplutt1976gmail.com) - -For legal stuff, see LICENCE in this directory. Basically, you may do whatever -you want with the source. Use, modify, sell, print it out, roll it and smoke it - - as long as I won't be held responsible. - -Love to hear feedback though! - - -* INTRODUCTION - -Spiffs is a file system intended for SPI NOR flash devices on embedded targets. - -Spiffs is designed with following characteristics in mind: - - Small (embedded) targets, sparse RAM without heap - - Only big areas of data (blocks) can be erased - - An erase will reset all bits in block to ones - - Writing pulls one to zeroes - - Zeroes can only be pulled to ones by erase - - Wear leveling - - -* FEATURES - -What spiffs does: - - Specifically designed for low ram usage - - Uses statically sized ram buffers, independent of number of files - - Posix-like api: open, close, read, write, seek, stat, etc - - It can be run on any NOR flash, not only SPI flash - theoretically also on - embedded flash of an microprocessor - - Multiple spiffs configurations can be run on same target - and even on same - SPI flash device - - Implements static wear leveling - - Built in file system consistency checks - -What spiffs does not: - - Presently, spiffs does not support directories. It produces a flat - structure. Creating a file with path "tmp/myfile.txt" will create a file - called "tmp/myfile.txt" instead of a "myfile.txt" under directory "tmp". - - It is not a realtime stack. One write operation might take much longer than - another. - - Poor scalability. Spiffs is intended for small memory devices - the normal - sizes for SPI flashes. Going beyond ~128MB is probably a bad idea. This is - a side effect of the design goal to use as little ram as possible. - - Presently, it does not detect or handle bad blocks. - - -* MORE INFO - -For integration, see the docs/INTEGRATION file. - -For use and design, see the docs/TECH_SPEC file. - -For testing and contributions, see the docs/IMPLEMENTING file. - -* HISTORY - -0.3.0 - Added existing namecheck when creating files - Lots of static analysis bugs #6 - Added rename func - Fix SPIFFS_read length when reading beyond file size - Added reading beyond file length testcase - Made build a bit more configurable - Changed name in spiffs from "errno" to "err_code" due to conflicts compiling - in mingw - Improved GC checks, fixed an append bug, more robust truncate for very special - case - GC checks preempts GC, truncate even less picky - Struct alignment needed for some targets, define in spiffs config #10 - Spiffs filesystem magic, definable in config - - New config defines: - SPIFFS_USE_MAGIC - enable or disable magic check upon mount - SPIFFS_ALIGNED_OBJECT_INDEX_TABLES - alignment for certain targets - New API functions: - SPIFFS_rename - rename files - SPIFFS_clearerr - clears last errno - SPIFFS_info - returns info on used and total bytes in fs - SPIFFS_format - formats the filesystem - SPIFFS_mounted - checks if filesystem is mounted - - diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/TECH_SPEC b/sparkfun/esp8266/cores/esp8266/spiffs/TECH_SPEC deleted file mode 100644 index b4755a6d..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/TECH_SPEC +++ /dev/null @@ -1,239 +0,0 @@ -* USING SPIFFS - -TODO - - -* SPIFFS DESIGN - -Spiffs is inspired by YAFFS. However, YAFFS is designed for NAND flashes, and -for bigger targets with much more ram. Nevertheless, many wise thoughts have -been borrowed from YAFFS when writing spiffs. Kudos! - -The main complication writing spiffs was that it cannot be assumed the target -has a heap. Spiffs must go along only with the work ram buffer given to it. -This forces extra implementation on many areas of spiffs. - - -** SPI flash devices using NOR technology - -Below is a small description of how SPI flashes work internally. This is to -give an understanding of the design choices made in spiffs. - -SPI flash devices are physically divided in blocks. On some SPI flash devices, -blocks are further divided into sectors. Datasheets sometimes name blocks as -sectors and vice versa. - -Common memory capacaties for SPI flashes are 512kB up to 8MB of data, where -blocks may be 64kB. Sectors can be e.g. 4kB, if supported. Many SPI flashes -have uniform block sizes, whereas others have non-uniform - the latter meaning -that e.g. the first 16 blocks are 4kB big, and the rest are 64kB. - -The entire memory is linear and can be read and written in random access. -Erasing can only be done block- or sectorwise; or by mass erase. - -SPI flashes can normally be erased from 100.000 up to 1.000.000 cycles before -they fail. - -A clean SPI flash from factory have all bits in entire memory set to one. A -mass erase will reset the device to this state. Block or sector erasing will -put the all bits in the area given by the sector or block to ones. Writing to a -NOR flash pulls ones to zeroes. Writing 0xFF to an address is simply a no-op. - -Writing 0b10101010 to a flash address holding 0b00001111 will yield 0b00001010. - -This way of "write by nand" is used considerably in spiffs. - -Common characteristics of NOR flashes are quick reads, but slow writes. - -And finally, unlike NAND flashes, NOR flashes seem to not need any error -correction. They always write correctly I gather. - - -** Spiffs logical structure - -Some terminology before proceeding. Physical blocks/sectors means sizes stated -in the datasheet. Logical blocks and pages is something the integrator choose. - - -** Blocks and pages - -Spiffs is allocated to a part or all of the memory of the SPI flash device. -This area is divided into logical blocks, which in turn are divided into -logical pages. The boundary of a logical block must coincide with one or more -physical blocks. The sizes for logical blocks and logical pages always remain -the same, they are uniform. - -Example: non-uniform flash mapped to spiffs with 128kB logical blocks - -PHYSICAL FLASH BLOCKS SPIFFS LOGICAL BLOCKS: 128kB - -+-----------------------+ - - - +-----------------------+ -| Block 1 : 16kB | | Block 1 : 128kB | -+-----------------------+ | | -| Block 2 : 16kB | | | -+-----------------------+ | | -| Block 3 : 16kB | | | -+-----------------------+ | | -| Block 4 : 16kB | | | -+-----------------------+ | | -| Block 5 : 64kB | | | -+-----------------------+ - - - +-----------------------+ -| Block 6 : 64kB | | Block 2 : 128kB | -+-----------------------+ | | -| Block 7 : 64kB | | | -+-----------------------+ - - - +-----------------------+ -| Block 8 : 64kB | | Block 3 : 128kB | -+-----------------------+ | | -| Block 9 : 64kB | | | -+-----------------------+ - - - +-----------------------+ -| ... | | ... | - -A logical block is divided further into a number of logical pages. A page -defines the smallest data holding element known to spiffs. Hence, if a file -is created being one byte big, it will occupy one page for index and one page -for data - it will occupy 2 x size of a logical page on flash. -So it seems it is good to select a small page size. - -Each page has a metadata header being normally 5 to 9 bytes. This said, a very -small page size will make metadata occupy a lot of the memory on the flash. A -page size of 64 bytes will waste 8-14% on metadata, while 256 bytes 2-4%. -So it seems it is good to select a big page size. - -Also, spiffs uses a ram buffer being two times the page size. This ram buffer -is used for loading and manipulating pages, but it is also used for algorithms -to find free file ids, scanning the file system, etc. Having too small a page -size means less work buffer for spiffs, ending up in more reads operations and -eventually gives a slower file system. - -Choosing the page size for the system involves many factors: - - How big is the logical block size - - What is the normal size of most files - - How much ram can be spent - - How much data (vs metadata) must be crammed into the file system - - How fast must spiffs be - - Other things impossible to find out - -So, chosing the Optimal Page Size (tm) seems tricky, to say the least. Don't -fret - there is no optimal page size. This varies from how the target will use -spiffs. Use the golden rule: - - ~~~ Logical Page Size = Logical Block Size / 256 ~~~ - -This is a good starting point. The final page size can then be derived through -heuristical experimenting for us non-analytical minds. - - -** Objects, indices and look-ups - -A file, or an object as called in spiffs, is identified by an object id. -Another YAFFS rip-off. This object id is a part of the page header. So, all -pages know to which object/file they belong - not counting the free pages. - -An object is made up of two types of pages: object index pages and data pages. -Data pages contain the data written by user. Index pages contain metadata about -the object, more specifically what data pages are part of the object. - -The page header also includes something called a span index. Let's say a file -is written covering three data pages. The first data page will then have span -index 0, the second span index 1, and the last data page will have span index -2. Simple as that. - -Finally, each page header contain flags, telling if the page is used, -deleted, finalized, holds index or data, and more. - -Object indices also have span indices, where an object index with span index 0 -is referred to as the object index header. This page does not only contain -references to data pages, but also extra info such as object name, object size -in bytes, flags for file or directory, etc. - -If one were to create a file covering three data pages, named e.g. -"spandex-joke.txt", given object id 12, it could look like this: - -PAGE 0 - -PAGE 1 page header: [obj_id:12 span_ix:0 flags:USED|DATA] - - -PAGE 2 page header: [obj_id:12 span_ix:1 flags:USED|DATA] - - -PAGE 3 page header: [obj_id:545 span_ix:13 flags:USED|DATA] - - -PAGE 4 page header: [obj_id:12 span_ix:2 flags:USED|DATA] - - -PAGE 5 page header: [obj_id:12 span_ix:0 flags:USED|INDEX] - obj ix header: [name:spandex-joke.txt size:600 bytes flags:FILE] - obj ix: [1 2 4] - -Looking in detail at page 5, the object index header page, the object index -array refers to each data page in order, as mentioned before. The index of the -object index array correlates with the data page span index. - - entry ix: 0 1 2 - obj ix: [1 2 4] - | | | - PAGE 1, DATA, SPAN_IX 0 --------/ | | - PAGE 2, DATA, SPAN_IX 1 --------/ | - PAGE 4, DATA, SPAN_IX 2 --------/ - -Things to be unveiled in page 0 - well.. Spiffs is designed for systems low on -ram. We cannot keep a dynamic list on the whereabouts of each object index -header so we can find a file fast. There might not even be a heap! But, we do -not want to scan all page headers on the flash to find the object index header. - -The first page(s) of each block contains the so called object look-up. These -are not normal pages, they do not have a header. Instead, they are arrays -pointing out what object-id the rest of all pages in the block belongs to. - -By this look-up, only the first page(s) in each block must to scanned to find -the actual page which contains the object index header of the desired object. - -The object lookup is redundant metadata. The assumption is that it presents -less overhead reading a full page of data to memory from each block and search -that, instead of reading a small amount of data from each page (i.e. the page -header) in all blocks. Each read operation from SPI flash normally contains -extra data as the read command itself and the flash address. Also, depending on -the underlying implementation, other criterions may need to be passed for each -read transaction, like mutexes and such. - -The veiled example unveiled would look like this, with some extra pages: - -PAGE 0 [ 12 12 545 12 12 34 34 4 0 0 0 0 ...] -PAGE 1 page header: [obj_id:12 span_ix:0 flags:USED|DATA] ... -PAGE 2 page header: [obj_id:12 span_ix:1 flags:USED|DATA] ... -PAGE 3 page header: [obj_id:545 span_ix:13 flags:USED|DATA] ... -PAGE 4 page header: [obj_id:12 span_ix:2 flags:USED|DATA] ... -PAGE 5 page header: [obj_id:12 span_ix:0 flags:USED|INDEX] ... -PAGE 6 page header: [obj_id:34 span_ix:0 flags:USED|DATA] ... -PAGE 7 page header: [obj_id:34 span_ix:1 flags:USED|DATA] ... -PAGE 8 page header: [obj_id:4 span_ix:1 flags:USED|INDEX] ... -PAGE 9 page header: [obj_id:23 span_ix:0 flags:DELETED|INDEX] ... -PAGE 10 page header: [obj_id:23 span_ix:0 flags:DELETED|DATA] ... -PAGE 11 page header: [obj_id:23 span_ix:1 flags:DELETED|DATA] ... -PAGE 12 page header: [obj_id:23 span_ix:2 flags:DELETED|DATA] ... -... - -Ok, so why are page 9 to 12 marked as 0 when they belong to object id 23? These -pages are deleted, so this is marked both in page header flags and in the look -up. This is an example where spiffs uses NOR flashes "nand-way" of writing. - -As a matter of fact, there are two object id's which are special: - -obj id 0 (all bits zeroes) - indicates a deleted page in object look up -obj id 0xff.. (all bits ones) - indicates a free page in object look up - -Actually, the object id's have another quirk: if the most significant bit is -set, this indicates an object index page. If the most significant bit is zero, -this indicates a data page. So to be fully correct, page 0 in above example -would look like this: - -PAGE 0 [ 12 12 545 12 *12 34 34 *4 0 0 0 0 ...] - -where the asterisk means the msb of the object id is set. - -This is another way to speed up the searches when looking for object indices. -By looking on the object id's msb in the object lookup, it is also possible -to find out whether the page is an object index page or a data page. - diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/TODO b/sparkfun/esp8266/cores/esp8266/spiffs/TODO deleted file mode 100644 index c947316a..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/TODO +++ /dev/null @@ -1,15 +0,0 @@ -* When mending lost pages, also see if they fit into length specified in object index header - -SPIFFS2 thoughts - -* Instead of exact object id:s in the object lookup tables, use a hash of span index and object id. - Eg. object id xor:ed with bit-reversed span index. - This should decrease number of actual pages that needs to be visited when looking thru the obj lut. - -* Logical number of each block. When moving stuff in a garbage collected page, the free - page is assigned the same number as the garbage collected. Thus, object index pages do not have to - be rewritten. - -* Steal one page, use as a bit parity page. When starting an fs modification operation, write one bit - as zero. When ending, write another bit as zero. On mount, if number of zeroes in page is uneven, a - check is automatically run. \ No newline at end of file diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs.h b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs.h deleted file mode 100644 index 7df7ae04..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs.h +++ /dev/null @@ -1,520 +0,0 @@ -/* - * spiffs.h - * - * Created on: May 26, 2013 - * Author: petera - */ - - - -#ifndef SPIFFS_H_ -#define SPIFFS_H_ -#ifdef __cplusplus -extern "C" { -#endif - -#include "spiffs_config.h" - -#define SPIFFS_OK 0 -#define SPIFFS_ERR_NOT_MOUNTED -10000 -#define SPIFFS_ERR_FULL -10001 -#define SPIFFS_ERR_NOT_FOUND -10002 -#define SPIFFS_ERR_END_OF_OBJECT -10003 -#define SPIFFS_ERR_DELETED -10004 -#define SPIFFS_ERR_NOT_FINALIZED -10005 -#define SPIFFS_ERR_NOT_INDEX -10006 -#define SPIFFS_ERR_OUT_OF_FILE_DESCS -10007 -#define SPIFFS_ERR_FILE_CLOSED -10008 -#define SPIFFS_ERR_FILE_DELETED -10009 -#define SPIFFS_ERR_BAD_DESCRIPTOR -10010 -#define SPIFFS_ERR_IS_INDEX -10011 -#define SPIFFS_ERR_IS_FREE -10012 -#define SPIFFS_ERR_INDEX_SPAN_MISMATCH -10013 -#define SPIFFS_ERR_DATA_SPAN_MISMATCH -10014 -#define SPIFFS_ERR_INDEX_REF_FREE -10015 -#define SPIFFS_ERR_INDEX_REF_LU -10016 -#define SPIFFS_ERR_INDEX_REF_INVALID -10017 -#define SPIFFS_ERR_INDEX_FREE -10018 -#define SPIFFS_ERR_INDEX_LU -10019 -#define SPIFFS_ERR_INDEX_INVALID -10020 -#define SPIFFS_ERR_NOT_WRITABLE -10021 -#define SPIFFS_ERR_NOT_READABLE -10022 -#define SPIFFS_ERR_CONFLICTING_NAME -10023 -#define SPIFFS_ERR_NOT_CONFIGURED -10024 - -#define SPIFFS_ERR_NOT_A_FS -10025 -#define SPIFFS_ERR_MOUNTED -10026 -#define SPIFFS_ERR_ERASE_FAIL -10027 -#define SPIFFS_ERR_MAGIC_NOT_POSSIBLE -10028 - - -#define SPIFFS_ERR_INTERNAL -10050 - -#define SPIFFS_ERR_TEST -10100 - - -// spiffs file descriptor index type. must be signed -typedef s16_t spiffs_file; -// spiffs file descriptor flags -typedef u16_t spiffs_flags; -// spiffs file mode -typedef u16_t spiffs_mode; -// object type -typedef u8_t spiffs_obj_type; - -/* spi read call function type */ -typedef s32_t (*spiffs_read)(u32_t addr, u32_t size, u8_t *dst); -/* spi write call function type */ -typedef s32_t (*spiffs_write)(u32_t addr, u32_t size, u8_t *src); -/* spi erase call function type */ -typedef s32_t (*spiffs_erase)(u32_t addr, u32_t size); - -/* file system check callback report operation */ -typedef enum { - SPIFFS_CHECK_LOOKUP = 0, - SPIFFS_CHECK_INDEX, - SPIFFS_CHECK_PAGE -} spiffs_check_type; - -/* file system check callback report type */ -typedef enum { - SPIFFS_CHECK_PROGRESS = 0, - SPIFFS_CHECK_ERROR, - SPIFFS_CHECK_FIX_INDEX, - SPIFFS_CHECK_FIX_LOOKUP, - SPIFFS_CHECK_DELETE_ORPHANED_INDEX, - SPIFFS_CHECK_DELETE_PAGE, - SPIFFS_CHECK_DELETE_BAD_FILE, -} spiffs_check_report; - -/* file system check callback function */ -typedef void (*spiffs_check_callback)(spiffs_check_type type, spiffs_check_report report, - u32_t arg1, u32_t arg2); - -#ifndef SPIFFS_DBG -#define SPIFFS_DBG(...) \ - print(__VA_ARGS__) -#endif -#ifndef SPIFFS_GC_DBG -#define SPIFFS_GC_DBG(...) c_printf(__VA_ARGS__) -#endif -#ifndef SPIFFS_CACHE_DBG -#define SPIFFS_CACHE_DBG(...) c_printf(__VA_ARGS__) -#endif -#ifndef SPIFFS_CHECK_DBG -#define SPIFFS_CHECK_DBG(...) c_printf(__VA_ARGS__) -#endif - -/* Any write to the filehandle is appended to end of the file */ -#define SPIFFS_APPEND (1<<0) -/* If the opened file exists, it will be truncated to zero length before opened */ -#define SPIFFS_TRUNC (1<<1) -/* If the opened file does not exist, it will be created before opened */ -#define SPIFFS_CREAT (1<<2) -/* The opened file may only be read */ -#define SPIFFS_RDONLY (1<<3) -/* The opened file may only be writted */ -#define SPIFFS_WRONLY (1<<4) -/* The opened file may be both read and writted */ -#define SPIFFS_RDWR (SPIFFS_RDONLY | SPIFFS_WRONLY) -/* Any writes to the filehandle will never be cached */ -#define SPIFFS_DIRECT (1<<5) - -#define SPIFFS_SEEK_SET (0) -#define SPIFFS_SEEK_CUR (1) -#define SPIFFS_SEEK_END (2) - -#define SPIFFS_TYPE_FILE (1) -#define SPIFFS_TYPE_DIR (2) -#define SPIFFS_TYPE_HARD_LINK (3) -#define SPIFFS_TYPE_SOFT_LINK (4) - -#ifndef SPIFFS_LOCK -#define SPIFFS_LOCK(fs) -#endif - -#ifndef SPIFFS_UNLOCK -#define SPIFFS_UNLOCK(fs) -#endif - -// phys structs - -// spiffs spi configuration struct -typedef struct { - // physical read function - spiffs_read hal_read_f; - // physical write function - spiffs_write hal_write_f; - // physical erase function - spiffs_erase hal_erase_f; -#if SPIFFS_SINGLETON == 0 - // physical size of the spi flash - u32_t phys_size; - // physical offset in spi flash used for spiffs, - // must be on block boundary - u32_t phys_addr; - // physical size when erasing a block - u32_t phys_erase_block; - - // logical size of a block, must be on physical - // block size boundary and must never be less than - // a physical block - u32_t log_block_size; - // logical size of a page, must be at least - // log_block_size / 8 - u32_t log_page_size; -#endif -} spiffs_config; - -typedef struct { - // file system configuration - spiffs_config cfg; - // number of logical blocks - u32_t block_count; - - // cursor for free blocks, block index - spiffs_block_ix free_cursor_block_ix; - // cursor for free blocks, entry index - int free_cursor_obj_lu_entry; - // cursor when searching, block index - spiffs_block_ix cursor_block_ix; - // cursor when searching, entry index - int cursor_obj_lu_entry; - - // primary work buffer, size of a logical page - u8_t *lu_work; - // secondary work buffer, size of a logical page - u8_t *work; - // file descriptor memory area - u8_t *fd_space; - // available file descriptors - u32_t fd_count; - - // last error - s32_t err_code; - - // current number of free blocks - u32_t free_blocks; - // current number of busy pages - u32_t stats_p_allocated; - // current number of deleted pages - u32_t stats_p_deleted; - // flag indicating that garbage collector is cleaning - u8_t cleaning; - // max erase count amongst all blocks - spiffs_obj_id max_erase_count; - -#if SPIFFS_GC_STATS - u32_t stats_gc_runs; -#endif - -#if SPIFFS_CACHE - // cache memory - void *cache; - // cache size - u32_t cache_size; -#if SPIFFS_CACHE_STATS - u32_t cache_hits; - u32_t cache_misses; -#endif -#endif - - // check callback function - spiffs_check_callback check_cb_f; - - // mounted flag - u8_t mounted; - // config magic - u32_t config_magic; -} spiffs; - -/* spiffs file status struct */ -typedef struct { - spiffs_obj_id obj_id; - u32_t size; - spiffs_obj_type type; - u8_t name[SPIFFS_OBJ_NAME_LEN]; -} spiffs_stat; - -struct spiffs_dirent { - spiffs_obj_id obj_id; - u8_t name[SPIFFS_OBJ_NAME_LEN]; - spiffs_obj_type type; - u32_t size; - spiffs_page_ix pix; -}; - -typedef struct { - spiffs *fs; - spiffs_block_ix block; - int entry; -} spiffs_DIR; - -// functions - -/** - * Initializes the file system dynamic parameters and mounts the filesystem. - * If SPIFFS_USE_MAGIC is enabled the mounting may fail with SPIFFS_ERR_NOT_A_FS - * if the flash does not contain a recognizable file system. - * In this case, SPIFFS_format must be called prior to remounting. - * @param fs the file system struct - * @param config the physical and logical configuration of the file system - * @param work a memory work buffer comprising 2*config->log_page_size - * bytes used throughout all file system operations - * @param fd_space memory for file descriptors - * @param fd_space_size memory size of file descriptors - * @param cache memory for cache, may be null - * @param cache_size memory size of cache - * @param check_cb_f callback function for reporting during consistency checks - */ -s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work, - u8_t *fd_space, u32_t fd_space_size, - void *cache, u32_t cache_size, - spiffs_check_callback check_cb_f); - -/** - * Unmounts the file system. All file handles will be flushed of any - * cached writes and closed. - * @param fs the file system struct - */ -void SPIFFS_unmount(spiffs *fs); - -/** - * Creates a new file. - * @param fs the file system struct - * @param path the path of the new file - * @param mode ignored, for posix compliance - */ -s32_t SPIFFS_creat(spiffs *fs, char *path, spiffs_mode mode); - -/** - * Opens/creates a file. - * @param fs the file system struct - * @param path the path of the new file - * @param flags the flags for the open command, can be combinations of - * SPIFFS_APPEND, SPIFFS_TRUNC, SPIFFS_CREAT, SPIFFS_RD_ONLY, - * SPIFFS_WR_ONLY, SPIFFS_RDWR, SPIFFS_DIRECT - * @param mode ignored, for posix compliance - */ -spiffs_file SPIFFS_open(spiffs *fs, char *path, spiffs_flags flags, spiffs_mode mode); - - -/** - * Opens a file by given dir entry. - * Optimization purposes, when traversing a file system with SPIFFS_readdir - * a normal SPIFFS_open would need to traverse the filesystem again to find - * the file, whilst SPIFFS_open_by_dirent already knows where the file resides. - * @param fs the file system struct - * @param path the dir entry to the file - * @param flags the flags for the open command, can be combinations of - * SPIFFS_APPEND, SPIFFS_TRUNC, SPIFFS_CREAT, SPIFFS_RD_ONLY, - * SPIFFS_WR_ONLY, SPIFFS_RDWR, SPIFFS_DIRECT. - * SPIFFS_CREAT will have no effect in this case. - * @param mode ignored, for posix compliance - */ -spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_flags flags, spiffs_mode mode); - -/** - * Reads from given filehandle. - * @param fs the file system struct - * @param fh the filehandle - * @param buf where to put read data - * @param len how much to read - * @returns number of bytes read, or -1 if error - */ -s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len); - -/** - * Writes to given filehandle. - * @param fs the file system struct - * @param fh the filehandle - * @param buf the data to write - * @param len how much to write - * @returns number of bytes written, or -1 if error - */ -s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len); - -/** - * Moves the read/write file offset - * @param fs the file system struct - * @param fh the filehandle - * @param offs how much/where to move the offset - * @param whence if SPIFFS_SEEK_SET, the file offset shall be set to offset bytes - * if SPIFFS_SEEK_CUR, the file offset shall be set to its current location plus offset - * if SPIFFS_SEEK_END, the file offset shall be set to the size of the file plus offset - */ -s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence); - -/** - * Removes a file by path - * @param fs the file system struct - * @param path the path of the file to remove - */ -s32_t SPIFFS_remove(spiffs *fs, char *path); - -/** - * Removes a file by filehandle - * @param fs the file system struct - * @param fh the filehandle of the file to remove - */ -s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh); - -/** - * Gets file status by path - * @param fs the file system struct - * @param path the path of the file to stat - * @param s the stat struct to populate - */ -s32_t SPIFFS_stat(spiffs *fs, char *path, spiffs_stat *s); - -/** - * Gets file status by filehandle - * @param fs the file system struct - * @param fh the filehandle of the file to stat - * @param s the stat struct to populate - */ -s32_t SPIFFS_fstat(spiffs *fs, spiffs_file fh, spiffs_stat *s); - -/** - * Flushes all pending write operations from cache for given file - * @param fs the file system struct - * @param fh the filehandle of the file to flush - */ -s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh); - -/** - * Closes a filehandle. If there are pending write operations, these are finalized before closing. - * @param fs the file system struct - * @param fh the filehandle of the file to close - */ -void SPIFFS_close(spiffs *fs, spiffs_file fh); - -/** - * Renames a file - * @param fs the file system struct - * @param old path of file to rename - * @param newPath new path of file - */ -s32_t SPIFFS_rename(spiffs *fs, char *old, char *newPath); - -/** - * Returns last error of last file operation. - * @param fs the file system struct - */ -s32_t SPIFFS_errno(spiffs *fs); - -/** - * Clears last error. - * @param fs the file system struct - */ -void SPIFFS_clearerr(spiffs *fs); - -/** - * Opens a directory stream corresponding to the given name. - * The stream is positioned at the first entry in the directory. - * On hydrogen builds the name argument is ignored as hydrogen builds always correspond - * to a flat file structure - no directories. - * @param fs the file system struct - * @param name the name of the directory - * @param d pointer the directory stream to be populated - */ -spiffs_DIR *SPIFFS_opendir(spiffs *fs, char *name, spiffs_DIR *d); - -/** - * Closes a directory stream - * @param d the directory stream to close - */ -s32_t SPIFFS_closedir(spiffs_DIR *d); - -/** - * Reads a directory into given spifs_dirent struct. - * @param d pointer to the directory stream - * @param e the dirent struct to be populated - * @returns null if error or end of stream, else given dirent is returned - */ -struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e); - -/** - * Runs a consistency check on given filesystem. - * @param fs the file system struct - */ -s32_t SPIFFS_check(spiffs *fs); - - -/** - * Returns number of total bytes available and number of used bytes. - * This is an estimation, and depends on if there a many files with little - * data or few files with much data. - * NB: If used number of bytes exceeds total bytes, a SPIFFS_check should - * run. This indicates a power loss in midst of things. In worst case - * (repeated powerlosses in mending or gc) you might have to delete some files. - * - * @param fs the file system struct - * @param total total number of bytes in filesystem - * @param used used number of bytes in filesystem - */ -s32_t SPIFFS_info(spiffs *fs, u32_t *total, u32_t *used); - -/** - * Formats the entire file system. All data will be lost. - * The filesystem must not be mounted when calling this. - * - * NB: formatting is awkward. Due to backwards compatibility, SPIFFS_mount - * MUST be called prior to formatting in order to configure the filesystem. - * If SPIFFS_mount succeeds, SPIFFS_unmount must be called before calling - * SPIFFS_format. - * If SPIFFS_mount fails, SPIFFS_format can be called directly without calling - * SPIFFS_unmount first. - */ -s32_t SPIFFS_format(spiffs *fs); - -/** - * Returns nonzero if spiffs is mounted, or zero if unmounted. - */ -u8_t SPIFFS_mounted(spiffs *fs); - -/** - * Check if EOF reached. - * @param fs the file system struct - * @param fh the filehandle of the file to check - */ -s32_t SPIFFS_eof(spiffs *fs, spiffs_file fh); - -/** - * Get the current position of the data pointer. - * @param fs the file system struct - * @param fh the filehandle of the open file - */ -s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh); - -#if SPIFFS_TEST_VISUALISATION -/** - * Prints out a visualization of the filesystem. - * @param fs the file system struct - */ -s32_t SPIFFS_vis(spiffs *fs); -#endif - -#if SPIFFS_BUFFER_HELP -/** - * Returns number of bytes needed for the filedescriptor buffer given - * amount of file descriptors. - */ -u32_t SPIFFS_buffer_bytes_for_filedescs(spiffs *fs, u32_t num_descs); - -#if SPIFFS_CACHE -/** - * Returns number of bytes needed for the cache buffer given - * amount of cache pages. - */ -u32_t SPIFFS_buffer_bytes_for_cache(spiffs *fs, u32_t num_pages); -#endif -#endif - -#include "spiffs_esp8266.h" - -#ifdef __cplusplus -} -#endif - -#endif /* SPIFFS_H_ */ diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_cache.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_cache.c deleted file mode 100644 index 5bfe51e8..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_cache.c +++ /dev/null @@ -1,303 +0,0 @@ -/* - * spiffs_cache.c - * - * Created on: Jun 23, 2013 - * Author: petera - */ - -#include "spiffs.h" -#include "spiffs_nucleus.h" - -#if SPIFFS_CACHE - -// returns cached page for give page index, or null if no such cached page -static spiffs_cache_page *spiffs_cache_page_get(spiffs *fs, spiffs_page_ix pix) { - spiffs_cache *cache = spiffs_get_cache(fs); - if ((cache->cpage_use_map & cache->cpage_use_mask) == 0) return 0; - int i; - for (i = 0; i < cache->cpage_count; i++) { - spiffs_cache_page *cp = spiffs_get_cache_page_hdr(fs, cache, i); - if ((cache->cpage_use_map & (1<flags & SPIFFS_CACHE_FLAG_TYPE_WR) == 0 && - cp->pix == pix ) { - SPIFFS_CACHE_DBG("CACHE_GET: have cache page %d for %04x\n", i, pix); - cp->last_access = cache->last_access; - return cp; - } - } - //SPIFFS_CACHE_DBG("CACHE_GET: no cache for %04x\n", pix); - return 0; -} - -// frees cached page -static s32_t spiffs_cache_page_free(spiffs *fs, int ix, u8_t write_back) { - s32_t res = SPIFFS_OK; - spiffs_cache *cache = spiffs_get_cache(fs); - spiffs_cache_page *cp = spiffs_get_cache_page_hdr(fs, cache, ix); - if (cache->cpage_use_map & (1<flags & SPIFFS_CACHE_FLAG_TYPE_WR) == 0 && - (cp->flags & SPIFFS_CACHE_FLAG_DIRTY)) { - u8_t *mem = spiffs_get_cache_page(fs, cache, ix); - res = fs->cfg.hal_write_f(SPIFFS_PAGE_TO_PADDR(fs, cp->pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), mem); - } - - cp->flags = 0; - cache->cpage_use_map &= ~(1 << ix); - - if (cp->flags & SPIFFS_CACHE_FLAG_TYPE_WR) { - SPIFFS_CACHE_DBG("CACHE_FREE: free cache page %d objid %04x\n", ix, cp->obj_id); - } else { - SPIFFS_CACHE_DBG("CACHE_FREE: free cache page %d pix %04x\n", ix, cp->pix); - } - } - - return res; -} - -// removes the oldest accessed cached page -static s32_t spiffs_cache_page_remove_oldest(spiffs *fs, u8_t flag_mask, u8_t flags) { - s32_t res = SPIFFS_OK; - spiffs_cache *cache = spiffs_get_cache(fs); - - if ((cache->cpage_use_map & cache->cpage_use_mask) != cache->cpage_use_mask) { - // at least one free cpage - return SPIFFS_OK; - } - - // all busy, scan thru all to find the cpage which has oldest access - int i; - int cand_ix = -1; - u32_t oldest_val = 0; - for (i = 0; i < cache->cpage_count; i++) { - spiffs_cache_page *cp = spiffs_get_cache_page_hdr(fs, cache, i); - if ((cache->last_access - cp->last_access) > oldest_val && - (cp->flags & flag_mask) == flags) { - oldest_val = cache->last_access - cp->last_access; - cand_ix = i; - } - } - - if (cand_ix >= 0) { - res = spiffs_cache_page_free(fs, cand_ix, 1); - } - - return res; -} - -// allocates a new cached page and returns it, or null if all cache pages are busy -static spiffs_cache_page *spiffs_cache_page_allocate(spiffs *fs) { - spiffs_cache *cache = spiffs_get_cache(fs); - if (cache->cpage_use_map == 0xffffffff) { - // out of cache memory - return 0; - } - int i; - for (i = 0; i < cache->cpage_count; i++) { - if ((cache->cpage_use_map & (1<cpage_use_map |= (1<last_access = cache->last_access; - SPIFFS_CACHE_DBG("CACHE_ALLO: allocated cache page %d\n", i); - return cp; - } - } - // out of cache entries - return 0; -} - -// drops the cache page for give page index -void spiffs_cache_drop_page(spiffs *fs, spiffs_page_ix pix) { - spiffs_cache_page *cp = spiffs_cache_page_get(fs, pix); - if (cp) { - spiffs_cache_page_free(fs, cp->ix, 0); - } -} - -// ------------------------------ - -// reads from spi flash or the cache -s32_t spiffs_phys_rd( - spiffs *fs, - u8_t op, - spiffs_file fh, - u32_t addr, - u32_t len, - u8_t *dst) { - (void)fh; - s32_t res = SPIFFS_OK; - spiffs_cache *cache = spiffs_get_cache(fs); - spiffs_cache_page *cp = spiffs_cache_page_get(fs, SPIFFS_PADDR_TO_PAGE(fs, addr)); - cache->last_access++; - if (cp) { -#if SPIFFS_CACHE_STATS - fs->cache_hits++; -#endif - cp->last_access = cache->last_access; - } else { - if ((op & SPIFFS_OP_TYPE_MASK) == SPIFFS_OP_T_OBJ_LU2) { - // for second layer lookup functions, we do not cache in order to prevent shredding - return fs->cfg.hal_read_f( - addr , - len, - dst); - } -#if SPIFFS_CACHE_STATS - fs->cache_misses++; -#endif - res = spiffs_cache_page_remove_oldest(fs, SPIFFS_CACHE_FLAG_TYPE_WR, 0); - cp = spiffs_cache_page_allocate(fs); - if (cp) { - cp->flags = SPIFFS_CACHE_FLAG_WRTHRU; - cp->pix = SPIFFS_PADDR_TO_PAGE(fs, addr); - } - - s32_t res2 = fs->cfg.hal_read_f( - addr - SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr), - SPIFFS_CFG_LOG_PAGE_SZ(fs), - spiffs_get_cache_page(fs, cache, cp->ix)); - if (res2 != SPIFFS_OK) { - res = res2; - } - } - u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix); - c_memcpy(dst, &mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], len); - return res; -} - -// writes to spi flash and/or the cache -s32_t spiffs_phys_wr( - spiffs *fs, - u8_t op, - spiffs_file fh, - u32_t addr, - u32_t len, - u8_t *src) { - (void)fh; - spiffs_page_ix pix = SPIFFS_PADDR_TO_PAGE(fs, addr); - spiffs_cache *cache = spiffs_get_cache(fs); - spiffs_cache_page *cp = spiffs_cache_page_get(fs, pix); - - if (cp && (op & SPIFFS_OP_COM_MASK) != SPIFFS_OP_C_WRTHRU) { - // have a cache page - // copy in data to cache page - - if ((op & SPIFFS_OP_COM_MASK) == SPIFFS_OP_C_DELE && - (op & SPIFFS_OP_TYPE_MASK) != SPIFFS_OP_T_OBJ_LU) { - // page is being deleted, wipe from cache - unless it is a lookup page - spiffs_cache_page_free(fs, cp->ix, 0); - return fs->cfg.hal_write_f(addr, len, src); - } - - u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix); - c_memcpy(&mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], src, len); - - cache->last_access++; - cp->last_access = cache->last_access; - - if (cp->flags && SPIFFS_CACHE_FLAG_WRTHRU) { - // page is being updated, no write-cache, just pass thru - return fs->cfg.hal_write_f(addr, len, src); - } else { - return SPIFFS_OK; - } - } else { - // no cache page, no write cache - just write thru - return fs->cfg.hal_write_f(addr, len, src); - } -} - -#if SPIFFS_CACHE_WR -// returns the cache page that this fd refers, or null if no cache page -spiffs_cache_page *spiffs_cache_page_get_by_fd(spiffs *fs, spiffs_fd *fd) { - spiffs_cache *cache = spiffs_get_cache(fs); - - if ((cache->cpage_use_map & cache->cpage_use_mask) == 0) { - // all cpages free, no cpage cannot be assigned to obj_id - return 0; - } - - int i; - for (i = 0; i < cache->cpage_count; i++) { - spiffs_cache_page *cp = spiffs_get_cache_page_hdr(fs, cache, i); - if ((cache->cpage_use_map & (1<flags & SPIFFS_CACHE_FLAG_TYPE_WR) && - cp->obj_id == fd->obj_id) { - return cp; - } - } - - return 0; -} - -// allocates a new cache page and refers this to given fd - flushes an old cache -// page if all cache is busy -spiffs_cache_page *spiffs_cache_page_allocate_by_fd(spiffs *fs, spiffs_fd *fd) { - // before this function is called, it is ensured that there is no already existing - // cache page with same object id - spiffs_cache_page_remove_oldest(fs, SPIFFS_CACHE_FLAG_TYPE_WR, 0); - spiffs_cache_page *cp = spiffs_cache_page_allocate(fs); - if (cp == 0) { - // could not get cache page - return 0; - } - - cp->flags = SPIFFS_CACHE_FLAG_TYPE_WR; - cp->obj_id = fd->obj_id; - fd->cache_page = cp; - return cp; -} - -// unrefers all fds that this cache page refers to and releases the cache page -void spiffs_cache_fd_release(spiffs *fs, spiffs_cache_page *cp) { - if (cp == 0) return; - u32_t i; - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - for (i = 0; i < fs->fd_count; i++) { - spiffs_fd *cur_fd = &fds[i]; - if (cur_fd->file_nbr != 0 && cur_fd->cache_page == cp) { - cur_fd->cache_page = 0; - } - } - spiffs_cache_page_free(fs, cp->ix, 0); - - cp->obj_id = 0; -} - -#endif - -// initializes the cache -void spiffs_cache_init(spiffs *fs) { - if (fs->cache == 0) return; - u32_t sz = fs->cache_size; - u32_t cache_mask = 0; - int i; - int cache_entries = - (sz - sizeof(spiffs_cache)) / (SPIFFS_CACHE_PAGE_SIZE(fs)); - if (cache_entries <= 0) return; - - for (i = 0; i < cache_entries; i++) { - cache_mask <<= 1; - cache_mask |= 1; - } - - spiffs_cache cache; - c_memset(&cache, 0, sizeof(spiffs_cache)); - cache.cpage_count = cache_entries; - cache.cpages = (u8_t *)((u8_t *)fs->cache + sizeof(spiffs_cache)); - - cache.cpage_use_map = 0xffffffff; - cache.cpage_use_mask = cache_mask; - c_memcpy(fs->cache, &cache, sizeof(spiffs_cache)); - - spiffs_cache *c = spiffs_get_cache(fs); - - c_memset(c->cpages, 0, c->cpage_count * SPIFFS_CACHE_PAGE_SIZE(fs)); - - c->cpage_use_map &= ~(c->cpage_use_mask); - for (i = 0; i < cache.cpage_count; i++) { - spiffs_get_cache_page_hdr(fs, c, i)->ix = i; - } -} - -#endif // SPIFFS_CACHE diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_check.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_check.c deleted file mode 100644 index 50bbb5c8..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_check.c +++ /dev/null @@ -1,973 +0,0 @@ -/* - * spiffs_check.c - * - * Contains functionality for checking file system consistency - * and mending problems. - * Three levels of consistency checks are implemented: - * - * Look up consistency - * Checks if indices in lookup pages are coherent with page headers - * Object index consistency - * Checks if there are any orphaned object indices (missing object index headers). - * If an object index is found but not its header, the object index is deleted. - * This is critical for the following page consistency check. - * Page consistency - * Checks for pages that ought to be indexed, ought not to be indexed, are multiple indexed - * - * - * Created on: Jul 7, 2013 - * Author: petera - */ - -#include "spiffs.h" -#include "spiffs_nucleus.h" - -//--------------------------------------- -// Look up consistency - -// searches in the object indices and returns the referenced page index given -// the object id and the data span index -// destroys fs->lu_work -static s32_t spiffs_object_get_data_page_index_reference( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_span_ix data_spix, - spiffs_page_ix *pix, - spiffs_page_ix *objix_pix) { - s32_t res; - - // calculate object index span index for given data page span index - spiffs_span_ix objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - - // find obj index for obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, obj_id | SPIFFS_OBJ_ID_IX_FLAG, objix_spix, 0, objix_pix); - SPIFFS_CHECK_RES(res); - - // load obj index entry - u32_t addr = SPIFFS_PAGE_TO_PADDR(fs, *objix_pix); - if (objix_spix == 0) { - // get referenced page from object index header - addr += sizeof(spiffs_page_object_ix_header) + data_spix * sizeof(spiffs_page_ix); - } else { - // get referenced page from object index - addr += sizeof(spiffs_page_object_ix) + SPIFFS_OBJ_IX_ENTRY(fs, data_spix) * sizeof(spiffs_page_ix); - } - - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, 0, addr, sizeof(spiffs_page_ix), (u8_t *)pix); - - return res; -} - -// copies page contents to a new page -static s32_t spiffs_rewrite_page(spiffs *fs, spiffs_page_ix cur_pix, spiffs_page_header *p_hdr, spiffs_page_ix *new_pix) { - s32_t res; - res = spiffs_page_allocate_data(fs, p_hdr->obj_id, p_hdr, 0,0,0,0, new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_phys_cpy(fs, 0, - SPIFFS_PAGE_TO_PADDR(fs, *new_pix) + sizeof(spiffs_page_header), - SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + sizeof(spiffs_page_header), - SPIFFS_DATA_PAGE_SIZE(fs)); - SPIFFS_CHECK_RES(res); - return res; -} - -// rewrites the object index for given object id and replaces the -// data page index to a new page index -static s32_t spiffs_rewrite_index(spiffs *fs, spiffs_obj_id obj_id, spiffs_span_ix data_spix, spiffs_page_ix new_data_pix, spiffs_page_ix objix_pix) { - s32_t res; - spiffs_block_ix bix; - int entry; - spiffs_page_ix free_pix; - obj_id |= SPIFFS_OBJ_ID_IX_FLAG; - - // find free entry - res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry); - SPIFFS_CHECK_RES(res); - free_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - - // calculate object index span index for given data page span index - spiffs_span_ix objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - if (objix_spix == 0) { - // calc index in index header - entry = data_spix; - } else { - // calc entry in index - entry = SPIFFS_OBJ_IX_ENTRY(fs, data_spix); - } - // load index - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - spiffs_page_header *objix_p_hdr = (spiffs_page_header *)fs->lu_work; - - // be ultra safe, double check header against provided data - if (objix_p_hdr->obj_id != obj_id) { - spiffs_page_delete(fs, free_pix); - return SPIFFS_ERR_CHECK_OBJ_ID_MISM; - } - if (objix_p_hdr->span_ix != objix_spix) { - spiffs_page_delete(fs, free_pix); - return SPIFFS_ERR_CHECK_SPIX_MISM; - } - if ((objix_p_hdr->flags & (SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_IXDELE | SPIFFS_PH_FLAG_INDEX | - SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_DELET)) != - (SPIFFS_PH_FLAG_IXDELE | SPIFFS_PH_FLAG_DELET)) { - spiffs_page_delete(fs, free_pix); - return SPIFFS_ERR_CHECK_FLAGS_BAD; - } - - // rewrite in mem - if (objix_spix == 0) { - ((spiffs_page_ix*)((u8_t *)fs->lu_work + sizeof(spiffs_page_object_ix_header)))[data_spix] = new_data_pix; - } else { - ((spiffs_page_ix*)((u8_t *)fs->lu_work + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = new_data_pix; - } - - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_PAGE_TO_PADDR(fs, free_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, - 0, SPIFFS_BLOCK_TO_PADDR(fs, SPIFFS_BLOCK_FOR_PAGE(fs, free_pix)) + SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, free_pix) * sizeof(spiffs_page_ix), - sizeof(spiffs_obj_id), - (u8_t *)&obj_id); - SPIFFS_CHECK_RES(res); - res = spiffs_page_delete(fs, objix_pix); - - return res; -} - -// deletes an object just by marking object index header as deleted -static s32_t spiffs_delete_obj_lazy(spiffs *fs, spiffs_obj_id obj_id) { - spiffs_page_ix objix_hdr_pix; - s32_t res; - res = spiffs_obj_lu_find_id_and_span(fs, obj_id, 0, 0, &objix_hdr_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - return SPIFFS_OK; - } - SPIFFS_CHECK_RES(res); - u8_t flags = 0xff & ~SPIFFS_PH_FLAG_IXDELE; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, - 0, SPIFFS_PAGE_TO_PADDR(fs, objix_hdr_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&flags); - return res; -} - -// validates the given look up entry -static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, spiffs_page_header *p_hdr, - spiffs_page_ix cur_pix, spiffs_block_ix cur_block, int cur_entry, int *reload_lu) { - (void)cur_block; - (void)cur_entry; - u8_t delete_page = 0; - s32_t res = SPIFFS_OK; - spiffs_page_ix objix_pix; - spiffs_page_ix ref_pix; - // check validity, take actions - if (((lu_obj_id == SPIFFS_OBJ_ID_DELETED) && (p_hdr->flags & SPIFFS_PH_FLAG_DELET)) || - ((lu_obj_id == SPIFFS_OBJ_ID_FREE) && (p_hdr->flags & SPIFFS_PH_FLAG_USED) == 0)) { - // look up entry deleted / free but used in page header - SPIFFS_CHECK_DBG("LU: pix %04x deleted/free in lu but not on page\n", cur_pix); - *reload_lu = 1; - delete_page = 1; - if (p_hdr->flags & SPIFFS_PH_FLAG_INDEX) { - // header says data page - // data page can be removed if not referenced by some object index - res = spiffs_object_get_data_page_index_reference(fs, p_hdr->obj_id, p_hdr->span_ix, &ref_pix, &objix_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - // no object with this id, so remove page safely - res = SPIFFS_OK; - } else { - SPIFFS_CHECK_RES(res); - if (ref_pix == cur_pix) { - // data page referenced by object index but deleted in lu - // copy page to new place and re-write the object index to new place - spiffs_page_ix new_pix; - res = spiffs_rewrite_page(fs, cur_pix, p_hdr, &new_pix); - SPIFFS_CHECK_DBG("LU: FIXUP: data page not found elsewhere, rewriting %04x to new page %04x\n", cur_pix, new_pix); - SPIFFS_CHECK_RES(res); - *reload_lu = 1; - SPIFFS_CHECK_DBG("LU: FIXUP: %04x rewritten to %04x, affected objix_pix %04x\n", cur_pix, new_pix, objix_pix); - res = spiffs_rewrite_index(fs, p_hdr->obj_id, p_hdr->span_ix, new_pix, objix_pix); - if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) { - // index bad also, cannot mend this file - SPIFFS_CHECK_DBG("LU: FIXUP: index bad %d, cannot mend!\n", res); - res = spiffs_page_delete(fs, new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_delete_obj_lazy(fs, p_hdr->obj_id); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr->obj_id, 0); - } else { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_INDEX, p_hdr->obj_id, p_hdr->span_ix); - } - SPIFFS_CHECK_RES(res); - } - } - } else { - // header says index page - // index page can be removed if other index with same obj_id and spanix is found - res = spiffs_obj_lu_find_id_and_span(fs, p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, cur_pix, 0); - if (res == SPIFFS_ERR_NOT_FOUND) { - // no such index page found, check for a data page amongst page headers - // lu cannot be trusted - res = spiffs_obj_lu_find_id_and_span_by_phdr(fs, p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG, 0, 0, 0); - if (res == SPIFFS_OK) { // ignore other errors - // got a data page also, assume lu corruption only, rewrite to new page - spiffs_page_ix new_pix; - res = spiffs_rewrite_page(fs, cur_pix, p_hdr, &new_pix); - SPIFFS_CHECK_DBG("LU: FIXUP: ix page with data not found elsewhere, rewriting %04x to new page %04x\n", cur_pix, new_pix); - SPIFFS_CHECK_RES(res); - *reload_lu = 1; - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); - } - } else { - SPIFFS_CHECK_RES(res); - } - } - } - if (lu_obj_id != SPIFFS_OBJ_ID_FREE && lu_obj_id != SPIFFS_OBJ_ID_DELETED) { - // look up entry used - if ((p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG) != (lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG)) { - SPIFFS_CHECK_DBG("LU: pix %04x differ in obj_id lu:%04x ph:%04x\n", cur_pix, lu_obj_id, p_hdr->obj_id); - delete_page = 1; - if ((p_hdr->flags & SPIFFS_PH_FLAG_DELET) == 0 || - (p_hdr->flags & SPIFFS_PH_FLAG_FINAL) || - (p_hdr->flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_IXDELE)) == 0) { - // page deleted or not finalized, just remove it - } else { - if (p_hdr->flags & SPIFFS_PH_FLAG_INDEX) { - // if data page, check for reference to this page - res = spiffs_object_get_data_page_index_reference(fs, p_hdr->obj_id, p_hdr->span_ix, &ref_pix, &objix_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - // no object with this id, so remove page safely - res = SPIFFS_OK; - } else { - SPIFFS_CHECK_RES(res); - // if found, rewrite page with object id, update index, and delete current - if (ref_pix == cur_pix) { - spiffs_page_ix new_pix; - res = spiffs_rewrite_page(fs, cur_pix, p_hdr, &new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_rewrite_index(fs, p_hdr->obj_id, p_hdr->span_ix, new_pix, objix_pix); - if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) { - // index bad also, cannot mend this file - SPIFFS_CHECK_DBG("LU: FIXUP: index bad %d, cannot mend!\n", res); - res = spiffs_page_delete(fs, new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_delete_obj_lazy(fs, p_hdr->obj_id); - *reload_lu = 1; - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr->obj_id, 0); - } - SPIFFS_CHECK_RES(res); - } - } - } else { - // else if index, check for other pages with both obj_id's and spanix - spiffs_page_ix objix_pix_lu, objix_pix_ph; - // see if other object index page exists for lookup obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, 0, &objix_pix_lu); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - objix_pix_lu = 0; - } - SPIFFS_CHECK_RES(res); - // see if other object index exists for page header obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, 0, &objix_pix_ph); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - objix_pix_ph = 0; - } - SPIFFS_CHECK_RES(res); - // if both obj_id's found, just delete current - if (objix_pix_ph == 0 || objix_pix_lu == 0) { - // otherwise try finding first corresponding data pages - spiffs_page_ix data_pix_lu, data_pix_ph; - // see if other data page exists for look up obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, lu_obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, 0, 0, &data_pix_lu); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - objix_pix_lu = 0; - } - SPIFFS_CHECK_RES(res); - // see if other data page exists for page header obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, p_hdr->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, 0, 0, &data_pix_ph); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - objix_pix_ph = 0; - } - SPIFFS_CHECK_RES(res); - - spiffs_page_header new_ph; - new_ph.flags = 0xff & ~(SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL); - new_ph.span_ix = p_hdr->span_ix; - spiffs_page_ix new_pix; - if ((objix_pix_lu && data_pix_lu && data_pix_ph && objix_pix_ph == 0) || - (objix_pix_lu == 0 && data_pix_ph && objix_pix_ph == 0)) { - // got a data page for page header obj id - // rewrite as obj_id_ph - new_ph.obj_id = p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG; - res = spiffs_rewrite_page(fs, cur_pix, &new_ph, &new_pix); - SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page %04x as %04x to pix %04x\n", cur_pix, new_ph.obj_id, new_pix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); - SPIFFS_CHECK_RES(res); - *reload_lu = 1; - } else if ((objix_pix_ph && data_pix_ph && data_pix_lu && objix_pix_lu == 0) || - (objix_pix_ph == 0 && data_pix_lu && objix_pix_lu == 0)) { - // got a data page for look up obj id - // rewrite as obj_id_lu - new_ph.obj_id = lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG; - SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page %04x as %04x\n", cur_pix, new_ph.obj_id); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); - res = spiffs_rewrite_page(fs, cur_pix, &new_ph, &new_pix); - SPIFFS_CHECK_RES(res); - *reload_lu = 1; - } else { - // cannot safely do anything - SPIFFS_CHECK_DBG("LU: FIXUP: nothing to do, just delete\n"); - } - } - } - } - } else if (((lu_obj_id & SPIFFS_OBJ_ID_IX_FLAG) && (p_hdr->flags & SPIFFS_PH_FLAG_INDEX)) || - ((lu_obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0 && (p_hdr->flags & SPIFFS_PH_FLAG_INDEX) == 0)) { - SPIFFS_CHECK_DBG("LU: %04x lu/page index marking differ\n", cur_pix); - spiffs_page_ix data_pix, objix_pix_d; - // see if other data page exists for given obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, lu_obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, cur_pix, &data_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - data_pix = 0; - } - SPIFFS_CHECK_RES(res); - // see if other object index exists for given obj id and span index - res = spiffs_obj_lu_find_id_and_span(fs, lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, cur_pix, &objix_pix_d); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - objix_pix_d = 0; - } - SPIFFS_CHECK_RES(res); - - delete_page = 1; - // if other data page exists and object index exists, just delete page - if (data_pix && objix_pix_d) { - SPIFFS_CHECK_DBG("LU: FIXUP: other index and data page exists, simply remove\n"); - } else - // if only data page exists, make this page index - if (data_pix && objix_pix_d == 0) { - SPIFFS_CHECK_DBG("LU: FIXUP: other data page exists, make this index\n"); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_INDEX, lu_obj_id, p_hdr->span_ix); - spiffs_page_header new_ph; - spiffs_page_ix new_pix; - new_ph.flags = 0xff & ~(SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX); - new_ph.obj_id = lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG; - new_ph.span_ix = p_hdr->span_ix; - res = spiffs_page_allocate_data(fs, new_ph.obj_id, &new_ph, 0, 0, 0, 1, &new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_phys_cpy(fs, 0, SPIFFS_PAGE_TO_PADDR(fs, new_pix) + sizeof(spiffs_page_header), - SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + sizeof(spiffs_page_header), - SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_header)); - SPIFFS_CHECK_RES(res); - } else - // if only index exists, make data page - if (data_pix == 0 && objix_pix_d) { - SPIFFS_CHECK_DBG("LU: FIXUP: other index page exists, make this data\n"); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, lu_obj_id, p_hdr->span_ix); - spiffs_page_header new_ph; - spiffs_page_ix new_pix; - new_ph.flags = 0xff & ~(SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_FINAL); - new_ph.obj_id = lu_obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - new_ph.span_ix = p_hdr->span_ix; - res = spiffs_page_allocate_data(fs, new_ph.obj_id, &new_ph, 0, 0, 0, 1, &new_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_phys_cpy(fs, 0, SPIFFS_PAGE_TO_PADDR(fs, new_pix) + sizeof(spiffs_page_header), - SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + sizeof(spiffs_page_header), - SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_header)); - SPIFFS_CHECK_RES(res); - } else { - // if nothing exists, we cannot safely make a decision - delete - } - } - else if ((p_hdr->flags & SPIFFS_PH_FLAG_DELET) == 0) { - SPIFFS_CHECK_DBG("LU: pix %04x busy in lu but deleted on page\n", cur_pix); - delete_page = 1; - } else if ((p_hdr->flags & SPIFFS_PH_FLAG_FINAL)) { - SPIFFS_CHECK_DBG("LU: pix %04x busy but not final\n", cur_pix); - // page can be removed if not referenced by object index - *reload_lu = 1; - res = spiffs_object_get_data_page_index_reference(fs, lu_obj_id, p_hdr->span_ix, &ref_pix, &objix_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - // no object with this id, so remove page safely - res = SPIFFS_OK; - delete_page = 1; - } else { - SPIFFS_CHECK_RES(res); - if (ref_pix != cur_pix) { - SPIFFS_CHECK_DBG("LU: FIXUP: other finalized page is referred, just delete\n"); - delete_page = 1; - } else { - // page referenced by object index but not final - // just finalize - SPIFFS_CHECK_DBG("LU: FIXUP: unfinalized page is referred, finalizing\n"); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix); - u8_t flags = 0xff & ~SPIFFS_PH_FLAG_FINAL; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), (u8_t*)&flags); - } - } - } - } - - if (delete_page) { - SPIFFS_CHECK_DBG("LU: FIXUP: deleting page %04x\n", cur_pix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_DELETE_PAGE, cur_pix, 0); - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - } - - return res; -} - -static s32_t spiffs_lookup_check_v(spiffs *fs, spiffs_obj_id obj_id, spiffs_block_ix cur_block, int cur_entry, - u32_t user_data, void *user_p) { - (void)user_data; - (void)user_p; - s32_t res = SPIFFS_OK; - spiffs_page_header p_hdr; - spiffs_page_ix cur_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, cur_block, cur_entry); - - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_PROGRESS, - (cur_block * 256)/fs->block_count, 0); - - // load header - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - - int reload_lu = 0; - - res = spiffs_lookup_check_validate(fs, obj_id, &p_hdr, cur_pix, cur_block, cur_entry, &reload_lu); - SPIFFS_CHECK_RES(res); - - if (res == SPIFFS_OK) { - return reload_lu ? SPIFFS_VIS_COUNTINUE_RELOAD : SPIFFS_VIS_COUNTINUE; - } - return res; -} - - -// Scans all object look up. For each entry, corresponding page header is checked for validity. -// If an object index header page is found, this is also checked -s32_t spiffs_lookup_consistency_check(spiffs *fs, u8_t check_all_objects) { - (void)check_all_objects; - s32_t res = SPIFFS_OK; - - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_PROGRESS, 0, 0); - - res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_lookup_check_v, 0, 0, 0, 0); - - if (res == SPIFFS_VIS_END) { - res = SPIFFS_OK; - } - - if (res != SPIFFS_OK) { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_ERROR, res, 0); - } - - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_PROGRESS, 256, 0); - - return res; -} - -//--------------------------------------- -// Page consistency - -// Scans all pages (except lu pages), reserves 4 bits in working memory for each page -// bit 0: 0 == FREE|DELETED, 1 == USED -// bit 1: 0 == UNREFERENCED, 1 == REFERENCED -// bit 2: 0 == NOT_INDEX, 1 == INDEX -// bit 3: unused -// A consistent file system will have only pages being -// * x000 free, unreferenced, not index -// * x011 used, referenced only once, not index -// * x101 used, unreferenced, index -// The working memory might not fit all pages so several scans might be needed -static s32_t spiffs_page_consistency_check_i(spiffs *fs) { - const u32_t bits = 4; - const spiffs_page_ix pages_per_scan = SPIFFS_CFG_LOG_PAGE_SZ(fs) * 8 / bits; - - s32_t res = SPIFFS_OK; - spiffs_page_ix pix_offset = 0; - - // for each range of pages fitting into work memory - while (pix_offset < SPIFFS_PAGES_PER_BLOCK(fs) * fs->block_count) { - // set this flag to abort all checks and rescan the page range - u8_t restart = 0; - c_memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - - spiffs_block_ix cur_block = 0; - // build consistency bitmap for id range traversing all blocks - while (!restart && cur_block < fs->block_count) { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_PROGRESS, - (pix_offset*256)/(SPIFFS_PAGES_PER_BLOCK(fs) * fs->block_count) + - ((((cur_block * pages_per_scan * 256)/ (SPIFFS_PAGES_PER_BLOCK(fs) * fs->block_count))) / fs->block_count), - 0); - - // traverse each page except for lookup pages - spiffs_page_ix cur_pix = SPIFFS_OBJ_LOOKUP_PAGES(fs) + SPIFFS_PAGES_PER_BLOCK(fs) * cur_block; - while (!restart && cur_pix < SPIFFS_PAGES_PER_BLOCK(fs) * (cur_block+1)) { - // read header - spiffs_page_header p_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - - u8_t within_range = (cur_pix >= pix_offset && cur_pix < pix_offset + pages_per_scan); - const u32_t pix_byte_ix = (cur_pix - pix_offset) / (8/bits); - const u8_t pix_bit_ix = (cur_pix & ((8/bits)-1)) * bits; - - if (within_range && - (p_hdr.flags & SPIFFS_PH_FLAG_DELET) && (p_hdr.flags & SPIFFS_PH_FLAG_USED) == 0) { - // used - fs->work[pix_byte_ix] |= (1<<(pix_bit_ix + 0)); - } - if ((p_hdr.flags & SPIFFS_PH_FLAG_DELET) && - (p_hdr.flags & SPIFFS_PH_FLAG_IXDELE) && - (p_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED)) == 0) { - // found non-deleted index - if (within_range) { - fs->work[pix_byte_ix] |= (1<<(pix_bit_ix + 2)); - } - - // load non-deleted index - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - - // traverse index for referenced pages - spiffs_page_ix *object_page_index; - spiffs_page_header *objix_p_hdr = (spiffs_page_header *)fs->lu_work; - - int entries; - int i; - spiffs_span_ix data_spix_offset; - if (p_hdr.span_ix == 0) { - // object header page index - entries = SPIFFS_OBJ_HDR_IX_LEN(fs); - data_spix_offset = 0; - object_page_index = (spiffs_page_ix *)((u8_t *)fs->lu_work + sizeof(spiffs_page_object_ix_header)); - } else { - // object page index - entries = SPIFFS_OBJ_IX_LEN(fs); - data_spix_offset = SPIFFS_OBJ_HDR_IX_LEN(fs) + SPIFFS_OBJ_IX_LEN(fs) * (p_hdr.span_ix - 1); - object_page_index = (spiffs_page_ix *)((u8_t *)fs->lu_work + sizeof(spiffs_page_object_ix)); - } - - // for all entries in index - for (i = 0; !restart && i < entries; i++) { - spiffs_page_ix rpix = object_page_index[i]; - u8_t rpix_within_range = rpix >= pix_offset && rpix < pix_offset + pages_per_scan; - - if ((rpix != (spiffs_page_ix)-1 && rpix > SPIFFS_MAX_PAGES(fs)) - || (rpix_within_range && SPIFFS_IS_LOOKUP_PAGE(fs, rpix))) { - - // bad reference - SPIFFS_CHECK_DBG("PA: pix %04x bad pix / LU referenced from page %04x\n", - rpix, cur_pix); - // check for data page elsewhere - spiffs_page_ix data_pix; - res = spiffs_obj_lu_find_id_and_span(fs, objix_p_hdr->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - data_spix_offset + i, 0, &data_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - data_pix = 0; - } - SPIFFS_CHECK_RES(res); - if (data_pix == 0) { - // if not, allocate free page - spiffs_page_header new_ph; - new_ph.flags = 0xff & ~(SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_FINAL); - new_ph.obj_id = objix_p_hdr->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - new_ph.span_ix = data_spix_offset + i; - res = spiffs_page_allocate_data(fs, new_ph.obj_id, &new_ph, 0, 0, 0, 1, &data_pix); - SPIFFS_CHECK_RES(res); - SPIFFS_CHECK_DBG("PA: FIXUP: found no existing data page, created new @ %04x\n", data_pix); - } - // remap index - SPIFFS_CHECK_DBG("PA: FIXUP: rewriting index pix %04x\n", cur_pix); - res = spiffs_rewrite_index(fs, objix_p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG, - data_spix_offset + i, data_pix, cur_pix); - if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) { - // index bad also, cannot mend this file - SPIFFS_CHECK_DBG("PA: FIXUP: index bad %d, cannot mend - delete object\n", res); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, objix_p_hdr->obj_id, 0); - // delete file - res = spiffs_page_delete(fs, cur_pix); - } else { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_FIX_INDEX, objix_p_hdr->obj_id, objix_p_hdr->span_ix); - } - SPIFFS_CHECK_RES(res); - restart = 1; - - } else if (rpix_within_range) { - - // valid reference - // read referenced page header - spiffs_page_header rp_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, rpix), sizeof(spiffs_page_header), (u8_t*)&rp_hdr); - SPIFFS_CHECK_RES(res); - - // cross reference page header check - if (rp_hdr.obj_id != (p_hdr.obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) || - rp_hdr.span_ix != data_spix_offset + i || - (rp_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED)) != - (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_INDEX)) { - SPIFFS_CHECK_DBG("PA: pix %04x has inconsistent page header ix id/span:%04x/%04x, ref id/span:%04x/%04x flags:%02x\n", - rpix, p_hdr.obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, data_spix_offset + i, - rp_hdr.obj_id, rp_hdr.span_ix, rp_hdr.flags); - // try finding correct page - spiffs_page_ix data_pix; - res = spiffs_obj_lu_find_id_and_span(fs, p_hdr.obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - data_spix_offset + i, rpix, &data_pix); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - data_pix = 0; - } - SPIFFS_CHECK_RES(res); - if (data_pix == 0) { - // not found, this index is badly borked - SPIFFS_CHECK_DBG("PA: FIXUP: index bad, delete object id %04x\n", p_hdr.obj_id); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0); - res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id); - SPIFFS_CHECK_RES(res); - break; - } else { - // found it, so rewrite index - SPIFFS_CHECK_DBG("PA: FIXUP: found correct data pix %04x, rewrite ix pix %04x id %04x\n", - data_pix, cur_pix, p_hdr.obj_id); - res = spiffs_rewrite_index(fs, p_hdr.obj_id, data_spix_offset + i, data_pix, cur_pix); - if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) { - // index bad also, cannot mend this file - SPIFFS_CHECK_DBG("PA: FIXUP: index bad %d, cannot mend!\n", res); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0); - res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id); - } else { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_FIX_INDEX, p_hdr.obj_id, p_hdr.span_ix); - } - SPIFFS_CHECK_RES(res); - restart = 1; - } - } - else { - // mark rpix as referenced - const u32_t rpix_byte_ix = (rpix - pix_offset) / (8/bits); - const u8_t rpix_bit_ix = (rpix & ((8/bits)-1)) * bits; - if (fs->work[rpix_byte_ix] & (1<<(rpix_bit_ix + 1))) { - SPIFFS_CHECK_DBG("PA: pix %04x multiple referenced from page %04x\n", - rpix, cur_pix); - // Here, we should have fixed all broken references - getting this means there - // must be multiple files with same object id. Only solution is to delete - // the object which is referring to this page - SPIFFS_CHECK_DBG("PA: FIXUP: removing object %04x and page %04x\n", - p_hdr.obj_id, cur_pix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0); - res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id); - SPIFFS_CHECK_RES(res); - // extra precaution, delete this page also - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - restart = 1; - } - fs->work[rpix_byte_ix] |= (1<<(rpix_bit_ix + 1)); - } - } - } // for all index entries - } // found index - - // next page - cur_pix++; - } - // next block - cur_block++; - } - // check consistency bitmap - if (!restart) { - spiffs_page_ix objix_pix; - spiffs_page_ix rpix; - - u32_t byte_ix; - u8_t bit_ix; - for (byte_ix = 0; !restart && byte_ix < SPIFFS_CFG_LOG_PAGE_SZ(fs); byte_ix++) { - for (bit_ix = 0; !restart && bit_ix < 8/bits; bit_ix ++) { - u8_t bitmask = (fs->work[byte_ix] >> (bit_ix * bits)) & 0x7; - spiffs_page_ix cur_pix = pix_offset + byte_ix * (8/bits) + bit_ix; - - // 000 ok - free, unreferenced, not index - - if (bitmask == 0x1) { - - // 001 - SPIFFS_CHECK_DBG("PA: pix %04x USED, UNREFERENCED, not index\n", cur_pix); - - u8_t rewrite_ix_to_this = 0; - u8_t delete_page = 0; - // check corresponding object index entry - spiffs_page_header p_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - - res = spiffs_object_get_data_page_index_reference(fs, p_hdr.obj_id, p_hdr.span_ix, - &rpix, &objix_pix); - if (res == SPIFFS_OK) { - if (((rpix == (spiffs_page_ix)-1 || rpix > SPIFFS_MAX_PAGES(fs)) || (SPIFFS_IS_LOOKUP_PAGE(fs, rpix)))) { - // pointing to a bad page altogether, rewrite index to this - rewrite_ix_to_this = 1; - SPIFFS_CHECK_DBG("PA: corresponding ref is bad: %04x, rewrite to this %04x\n", rpix, cur_pix); - } else { - // pointing to something else, check what - spiffs_page_header rp_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, rpix), sizeof(spiffs_page_header), (u8_t*)&rp_hdr); - SPIFFS_CHECK_RES(res); - if (((p_hdr.obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) == rp_hdr.obj_id) && - ((rp_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_FINAL)) == - (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_DELET))) { - // pointing to something else valid, just delete this page then - SPIFFS_CHECK_DBG("PA: corresponding ref is good but different: %04x, delete this %04x\n", rpix, cur_pix); - delete_page = 1; - } else { - // pointing to something weird, update index to point to this page instead - if (rpix != cur_pix) { - SPIFFS_CHECK_DBG("PA: corresponding ref is weird: %04x %s%s%s%s, rewrite this %04x\n", rpix, - (rp_hdr.flags & SPIFFS_PH_FLAG_INDEX) ? "" : "INDEX ", - (rp_hdr.flags & SPIFFS_PH_FLAG_DELET) ? "" : "DELETED ", - (rp_hdr.flags & SPIFFS_PH_FLAG_USED) ? "NOTUSED " : "", - (rp_hdr.flags & SPIFFS_PH_FLAG_FINAL) ? "NOTFINAL " : "", - cur_pix); - rewrite_ix_to_this = 1; - } else { - // should not happen, destined for fubar - } - } - } - } else if (res == SPIFFS_ERR_NOT_FOUND) { - SPIFFS_CHECK_DBG("PA: corresponding ref not found, delete %04x\n", cur_pix); - delete_page = 1; - res = SPIFFS_OK; - } - - if (rewrite_ix_to_this) { - // if pointing to invalid page, redirect index to this page - SPIFFS_CHECK_DBG("PA: FIXUP: rewrite index id %04x data spix %04x to point to this pix: %04x\n", - p_hdr.obj_id, p_hdr.span_ix, cur_pix); - res = spiffs_rewrite_index(fs, p_hdr.obj_id, p_hdr.span_ix, cur_pix, objix_pix); - if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) { - // index bad also, cannot mend this file - SPIFFS_CHECK_DBG("PA: FIXUP: index bad %d, cannot mend!\n", res); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0); - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id); - } else { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_FIX_INDEX, p_hdr.obj_id, p_hdr.span_ix); - } - SPIFFS_CHECK_RES(res); - restart = 1; - continue; - } else if (delete_page) { - SPIFFS_CHECK_DBG("PA: FIXUP: deleting page %04x\n", cur_pix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_PAGE, cur_pix, 0); - res = spiffs_page_delete(fs, cur_pix); - } - SPIFFS_CHECK_RES(res); - } - if (bitmask == 0x2) { - - // 010 - SPIFFS_CHECK_DBG("PA: pix %04x FREE, REFERENCED, not index\n", cur_pix); - - // no op, this should be taken care of when checking valid references - } - - // 011 ok - busy, referenced, not index - - if (bitmask == 0x4) { - - // 100 - SPIFFS_CHECK_DBG("PA: pix %04x FREE, unreferenced, INDEX\n", cur_pix); - - // this should never happen, major fubar - } - - // 101 ok - busy, unreferenced, index - - if (bitmask == 0x6) { - - // 110 - SPIFFS_CHECK_DBG("PA: pix %04x FREE, REFERENCED, INDEX\n", cur_pix); - - // no op, this should be taken care of when checking valid references - } - if (bitmask == 0x7) { - - // 111 - SPIFFS_CHECK_DBG("PA: pix %04x USED, REFERENCED, INDEX\n", cur_pix); - - // no op, this should be taken care of when checking valid references - } - } - } - } - // next page range - if (!restart) { - pix_offset += pages_per_scan; - } - } // while page range not reached end - return res; -} - -// Checks consistency amongst all pages and fixes irregularities -s32_t spiffs_page_consistency_check(spiffs *fs) { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_PROGRESS, 0, 0); - s32_t res = spiffs_page_consistency_check_i(fs); - if (res != SPIFFS_OK) { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_ERROR, res, 0); - } - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_PAGE, SPIFFS_CHECK_PROGRESS, 256, 0); - return res; -} - -//--------------------------------------- -// Object index consistency - -// searches for given object id in temporary object id index, -// returns the index or -1 -static int spiffs_object_index_search(spiffs *fs, spiffs_obj_id obj_id) { - u32_t i; - spiffs_obj_id *obj_table = (spiffs_obj_id *)fs->work; - obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG; - for (i = 0; i < SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id); i++) { - if ((obj_table[i] & ~SPIFFS_OBJ_ID_IX_FLAG) == obj_id) { - return i; - } - } - return -1; -} - -static s32_t spiffs_object_index_consistency_check_v(spiffs *fs, spiffs_obj_id obj_id, spiffs_block_ix cur_block, - int cur_entry, u32_t user_data, void *user_p) { - (void)user_data; - s32_t res_c = SPIFFS_VIS_COUNTINUE; - s32_t res = SPIFFS_OK; - u32_t *log_ix = (u32_t *)user_p; - spiffs_obj_id *obj_table = (spiffs_obj_id *)fs->work; - - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_PROGRESS, - (cur_block * 256)/fs->block_count, 0); - - if (obj_id != SPIFFS_OBJ_ID_FREE && obj_id != SPIFFS_OBJ_ID_DELETED && (obj_id & SPIFFS_OBJ_ID_IX_FLAG)) { - spiffs_page_header p_hdr; - spiffs_page_ix cur_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, cur_block, cur_entry); - - // load header - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - - if (p_hdr.span_ix == 0 && - (p_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) == - (SPIFFS_PH_FLAG_DELET)) { - SPIFFS_CHECK_DBG("IX: pix %04x, obj id:%04x spix:%04x header not fully deleted - deleting\n", - cur_pix, obj_id, p_hdr.span_ix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_DELETE_PAGE, cur_pix, obj_id); - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - return res_c; - } - - if ((p_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) == - (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) { - return res_c; - } - - if (p_hdr.span_ix == 0) { - // objix header page, register objid as reachable - int r = spiffs_object_index_search(fs, obj_id); - if (r == -1) { - // not registered, do it - obj_table[*log_ix] = obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - (*log_ix)++; - if (*log_ix >= SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)) { - *log_ix = 0; - } - } - } else { // span index - // objix page, see if header can be found - int r = spiffs_object_index_search(fs, obj_id); - u8_t delete = 0; - if (r == -1) { - // not in temporary index, try finding it - spiffs_page_ix objix_hdr_pix; - res = spiffs_obj_lu_find_id_and_span(fs, obj_id | SPIFFS_OBJ_ID_IX_FLAG, 0, 0, &objix_hdr_pix); - res_c = SPIFFS_VIS_COUNTINUE_RELOAD; - if (res == SPIFFS_OK) { - // found, register as reachable - obj_table[*log_ix] = obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - } else if (res == SPIFFS_ERR_NOT_FOUND) { - // not found, register as unreachable - delete = 1; - obj_table[*log_ix] = obj_id | SPIFFS_OBJ_ID_IX_FLAG; - } else { - SPIFFS_CHECK_RES(res); - } - (*log_ix)++; - if (*log_ix >= SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)) { - *log_ix = 0; - } - } else { - // in temporary index, check reachable flag - if ((obj_table[r] & SPIFFS_OBJ_ID_IX_FLAG)) { - // registered as unreachable - delete = 1; - } - } - - if (delete) { - SPIFFS_CHECK_DBG("IX: FIXUP: pix %04x, obj id:%04x spix:%04x is orphan index - deleting\n", - cur_pix, obj_id, p_hdr.span_ix); - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_DELETE_ORPHANED_INDEX, cur_pix, obj_id); - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - } - } // span index - } // valid object index id - - return res_c; -} - -// Removes orphaned and partially deleted index pages. -// Scans for index pages. When an index page is found, corresponding index header is searched for. -// If no such page exists, the index page cannot be reached as no index header exists and must be -// deleted. -s32_t spiffs_object_index_consistency_check(spiffs *fs) { - s32_t res = SPIFFS_OK; - // impl note: - // fs->work is used for a temporary object index memory, listing found object ids and - // indicating whether they can be reached or not. Acting as a fifo if object ids cannot fit. - // In the temporary object index memory, SPIFFS_OBJ_ID_IX_FLAG bit is used to indicate - // a reachable/unreachable object id. - c_memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - u32_t obj_id_log_ix = 0; - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_PROGRESS, 0, 0); - res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_object_index_consistency_check_v, 0, &obj_id_log_ix, - 0, 0); - if (res == SPIFFS_VIS_END) { - res = SPIFFS_OK; - } - if (res != SPIFFS_OK) { - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_ERROR, res, 0); - } - if (fs->check_cb_f) fs->check_cb_f(SPIFFS_CHECK_INDEX, SPIFFS_CHECK_PROGRESS, 256, 0); - return res; -} - diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_config.h b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_config.h deleted file mode 100644 index d59ac80b..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_config.h +++ /dev/null @@ -1,239 +0,0 @@ -/* - * spiffs_config.h - * - * Created on: Jul 3, 2013 - * Author: petera - */ - -#ifndef SPIFFS_CONFIG_H_ -#define SPIFFS_CONFIG_H_ - -#include "mem.h" -#include "c_types.h" -#include "stddef.h" -#include "osapi.h" -#include "ets_sys.h" - -#define c_memcpy os_memcpy -#define c_printf os_printf -#define c_memset os_memset - -typedef signed short file_t; -typedef long int s32_t; -typedef long unsigned int u32_t; -typedef int16_t s16_t; -typedef uint16_t u16_t; -typedef int8_t s8_t; -typedef uint8_t u8_t; - -#ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ -#endif - -#ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ -#endif - -#ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ -#endif - -#ifndef EOF -#define EOF (-1) -#endif - -// compile time switches - -// Set generic spiffs debug output call. -#ifndef SPIFFS_DGB -#define SPIFFS_DBG(...) //c_printf(__VA_ARGS__) -#endif -// Set spiffs debug output call for garbage collecting. -#ifndef SPIFFS_GC_DGB -#define SPIFFS_GC_DBG(...) //c_printf(__VA_ARGS__) -#endif -// Set spiffs debug output call for caching. -#ifndef SPIFFS_CACHE_DGB -#define SPIFFS_CACHE_DBG(...) //c_printf(__VA_ARGS__) -#endif -// Set spiffs debug output call for system consistency checks. -#ifndef SPIFFS_CHECK_DGB -#define SPIFFS_CHECK_DBG(...) //c_printf(__VA_ARGS__) -#endif - -// Enable/disable API functions to determine exact number of bytes -// for filedescriptor and cache buffers. Once decided for a configuration, -// this can be disabled to reduce flash. -#ifndef SPIFFS_BUFFER_HELP -#define SPIFFS_BUFFER_HELP 0 -#endif - -// Enables/disable memory read caching of nucleus file system operations. -// If enabled, memory area must be provided for cache in SPIFFS_mount. -#ifndef SPIFFS_CACHE -#define SPIFFS_CACHE 1 -#endif -#if SPIFFS_CACHE -// Enables memory write caching for file descriptors in hydrogen -#ifndef SPIFFS_CACHE_WR -#define SPIFFS_CACHE_WR 1 -#endif - -// Enable/disable statistics on caching. Debug/test purpose only. -#ifndef SPIFFS_CACHE_STATS -#define SPIFFS_CACHE_STATS 0 -#endif -#endif - -// Always check header of each accessed page to ensure consistent state. -// If enabled it will increase number of reads, will increase flash. -#ifndef SPIFFS_PAGE_CHECK -#define SPIFFS_PAGE_CHECK 1 -#endif - -// Define maximum number of gc runs to perform to reach desired free pages. -#ifndef SPIFFS_GC_MAX_RUNS -#define SPIFFS_GC_MAX_RUNS 5 -#endif - -// Enable/disable statistics on gc. Debug/test purpose only. -#ifndef SPIFFS_GC_STATS -#define SPIFFS_GC_STATS 0 -#endif - -// Garbage collecting examines all pages in a block which and sums up -// to a block score. Deleted pages normally gives positive score and -// used pages normally gives a negative score (as these must be moved). -// To have a fair wear-leveling, the erase age is also included in score, -// whose factor normally is the most positive. -// The larger the score, the more likely it is that the block will -// picked for garbage collection. - -// Garbage collecting heuristics - weight used for deleted pages. -#ifndef SPIFFS_GC_HEUR_W_DELET -#define SPIFFS_GC_HEUR_W_DELET (5) -#endif -// Garbage collecting heuristics - weight used for used pages. -#ifndef SPIFFS_GC_HEUR_W_USED -#define SPIFFS_GC_HEUR_W_USED (-1) -#endif -// Garbage collecting heuristics - weight used for time between -// last erased and erase of this block. -#ifndef SPIFFS_GC_HEUR_W_ERASE_AGE -#define SPIFFS_GC_HEUR_W_ERASE_AGE (50) -#endif - -// Object name maximum length. -#ifndef SPIFFS_OBJ_NAME_LEN -#define SPIFFS_OBJ_NAME_LEN (32) -#endif - -// Size of buffer allocated on stack used when copying data. -// Lower value generates more read/writes. No meaning having it bigger -// than logical page size. -#ifndef SPIFFS_COPY_BUFFER_STACK -#define SPIFFS_COPY_BUFFER_STACK (64) -#endif - -// Enable this to have an identifiable spiffs filesystem. This will look for -// a magic in all sectors to determine if this is a valid spiffs system or -// not on mount point. If not, SPIFFS_format must be called prior to mounting -// again. -#ifndef SPIFFS_USE_MAGIC -#define SPIFFS_USE_MAGIC (0) -#endif - -// SPIFFS_LOCK and SPIFFS_UNLOCK protects spiffs from reentrancy on api level -// These should be defined on a multithreaded system - -// define this to enter a mutex if you're running on a multithreaded system -#ifndef SPIFFS_LOCK -#define SPIFFS_LOCK(fs) -#endif -// define this to exit a mutex if you're running on a multithreaded system -#ifndef SPIFFS_UNLOCK -#define SPIFFS_UNLOCK(fs) -#endif - - -// Enable if only one spiffs instance with constant configuration will exist -// on the target. This will reduce calculations, flash and memory accesses. -// Parts of configuration must be defined below instead of at time of mount. -#ifndef SPIFFS_SINGLETON -#define SPIFFS_SINGLETON 0 -#endif - -#if SPIFFS_SINGLETON -// Instead of giving parameters in config struct, singleton build must -// give parameters in defines below. -#ifndef SPIFFS_CFG_PHYS_SZ -#define SPIFFS_CFG_PHYS_SZ(ignore) (1024*1024*2) -#endif -#ifndef SPIFFS_CFG_PHYS_ERASE_SZ -#define SPIFFS_CFG_PHYS_ERASE_SZ(ignore) (65536) -#endif -#ifndef SPIFFS_CFG_PHYS_ADDR -#define SPIFFS_CFG_PHYS_ADDR(ignore) (0) -#endif -#ifndef SPIFFS_CFG_LOG_PAGE_SZ -#define SPIFFS_CFG_LOG_PAGE_SZ(ignore) (256) -#endif -#ifndef SPIFFS_CFG_LOG_BLOCK_SZ -#define SPIFFS_CFG_LOG_BLOCK_SZ(ignore) (65536) -#endif -#endif - -// Enable this if your target needs aligned data for index tables -#ifndef SPIFFS_ALIGNED_OBJECT_INDEX_TABLES -#define SPIFFS_ALIGNED_OBJECT_INDEX_TABLES 1 -#endif - -// Set SPIFFS_TEST_VISUALISATION to non-zero to enable SPIFFS_vis function -// in the api. This function will visualize all filesystem using given printf -// function. -#ifndef SPIFFS_TEST_VISUALISATION -#define SPIFFS_TEST_VISUALISATION 1 -#endif -#if SPIFFS_TEST_VISUALISATION -#ifndef spiffs_printf -#define spiffs_printf(...) c_printf(__VA_ARGS__) -#endif -// spiffs_printf argument for a free page -#ifndef SPIFFS_TEST_VIS_FREE_STR -#define SPIFFS_TEST_VIS_FREE_STR "_" -#endif -// spiffs_printf argument for a deleted page -#ifndef SPIFFS_TEST_VIS_DELE_STR -#define SPIFFS_TEST_VIS_DELE_STR "/" -#endif -// spiffs_printf argument for an index page for given object id -#ifndef SPIFFS_TEST_VIS_INDX_STR -#define SPIFFS_TEST_VIS_INDX_STR(id) "i" -#endif -// spiffs_printf argument for a data page for given object id -#ifndef SPIFFS_TEST_VIS_DATA_STR -#define SPIFFS_TEST_VIS_DATA_STR(id) "d" -#endif -#endif - -// Types depending on configuration such as the amount of flash bytes -// given to spiffs file system in total (spiffs_file_system_size), -// the logical block size (log_block_size), and the logical page size -// (log_page_size) - -// Block index type. Make sure the size of this type can hold -// the highest number of all blocks - i.e. spiffs_file_system_size / log_block_size -typedef u16_t spiffs_block_ix; -// Page index type. Make sure the size of this type can hold -// the highest page number of all pages - i.e. spiffs_file_system_size / log_page_size -typedef u16_t spiffs_page_ix; -// Object id type - most significant bit is reserved for index flag. Make sure the -// size of this type can hold the highest object id on a full system, -// i.e. 2 + (spiffs_file_system_size / (2*log_page_size))*2 -typedef u16_t spiffs_obj_id; -// Object span index type. Make sure the size of this type can -// hold the largest possible span index on the system - -// i.e. (spiffs_file_system_size / log_page_size) - 1 -typedef u16_t spiffs_span_ix; - -#endif /* SPIFFS_CONFIG_H_ */ diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.c deleted file mode 100644 index e0a79d50..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.c +++ /dev/null @@ -1,157 +0,0 @@ -#include "spiffs_esp8266.h" -#include "spi_flash.h" -#include "esp8266_peri.h" -#include "Arduino.h" - -/* - FLASH ACCESS FUNCTIONS -*/ - -//lowest level sector erase method -bool flashmem_erase_sector( uint32_t sector_id ){ - WDT_RESET(); - noInterrupts(); - uint32_t chip_size = flashchip->chip_size; - flashchip->chip_size = 0x01000000; - bool erased = spi_flash_erase_sector( sector_id ) == SPI_FLASH_RESULT_OK; - flashchip->chip_size = chip_size; - interrupts(); - return erased; -} - -//lowest level data write method -uint32_t flashmem_write_internal( const void *from, uint32_t toaddr, uint32_t size ){ - toaddr -= INTERNAL_FLASH_START_ADDRESS; - SpiFlashOpResult r; - const uint32_t blkmask = INTERNAL_FLASH_WRITE_UNIT_SIZE - 1; - uint32_t *apbuf = NULL; - if(((uint32_t)from) & blkmask){ - apbuf = (uint32_t *)os_malloc(size); - if(!apbuf) - return 0; - os_memcpy(apbuf, from, size); - } - WDT_RESET(); - noInterrupts(); - uint32_t chip_size = flashchip->chip_size; - flashchip->chip_size = 0x01000000; - r = spi_flash_write(toaddr, apbuf?(uint32 *)apbuf:(uint32 *)from, size); - flashchip->chip_size = chip_size; - interrupts(); - if(apbuf) - os_free(apbuf); - if(SPI_FLASH_RESULT_OK == r) - return size; - else{ - SPIFFS_API_DBG_E( "ERROR in flash_write: r=%d at %08X\n", ( int )r, ( unsigned )toaddr+INTERNAL_FLASH_START_ADDRESS ); - return 0; - } -} - -//lowest level data read method -uint32_t flashmem_read_internal( void *to, uint32_t fromaddr, uint32_t size ){ - fromaddr -= INTERNAL_FLASH_START_ADDRESS; - SpiFlashOpResult r; - WDT_RESET(); - noInterrupts(); - uint32_t chip_size = flashchip->chip_size; - flashchip->chip_size = 0x01000000; - r = spi_flash_read(fromaddr, (uint32 *)to, size); - flashchip->chip_size = chip_size; - interrupts(); - if(SPI_FLASH_RESULT_OK == r) - return size; - else{ - SPIFFS_API_DBG_E( "ERROR in flash_read: r=%d at %08X\n", ( int )r, ( unsigned )fromaddr+INTERNAL_FLASH_START_ADDRESS ); - return 0; - } -} - -//mid level data write method -uint32_t flashmem_write( const void *from, uint32_t toaddr, uint32_t size ){ - uint32_t temp, rest, ssize = size; - unsigned i; - char tmpdata[ INTERNAL_FLASH_WRITE_UNIT_SIZE ]; - const uint8_t *pfrom = ( const uint8_t* )from; - const uint32_t blksize = INTERNAL_FLASH_WRITE_UNIT_SIZE; - const uint32_t blkmask = INTERNAL_FLASH_WRITE_UNIT_SIZE - 1; - - // Align the start - if(toaddr & blkmask){ - rest = toaddr & blkmask; - temp = toaddr & ~blkmask; // this is the actual aligned address - // c_memcpy( tmpdata, ( const void* )temp, blksize ); - flashmem_read_internal( tmpdata, temp, blksize ); - for( i = rest; size && ( i < blksize ); i ++, size --, pfrom ++ ) - tmpdata[ i ] = *pfrom; - flashmem_write_internal( tmpdata, temp, blksize ); - if( size == 0 ) - return ssize; - toaddr = temp + blksize; - } - // The start address is now a multiple of blksize - // Compute how many bytes we can write as multiples of blksize - rest = size & blkmask; - temp = size & ~blkmask; - // Program the blocks now - if(temp){ - flashmem_write_internal( pfrom, toaddr, temp ); - toaddr += temp; - pfrom += temp; - } - // And the final part of a block if needed - if(rest){ - // c_memcpy( tmpdata, ( const void* )toaddr, blksize ); - flashmem_read_internal( tmpdata, toaddr, blksize ); - for( i = 0; size && ( i < rest ); i ++, size --, pfrom ++ ) - tmpdata[ i ] = *pfrom; - flashmem_write_internal( tmpdata, toaddr, blksize ); - } - return ssize; -} - -//mid level data write method -uint32_t flashmem_read( void *to, uint32_t fromaddr, uint32_t size ){ - uint32_t temp, rest, ssize = size; - unsigned i; - char tmpdata[ INTERNAL_FLASH_READ_UNIT_SIZE ]; - uint8_t *pto = ( uint8_t* )to; - const uint32_t blksize = INTERNAL_FLASH_READ_UNIT_SIZE; - const uint32_t blkmask = INTERNAL_FLASH_READ_UNIT_SIZE - 1; - - // Align the start - if(fromaddr & blkmask){ - rest = fromaddr & blkmask; - temp = fromaddr & ~blkmask; // this is the actual aligned address - flashmem_read_internal( tmpdata, temp, blksize ); - for( i = rest; size && ( i < blksize ); i ++, size --, pto ++ ) - *pto = tmpdata[ i ]; - - if( size == 0 ) - return ssize; - fromaddr = temp + blksize; - } - // The start address is now a multiple of blksize - // Compute how many bytes we can read as multiples of blksize - rest = size & blkmask; - temp = size & ~blkmask; - // Program the blocks now - if(temp){ - flashmem_read_internal( pto, fromaddr, temp ); - fromaddr += temp; - pto += temp; - } - // And the final part of a block if needed - if(rest){ - flashmem_read_internal( tmpdata, fromaddr, blksize ); - for( i = 0; size && ( i < rest ); i ++, size --, pto ++ ) - *pto = tmpdata[ i ]; - } - return ssize; -} - -//shorthand when start and end addresses of the sector are not needed -uint32_t flashmem_get_sector_of_address( uint32_t addr ){ - return (addr - INTERNAL_FLASH_START_ADDRESS) / INTERNAL_FLASH_SECTOR_SIZE;; -} - diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.h b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.h deleted file mode 100644 index d97f3e3e..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_esp8266.h +++ /dev/null @@ -1,37 +0,0 @@ -#ifndef SYSTEM_FLASHMEM_H_ -#define SYSTEM_FLASHMEM_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "spiffs.h" - -/******************* -The W25Q32BV array is organized into 16,384 programmable pages of 256-bytes each. Up to 256 bytes can be programmed at a time. -Pages can be erased in groups of 16 (4KB sector erase), groups of 128 (32KB block erase), groups of 256 (64KB block erase) or -the entire chip (chip erase). The W25Q32BV has 1,024 erasable sectors and 64 erasable blocks respectively. -The small 4KB sectors allow for greater flexibility in applications that require data and parameter storage. -********************/ - -#define SPIFFS_API_DBG_V(fmt, ...) //os_printf(fmt, ##__VA_ARGS__) -#define SPIFFS_API_DBG_E(fmt, ...) //os_printf("ERROR: " fmt , ##__VA_ARGS__) - -#define INTERNAL_FLASH_PAGE_SIZE 256 -#define INTERNAL_FLASH_SECTOR_SIZE 4096 -#define INTERNAL_FLASH_START_ADDRESS 0x40200000 - -#define INTERNAL_FLASH_WRITE_UNIT_SIZE 4 -#define INTERNAL_FLASH_READ_UNIT_SIZE 4 - -extern uint32_t flashmem_write( const void *from, uint32_t toaddr, uint32_t size ); -extern uint32_t flashmem_read( void *to, uint32_t fromaddr, uint32_t size ); -extern bool flashmem_erase_sector( uint32_t sector_id ); -uint32_t flashmem_find_sector( uint32_t address, uint32_t *pstart, uint32_t *pend ); -uint32_t flashmem_get_sector_of_address( uint32_t addr ); - -#ifdef __cplusplus -} -#endif - -#endif /* SYSTEM_FLASHMEM_H_ */ diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_gc.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_gc.c deleted file mode 100644 index 87e4faf9..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_gc.c +++ /dev/null @@ -1,559 +0,0 @@ -#include "spiffs.h" -#include "spiffs_nucleus.h" - -// Erases a logical block and updates the erase counter. -// If cache is enabled, all pages that might be cached in this block -// is dropped. -static s32_t spiffs_gc_erase_block( - spiffs *fs, - spiffs_block_ix bix) { - s32_t res; - - SPIFFS_GC_DBG("gc: erase block %d\n", bix); - res = spiffs_erase_block(fs, bix); - SPIFFS_CHECK_RES(res); - -#if SPIFFS_CACHE - { - u32_t i; - for (i = 0; i < SPIFFS_PAGES_PER_BLOCK(fs); i++) { - spiffs_cache_drop_page(fs, SPIFFS_PAGE_FOR_BLOCK(fs, bix) + i); - } - } -#endif - return res; -} - -// Searches for blocks where all entries are deleted - if one is found, -// the block is erased. Compared to the non-quick gc, the quick one ensures -// that no updates are needed on existing objects on pages that are erased. -s32_t spiffs_gc_quick( - spiffs *fs) { - s32_t res = SPIFFS_OK; - u32_t blocks = fs->block_count; - spiffs_block_ix cur_block = 0; - u32_t cur_block_addr = 0; - int cur_entry = 0; - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - - SPIFFS_GC_DBG("gc_quick: running\n", cur_block); -#if SPIFFS_GC_STATS - fs->stats_gc_runs++; -#endif - - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - - // find fully deleted blocks - // check each block - while (res == SPIFFS_OK && blocks--) { - u16_t deleted_pages_in_block = 0; - - int obj_lookup_page = 0; - // check each object lookup page - while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, cur_block_addr + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && - cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) { - spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset]; - if (obj_id == SPIFFS_OBJ_ID_DELETED) { - deleted_pages_in_block++; - } else if (obj_id == SPIFFS_OBJ_ID_FREE) { - // kill scan, go for next block - obj_lookup_page = SPIFFS_OBJ_LOOKUP_PAGES(fs); - res = 1; // kill object lu loop - break; - } else { - // kill scan, go for next block - obj_lookup_page = SPIFFS_OBJ_LOOKUP_PAGES(fs); - res = 1; // kill object lu loop - break; - } - cur_entry++; - } // per entry - obj_lookup_page++; - } // per object lookup page - if (res == 1) res = SPIFFS_OK; - - if (res == SPIFFS_OK && deleted_pages_in_block == SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - // found a fully deleted block - fs->stats_p_deleted -= deleted_pages_in_block; - res = spiffs_gc_erase_block(fs, cur_block); - return res; - } - - cur_entry = 0; - cur_block++; - cur_block_addr += SPIFFS_CFG_LOG_BLOCK_SZ(fs); - } // per block - - return res; -} - -// Checks if garbaga collecting is necessary. If so a candidate block is found, -// cleansed and erased -s32_t spiffs_gc_check( - spiffs *fs, - u32_t len) { - s32_t res; - s32_t free_pages = - (SPIFFS_PAGES_PER_BLOCK(fs) - SPIFFS_OBJ_LOOKUP_PAGES(fs)) * (fs->block_count-2) - - fs->stats_p_allocated - fs->stats_p_deleted; - int tries = 0; - - if (fs->free_blocks > 3 && - (s32_t)len < free_pages * (s32_t)SPIFFS_DATA_PAGE_SIZE(fs)) { - return SPIFFS_OK; - } - - u32_t needed_pages = (len + SPIFFS_DATA_PAGE_SIZE(fs) - 1) / SPIFFS_DATA_PAGE_SIZE(fs); -// if (fs->free_blocks <= 2 && (s32_t)needed_pages > free_pages) { -// SPIFFS_GC_DBG("gc: full freeblk:%d needed:%d free:%d dele:%d\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted); -// return SPIFFS_ERR_FULL; -// } - if ((s32_t)needed_pages > (s32_t)(free_pages + fs->stats_p_deleted)) { - SPIFFS_GC_DBG("gc_check: full freeblk:%d needed:%d free:%d dele:%d\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted); - return SPIFFS_ERR_FULL; - } - - do { - SPIFFS_GC_DBG("\ngc_check #%d: run gc free_blocks:%d pfree:%d pallo:%d pdele:%d [%d] len:%d of %d\n", - tries, - fs->free_blocks, free_pages, fs->stats_p_allocated, fs->stats_p_deleted, (free_pages+fs->stats_p_allocated+fs->stats_p_deleted), - len, free_pages*SPIFFS_DATA_PAGE_SIZE(fs)); - - spiffs_block_ix *cands; - int count; - spiffs_block_ix cand; - s32_t prev_free_pages = free_pages; - // if the fs is crammed, ignore block age when selecting candidate - kind of a bad state - res = spiffs_gc_find_candidate(fs, &cands, &count, free_pages <= 0); - SPIFFS_CHECK_RES(res); - if (count == 0) { - SPIFFS_GC_DBG("gc_check: no candidates, return\n"); - return (s32_t)needed_pages < free_pages ? SPIFFS_OK : SPIFFS_ERR_FULL; - } -#if SPIFFS_GC_STATS - fs->stats_gc_runs++; -#endif - cand = cands[0]; - fs->cleaning = 1; - //c_printf("gcing: cleaning block %d\n", cand); - res = spiffs_gc_clean(fs, cand); - fs->cleaning = 0; - if (res < 0) { - SPIFFS_GC_DBG("gc_check: cleaning block %d, result %d\n", cand, res); - } else { - SPIFFS_GC_DBG("gc_check: cleaning block %d, result %d\n", cand, res); - } - SPIFFS_CHECK_RES(res); - - res = spiffs_gc_erase_page_stats(fs, cand); - SPIFFS_CHECK_RES(res); - - res = spiffs_gc_erase_block(fs, cand); - SPIFFS_CHECK_RES(res); - - free_pages = - (SPIFFS_PAGES_PER_BLOCK(fs) - SPIFFS_OBJ_LOOKUP_PAGES(fs)) * (fs->block_count - 2) - - fs->stats_p_allocated - fs->stats_p_deleted; - - if (prev_free_pages <= 0 && prev_free_pages == free_pages) { - // abort early to reduce wear, at least tried once - SPIFFS_GC_DBG("gc_check: early abort, no result on gc when fs crammed\n"); - break; - } - - } while (++tries < SPIFFS_GC_MAX_RUNS && (fs->free_blocks <= 2 || - (s32_t)len > free_pages*(s32_t)SPIFFS_DATA_PAGE_SIZE(fs))); - - free_pages = - (SPIFFS_PAGES_PER_BLOCK(fs) - SPIFFS_OBJ_LOOKUP_PAGES(fs)) * (fs->block_count - 2) - - fs->stats_p_allocated - fs->stats_p_deleted; - if ((s32_t)len > free_pages*(s32_t)SPIFFS_DATA_PAGE_SIZE(fs)) { - res = SPIFFS_ERR_FULL; - } - - SPIFFS_GC_DBG("gc_check: finished, %d dirty, blocks %d free, %d pages free, %d tries, res %d\n", - fs->stats_p_allocated + fs->stats_p_deleted, - fs->free_blocks, free_pages, tries, res); - - return res; -} - -// Updates page statistics for a block that is about to be erased -s32_t spiffs_gc_erase_page_stats( - spiffs *fs, - spiffs_block_ix bix) { - s32_t res = SPIFFS_OK; - int obj_lookup_page = 0; - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - int cur_entry = 0; - u32_t dele = 0; - u32_t allo = 0; - - // check each object lookup page - while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) { - spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset]; - if (obj_id == SPIFFS_OBJ_ID_FREE) { - } else if (obj_id == SPIFFS_OBJ_ID_DELETED) { - dele++; - } else { - allo++; - } - cur_entry++; - } // per entry - obj_lookup_page++; - } // per object lookup page - SPIFFS_GC_DBG("gc_check: wipe pallo:%d pdele:%d\n", allo, dele); - fs->stats_p_allocated -= allo; - fs->stats_p_deleted -= dele; - return res; -} - -// Finds block candidates to erase -s32_t spiffs_gc_find_candidate( - spiffs *fs, - spiffs_block_ix **block_candidates, - int *candidate_count, - char fs_crammed) { - s32_t res = SPIFFS_OK; - u32_t blocks = fs->block_count; - spiffs_block_ix cur_block = 0; - u32_t cur_block_addr = 0; - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - int cur_entry = 0; - - // using fs->work area as sorted candidate memory, (spiffs_block_ix)cand_bix/(s32_t)score - int max_candidates = MIN(fs->block_count, (SPIFFS_CFG_LOG_PAGE_SZ(fs)-8)/(sizeof(spiffs_block_ix) + sizeof(s32_t))); - *candidate_count = 0; - c_memset(fs->work, 0xff, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - - // divide up work area into block indices and scores - // todo alignment? - spiffs_block_ix *cand_blocks = (spiffs_block_ix *)fs->work; - s32_t *cand_scores = (s32_t *)(fs->work + max_candidates * sizeof(spiffs_block_ix)); - - *block_candidates = cand_blocks; - - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - - // check each block - while (res == SPIFFS_OK && blocks--) { - u16_t deleted_pages_in_block = 0; - u16_t used_pages_in_block = 0; - - int obj_lookup_page = 0; - // check each object lookup page - while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, cur_block_addr + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && - cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) { - spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset]; - if (obj_id == SPIFFS_OBJ_ID_FREE) { - // when a free entry is encountered, scan logic ensures that all following entries are free also - res = 1; // kill object lu loop - break; - } else if (obj_id == SPIFFS_OBJ_ID_DELETED) { - deleted_pages_in_block++; - } else { - used_pages_in_block++; - } - cur_entry++; - } // per entry - obj_lookup_page++; - } // per object lookup page - if (res == 1) res = SPIFFS_OK; - - // calculate score and insert into candidate table - // stoneage sort, but probably not so many blocks - if (res == SPIFFS_OK && deleted_pages_in_block > 0) { - // read erase count - spiffs_obj_id erase_count; - res = _spiffs_rd(fs, SPIFFS_OP_C_READ | SPIFFS_OP_T_OBJ_LU2, 0, - SPIFFS_ERASE_COUNT_PADDR(fs, cur_block), - sizeof(spiffs_obj_id), (u8_t *)&erase_count); - SPIFFS_CHECK_RES(res); - - spiffs_obj_id erase_age; - if (fs->max_erase_count > erase_count) { - erase_age = fs->max_erase_count - erase_count; - } else { - erase_age = SPIFFS_OBJ_ID_FREE - (erase_count - fs->max_erase_count); - } - - s32_t score = - deleted_pages_in_block * SPIFFS_GC_HEUR_W_DELET + - used_pages_in_block * SPIFFS_GC_HEUR_W_USED + - erase_age * (fs_crammed ? 0 : SPIFFS_GC_HEUR_W_ERASE_AGE); - int cand_ix = 0; - SPIFFS_GC_DBG("gc_check: bix:%d del:%d use:%d score:%d\n", cur_block, deleted_pages_in_block, used_pages_in_block, score); - while (cand_ix < max_candidates) { - if (cand_blocks[cand_ix] == (spiffs_block_ix)-1) { - cand_blocks[cand_ix] = cur_block; - cand_scores[cand_ix] = score; - break; - } else if (cand_scores[cand_ix] < score) { - int reorder_cand_ix = max_candidates - 2; - while (reorder_cand_ix >= cand_ix) { - cand_blocks[reorder_cand_ix + 1] = cand_blocks[reorder_cand_ix]; - cand_scores[reorder_cand_ix + 1] = cand_scores[reorder_cand_ix]; - reorder_cand_ix--; - } - cand_blocks[cand_ix] = cur_block; - cand_scores[cand_ix] = score; - break; - } - cand_ix++; - } - (*candidate_count)++; - } - - cur_entry = 0; - cur_block++; - cur_block_addr += SPIFFS_CFG_LOG_BLOCK_SZ(fs); - } // per block - - return res; -} - -typedef enum { - FIND_OBJ_DATA, - MOVE_OBJ_DATA, - MOVE_OBJ_IX, - FINISHED -} spiffs_gc_clean_state; - -typedef struct { - spiffs_gc_clean_state state; - spiffs_obj_id cur_obj_id; - spiffs_span_ix cur_objix_spix; - spiffs_page_ix cur_objix_pix; - int stored_scan_entry_index; - u8_t obj_id_found; -} spiffs_gc; - -// Empties given block by moving all data into free pages of another block -// Strategy: -// loop: -// scan object lookup for object data pages -// for first found id, check spix and load corresponding object index page to memory -// push object scan lookup entry index -// rescan object lookup, find data pages with same id and referenced by same object index -// move data page, update object index in memory -// when reached end of lookup, store updated object index -// pop object scan lookup entry index -// repeat loop until end of object lookup -// scan object lookup again for remaining object index pages, move to new page in other block -// -s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) { - s32_t res = SPIFFS_OK; - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - int cur_entry = 0; - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - spiffs_gc gc; - spiffs_page_ix cur_pix = 0; - spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work; - spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work; - - SPIFFS_GC_DBG("gc_clean: cleaning block %d\n", bix); - - c_memset(&gc, 0, sizeof(spiffs_gc)); - gc.state = FIND_OBJ_DATA; - - if (fs->free_cursor_block_ix == bix) { - // move free cursor to next block, cannot use free pages from the block we want to clean - fs->free_cursor_block_ix = (bix+1)%fs->block_count; - fs->free_cursor_obj_lu_entry = 0; - SPIFFS_GC_DBG("gc_clean: move free cursor to block %d\n", fs->free_cursor_block_ix); - } - - while (res == SPIFFS_OK && gc.state != FINISHED) { - SPIFFS_GC_DBG("gc_clean: state = %d entry:%d\n", gc.state, cur_entry); - gc.obj_id_found = 0; - - // scan through lookup pages - int obj_lookup_page = cur_entry / entries_per_page; - u8_t scan = 1; - // check each object lookup page - while (scan && res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), - SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (scan && res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) { - spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset]; - cur_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, cur_entry); - - // act upon object id depending on gc state - switch (gc.state) { - case FIND_OBJ_DATA: - if (obj_id != SPIFFS_OBJ_ID_DELETED && obj_id != SPIFFS_OBJ_ID_FREE && - ((obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0)) { - SPIFFS_GC_DBG("gc_clean: FIND_DATA state:%d - found obj id %04x\n", gc.state, obj_id); - gc.obj_id_found = 1; - gc.cur_obj_id = obj_id; - scan = 0; - } - break; - case MOVE_OBJ_DATA: - if (obj_id == gc.cur_obj_id) { - spiffs_page_header p_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - SPIFFS_GC_DBG("gc_clean: MOVE_DATA found data page %04x:%04x @ %04x\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix); - if (SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, p_hdr.span_ix) != gc.cur_objix_spix) { - SPIFFS_GC_DBG("gc_clean: MOVE_DATA no objix spix match, take in another run\n"); - } else { - spiffs_page_ix new_data_pix; - if (p_hdr.flags & SPIFFS_PH_FLAG_DELET) { - // move page - res = spiffs_page_move(fs, 0, 0, obj_id, &p_hdr, cur_pix, &new_data_pix); - SPIFFS_GC_DBG("gc_clean: MOVE_DATA move objix %04x:%04x page %04x to %04x\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix, new_data_pix); - SPIFFS_CHECK_RES(res); - // move wipes obj_lu, reload it - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), - SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - } else { - // page is deleted but not deleted in lookup, scrap it - SPIFFS_GC_DBG("gc_clean: MOVE_DATA wipe objix %04x:%04x page %04x\n", obj_id, p_hdr.span_ix, cur_pix); - res = spiffs_page_delete(fs, cur_pix); - SPIFFS_CHECK_RES(res); - new_data_pix = SPIFFS_OBJ_ID_FREE; - } - // update memory representation of object index page with new data page - if (gc.cur_objix_spix == 0) { - // update object index header page - ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[p_hdr.span_ix] = new_data_pix; - SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page %04x to objix_hdr entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix)); - } else { - // update object index page - ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix)] = new_data_pix; - SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page %04x to objix entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix)); - } - } - } - break; - case MOVE_OBJ_IX: - if (obj_id != SPIFFS_OBJ_ID_DELETED && obj_id != SPIFFS_OBJ_ID_FREE && - (obj_id & SPIFFS_OBJ_ID_IX_FLAG)) { - // found an index object id - spiffs_page_header p_hdr; - spiffs_page_ix new_pix; - // load header - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - if (p_hdr.flags & SPIFFS_PH_FLAG_DELET) { - // move page - res = spiffs_page_move(fs, 0, 0, obj_id, &p_hdr, cur_pix, &new_pix); - SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX move objix %04x:%04x page %04x to %04x\n", obj_id, p_hdr.span_ix, cur_pix, new_pix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_UPD, obj_id, p_hdr.span_ix, new_pix, 0); - // move wipes obj_lu, reload it - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), - SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - } else { - // page is deleted but not deleted in lookup, scrap it - SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX wipe objix %04x:%04x page %04x\n", obj_id, p_hdr.span_ix, cur_pix); - res = spiffs_page_delete(fs, cur_pix); - if (res == SPIFFS_OK) { - spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_DEL, obj_id, p_hdr.span_ix, cur_pix, 0); - } - } - SPIFFS_CHECK_RES(res); - } - break; - default: - scan = 0; - break; - } - cur_entry++; - } // per entry - obj_lookup_page++; - } // per object lookup page - - if (res != SPIFFS_OK) break; - - // state finalization and switch - switch (gc.state) { - case FIND_OBJ_DATA: - if (gc.obj_id_found) { - // find out corresponding obj ix page and load it to memory - spiffs_page_header p_hdr; - spiffs_page_ix objix_pix; - gc.stored_scan_entry_index = cur_entry; - cur_entry = 0; - gc.state = MOVE_OBJ_DATA; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr); - SPIFFS_CHECK_RES(res); - gc.cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, p_hdr.span_ix); - SPIFFS_GC_DBG("gc_clean: FIND_DATA find objix span_ix:%04x\n", gc.cur_objix_spix); - res = spiffs_obj_lu_find_id_and_span(fs, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_spix, 0, &objix_pix); - SPIFFS_CHECK_RES(res); - SPIFFS_GC_DBG("gc_clean: FIND_DATA found object index at page %04x\n", objix_pix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix->p_hdr, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_spix); - gc.cur_objix_pix = objix_pix; - } else { - gc.state = MOVE_OBJ_IX; - cur_entry = 0; // restart entry scan index - } - break; - case MOVE_OBJ_DATA: { - // store modified objix (hdr) page - spiffs_page_ix new_objix_pix; - gc.state = FIND_OBJ_DATA; - cur_entry = gc.stored_scan_entry_index; - if (gc.cur_objix_spix == 0) { - // store object index header page - res = spiffs_object_update_index_hdr(fs, 0, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_pix, fs->work, 0, 0, &new_objix_pix); - SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix_hdr page, %04x:%04x\n", new_objix_pix, 0); - SPIFFS_CHECK_RES(res); - } else { - // store object index page - res = spiffs_page_move(fs, 0, fs->work, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, 0, gc.cur_objix_pix, &new_objix_pix); - SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix page, %04x:%04x\n", new_objix_pix, objix->p_hdr.span_ix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_UPD, gc.cur_obj_id, objix->p_hdr.span_ix, new_objix_pix, 0); - } - } - break; - case MOVE_OBJ_IX: - gc.state = FINISHED; - break; - default: - cur_entry = 0; - break; - } - SPIFFS_GC_DBG("gc_clean: state-> %d\n", gc.state); - } // while state != FINISHED - - - return res; -} - diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_hydrogen.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_hydrogen.c deleted file mode 100644 index 6601b61a..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_hydrogen.c +++ /dev/null @@ -1,973 +0,0 @@ -/* - * spiffs_hydrogen.c - * - * Created on: Jun 16, 2013 - * Author: petera - */ - -#include "spiffs.h" -#include "spiffs_nucleus.h" - -static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh); - -#if SPIFFS_BUFFER_HELP -u32_t SPIFFS_buffer_bytes_for_filedescs(spiffs *fs, u32_t num_descs) { - return num_descs * sizeof(spiffs_fd); -} -#if SPIFFS_CACHE -u32_t SPIFFS_buffer_bytes_for_cache(spiffs *fs, u32_t num_pages) { - return sizeof(spiffs_cache) + num_pages * (sizeof(spiffs_cache_page) + SPIFFS_CFG_LOG_PAGE_SZ(fs)); -} -#endif -#endif - -u8_t SPIFFS_mounted(spiffs *fs) { - return SPIFFS_CHECK_MOUNT(fs); -} - -s32_t SPIFFS_format(spiffs *fs) { - SPIFFS_API_CHECK_CFG(fs); - if (SPIFFS_CHECK_MOUNT(fs)) { - fs->err_code = SPIFFS_ERR_MOUNTED; - return -1; - } - - s32_t res; - SPIFFS_LOCK(fs); - - spiffs_block_ix bix = 0; - while (bix < fs->block_count) { - fs->max_erase_count = 0; - res = spiffs_erase_block(fs, bix); - if (res != SPIFFS_OK) { - res = SPIFFS_ERR_ERASE_FAIL; - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - bix++; - } - - SPIFFS_UNLOCK(fs); - - return 0; -} - -s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work, - u8_t *fd_space, u32_t fd_space_size, - void *cache, u32_t cache_size, - spiffs_check_callback check_cb_f) { - SPIFFS_LOCK(fs); - c_memset(fs, 0, sizeof(spiffs)); - c_memcpy(&fs->cfg, config, sizeof(spiffs_config)); - fs->block_count = SPIFFS_CFG_PHYS_SZ(fs) / SPIFFS_CFG_LOG_BLOCK_SZ(fs); - fs->work = &work[0]; - fs->lu_work = &work[SPIFFS_CFG_LOG_PAGE_SZ(fs)]; - c_memset(fd_space, 0, fd_space_size); - // align fd_space pointer to pointer size byte boundary, below is safe - u8_t ptr_size = sizeof(void*); -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-to-int-cast" - u8_t addr_lsb = ((u8_t)fd_space) & (ptr_size-1); -#pragma GCC diagnostic pop - if (addr_lsb) { - fd_space += (ptr_size-addr_lsb); - fd_space_size -= (ptr_size-addr_lsb); - } - fs->fd_space = fd_space; - fs->fd_count = (fd_space_size/sizeof(spiffs_fd)); - - // align cache pointer to 4 byte boundary, below is safe -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wpointer-to-int-cast" - addr_lsb = ((u8_t)cache) & (ptr_size-1); -#pragma GCC diagnostic pop - if (addr_lsb) { - u8_t *cache_8 = (u8_t *)cache; - cache_8 += (ptr_size-addr_lsb); - cache = cache_8; - cache_size -= (ptr_size-addr_lsb); - } - if (cache_size & (ptr_size-1)) { - cache_size -= (cache_size & (ptr_size-1)); - } -#if SPIFFS_CACHE - fs->cache = cache; - fs->cache_size = cache_size; - spiffs_cache_init(fs); -#endif - - s32_t res; - -#if SPIFFS_USE_MAGIC - res = SPIFFS_CHECK_MAGIC_POSSIBLE(fs) ? SPIFFS_OK : SPIFFS_ERR_MAGIC_NOT_POSSIBLE; - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); -#endif - - fs->config_magic = SPIFFS_CONFIG_MAGIC; - - res = spiffs_obj_lu_scan(fs); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - SPIFFS_DBG("page index byte len: %d\n", SPIFFS_CFG_LOG_PAGE_SZ(fs)); - SPIFFS_DBG("object lookup pages: %d\n", SPIFFS_OBJ_LOOKUP_PAGES(fs)); - SPIFFS_DBG("page pages per block: %d\n", SPIFFS_PAGES_PER_BLOCK(fs)); - SPIFFS_DBG("page header length: %d\n", sizeof(spiffs_page_header)); - SPIFFS_DBG("object header index entries: %d\n", SPIFFS_OBJ_HDR_IX_LEN(fs)); - SPIFFS_DBG("object index entries: %d\n", SPIFFS_OBJ_IX_LEN(fs)); - SPIFFS_DBG("available file descriptors: %d\n", fs->fd_count); - SPIFFS_DBG("free blocks: %d\n", fs->free_blocks); - - fs->check_cb_f = check_cb_f; - - fs->mounted = 1; - - SPIFFS_UNLOCK(fs); - - return 0; -} - -void SPIFFS_unmount(spiffs *fs) { - if (!SPIFFS_CHECK_CFG(fs) || !SPIFFS_CHECK_MOUNT(fs)) return; - SPIFFS_LOCK(fs); - u32_t i; - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - for (i = 0; i < fs->fd_count; i++) { - spiffs_fd *cur_fd = &fds[i]; - if (cur_fd->file_nbr != 0) { -#if SPIFFS_CACHE - (void)spiffs_fflush_cache(fs, cur_fd->file_nbr); -#endif - spiffs_fd_return(fs, cur_fd->file_nbr); - } - } - fs->mounted = 0; - - SPIFFS_UNLOCK(fs); -} - -s32_t SPIFFS_errno(spiffs *fs) { - return fs->err_code; -} - -void SPIFFS_clearerr(spiffs *fs) { - fs->err_code = SPIFFS_OK; -} - -s32_t SPIFFS_creat(spiffs *fs, char *path, spiffs_mode mode) { - (void)mode; - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - spiffs_obj_id obj_id; - s32_t res; - - res = spiffs_obj_lu_find_free_obj_id(fs, &obj_id, (u8_t *)path); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - res = spiffs_object_create(fs, obj_id, (u8_t *)path, SPIFFS_TYPE_FILE, 0); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - SPIFFS_UNLOCK(fs); - return 0; -} - -spiffs_file SPIFFS_open(spiffs *fs, char *path, spiffs_flags flags, spiffs_mode mode) { - (void)mode; - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - spiffs_page_ix pix; - - s32_t res = spiffs_fd_find_new(fs, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_find_object_index_header_by_name(fs, (u8_t*)path, &pix); - if ((flags & SPIFFS_CREAT) == 0) { - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - - if ((flags & SPIFFS_CREAT) && res == SPIFFS_ERR_NOT_FOUND) { - spiffs_obj_id obj_id; - // no need to enter conflicting name here, already looked for it above - res = spiffs_obj_lu_find_free_obj_id(fs, &obj_id, 0); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - res = spiffs_object_create(fs, obj_id, (u8_t*)path, SPIFFS_TYPE_FILE, &pix); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - flags &= ~SPIFFS_TRUNC; - } else { - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - res = spiffs_object_open_by_page(fs, pix, fd, flags, mode); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - if (flags & SPIFFS_TRUNC) { - res = spiffs_object_truncate(fd, 0, 0); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - - fd->fdoffset = 0; - - SPIFFS_UNLOCK(fs); - - return fd->file_nbr; -} - -spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_flags flags, spiffs_mode mode) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - - s32_t res = spiffs_fd_find_new(fs, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_open_by_page(fs, e->pix, fd, flags, mode); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - if (flags & SPIFFS_TRUNC) { - res = spiffs_object_truncate(fd, 0, 0); - if (res < SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - - fd->fdoffset = 0; - - SPIFFS_UNLOCK(fs); - - return fd->file_nbr; -} - -s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - if ((fd->flags & SPIFFS_RDONLY) == 0) { - res = SPIFFS_ERR_NOT_READABLE; - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - -#if SPIFFS_CACHE_WR - spiffs_fflush_cache(fs, fh); -#endif - - if (fd->fdoffset + len >= fd->size) { - // reading beyond file size - s32_t avail = fd->size - fd->fdoffset; - if (avail <= 0) { - SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_END_OF_OBJECT); - } - res = spiffs_object_read(fd, fd->fdoffset, avail, (u8_t*)buf); - if (res == SPIFFS_ERR_END_OF_OBJECT) { - fd->fdoffset += avail; - SPIFFS_UNLOCK(fs); - return avail; - } else { - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - len = avail; - } - } else { - // reading within file size - res = spiffs_object_read(fd, fd->fdoffset, len, (u8_t*)buf); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - fd->fdoffset += len; - - SPIFFS_UNLOCK(fs); - - return len; -} - -static s32_t spiffs_hydro_write(spiffs *fs, spiffs_fd *fd, void *buf, u32_t offset, s32_t len) { - (void)fs; - s32_t res = SPIFFS_OK; - s32_t remaining = len; - if (fd->size != SPIFFS_UNDEFINED_LEN && offset < fd->size) { - s32_t m_len = MIN((s32_t)(fd->size - offset), len); - res = spiffs_object_modify(fd, offset, (u8_t *)buf, m_len); - SPIFFS_CHECK_RES(res); - remaining -= m_len; - u8_t *buf_8 = (u8_t *)buf; - buf_8 += m_len; - buf = buf_8; - offset += m_len; - } - if (remaining > 0) { - res = spiffs_object_append(fd, offset, (u8_t *)buf, remaining); - SPIFFS_CHECK_RES(res); - } - return len; - -} - -s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - u32_t offset; - - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - if ((fd->flags & SPIFFS_WRONLY) == 0) { - res = SPIFFS_ERR_NOT_WRITABLE; - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - - offset = fd->fdoffset; - -#if SPIFFS_CACHE_WR - if (fd->cache_page == 0) { - // see if object id is associated with cache already - fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd); - } -#endif - if (fd->flags & SPIFFS_APPEND) { - if (fd->size == SPIFFS_UNDEFINED_LEN) { - offset = 0; - } else { - offset = fd->size; - } -#if SPIFFS_CACHE_WR - if (fd->cache_page) { - offset = MAX(offset, fd->cache_page->offset + fd->cache_page->size); - } -#endif - } - -#if SPIFFS_CACHE_WR - if ((fd->flags & SPIFFS_DIRECT) == 0) { - if (len < (s32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs)) { - // small write, try to cache it - u8_t alloc_cpage = 1; - if (fd->cache_page) { - // have a cached page for this fd already, check cache page boundaries - if (offset < fd->cache_page->offset || // writing before cache - offset > fd->cache_page->offset + fd->cache_page->size || // writing after cache - offset + len > fd->cache_page->offset + SPIFFS_CFG_LOG_PAGE_SZ(fs)) // writing beyond cache page - { - // boundary violation, write back cache first and allocate new - SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %d for fd %d:%04x, boundary viol, offs:%d size:%d\n", - fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size); - res = spiffs_hydro_write(fs, fd, - spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix), - fd->cache_page->offset, fd->cache_page->size); - spiffs_cache_fd_release(fs, fd->cache_page); - SPIFFS_API_CHECK_RES(fs, res); - } else { - // writing within cache - alloc_cpage = 0; - } - } - - if (alloc_cpage) { - fd->cache_page = spiffs_cache_page_allocate_by_fd(fs, fd); - if (fd->cache_page) { - fd->cache_page->offset = offset; - fd->cache_page->size = 0; - SPIFFS_CACHE_DBG("CACHE_WR_ALLO: allocating cache page %d for fd %d:%04x\n", - fd->cache_page->ix, fd->file_nbr, fd->obj_id); - } - } - - if (fd->cache_page) { - u32_t offset_in_cpage = offset - fd->cache_page->offset; - SPIFFS_CACHE_DBG("CACHE_WR_WRITE: storing to cache page %d for fd %d:%04x, offs %d:%d len %d\n", - fd->cache_page->ix, fd->file_nbr, fd->obj_id, - offset, offset_in_cpage, len); - spiffs_cache *cache = spiffs_get_cache(fs); - u8_t *cpage_data = spiffs_get_cache_page(fs, cache, fd->cache_page->ix); - c_memcpy(&cpage_data[offset_in_cpage], buf, len); - fd->cache_page->size = MAX(fd->cache_page->size, offset_in_cpage + len); - fd->fdoffset += len; - SPIFFS_UNLOCK(fs); - return len; - } else { - res = spiffs_hydro_write(fs, fd, buf, offset, len); - SPIFFS_API_CHECK_RES(fs, res); - fd->fdoffset += len; - SPIFFS_UNLOCK(fs); - return res; - } - } else { - // big write, no need to cache it - but first check if there is a cached write already - if (fd->cache_page) { - // write back cache first - SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %d for fd %d:%04x, big write, offs:%d size:%d\n", - fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size); - res = spiffs_hydro_write(fs, fd, - spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix), - fd->cache_page->offset, fd->cache_page->size); - spiffs_cache_fd_release(fs, fd->cache_page); - SPIFFS_API_CHECK_RES(fs, res); - res = spiffs_hydro_write(fs, fd, buf, offset, len); - SPIFFS_API_CHECK_RES(fs, res); - } - } - } -#endif - - res = spiffs_hydro_write(fs, fd, buf, offset, len); - SPIFFS_API_CHECK_RES(fs, res); - fd->fdoffset += len; - - SPIFFS_UNLOCK(fs); - - return res; -} - -s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES(fs, res); - -#if SPIFFS_CACHE_WR - spiffs_fflush_cache(fs, fh); -#endif - - switch (whence) { - case SPIFFS_SEEK_CUR: - offs = fd->fdoffset+offs; - break; - case SPIFFS_SEEK_END: - offs = (fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size) + offs; - break; - } - - if (offs > (s32_t)fd->size) { - res = SPIFFS_ERR_END_OF_OBJECT; - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - spiffs_span_ix data_spix = offs / SPIFFS_DATA_PAGE_SIZE(fs); - spiffs_span_ix objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - if (fd->cursor_objix_spix != objix_spix) { - spiffs_page_ix pix; - res = spiffs_obj_lu_find_id_and_span( - fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, objix_spix, 0, &pix); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - fd->cursor_objix_spix = objix_spix; - fd->cursor_objix_pix = pix; - } - fd->fdoffset = offs; - - SPIFFS_UNLOCK(fs); - - return 0; -} - -s32_t SPIFFS_remove(spiffs *fs, char *path) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - spiffs_page_ix pix; - s32_t res; - - res = spiffs_fd_find_new(fs, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_find_object_index_header_by_name(fs, (u8_t *)path, &pix); - if (res != SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_open_by_page(fs, pix, fd, 0,0); - if (res != SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_truncate(fd, 0, 1); - if (res != SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - SPIFFS_UNLOCK(fs); - return 0; -} - -s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - if ((fd->flags & SPIFFS_WRONLY) == 0) { - res = SPIFFS_ERR_NOT_WRITABLE; - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - } - -#if SPIFFS_CACHE_WR - spiffs_cache_fd_release(fs, fd->cache_page); -#endif - - res = spiffs_object_truncate(fd, 0, 1); - - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - SPIFFS_UNLOCK(fs); - - return 0; -} - -static s32_t spiffs_stat_pix(spiffs *fs, spiffs_page_ix pix, spiffs_file fh, spiffs_stat *s) { - spiffs_page_object_ix_header objix_hdr; - spiffs_obj_id obj_id; - s32_t res =_spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, fh, - SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr); - SPIFFS_API_CHECK_RES(fs, res); - - u32_t obj_id_addr = SPIFFS_BLOCK_TO_PADDR(fs, SPIFFS_BLOCK_FOR_PAGE(fs , pix)) + - SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, pix) * sizeof(spiffs_obj_id); - res =_spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, fh, - obj_id_addr, sizeof(spiffs_obj_id), (u8_t *)&obj_id); - SPIFFS_API_CHECK_RES(fs, res); - - s->obj_id = obj_id; - s->type = objix_hdr.type; - s->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size; - strncpy((char *)s->name, (char *)objix_hdr.name, SPIFFS_OBJ_NAME_LEN); - - return res; -} - -s32_t SPIFFS_stat(spiffs *fs, char *path, spiffs_stat *s) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - s32_t res; - spiffs_page_ix pix; - - res = spiffs_object_find_object_index_header_by_name(fs, (u8_t*)path, &pix); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_stat_pix(fs, pix, 0, s); - - SPIFFS_UNLOCK(fs); - - return res; -} - -s32_t SPIFFS_fstat(spiffs *fs, spiffs_file fh, spiffs_stat *s) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - -#if SPIFFS_CACHE_WR - spiffs_fflush_cache(fs, fh); -#endif - - res = spiffs_stat_pix(fs, fd->objix_hdr_pix, fh, s); - - SPIFFS_UNLOCK(fs); - - return res; -} - -// Checks if there are any cached writes for the object id associated with -// given filehandle. If so, these writes are flushed. -static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) { - s32_t res = SPIFFS_OK; -#if SPIFFS_CACHE_WR - - spiffs_fd *fd; - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES(fs, res); - - if ((fd->flags & SPIFFS_DIRECT) == 0) { - if (fd->cache_page == 0) { - // see if object id is associated with cache already - fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd); - } - if (fd->cache_page) { - SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %d for fd %d:%04x, flush, offs:%d size:%d\n", - fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size); - res = spiffs_hydro_write(fs, fd, - spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix), - fd->cache_page->offset, fd->cache_page->size); - if (res < SPIFFS_OK) { - fs->err_code = res; - } - spiffs_cache_fd_release(fs, fd->cache_page); - } - } -#endif - - return res; -} - -s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - s32_t res = SPIFFS_OK; -#if SPIFFS_CACHE_WR - SPIFFS_LOCK(fs); - res = spiffs_fflush_cache(fs, fh); - SPIFFS_API_CHECK_RES_UNLOCK(fs,res); - SPIFFS_UNLOCK(fs); -#endif - - return res; -} - -void SPIFFS_close(spiffs *fs, spiffs_file fh) { - if (!SPIFFS_CHECK_CFG((fs))) { - (fs)->err_code = SPIFFS_ERR_NOT_CONFIGURED; - return; - } - - if (!SPIFFS_CHECK_MOUNT(fs)) { - fs->err_code = SPIFFS_ERR_NOT_MOUNTED; - return; - } - SPIFFS_LOCK(fs); - -#if SPIFFS_CACHE - spiffs_fflush_cache(fs, fh); -#endif - spiffs_fd_return(fs, fh); - - SPIFFS_UNLOCK(fs); -} - -s32_t SPIFFS_rename(spiffs *fs, char *old, char *new) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_page_ix pix_old, pix_dummy; - spiffs_fd *fd; - - s32_t res = spiffs_object_find_object_index_header_by_name(fs, (u8_t*)old, &pix_old); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_find_object_index_header_by_name(fs, (u8_t*)new, &pix_dummy); - if (res == SPIFFS_ERR_NOT_FOUND) { - res = SPIFFS_OK; - } else if (res == SPIFFS_OK) { - res = SPIFFS_ERR_CONFLICTING_NAME; - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_fd_find_new(fs, &fd); - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_open_by_page(fs, pix_old, fd, 0, 0); - if (res != SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, (u8_t*)new, - 0, &pix_dummy); - - if (res != SPIFFS_OK) { - spiffs_fd_return(fs, fd->file_nbr); - } - SPIFFS_API_CHECK_RES_UNLOCK(fs, res); - - SPIFFS_UNLOCK(fs); - - return res; -} - -spiffs_DIR *SPIFFS_opendir(spiffs *fs, char *name, spiffs_DIR *d) { - (void)name; - - if (!SPIFFS_CHECK_CFG((fs))) { - (fs)->err_code = SPIFFS_ERR_NOT_CONFIGURED; - return 0; - } - - if (!SPIFFS_CHECK_MOUNT(fs)) { - fs->err_code = SPIFFS_ERR_NOT_MOUNTED; - return 0; - } - - d->fs = fs; - d->block = 0; - d->entry = 0; - return d; -} - -static s32_t spiffs_read_dir_v( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_block_ix bix, - int ix_entry, - u32_t user_data, - void *user_p) { - (void)user_data; - s32_t res; - spiffs_page_object_ix_header objix_hdr; - if (obj_id == SPIFFS_OBJ_ID_FREE || obj_id == SPIFFS_OBJ_ID_DELETED || - (obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0) { - return SPIFFS_VIS_COUNTINUE; - } - - spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr); - if (res != SPIFFS_OK) return res; - if ((obj_id & SPIFFS_OBJ_ID_IX_FLAG) && - objix_hdr.p_hdr.span_ix == 0 && - (objix_hdr.p_hdr.flags& (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) == - (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) { - struct spiffs_dirent *e = (struct spiffs_dirent *)user_p; - e->obj_id = obj_id; - strcpy((char *)e->name, (char *)objix_hdr.name); - e->type = objix_hdr.type; - e->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size; - e->pix = pix; - return SPIFFS_OK; - } - - return SPIFFS_VIS_COUNTINUE; -} - -struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) { - if (!SPIFFS_CHECK_MOUNT(d->fs)) { - d->fs->err_code = SPIFFS_ERR_NOT_MOUNTED; - return 0; - } - SPIFFS_LOCK(fs); - - spiffs_block_ix bix; - int entry; - s32_t res; - struct spiffs_dirent *ret = 0; - - res = spiffs_obj_lu_find_entry_visitor(d->fs, - d->block, - d->entry, - SPIFFS_VIS_NO_WRAP, - 0, - spiffs_read_dir_v, - 0, - e, - &bix, - &entry); - if (res == SPIFFS_OK) { - d->block = bix; - d->entry = entry + 1; - ret = e; - } else { - d->fs->err_code = res; - } - SPIFFS_UNLOCK(fs); - return ret; -} - -s32_t SPIFFS_closedir(spiffs_DIR *d) { - SPIFFS_API_CHECK_CFG(d->fs); - SPIFFS_API_CHECK_MOUNT(d->fs); - return 0; -} - -s32_t SPIFFS_check(spiffs *fs) { - s32_t res; - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - res = spiffs_lookup_consistency_check(fs, 0); - - res = spiffs_object_index_consistency_check(fs); - - res = spiffs_page_consistency_check(fs); - - res = spiffs_obj_lu_scan(fs); - - SPIFFS_UNLOCK(fs); - return res; -} - -s32_t SPIFFS_info(spiffs *fs, u32_t *total, u32_t *used) { - s32_t res = SPIFFS_OK; - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - u32_t pages_per_block = SPIFFS_PAGES_PER_BLOCK(fs); - u32_t blocks = fs->block_count; - u32_t obj_lu_pages = SPIFFS_OBJ_LOOKUP_PAGES(fs); - u32_t data_page_size = SPIFFS_DATA_PAGE_SIZE(fs); - u32_t total_data_pages = (blocks - 2) * (pages_per_block - obj_lu_pages) + 1; // -2 for spare blocks, +1 for emergency page - - if (total) { - *total = total_data_pages * data_page_size; - } - - if (used) { - *used = fs->stats_p_allocated * data_page_size; - } - - SPIFFS_UNLOCK(fs); - return res; -} - -s32_t SPIFFS_eof(spiffs *fs, spiffs_file fh) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES(fs, res); - -#if SPIFFS_CACHE_WR - spiffs_fflush_cache(fs, fh); -#endif - - res = (fd->fdoffset == fd->size); - - SPIFFS_UNLOCK(fs); - return res; -} - -s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh) { - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - spiffs_fd *fd; - s32_t res; - res = spiffs_fd_get(fs, fh, &fd); - SPIFFS_API_CHECK_RES(fs, res); - -#if SPIFFS_CACHE_WR - spiffs_fflush_cache(fs, fh); -#endif - - res = fd->fdoffset; - - SPIFFS_UNLOCK(fs); - return res; -} - -#if SPIFFS_TEST_VISUALISATION -s32_t SPIFFS_vis(spiffs *fs) { - s32_t res = SPIFFS_OK; - SPIFFS_API_CHECK_CFG(fs); - SPIFFS_API_CHECK_MOUNT(fs); - SPIFFS_LOCK(fs); - - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - spiffs_block_ix bix = 0; - - while (bix < fs->block_count) { - // check each object lookup page - int obj_lookup_page = 0; - int cur_entry = 0; - - while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) { - spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset]; - if (cur_entry == 0) { - spiffs_printf("%4i ", bix); - } else if ((cur_entry & 0x3f) == 0) { - spiffs_printf(" "); - } - if (obj_id == SPIFFS_OBJ_ID_FREE) { - spiffs_printf(SPIFFS_TEST_VIS_FREE_STR); - } else if (obj_id == SPIFFS_OBJ_ID_DELETED) { - spiffs_printf(SPIFFS_TEST_VIS_DELE_STR); - } else if (obj_id & SPIFFS_OBJ_ID_IX_FLAG){ - spiffs_printf(SPIFFS_TEST_VIS_INDX_STR(obj_id)); - } else { - spiffs_printf(SPIFFS_TEST_VIS_DATA_STR(obj_id)); - } - cur_entry++; - if ((cur_entry & 0x3f) == 0) { - spiffs_printf("\n"); - } - } // per entry - obj_lookup_page++; - } // per object lookup page - - spiffs_obj_id erase_count; - res = _spiffs_rd(fs, SPIFFS_OP_C_READ | SPIFFS_OP_T_OBJ_LU2, 0, - SPIFFS_ERASE_COUNT_PADDR(fs, bix), - sizeof(spiffs_obj_id), (u8_t *)&erase_count); - SPIFFS_CHECK_RES(res); - - if (erase_count != (spiffs_obj_id)-1) { - spiffs_printf("\tera_cnt: %d\n", erase_count); - } else { - spiffs_printf("\tera_cnt: N/A\n"); - } - - bix++; - } // per block - - spiffs_printf("era_cnt_max: %d\n", fs->max_erase_count); - spiffs_printf("last_errno: %d\n", fs->err_code); - spiffs_printf("blocks: %d\n", fs->block_count); - spiffs_printf("free_blocks: %d\n", fs->free_blocks); - spiffs_printf("page_alloc: %d\n", fs->stats_p_allocated); - spiffs_printf("page_delet: %d\n", fs->stats_p_deleted); - u32_t total, used; - SPIFFS_info(fs, &total, &used); - spiffs_printf("used: %d of %d\n", used, total); - - SPIFFS_UNLOCK(fs); - return res; -} -#endif diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.c b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.c deleted file mode 100644 index fa75fd8e..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.c +++ /dev/null @@ -1,1896 +0,0 @@ -#include "spiffs.h" -#include "spiffs_nucleus.h" - -static s32_t spiffs_page_data_check(spiffs *fs, spiffs_fd *fd, spiffs_page_ix pix, spiffs_span_ix spix) { - s32_t res = SPIFFS_OK; - if (pix == (spiffs_page_ix)-1) { - // referring to page 0xffff...., bad object index - return SPIFFS_ERR_INDEX_REF_FREE; - } - if (pix % SPIFFS_PAGES_PER_BLOCK(fs) < SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - // referring to an object lookup page, bad object index - return SPIFFS_ERR_INDEX_REF_LU; - } - if (pix > SPIFFS_MAX_PAGES(fs)) { - // referring to a bad page - return SPIFFS_ERR_INDEX_REF_INVALID; - } -#if SPIFFS_PAGE_CHECK - spiffs_page_header ph; - res = _spiffs_rd( - fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_READ, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, pix), - sizeof(spiffs_page_header), - (u8_t *)&ph); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_DATA(ph, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, spix); -#endif - return res; -} - -static s32_t spiffs_page_index_check(spiffs *fs, spiffs_fd *fd, spiffs_page_ix pix, spiffs_span_ix spix) { - s32_t res = SPIFFS_OK; - if (pix == (spiffs_page_ix)-1) { - // referring to page 0xffff...., bad object index - return SPIFFS_ERR_INDEX_FREE; - } - if (pix % SPIFFS_PAGES_PER_BLOCK(fs) < SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - // referring to an object lookup page, bad object index - return SPIFFS_ERR_INDEX_LU; - } - if (pix > SPIFFS_MAX_PAGES(fs)) { - // referring to a bad page - return SPIFFS_ERR_INDEX_INVALID; - } -#if SPIFFS_PAGE_CHECK - spiffs_page_header ph; - res = _spiffs_rd( - fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, pix), - sizeof(spiffs_page_header), - (u8_t *)&ph); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(ph, fd->obj_id, spix); -#endif - return res; -} - -#if !SPIFFS_CACHE - -s32_t spiffs_phys_rd( - spiffs *fs, - u32_t addr, - u32_t len, - u8_t *dst) { - return fs->cfg.hal_read_f(addr, len, dst); -} - -s32_t spiffs_phys_wr( - spiffs *fs, - u32_t addr, - u32_t len, - u8_t *src) { - return fs->cfg.hal_write_f(addr, len, src); -} - -#endif - -s32_t spiffs_phys_cpy( - spiffs *fs, - spiffs_file fh, - u32_t dst, - u32_t src, - u32_t len) { - s32_t res; - u8_t b[SPIFFS_COPY_BUFFER_STACK]; - while (len > 0) { - u32_t chunk_size = MIN(SPIFFS_COPY_BUFFER_STACK, len); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_MOVS, fh, src, chunk_size, b); - SPIFFS_CHECK_RES(res); - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_MOVD, fh, dst, chunk_size, b); - SPIFFS_CHECK_RES(res); - len -= chunk_size; - src += chunk_size; - dst += chunk_size; - } - return SPIFFS_OK; -} - -// Find object lookup entry containing given id with visitor. -// Iterate over object lookup pages in each block until a given object id entry is found. -// When found, the visitor function is called with block index, entry index and user_data. -// If visitor returns SPIFFS_VIS_CONTINUE, the search goes on. Otherwise, the search will be -// ended and visitor's return code is returned to caller. -// If no visitor is given (0) the search returns on first entry with matching object id. -// If no match is found in all look up, SPIFFS_VIS_END is returned. -// @param fs the file system -// @param starting_block the starting block to start search in -// @param starting_lu_entry the look up index entry to start search in -// @param flags ored combination of SPIFFS_VIS_CHECK_ID, SPIFFS_VIS_CHECK_PH, -// SPIFFS_VIS_NO_WRAP -// @param obj_id argument object id -// @param v visitor callback function -// @param user_data any data, passed to the callback visitor function -// @param user_p any pointer, passed to the callback visitor function -// @param block_ix reported block index where match was found -// @param lu_entry reported look up index where match was found -s32_t spiffs_obj_lu_find_entry_visitor( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - u8_t flags, - spiffs_obj_id obj_id, - spiffs_visitor_f v, - u32_t user_data, - void *user_p, - spiffs_block_ix *block_ix, - int *lu_entry) { - s32_t res = SPIFFS_OK; - s32_t entry_count = fs->block_count * SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs); - spiffs_block_ix cur_block = starting_block; - u32_t cur_block_addr = starting_block * SPIFFS_CFG_LOG_BLOCK_SZ(fs); - - spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work; - int cur_entry = starting_lu_entry; - int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id)); - - // wrap initial - if (cur_entry >= (int)SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs) - 1) { - cur_entry = 0; - cur_block++; - cur_block_addr = cur_block * SPIFFS_CFG_LOG_BLOCK_SZ(fs); - if (cur_block >= fs->block_count) { - if (flags & SPIFFS_VIS_NO_WRAP) { - return SPIFFS_VIS_END; - } else { - // block wrap - cur_block = 0; - cur_block_addr = 0; - } - } - } - - // check each block - while (res == SPIFFS_OK && entry_count > 0) { - int obj_lookup_page = cur_entry / entries_per_page; - // check each object lookup page - while (res == SPIFFS_OK && obj_lookup_page < (int)SPIFFS_OBJ_LOOKUP_PAGES(fs)) { - int entry_offset = obj_lookup_page * entries_per_page; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, cur_block_addr + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - // check each entry - while (res == SPIFFS_OK && - cur_entry - entry_offset < entries_per_page && // for non-last obj lookup pages - cur_entry < (int)SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs)) // for last obj lookup page - { - if ((flags & SPIFFS_VIS_CHECK_ID) == 0 || obj_lu_buf[cur_entry-entry_offset] == obj_id) { - if (block_ix) *block_ix = cur_block; - if (lu_entry) *lu_entry = cur_entry; - if (v) { - res = v( - fs, - (flags & SPIFFS_VIS_CHECK_PH) ? obj_id : obj_lu_buf[cur_entry-entry_offset], - cur_block, - cur_entry, - user_data, - user_p); - if (res == SPIFFS_VIS_COUNTINUE || res == SPIFFS_VIS_COUNTINUE_RELOAD) { - if (res == SPIFFS_VIS_COUNTINUE_RELOAD) { - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, cur_block_addr + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work); - SPIFFS_CHECK_RES(res); - } - res = SPIFFS_OK; - cur_entry++; - entry_count--; - continue; - } else { - return res; - } - } else { - return SPIFFS_OK; - } - } - entry_count--; - cur_entry++; - } // per entry - obj_lookup_page++; - } // per object lookup page - cur_entry = 0; - cur_block++; - cur_block_addr += SPIFFS_CFG_LOG_BLOCK_SZ(fs); - if (cur_block >= fs->block_count) { - if (flags & SPIFFS_VIS_NO_WRAP) { - return SPIFFS_VIS_END; - } else { - // block wrap - cur_block = 0; - cur_block_addr = 0; - } - } - } // per block - - SPIFFS_CHECK_RES(res); - - return SPIFFS_VIS_END; -} - -s32_t spiffs_erase_block( - spiffs *fs, - spiffs_block_ix bix) { - s32_t res; - u32_t addr = SPIFFS_BLOCK_TO_PADDR(fs, bix); - s32_t size = SPIFFS_CFG_LOG_BLOCK_SZ(fs); - - // here we ignore res, just try erasing the block - while (size > 0) { - SPIFFS_DBG("erase %08x:%08x\n", addr, SPIFFS_CFG_PHYS_ERASE_SZ(fs)); - (void)fs->cfg.hal_erase_f(addr, SPIFFS_CFG_PHYS_ERASE_SZ(fs)); - addr += SPIFFS_CFG_PHYS_ERASE_SZ(fs); - size -= SPIFFS_CFG_PHYS_ERASE_SZ(fs); - } - fs->free_blocks++; - - // register erase count for this block - res = _spiffs_wr(fs, SPIFFS_OP_C_WRTHRU | SPIFFS_OP_T_OBJ_LU2, 0, - SPIFFS_ERASE_COUNT_PADDR(fs, bix), - sizeof(spiffs_obj_id), (u8_t *)&fs->max_erase_count); - SPIFFS_CHECK_RES(res); - -#if SPIFFS_USE_MAGIC - // finally, write magic - spiffs_obj_id magic = SPIFFS_MAGIC(fs); - res = _spiffs_wr(fs, SPIFFS_OP_C_WRTHRU | SPIFFS_OP_T_OBJ_LU2, 0, - SPIFFS_MAGIC_PADDR(fs, bix), - sizeof(spiffs_obj_id), (u8_t *)&magic); - SPIFFS_CHECK_RES(res); -#endif - - fs->max_erase_count++; - if (fs->max_erase_count == SPIFFS_OBJ_ID_IX_FLAG) { - fs->max_erase_count = 0; - } - - return res; -} - - -static s32_t spiffs_obj_lu_scan_v( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_block_ix bix, - int ix_entry, - u32_t user_data, - void *user_p) { - (void)bix; - (void)user_data; - (void)user_p; - if (obj_id == SPIFFS_OBJ_ID_FREE) { - if (ix_entry == 0) { - fs->free_blocks++; - // todo optimize further, return SPIFFS_NEXT_BLOCK - } - } else if (obj_id == SPIFFS_OBJ_ID_DELETED) { - fs->stats_p_deleted++; - } else { - fs->stats_p_allocated++; - } - - return SPIFFS_VIS_COUNTINUE; -} - - -// Scans thru all obj lu and counts free, deleted and used pages -// Find the maximum block erase count -// Checks magic if enabled -s32_t spiffs_obj_lu_scan( - spiffs *fs) { - s32_t res; - spiffs_block_ix bix; - int entry; -#if SPIFFS_USE_MAGIC - spiffs_block_ix unerased_bix = (spiffs_block_ix)-1; -#endif - - // find out erase count - // if enabled, check magic - bix = 0; - spiffs_obj_id erase_count_final; - spiffs_obj_id erase_count_min = SPIFFS_OBJ_ID_FREE; - spiffs_obj_id erase_count_max = 0; - while (bix < fs->block_count) { -#if SPIFFS_USE_MAGIC - spiffs_obj_id magic; - res = _spiffs_rd(fs, - SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_MAGIC_PADDR(fs, bix) , - sizeof(spiffs_obj_id), (u8_t *)&magic); - - SPIFFS_CHECK_RES(res); - if (magic != SPIFFS_MAGIC(fs)) { - if (unerased_bix == (spiffs_block_ix)-1) { - // allow one unerased block as it might be powered down during an erase - unerased_bix = bix; - } else { - // more than one unerased block, bail out - SPIFFS_CHECK_RES(SPIFFS_ERR_NOT_A_FS); - } - } -#endif - spiffs_obj_id erase_count; - res = _spiffs_rd(fs, - SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_ERASE_COUNT_PADDR(fs, bix) , - sizeof(spiffs_obj_id), (u8_t *)&erase_count); - SPIFFS_CHECK_RES(res); - if (erase_count != SPIFFS_OBJ_ID_FREE) { - erase_count_min = MIN(erase_count_min, erase_count); - erase_count_max = MAX(erase_count_max, erase_count); - } - bix++; - } - - if (erase_count_min == 0 && erase_count_max == SPIFFS_OBJ_ID_FREE) { - // clean system, set counter to zero - erase_count_final = 0; - } else if (erase_count_max - erase_count_min > (SPIFFS_OBJ_ID_FREE)/2) { - // wrap, take min - erase_count_final = erase_count_min+1; - } else { - erase_count_final = erase_count_max+1; - } - - fs->max_erase_count = erase_count_final; - -#if SPIFFS_USE_MAGIC - if (unerased_bix != (spiffs_block_ix)-1) { - // found one unerased block, remedy - SPIFFS_DBG("mount: erase block %d\n", bix); - res = spiffs_erase_block(fs, unerased_bix); - SPIFFS_CHECK_RES(res); - } -#endif - - // count blocks - - fs->free_blocks = 0; - fs->stats_p_allocated = 0; - fs->stats_p_deleted = 0; - - res = spiffs_obj_lu_find_entry_visitor(fs, - 0, - 0, - 0, - 0, - spiffs_obj_lu_scan_v, - 0, - 0, - &bix, - &entry); - - if (res == SPIFFS_VIS_END) { - res = SPIFFS_OK; - } - - SPIFFS_CHECK_RES(res); - - return res; -} - -// Find free object lookup entry -// Iterate over object lookup pages in each block until a free object id entry is found -s32_t spiffs_obj_lu_find_free( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - spiffs_block_ix *block_ix, - int *lu_entry) { - s32_t res; - if (!fs->cleaning && fs->free_blocks < 2) { - res = spiffs_gc_quick(fs); - SPIFFS_CHECK_RES(res); - if (fs->free_blocks < 2) { - return SPIFFS_ERR_FULL; - } - } - res = spiffs_obj_lu_find_id(fs, starting_block, starting_lu_entry, - SPIFFS_OBJ_ID_FREE, block_ix, lu_entry); - if (res == SPIFFS_OK) { - fs->free_cursor_block_ix = *block_ix; - fs->free_cursor_obj_lu_entry = *lu_entry; - if (*lu_entry == 0) { - fs->free_blocks--; - } - } - if (res == SPIFFS_VIS_END) { - SPIFFS_DBG("fs full\n"); - } - - return res == SPIFFS_VIS_END ? SPIFFS_ERR_FULL : res; -} - -// Find object lookup entry containing given id -// Iterate over object lookup pages in each block until a given object id entry is found -s32_t spiffs_obj_lu_find_id( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - spiffs_obj_id obj_id, - spiffs_block_ix *block_ix, - int *lu_entry) { - s32_t res = spiffs_obj_lu_find_entry_visitor( - fs, starting_block, starting_lu_entry, SPIFFS_VIS_CHECK_ID, obj_id, 0, 0, 0, block_ix, lu_entry); - if (res == SPIFFS_VIS_END) { - res = SPIFFS_ERR_NOT_FOUND; - } - return res; -} - - -static s32_t spiffs_obj_lu_find_id_and_span_v( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_block_ix bix, - int ix_entry, - u32_t user_data, - void *user_p) { - s32_t res; - spiffs_page_header ph; - spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry); - res = _spiffs_rd(fs, 0, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_header), (u8_t *)&ph); - SPIFFS_CHECK_RES(res); - if (ph.obj_id == obj_id && - ph.span_ix == (spiffs_span_ix)user_data && - (ph.flags & (SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_USED)) == SPIFFS_PH_FLAG_DELET && - !((obj_id & SPIFFS_OBJ_ID_IX_FLAG) && (ph.flags & SPIFFS_PH_FLAG_IXDELE) == 0 && ph.span_ix == 0) && - (user_p == 0 || *((spiffs_page_ix *)user_p) != pix)) { - return SPIFFS_OK; - } else { - return SPIFFS_VIS_COUNTINUE; - } -} - -// Find object lookup entry containing given id and span index -// Iterate over object lookup pages in each block until a given object id entry is found -s32_t spiffs_obj_lu_find_id_and_span( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix exclusion_pix, - spiffs_page_ix *pix) { - s32_t res; - spiffs_block_ix bix; - int entry; - - res = spiffs_obj_lu_find_entry_visitor(fs, - fs->cursor_block_ix, - fs->cursor_obj_lu_entry, - SPIFFS_VIS_CHECK_ID, - obj_id, - spiffs_obj_lu_find_id_and_span_v, - (u32_t)spix, - exclusion_pix ? &exclusion_pix : 0, - &bix, - &entry); - - if (res == SPIFFS_VIS_END) { - res = SPIFFS_ERR_NOT_FOUND; - } - - SPIFFS_CHECK_RES(res); - - if (pix) { - *pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - } - - fs->cursor_block_ix = bix; - fs->cursor_obj_lu_entry = entry; - - return res; -} - -// Find object lookup entry containing given id and span index in page headers only -// Iterate over object lookup pages in each block until a given object id entry is found -s32_t spiffs_obj_lu_find_id_and_span_by_phdr( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix exclusion_pix, - spiffs_page_ix *pix) { - s32_t res; - spiffs_block_ix bix; - int entry; - - res = spiffs_obj_lu_find_entry_visitor(fs, - fs->cursor_block_ix, - fs->cursor_obj_lu_entry, - SPIFFS_VIS_CHECK_PH, - obj_id, - spiffs_obj_lu_find_id_and_span_v, - (u32_t)spix, - exclusion_pix ? &exclusion_pix : 0, - &bix, - &entry); - - if (res == SPIFFS_VIS_END) { - res = SPIFFS_ERR_NOT_FOUND; - } - - SPIFFS_CHECK_RES(res); - - if (pix) { - *pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - } - - fs->cursor_block_ix = bix; - fs->cursor_obj_lu_entry = entry; - - return res; -} - -// Allocates a free defined page with given obj_id -// Occupies object lookup entry and page -// data may be NULL; where only page header is stored, len and page_offs is ignored -s32_t spiffs_page_allocate_data( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_page_header *ph, - u8_t *data, - u32_t len, - u32_t page_offs, - u8_t finalize, - spiffs_page_ix *pix) { - s32_t res = SPIFFS_OK; - spiffs_block_ix bix; - int entry; - - // find free entry - res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry); - SPIFFS_CHECK_RES(res); - - // occupy page in object lookup - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, - 0, SPIFFS_BLOCK_TO_PADDR(fs, bix) + entry * sizeof(spiffs_obj_id), sizeof(spiffs_obj_id), (u8_t*)&obj_id); - SPIFFS_CHECK_RES(res); - - fs->stats_p_allocated++; - - // write page header - ph->flags &= ~SPIFFS_PH_FLAG_USED; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, bix, entry), sizeof(spiffs_page_header), (u8_t*)ph); - SPIFFS_CHECK_RES(res); - - // write page data - if (data) { - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0,SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, bix, entry) + sizeof(spiffs_page_header) + page_offs, len, data); - SPIFFS_CHECK_RES(res); - } - - // finalize header if necessary - if (finalize && (ph->flags & SPIFFS_PH_FLAG_FINAL)) { - ph->flags &= ~SPIFFS_PH_FLAG_FINAL; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, bix, entry) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&ph->flags); - SPIFFS_CHECK_RES(res); - } - - // return written page - if (pix) { - *pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - } - - return res; -} - -// Moves a page from src to a free page and finalizes it. Updates page index. Page data is given in param page. -// If page data is null, provided header is used for metainfo and page data is physically copied. -s32_t spiffs_page_move( - spiffs *fs, - spiffs_file fh, - u8_t *page_data, - spiffs_obj_id obj_id, - spiffs_page_header *page_hdr, - spiffs_page_ix src_pix, - spiffs_page_ix *dst_pix) { - s32_t res; - u8_t was_final = 0; - spiffs_page_header *p_hdr; - spiffs_block_ix bix; - int entry; - spiffs_page_ix free_pix; - - // find free entry - res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry); - SPIFFS_CHECK_RES(res); - free_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - - if (dst_pix) *dst_pix = free_pix; - - p_hdr = page_data ? (spiffs_page_header *)page_data : page_hdr; - if (page_data) { - // got page data - was_final = (p_hdr->flags & SPIFFS_PH_FLAG_FINAL) == 0; - // write unfinalized page - p_hdr->flags |= SPIFFS_PH_FLAG_FINAL; - p_hdr->flags &= ~SPIFFS_PH_FLAG_USED; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_PAGE_TO_PADDR(fs, free_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), page_data); - } else { - // copy page data - res = spiffs_phys_cpy(fs, fh, SPIFFS_PAGE_TO_PADDR(fs, free_pix), SPIFFS_PAGE_TO_PADDR(fs, src_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs)); - } - SPIFFS_CHECK_RES(res); - - // mark entry in destination object lookup - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, - 0, SPIFFS_BLOCK_TO_PADDR(fs, SPIFFS_BLOCK_FOR_PAGE(fs, free_pix)) + SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, free_pix) * sizeof(spiffs_page_ix), - sizeof(spiffs_obj_id), - (u8_t *)&obj_id); - SPIFFS_CHECK_RES(res); - - fs->stats_p_allocated++; - - if (was_final) { - // mark finalized in destination page - p_hdr->flags &= ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_USED); - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - fh, - SPIFFS_PAGE_TO_PADDR(fs, free_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&p_hdr->flags); - SPIFFS_CHECK_RES(res); - } - // mark source deleted - res = spiffs_page_delete(fs, src_pix); - return res; -} - -// Deletes a page and removes it from object lookup. -s32_t spiffs_page_delete( - spiffs *fs, - spiffs_page_ix pix) { - s32_t res; - spiffs_page_header hdr; - hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_USED); - // mark deleted entry in source object lookup - spiffs_obj_id d_obj_id = SPIFFS_OBJ_ID_DELETED; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_DELE, - 0, - SPIFFS_BLOCK_TO_PADDR(fs, SPIFFS_BLOCK_FOR_PAGE(fs, pix)) + SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, pix) * sizeof(spiffs_page_ix), - sizeof(spiffs_obj_id), - (u8_t *)&d_obj_id); - SPIFFS_CHECK_RES(res); - - fs->stats_p_deleted++; - fs->stats_p_allocated--; - - // mark deleted in source page - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_DELE, - 0, - SPIFFS_PAGE_TO_PADDR(fs, pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&hdr.flags); - - return res; -} - -// Create an object index header page with empty index and undefined length -s32_t spiffs_object_create( - spiffs *fs, - spiffs_obj_id obj_id, - u8_t name[SPIFFS_OBJ_NAME_LEN], - spiffs_obj_type type, - spiffs_page_ix *objix_hdr_pix) { - s32_t res = SPIFFS_OK; - spiffs_block_ix bix; - spiffs_page_object_ix_header oix_hdr; - int entry; - - res = spiffs_gc_check(fs, SPIFFS_DATA_PAGE_SIZE(fs)); - SPIFFS_CHECK_RES(res); - - obj_id |= SPIFFS_OBJ_ID_IX_FLAG; - - // find free entry - res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry); - SPIFFS_CHECK_RES(res); - SPIFFS_DBG("create: found free page @ %04x bix:%d entry:%d\n", SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), bix, entry); - - // occupy page in object lookup - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT, - 0, SPIFFS_BLOCK_TO_PADDR(fs, bix) + entry * sizeof(spiffs_obj_id), sizeof(spiffs_obj_id), (u8_t*)&obj_id); - SPIFFS_CHECK_RES(res); - - fs->stats_p_allocated++; - - // write empty object index page - oix_hdr.p_hdr.obj_id = obj_id; - oix_hdr.p_hdr.span_ix = 0; - oix_hdr.p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED); - oix_hdr.type = type; - oix_hdr.size = SPIFFS_UNDEFINED_LEN; // keep ones so we can update later without wasting this page - strncpy((char *)&oix_hdr.name, (char *)name, SPIFFS_OBJ_NAME_LEN); - - - // update page - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, bix, entry), sizeof(spiffs_page_object_ix_header), (u8_t*)&oix_hdr); - - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_NEW, obj_id, 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), SPIFFS_UNDEFINED_LEN); - - if (objix_hdr_pix) { - *objix_hdr_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - } - - return res; -} - -// update object index header with any combination of name/size/index -// new_objix_hdr_data may be null, if so the object index header page is loaded -// name may be null, if so name is not changed -// size may be null, if so size is not changed -s32_t spiffs_object_update_index_hdr( - spiffs *fs, - spiffs_fd *fd, - spiffs_obj_id obj_id, - spiffs_page_ix objix_hdr_pix, - u8_t *new_objix_hdr_data, - u8_t name[SPIFFS_OBJ_NAME_LEN], - u32_t size, - spiffs_page_ix *new_pix) { - s32_t res = SPIFFS_OK; - spiffs_page_object_ix_header *objix_hdr; - spiffs_page_ix new_objix_hdr_pix; - - obj_id |= SPIFFS_OBJ_ID_IX_FLAG; - - if (new_objix_hdr_data) { - // object index header page already given to us, no need to load it - objix_hdr = (spiffs_page_object_ix_header *)new_objix_hdr_data; - } else { - // read object index header page - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_hdr_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - objix_hdr = (spiffs_page_object_ix_header *)fs->work; - } - - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, obj_id, 0); - - // change name - if (name) { - strncpy((char *)objix_hdr->name, (char *)name, SPIFFS_OBJ_NAME_LEN); - } - if (size) { - objix_hdr->size = size; - } - - // move and update page - res = spiffs_page_move(fs, fd == 0 ? 0 : fd->file_nbr, (u8_t*)objix_hdr, obj_id, 0, objix_hdr_pix, &new_objix_hdr_pix); - - if (res == SPIFFS_OK) { - if (new_pix) { - *new_pix = new_objix_hdr_pix; - } - // callback on object index update - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, obj_id, objix_hdr->p_hdr.span_ix, new_objix_hdr_pix, objix_hdr->size); - if (fd) fd->objix_hdr_pix = new_objix_hdr_pix; // if this is not in the registered cluster - } - - return res; -} - -void spiffs_cb_object_event( - spiffs *fs, - spiffs_fd *fd, - int ev, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix new_pix, - u32_t new_size) { - (void)fd; - // update index caches in all file descriptors - obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG; - u32_t i; - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - for (i = 0; i < fs->fd_count; i++) { - spiffs_fd *cur_fd = &fds[i]; - if (cur_fd->file_nbr == 0 || (cur_fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) != obj_id) continue; - if (spix == 0) { - if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) { - SPIFFS_DBG(" callback: setting fd %d:%04x objix_hdr_pix to %04x, size:%d\n", cur_fd->file_nbr, cur_fd->obj_id, new_pix, new_size); - cur_fd->objix_hdr_pix = new_pix; - if (new_size != 0) { - cur_fd->size = new_size; - } - } else if (ev == SPIFFS_EV_IX_DEL) { - cur_fd->file_nbr = 0; - cur_fd->obj_id = SPIFFS_OBJ_ID_DELETED; - } - } - if (cur_fd->cursor_objix_spix == spix) { - if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) { - SPIFFS_DBG(" callback: setting fd %d:%04x span:%04x objix_pix to %04x\n", cur_fd->file_nbr, cur_fd->obj_id, spix, new_pix); - cur_fd->cursor_objix_pix = new_pix; - } else { - cur_fd->cursor_objix_pix = 0; - } - } - } -} - -// Open object by id -s32_t spiffs_object_open_by_id( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_fd *fd, - spiffs_flags flags, - spiffs_mode mode) { - s32_t res = SPIFFS_OK; - spiffs_page_ix pix; - - res = spiffs_obj_lu_find_id_and_span(fs, obj_id | SPIFFS_OBJ_ID_IX_FLAG, 0, 0, &pix); - SPIFFS_CHECK_RES(res); - - res = spiffs_object_open_by_page(fs, pix, fd, flags, mode); - - return res; -} - -// Open object by page index -s32_t spiffs_object_open_by_page( - spiffs *fs, - spiffs_page_ix pix, - spiffs_fd *fd, - spiffs_flags flags, - spiffs_mode mode) { - (void)mode; - s32_t res = SPIFFS_OK; - spiffs_page_object_ix_header oix_hdr; - spiffs_obj_id obj_id; - - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&oix_hdr); - SPIFFS_CHECK_RES(res); - - spiffs_block_ix bix = SPIFFS_BLOCK_FOR_PAGE(fs, pix); - int entry = SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, pix); - - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ, - 0, SPIFFS_BLOCK_TO_PADDR(fs, bix) + entry * sizeof(spiffs_obj_id), sizeof(spiffs_obj_id), (u8_t *)&obj_id); - - fd->fs = fs; - fd->objix_hdr_pix = pix; - fd->size = oix_hdr.size; - fd->offset = 0; - fd->cursor_objix_pix = pix; - fd->cursor_objix_spix = 0; - fd->obj_id = obj_id; - fd->flags = flags; - - SPIFFS_VALIDATE_OBJIX(oix_hdr.p_hdr, fd->obj_id, 0); - - SPIFFS_DBG("open: fd %d is obj id %04x\n", fd->file_nbr, fd->obj_id); - - return res; -} - -// Append to object -// keep current object index (header) page in fs->work buffer -s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) { - spiffs *fs = fd->fs; - s32_t res = SPIFFS_OK; - u32_t written = 0; - - SPIFFS_DBG("append: %d bytes @ offs %d of size %d\n", len, offset, fd->size); - - if (offset > fd->size) { - SPIFFS_DBG("append: offset reversed to size\n"); - offset = fd->size; - } - - res = spiffs_gc_check(fs, len + SPIFFS_DATA_PAGE_SIZE(fs)); // add an extra page of data worth for meta - if (res != SPIFFS_OK) { - SPIFFS_DBG("append: gc check fail %d\n", res); - } - SPIFFS_CHECK_RES(res); - - spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work; - spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work; - spiffs_page_header p_hdr; - - spiffs_span_ix cur_objix_spix = 0; - spiffs_span_ix prev_objix_spix = (spiffs_span_ix)-1; - spiffs_page_ix cur_objix_pix = fd->objix_hdr_pix; - spiffs_page_ix new_objix_hdr_page; - - spiffs_span_ix data_spix = offset / SPIFFS_DATA_PAGE_SIZE(fs); - spiffs_page_ix data_page; - u32_t page_offs = offset % SPIFFS_DATA_PAGE_SIZE(fs); - - // write all data - while (res == SPIFFS_OK && written < len) { - // calculate object index page span index - cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - - // handle storing and loading of object indices - if (cur_objix_spix != prev_objix_spix) { - // new object index page - // within this clause we return directly if something fails, object index mess-up - if (written > 0) { - // store previous object index page, unless first pass - SPIFFS_DBG("append: %04x store objix %04x:%04x, written %d\n", fd->obj_id, - cur_objix_pix, prev_objix_spix, written); - if (prev_objix_spix == 0) { - // this is an update to object index header page - objix_hdr->size = offset+written; - if (offset == 0) { - // was an empty object, update same page (size was 0xffffffff) - res = spiffs_page_index_check(fs, fd, cur_objix_pix, 0); - SPIFFS_CHECK_RES(res); - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - } else { - // was a nonempty object, update to new page - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page); - SPIFFS_CHECK_RES(res); - SPIFFS_DBG("append: %04x store new objix_hdr, %04x:%04x, written %d\n", fd->obj_id, - new_objix_hdr_page, 0, written); - } - } else { - // this is an update to an object index page - res = spiffs_page_index_check(fs, fd, cur_objix_pix, prev_objix_spix); - SPIFFS_CHECK_RES(res); - - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD,fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0); - // update length in object index header page - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page); - SPIFFS_CHECK_RES(res); - SPIFFS_DBG("append: %04x store new size I %d in objix_hdr, %04x:%04x, written %d\n", fd->obj_id, - offset+written, new_objix_hdr_page, 0, written); - } - fd->size = offset+written; - fd->offset = offset+written; - } - - // create or load new object index page - if (cur_objix_spix == 0) { - // load object index header page, must always exist - SPIFFS_DBG("append: %04x load objixhdr page %04x:%04x\n", fd->obj_id, cur_objix_pix, cur_objix_spix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, fd->obj_id, cur_objix_spix); - } else { - spiffs_span_ix len_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, (fd->size-1)/SPIFFS_DATA_PAGE_SIZE(fs)); - // on subsequent passes, create a new object index page - if (written > 0 || cur_objix_spix > len_objix_spix) { - p_hdr.obj_id = fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG; - p_hdr.span_ix = cur_objix_spix; - p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX); - res = spiffs_page_allocate_data(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, - &p_hdr, 0, 0, 0, 1, &cur_objix_pix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_NEW, fd->obj_id, cur_objix_spix, cur_objix_pix, 0); - // quick "load" of new object index page - c_memset(fs->work, 0xff, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - c_memcpy(fs->work, &p_hdr, sizeof(spiffs_page_header)); - SPIFFS_DBG("append: %04x create objix page, %04x:%04x, written %d\n", fd->obj_id - , cur_objix_pix, cur_objix_spix, written); - } else { - // on first pass, we load existing object index page - spiffs_page_ix pix; - SPIFFS_DBG("append: %04x find objix span_ix:%04x\n", fd->obj_id, cur_objix_spix); - if (fd->cursor_objix_spix == cur_objix_spix) { - pix = fd->cursor_objix_pix; - } else { - res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &pix); - SPIFFS_CHECK_RES(res); - } - SPIFFS_DBG("append: %04x found object index at page %04x [fd size %d]\n", fd->obj_id, pix, fd->size); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, fd->obj_id, cur_objix_spix); - cur_objix_pix = pix; - } - fd->cursor_objix_pix = cur_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - fd->offset = offset+written; - fd->size = offset+written; - } - prev_objix_spix = cur_objix_spix; - } - - // write data - u32_t to_write = MIN(len-written, SPIFFS_DATA_PAGE_SIZE(fs) - page_offs); - if (page_offs == 0) { - // at beginning of a page, allocate and write a new page of data - p_hdr.obj_id = fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - p_hdr.span_ix = data_spix; - p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL); // finalize immediately - res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - &p_hdr, &data[written], to_write, page_offs, 1, &data_page); - SPIFFS_DBG("append: %04x store new data page, %04x:%04x offset:%d, len %d, written %d\n", fd->obj_id, - data_page, data_spix, page_offs, to_write, written); - } else { - // append to existing page, fill out free data in existing page - if (cur_objix_spix == 0) { - // get data page from object index header page - data_page = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix]; - } else { - // get data page from object index page - data_page = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)]; - } - - res = spiffs_page_data_check(fs, fd, data_page, data_spix); - SPIFFS_CHECK_RES(res); - - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, data_page) + sizeof(spiffs_page_header) + page_offs, to_write, &data[written]); - SPIFFS_DBG("append: %04x store to existing data page, %04x:%04x offset:%d, len %d, written %d\n", fd->obj_id - , data_page, data_spix, page_offs, to_write, written); - } - - if (res != SPIFFS_OK) break; - - // update memory representation of object index page with new data page - if (cur_objix_spix == 0) { - // update object index header page - ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = data_page; - SPIFFS_DBG("append: %04x wrote page %04x to objix_hdr entry %02x in mem\n", fd->obj_id - , data_page, data_spix); - objix_hdr->size = offset+written; - } else { - // update object index page - ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = data_page; - SPIFFS_DBG("append: %04x wrote page %04x to objix entry %02x in mem\n", fd->obj_id - , data_page, SPIFFS_OBJ_IX_ENTRY(fs, data_spix)); - } - - // update internals - page_offs = 0; - data_spix++; - written += to_write; - } // while all data - - fd->size = offset+written; - fd->offset = offset+written; - fd->cursor_objix_pix = cur_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - - // finalize updated object indices - s32_t res2 = SPIFFS_OK; - if (cur_objix_spix != 0) { - // wrote beyond object index header page - // write last modified object index page, unless object header index page - SPIFFS_DBG("append: %04x store objix page, %04x:%04x, written %d\n", fd->obj_id, - cur_objix_pix, cur_objix_spix, written); - - res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix); - SPIFFS_CHECK_RES(res2); - - res2 = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res2); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0); - - // update size in object header index page - res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page); - SPIFFS_DBG("append: %04x store new size II %d in objix_hdr, %04x:%04x, written %d, res %d\n", fd->obj_id - , offset+written, new_objix_hdr_page, 0, written, res2); - SPIFFS_CHECK_RES(res2); - } else { - // wrote within object index header page - if (offset == 0) { - // wrote to empty object - simply update size and write whole page - objix_hdr->size = offset+written; - SPIFFS_DBG("append: %04x store fresh objix_hdr page, %04x:%04x, written %d\n", fd->obj_id - , cur_objix_pix, cur_objix_spix, written); - - res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix); - SPIFFS_CHECK_RES(res2); - - res2 = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res2); - // callback on object index update - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix_hdr->p_hdr.span_ix, cur_objix_pix, objix_hdr->size); - } else { - // modifying object index header page, update size and make new copy - res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page); - SPIFFS_DBG("append: %04x store modified objix_hdr page, %04x:%04x, written %d\n", fd->obj_id - , new_objix_hdr_page, 0, written); - SPIFFS_CHECK_RES(res2); - } - } - - return res; -} - -// Modify object -// keep current object index (header) page in fs->work buffer -s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) { - spiffs *fs = fd->fs; - s32_t res = SPIFFS_OK; - u32_t written = 0; - - res = spiffs_gc_check(fs, len + SPIFFS_DATA_PAGE_SIZE(fs)); - SPIFFS_CHECK_RES(res); - - spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work; - spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work; - spiffs_page_header p_hdr; - - spiffs_span_ix cur_objix_spix = 0; - spiffs_span_ix prev_objix_spix = (spiffs_span_ix)-1; - spiffs_page_ix cur_objix_pix = fd->objix_hdr_pix; - spiffs_page_ix new_objix_hdr_pix; - - spiffs_span_ix data_spix = offset / SPIFFS_DATA_PAGE_SIZE(fs); - spiffs_page_ix data_pix; - u32_t page_offs = offset % SPIFFS_DATA_PAGE_SIZE(fs); - - - // write all data - while (res == SPIFFS_OK && written < len) { - // calculate object index page span index - cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - - // handle storing and loading of object indices - if (cur_objix_spix != prev_objix_spix) { - // new object index page - // within this clause we return directly if something fails, object index mess-up - if (written > 0) { - // store previous object index (header) page, unless first pass - if (prev_objix_spix == 0) { - // store previous object index header page - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix); - SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %d\n", new_objix_hdr_pix, 0, written); - SPIFFS_CHECK_RES(res); - } else { - // store new version of previous object index page - spiffs_page_ix new_objix_pix; - - res = spiffs_page_index_check(fs, fd, cur_objix_pix, prev_objix_spix); - SPIFFS_CHECK_RES(res); - - res = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix); - SPIFFS_DBG("modify: store previous modified objix page, %04x:%04x, written %d\n", new_objix_pix, objix->p_hdr.span_ix, written); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0); - } - } - - // load next object index page - if (cur_objix_spix == 0) { - // load object index header page, must exist - SPIFFS_DBG("modify: load objixhdr page %04x:%04x\n", cur_objix_pix, cur_objix_spix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, fd->obj_id, cur_objix_spix); - } else { - // load existing object index page on first pass - spiffs_page_ix pix; - SPIFFS_DBG("modify: find objix span_ix:%04x\n", cur_objix_spix); - if (fd->cursor_objix_spix == cur_objix_spix) { - pix = fd->cursor_objix_pix; - } else { - res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &pix); - SPIFFS_CHECK_RES(res); - } - SPIFFS_DBG("modify: found object index at page %04x\n", pix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, fd->obj_id, cur_objix_spix); - cur_objix_pix = pix; - } - fd->cursor_objix_pix = cur_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - fd->offset = offset+written; - prev_objix_spix = cur_objix_spix; - } - - // write partial data - u32_t to_write = MIN(len-written, SPIFFS_DATA_PAGE_SIZE(fs) - page_offs); - spiffs_page_ix orig_data_pix; - if (cur_objix_spix == 0) { - // get data page from object index header page - orig_data_pix = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix]; - } else { - // get data page from object index page - orig_data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)]; - } - - p_hdr.obj_id = fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - p_hdr.span_ix = data_spix; - p_hdr.flags = 0xff; - if (page_offs == 0 && to_write == SPIFFS_DATA_PAGE_SIZE(fs)) { - // a full page, allocate and write a new page of data - res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - &p_hdr, &data[written], to_write, page_offs, 1, &data_pix); - SPIFFS_DBG("modify: store new data page, %04x:%04x offset:%d, len %d, written %d\n", data_pix, data_spix, page_offs, to_write, written); - } else { - // write to existing page, allocate new and copy unmodified data - - res = spiffs_page_data_check(fs, fd, orig_data_pix, data_spix); - SPIFFS_CHECK_RES(res); - - res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - &p_hdr, 0, 0, 0, 0, &data_pix); - if (res != SPIFFS_OK) break; - - // copy unmodified data - if (page_offs > 0) { - // before modification - res = spiffs_phys_cpy(fs, fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header), - SPIFFS_PAGE_TO_PADDR(fs, orig_data_pix) + sizeof(spiffs_page_header), - page_offs); - if (res != SPIFFS_OK) break; - } - if (page_offs + to_write < SPIFFS_DATA_PAGE_SIZE(fs)) { - // after modification - res = spiffs_phys_cpy(fs, fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + page_offs + to_write, - SPIFFS_PAGE_TO_PADDR(fs, orig_data_pix) + sizeof(spiffs_page_header) + page_offs + to_write, - SPIFFS_DATA_PAGE_SIZE(fs) - (page_offs + to_write)); - if (res != SPIFFS_OK) break; - } - - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + page_offs, to_write, &data[written]); - if (res != SPIFFS_OK) break; - p_hdr.flags &= ~SPIFFS_PH_FLAG_FINAL; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&p_hdr.flags); - if (res != SPIFFS_OK) break; - - SPIFFS_DBG("modify: store to existing data page, src:%04x, dst:%04x:%04x offset:%d, len %d, written %d\n", orig_data_pix, data_pix, data_spix, page_offs, to_write, written); - } - - // delete original data page - res = spiffs_page_delete(fs, orig_data_pix); - if (res != SPIFFS_OK) break; - // update memory representation of object index page with new data page - if (cur_objix_spix == 0) { - // update object index header page - ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = data_pix; - SPIFFS_DBG("modify: wrote page %04x to objix_hdr entry %02x in mem\n", data_pix, data_spix); - } else { - // update object index page - ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = data_pix; - SPIFFS_DBG("modify: wrote page %04x to objix entry %02x in mem\n", data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix)); - } - - // update internals - page_offs = 0; - data_spix++; - written += to_write; - } // while all data - - fd->offset = offset+written; - fd->cursor_objix_pix = cur_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - - // finalize updated object indices - s32_t res2 = SPIFFS_OK; - if (cur_objix_spix != 0) { - // wrote beyond object index header page - // write last modified object index page - // move and update page - spiffs_page_ix new_objix_pix; - - res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix); - SPIFFS_CHECK_RES(res2); - - res2 = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix); - SPIFFS_DBG("modify: store modified objix page, %04x:%04x, written %d\n", new_objix_pix, cur_objix_spix, written); - fd->cursor_objix_pix = new_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - SPIFFS_CHECK_RES(res2); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0); - - } else { - // wrote within object index header page - res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix); - SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %d\n", new_objix_hdr_pix, 0, written); - SPIFFS_CHECK_RES(res2); - } - - return res; -} - -static s32_t spiffs_object_find_object_index_header_by_name_v( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_block_ix bix, - int ix_entry, - u32_t user_data, - void *user_p) { - (void)user_data; - s32_t res; - spiffs_page_object_ix_header objix_hdr; - spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry); - if (obj_id == SPIFFS_OBJ_ID_FREE || obj_id == SPIFFS_OBJ_ID_DELETED || - (obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0) { - return SPIFFS_VIS_COUNTINUE; - } - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr); - SPIFFS_CHECK_RES(res); - if (objix_hdr.p_hdr.span_ix == 0 && - (objix_hdr.p_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) == - (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) { - if (strcmp((char *)user_p, (char *)objix_hdr.name) == 0) { - return SPIFFS_OK; - } - } - - return SPIFFS_VIS_COUNTINUE; -} - -// Finds object index header page by name -s32_t spiffs_object_find_object_index_header_by_name( - spiffs *fs, - u8_t name[SPIFFS_OBJ_NAME_LEN], - spiffs_page_ix *pix) { - s32_t res; - spiffs_block_ix bix; - int entry; - - res = spiffs_obj_lu_find_entry_visitor(fs, - fs->cursor_block_ix, - fs->cursor_obj_lu_entry, - 0, - 0, - spiffs_object_find_object_index_header_by_name_v, - 0, - name, - &bix, - &entry); - - if (res == SPIFFS_VIS_END) { - res = SPIFFS_ERR_NOT_FOUND; - } - SPIFFS_CHECK_RES(res); - - if (pix) { - *pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry); - } - - fs->cursor_block_ix = bix; - fs->cursor_obj_lu_entry = entry; - - return res; -} - -// Truncates object to new size. If new size is null, object may be removed totally -s32_t spiffs_object_truncate( - spiffs_fd *fd, - u32_t new_size, - u8_t remove) { - s32_t res = SPIFFS_OK; - spiffs *fs = fd->fs; - - res = spiffs_gc_check(fs, remove ? 0 : SPIFFS_DATA_PAGE_SIZE(fs)); - SPIFFS_CHECK_RES(res); - - spiffs_page_ix objix_pix = fd->objix_hdr_pix; - spiffs_span_ix data_spix = (fd->size > 0 ? fd->size-1 : 0) / SPIFFS_DATA_PAGE_SIZE(fs); - u32_t cur_size = fd->size == (u32_t)SPIFFS_UNDEFINED_LEN ? 0 : fd->size ; - spiffs_span_ix cur_objix_spix = 0; - spiffs_span_ix prev_objix_spix = (spiffs_span_ix)-1; - spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work; - spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work; - spiffs_page_ix data_pix; - spiffs_page_ix new_objix_hdr_pix; - - // before truncating, check if object is to be fully removed and mark this - if (remove && new_size == 0) { - u8_t flags = ~( SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE); - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, fd->objix_hdr_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&flags); - SPIFFS_CHECK_RES(res); - } - - // delete from end of object until desired len is reached - while (cur_size > new_size) { - cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - - // put object index for current data span index in work buffer - if (prev_objix_spix != cur_objix_spix) { - if (prev_objix_spix != (spiffs_span_ix)-1) { - // remove previous object index page - SPIFFS_DBG("truncate: delete objix page %04x:%04x\n", objix_pix, prev_objix_spix); - - res = spiffs_page_index_check(fs, fd, objix_pix, prev_objix_spix); - SPIFFS_CHECK_RES(res); - - res = spiffs_page_delete(fs, objix_pix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_DEL, fd->obj_id, objix->p_hdr.span_ix, objix_pix, 0); - if (prev_objix_spix > 0) { - // update object index header page - SPIFFS_DBG("truncate: update objix hdr page %04x:%04x to size %d\n", fd->objix_hdr_pix, prev_objix_spix, cur_size); - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, 0, 0, cur_size, &new_objix_hdr_pix); - SPIFFS_CHECK_RES(res); - fd->size = cur_size; - } - } - // load current object index (header) page - if (cur_objix_spix == 0) { - objix_pix = fd->objix_hdr_pix; - } else { - res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &objix_pix); - SPIFFS_CHECK_RES(res); - } - - SPIFFS_DBG("truncate: load objix page %04x:%04x for data spix:%04x\n", objix_pix, cur_objix_spix, data_spix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix_hdr->p_hdr, fd->obj_id, cur_objix_spix); - fd->cursor_objix_pix = objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - fd->offset = cur_size; - - prev_objix_spix = cur_objix_spix; - } - - if (cur_objix_spix == 0) { - // get data page from object index header page - data_pix = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix]; - ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = SPIFFS_OBJ_ID_FREE; - } else { - // get data page from object index page - data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)]; - ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = SPIFFS_OBJ_ID_FREE; - } - - SPIFFS_DBG("truncate: got data pix %04x\n", data_pix); - - if (cur_size - SPIFFS_DATA_PAGE_SIZE(fs) >= new_size) { - // delete full data page - res = spiffs_page_data_check(fs, fd, data_pix, data_spix); - if (res != SPIFFS_ERR_DELETED && res != SPIFFS_OK && res != SPIFFS_ERR_INDEX_REF_FREE) { - SPIFFS_DBG("truncate: err validating data pix %d\n", res); - break; - } - - if (res == SPIFFS_OK) { - res = spiffs_page_delete(fs, data_pix); - if (res != SPIFFS_OK) { - SPIFFS_DBG("truncate: err deleting data pix %d\n", res); - break; - } - } else if (res == SPIFFS_ERR_DELETED || res == SPIFFS_ERR_INDEX_REF_FREE) { - res = SPIFFS_OK; - } - - // update current size - if (cur_size % SPIFFS_DATA_PAGE_SIZE(fs) == 0) { - cur_size -= SPIFFS_DATA_PAGE_SIZE(fs); - } else { - cur_size -= cur_size % SPIFFS_DATA_PAGE_SIZE(fs); - } - fd->size = cur_size; - fd->offset = cur_size; - SPIFFS_DBG("truncate: delete data page %04x for data spix:%04x, cur_size:%d\n", data_pix, data_spix, cur_size); - } else { - // delete last page, partially - spiffs_page_header p_hdr; - spiffs_page_ix new_data_pix; - u32_t bytes_to_remove = SPIFFS_DATA_PAGE_SIZE(fs) - (new_size % SPIFFS_DATA_PAGE_SIZE(fs)); - SPIFFS_DBG("truncate: delete %d bytes from data page %04x for data spix:%04x, cur_size:%d\n", bytes_to_remove, data_pix, data_spix, cur_size); - - res = spiffs_page_data_check(fs, fd, data_pix, data_spix); - if (res != SPIFFS_OK) break; - - p_hdr.obj_id = fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG; - p_hdr.span_ix = data_spix; - p_hdr.flags = 0xff; - // allocate new page and copy unmodified data - res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, - &p_hdr, 0, 0, 0, 0, &new_data_pix); - if (res != SPIFFS_OK) break; - res = spiffs_phys_cpy(fs, 0, - SPIFFS_PAGE_TO_PADDR(fs, new_data_pix) + sizeof(spiffs_page_header), - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header), - SPIFFS_DATA_PAGE_SIZE(fs) - bytes_to_remove); - if (res != SPIFFS_OK) break; - // delete original data page - res = spiffs_page_delete(fs, data_pix); - if (res != SPIFFS_OK) break; - p_hdr.flags &= ~SPIFFS_PH_FLAG_FINAL; - res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, new_data_pix) + offsetof(spiffs_page_header, flags), - sizeof(u8_t), - (u8_t *)&p_hdr.flags); - if (res != SPIFFS_OK) break; - - // update memory representation of object index page with new data page - if (cur_objix_spix == 0) { - // update object index header page - ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = new_data_pix; - SPIFFS_DBG("truncate: wrote page %04x to objix_hdr entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix)); - } else { - // update object index page - ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = new_data_pix; - SPIFFS_DBG("truncate: wrote page %04x to objix entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix)); - } - cur_size = new_size; - fd->size = new_size; - fd->offset = cur_size; - break; - } - data_spix--; - } // while all data - - // update object indices - if (cur_objix_spix == 0) { - // update object index header page - if (cur_size == 0) { - if (remove) { - // remove object altogether - SPIFFS_DBG("truncate: remove object index header page %04x\n", objix_pix); - - res = spiffs_page_index_check(fs, fd, objix_pix, 0); - SPIFFS_CHECK_RES(res); - - res = spiffs_page_delete(fs, objix_pix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_DEL, fd->obj_id, 0, objix_pix, 0); - } else { - // make uninitialized object - SPIFFS_DBG("truncate: reset objix_hdr page %04x\n", objix_pix); - c_memset(fs->work + sizeof(spiffs_page_object_ix_header), 0xff, - SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_object_ix_header)); - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - objix_pix, fs->work, 0, SPIFFS_UNDEFINED_LEN, &new_objix_hdr_pix); - SPIFFS_CHECK_RES(res); - } - } else { - // update object index header page - SPIFFS_DBG("truncate: update object index header page with indices and size\n"); - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - objix_pix, fs->work, 0, cur_size, &new_objix_hdr_pix); - SPIFFS_CHECK_RES(res); - } - } else { - // update both current object index page and object index header page - spiffs_page_ix new_objix_pix; - - res = spiffs_page_index_check(fs, fd, objix_pix, cur_objix_spix); - SPIFFS_CHECK_RES(res); - - // move and update object index page - res = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix_hdr, fd->obj_id, 0, objix_pix, &new_objix_pix); - SPIFFS_CHECK_RES(res); - spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0); - SPIFFS_DBG("truncate: store modified objix page, %04x:%04x\n", new_objix_pix, cur_objix_spix); - fd->cursor_objix_pix = new_objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - fd->offset = cur_size; - // update object index header page with new size - res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, - fd->objix_hdr_pix, 0, 0, cur_size, &new_objix_hdr_pix); - SPIFFS_CHECK_RES(res); - } - fd->size = cur_size; - - return res; -} - -s32_t spiffs_object_read( - spiffs_fd *fd, - u32_t offset, - u32_t len, - u8_t *dst) { - s32_t res = SPIFFS_OK; - spiffs *fs = fd->fs; - spiffs_page_ix objix_pix; - spiffs_page_ix data_pix; - spiffs_span_ix data_spix = offset / SPIFFS_DATA_PAGE_SIZE(fs); - u32_t cur_offset = offset; - spiffs_span_ix cur_objix_spix; - spiffs_span_ix prev_objix_spix = (spiffs_span_ix)-1; - spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work; - spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work; - - while (cur_offset < offset + len) { - cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix); - if (prev_objix_spix != cur_objix_spix) { - // load current object index (header) page - if (cur_objix_spix == 0) { - objix_pix = fd->objix_hdr_pix; - } else { - SPIFFS_DBG("read: find objix %04x:%04x\n", fd->obj_id, cur_objix_spix); - res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &objix_pix); - SPIFFS_CHECK_RES(res); - } - SPIFFS_DBG("read: load objix page %04x:%04x for data spix:%04x\n", objix_pix, cur_objix_spix, data_spix); - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ, - fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work); - SPIFFS_CHECK_RES(res); - SPIFFS_VALIDATE_OBJIX(objix->p_hdr, fd->obj_id, cur_objix_spix); - - fd->offset = cur_offset; - fd->cursor_objix_pix = objix_pix; - fd->cursor_objix_spix = cur_objix_spix; - - prev_objix_spix = cur_objix_spix; - } - - if (cur_objix_spix == 0) { - // get data page from object index header page - data_pix = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix]; - } else { - // get data page from object index page - data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)]; - } - - // all remaining data - u32_t len_to_read = offset + len - cur_offset; - // remaining data in page - len_to_read = MIN(len_to_read, SPIFFS_DATA_PAGE_SIZE(fs) - (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs))); - // remaining data in file - len_to_read = MIN(len_to_read, fd->size); - SPIFFS_DBG("read: offset:%d rd:%d data spix:%04x is data_pix:%04x addr:%08x\n", cur_offset, len_to_read, data_spix, data_pix, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs))); - if (len_to_read <= 0) { - res = SPIFFS_ERR_END_OF_OBJECT; - break; - } - res = spiffs_page_data_check(fs, fd, data_pix, data_spix); - SPIFFS_CHECK_RES(res); - res = _spiffs_rd( - fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_READ, - fd->file_nbr, - SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs)), - len_to_read, - dst); - SPIFFS_CHECK_RES(res); - dst += len_to_read; - cur_offset += len_to_read; - fd->offset = cur_offset; - data_spix++; - } - - return res; -} - -typedef struct { - spiffs_obj_id min_obj_id; - spiffs_obj_id max_obj_id; - u32_t compaction; - const u8_t *conflicting_name; -} spiffs_free_obj_id_state; - -static s32_t spiffs_obj_lu_find_free_obj_id_bitmap_v(spiffs *fs, spiffs_obj_id id, spiffs_block_ix bix, int ix_entry, - u32_t user_data, void *user_p) { - if (id != SPIFFS_OBJ_ID_FREE && id != SPIFFS_OBJ_ID_DELETED) { - spiffs_obj_id min_obj_id = user_data; - u8_t *conflicting_name = (u8_t *)user_p; - - // if conflicting name parameter is given, also check if this name is found in object index hdrs - if (conflicting_name && (id & SPIFFS_OBJ_ID_IX_FLAG)) { - spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry); - int res; - spiffs_page_object_ix_header objix_hdr; - res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ, - 0, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix_header), (u8_t *)&objix_hdr); - SPIFFS_CHECK_RES(res); - if (objix_hdr.p_hdr.span_ix == 0 && - (objix_hdr.p_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) == - (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) { - if (strcmp((char *)user_p, (char *)objix_hdr.name) == 0) { - return SPIFFS_ERR_CONFLICTING_NAME; - } - } - } - - id &= ~SPIFFS_OBJ_ID_IX_FLAG; - u32_t bit_ix = (id-min_obj_id) & 7; - int byte_ix = (id-min_obj_id) >> 3; - if (byte_ix >= 0 && (u32_t)byte_ix < SPIFFS_CFG_LOG_PAGE_SZ(fs)) { - fs->work[byte_ix] |= (1<conflicting_name && strcmp((const char *)state->conflicting_name, (char *)objix_hdr.name) == 0) { - return SPIFFS_ERR_CONFLICTING_NAME; - } - - id &= ~SPIFFS_OBJ_ID_IX_FLAG; - if (id >= state->min_obj_id && id <= state->max_obj_id) { - u8_t *map = (u8_t *)fs->work; - int ix = (id - state->min_obj_id) / state->compaction; - //SPIFFS_DBG("free_obj_id: add ix %d for id %04x min:%04x max%04x comp:%d\n", ix, id, state->min_obj_id, state->max_obj_id, state->compaction); - map[ix]++; - } - } - } - return SPIFFS_VIS_COUNTINUE; -} - -// Scans thru all object lookup for object index header pages. If total possible number of -// object ids cannot fit into a work buffer, these are grouped. When a group containing free -// object ids is found, the object lu is again scanned for object ids within group and bitmasked. -// Finally, the bitmasked is searched for a free id -s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, u8_t *conflicting_name) { - s32_t res = SPIFFS_OK; - u32_t max_objects = (SPIFFS_CFG_PHYS_SZ(fs) / (u32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs)) / 2; - spiffs_free_obj_id_state state; - spiffs_obj_id free_obj_id = SPIFFS_OBJ_ID_FREE; - state.min_obj_id = 1; - state.max_obj_id = max_objects + 1; - if (state.max_obj_id & SPIFFS_OBJ_ID_IX_FLAG) { - state.max_obj_id = ((spiffs_obj_id)-1) & ~SPIFFS_OBJ_ID_IX_FLAG; - } - state.compaction = 0; - state.conflicting_name = conflicting_name; - while (res == SPIFFS_OK && free_obj_id == SPIFFS_OBJ_ID_FREE) { - if (state.max_obj_id - state.min_obj_id <= (spiffs_obj_id)SPIFFS_CFG_LOG_PAGE_SZ(fs)*8) { - // possible to represent in bitmap - u32_t i, j; - SPIFFS_DBG("free_obj_id: BITM min:%04x max:%04x\n", state.min_obj_id, state.max_obj_id); - - c_memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_obj_lu_find_free_obj_id_bitmap_v, state.min_obj_id, - conflicting_name, 0, 0); - if (res == SPIFFS_VIS_END) res = SPIFFS_OK; - SPIFFS_CHECK_RES(res); - // traverse bitmask until found free obj_id - for (i = 0; i < SPIFFS_CFG_LOG_PAGE_SZ(fs); i++) { - u8_t mask = fs->work[i]; - if (mask == 0xff) { - continue; - } - for (j = 0; j < 8; j++) { - if ((mask & (1<work; - u8_t min_count = 0xff; - - for (i = 0; i < SPIFFS_CFG_LOG_PAGE_SZ(fs)/sizeof(u8_t); i++) { - if (map[i] < min_count) { - min_count = map[i]; - min_i = i; - if (min_count == 0) { - break; - } - } - } - - if (min_count == state.compaction) { - // there are no free objids! - SPIFFS_DBG("free_obj_id: compacted table is full\n"); - return SPIFFS_ERR_FULL; - } - - SPIFFS_DBG("free_obj_id: COMP select index:%d min_count:%d min:%04x max:%04x compact:%d\n", min_i, min_count, state.min_obj_id, state.max_obj_id, state.compaction); - - if (min_count == 0) { - // no id in this range, skip compacting and use directly - *obj_id = min_i * state.compaction + state.min_obj_id; - return SPIFFS_OK; - } else { - SPIFFS_DBG("free_obj_id: COMP SEL chunk:%04x min:%04x -> %04x\n", state.compaction, state.min_obj_id, state.min_obj_id + min_i * state.compaction); - state.min_obj_id += min_i * state.compaction; - state.max_obj_id = state.min_obj_id + state.compaction; - // decrease compaction - } - if ((state.max_obj_id - state.min_obj_id <= (spiffs_obj_id)SPIFFS_CFG_LOG_PAGE_SZ(fs)*8)) { - // no need for compacting, use bitmap - continue; - } - } - // in a work memory of log_page_size bytes, we may fit in log_page_size ids - // todo what if compaction is > 255 - then we cannot fit it in a byte - state.compaction = (state.max_obj_id-state.min_obj_id) / ((SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(u8_t))); - SPIFFS_DBG("free_obj_id: COMP min:%04x max:%04x compact:%d\n", state.min_obj_id, state.max_obj_id, state.compaction); - - c_memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs)); - res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_obj_lu_find_free_obj_id_compact_v, 0, &state, 0, 0); - if (res == SPIFFS_VIS_END) res = SPIFFS_OK; - SPIFFS_CHECK_RES(res); - state.conflicting_name = 0; // searched for conflicting name once, no need to do it again - } - } - - return res; -} - -s32_t spiffs_fd_find_new(spiffs *fs, spiffs_fd **fd) { - u32_t i; - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - for (i = 0; i < fs->fd_count; i++) { - spiffs_fd *cur_fd = &fds[i]; - if (cur_fd->file_nbr == 0) { - cur_fd->file_nbr = i+1; - *fd = cur_fd; - return SPIFFS_OK; - } - } - return SPIFFS_ERR_OUT_OF_FILE_DESCS; -} - -s32_t spiffs_fd_return(spiffs *fs, spiffs_file f) { - if (f <= 0 || f > (s16_t)fs->fd_count) { - return SPIFFS_ERR_BAD_DESCRIPTOR; - } - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - spiffs_fd *fd = &fds[f-1]; - if (fd->file_nbr == 0) { - return SPIFFS_ERR_FILE_CLOSED; - } - fd->file_nbr = 0; - return SPIFFS_OK; -} - -s32_t spiffs_fd_get(spiffs *fs, spiffs_file f, spiffs_fd **fd) { - if (f <= 0 || f > (s16_t)fs->fd_count) { - return SPIFFS_ERR_BAD_DESCRIPTOR; - } - spiffs_fd *fds = (spiffs_fd *)fs->fd_space; - *fd = &fds[f-1]; - if ((*fd)->file_nbr == 0) { - return SPIFFS_ERR_FILE_CLOSED; - } - return SPIFFS_OK; -} diff --git a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.h b/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.h deleted file mode 100644 index 5d905fe9..00000000 --- a/sparkfun/esp8266/cores/esp8266/spiffs/spiffs_nucleus.h +++ /dev/null @@ -1,718 +0,0 @@ -/* - * spiffs_nucleus.h - * - * Created on: Jun 15, 2013 - * Author: petera - */ - -/* SPIFFS layout - * - * spiffs is designed for following spi flash characteristics: - * - only big areas of data (blocks) can be erased - * - erasing resets all bits in a block to ones - * - writing pulls ones to zeroes - * - zeroes cannot be pulled to ones, without erase - * - wear leveling - * - * spiffs is also meant to be run on embedded, memory constraint devices. - * - * Entire area is divided in blocks. Entire area is also divided in pages. - * Each block contains same number of pages. A page cannot be erased, but a - * block can be erased. - * - * Entire area must be block_size * x - * page_size must be block_size / (2^y) where y > 2 - * - * ex: area = 1024*1024 bytes, block size = 65536 bytes, page size = 256 bytes - * - * BLOCK 0 PAGE 0 object lookup 1 - * PAGE 1 object lookup 2 - * ... - * PAGE n-1 object lookup n - * PAGE n object data 1 - * PAGE n+1 object data 2 - * ... - * PAGE n+m-1 object data m - * - * BLOCK 1 PAGE n+m object lookup 1 - * PAGE n+m+1 object lookup 2 - * ... - * PAGE 2n+m-1 object lookup n - * PAGE 2n+m object data 1 - * PAGE 2n+m object data 2 - * ... - * PAGE 2n+2m-1 object data m - * ... - * - * n is number of object lookup pages, which is number of pages needed to index all pages - * in a block by object id - * : block_size / page_size * sizeof(obj_id) / page_size - * m is number data pages, which is number of pages in block minus number of lookup pages - * : block_size / page_size - block_size / page_size * sizeof(obj_id) / page_size - * thus, n+m is total number of pages in a block - * : block_size / page_size - * - * ex: n = 65536/256*2/256 = 2, m = 65536/256 - 2 = 254 => n+m = 65536/256 = 256 - * - * Object lookup pages contain object id entries. Each entry represent the corresponding - * data page. - * Assuming a 16 bit object id, an object id being 0xffff represents a free page. - * An object id being 0x0000 represents a deleted page. - * - * ex: page 0 : lookup : 0008 0001 0aaa ffff ffff ffff ffff ffff .. - * page 1 : lookup : ffff ffff ffff ffff ffff ffff ffff ffff .. - * page 2 : data : data for object id 0008 - * page 3 : data : data for object id 0001 - * page 4 : data : data for object id 0aaa - * ... - * - * - * Object data pages can be either object index pages or object content. - * All object data pages contains a data page header, containing object id and span index. - * The span index denotes the object page ordering amongst data pages with same object id. - * This applies to both object index pages (when index spans more than one page of entries), - * and object data pages. - * An object index page contains page entries pointing to object content page. The entry index - * in a object index page correlates to the span index in the actual object data page. - * The first object index page (span index 0) is called object index header page, and also - * contains object flags (directory/file), size, object name etc. - * - * ex: - * BLOCK 1 - * PAGE 256: objectl lookup page 1 - * [*123] [ 123] [ 123] [ 123] - * [ 123] [*123] [ 123] [ 123] - * [free] [free] [free] [free] ... - * PAGE 257: objectl lookup page 2 - * [free] [free] [free] [free] ... - * PAGE 258: object index page (header) - * obj.id:0123 span.ix:0000 flags:INDEX - * size:1600 name:ex.txt type:file - * [259] [260] [261] [262] - * PAGE 259: object data page - * obj.id:0123 span.ix:0000 flags:DATA - * PAGE 260: object data page - * obj.id:0123 span.ix:0001 flags:DATA - * PAGE 261: object data page - * obj.id:0123 span.ix:0002 flags:DATA - * PAGE 262: object data page - * obj.id:0123 span.ix:0003 flags:DATA - * PAGE 263: object index page - * obj.id:0123 span.ix:0001 flags:INDEX - * [264] [265] [fre] [fre] - * [fre] [fre] [fre] [fre] - * PAGE 264: object data page - * obj.id:0123 span.ix:0004 flags:DATA - * PAGE 265: object data page - * obj.id:0123 span.ix:0005 flags:DATA - * - */ -#ifndef SPIFFS_NUCLEUS_H_ -#define SPIFFS_NUCLEUS_H_ - -#define _SPIFFS_ERR_CHECK_FIRST (SPIFFS_ERR_INTERNAL - 1) -#define SPIFFS_ERR_CHECK_OBJ_ID_MISM (SPIFFS_ERR_INTERNAL - 1) -#define SPIFFS_ERR_CHECK_SPIX_MISM (SPIFFS_ERR_INTERNAL - 2) -#define SPIFFS_ERR_CHECK_FLAGS_BAD (SPIFFS_ERR_INTERNAL - 3) -#define _SPIFFS_ERR_CHECK_LAST (SPIFFS_ERR_INTERNAL - 4) - -#define SPIFFS_VIS_COUNTINUE (SPIFFS_ERR_INTERNAL - 20) -#define SPIFFS_VIS_COUNTINUE_RELOAD (SPIFFS_ERR_INTERNAL - 21) -#define SPIFFS_VIS_END (SPIFFS_ERR_INTERNAL - 22) - -#define SPIFFS_EV_IX_UPD 0 -#define SPIFFS_EV_IX_NEW 1 -#define SPIFFS_EV_IX_DEL 2 - -#define SPIFFS_OBJ_ID_IX_FLAG (1<<(8*sizeof(spiffs_obj_id)-1)) - -#define SPIFFS_UNDEFINED_LEN (u32_t)(-1) - -#define SPIFFS_OBJ_ID_DELETED ((spiffs_obj_id)0) -#define SPIFFS_OBJ_ID_FREE ((spiffs_obj_id)-1) - -#define SPIFFS_MAGIC(fs) ((spiffs_obj_id)(0x20140529 ^ SPIFFS_CFG_LOG_PAGE_SZ(fs))) - -#define SPIFFS_CONFIG_MAGIC (0x20090315) - -#if SPIFFS_SINGLETON == 0 -#define SPIFFS_CFG_LOG_PAGE_SZ(fs) \ - ((fs)->cfg.log_page_size) -#define SPIFFS_CFG_LOG_BLOCK_SZ(fs) \ - ((fs)->cfg.log_block_size) -#define SPIFFS_CFG_PHYS_SZ(fs) \ - ((fs)->cfg.phys_size) -#define SPIFFS_CFG_PHYS_ERASE_SZ(fs) \ - ((fs)->cfg.phys_erase_block) -#define SPIFFS_CFG_PHYS_ADDR(fs) \ - ((fs)->cfg.phys_addr) -#endif - -// total number of pages -#define SPIFFS_MAX_PAGES(fs) \ - ( SPIFFS_CFG_PHYS_SZ(fs)/SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// total number of pages per block, including object lookup pages -#define SPIFFS_PAGES_PER_BLOCK(fs) \ - ( SPIFFS_CFG_LOG_BLOCK_SZ(fs)/SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// number of object lookup pages per block -#define SPIFFS_OBJ_LOOKUP_PAGES(fs) \ - (MAX(1, (SPIFFS_PAGES_PER_BLOCK(fs) * sizeof(spiffs_obj_id)) / SPIFFS_CFG_LOG_PAGE_SZ(fs)) ) -// checks if page index belongs to object lookup -#define SPIFFS_IS_LOOKUP_PAGE(fs,pix) \ - (((pix) % SPIFFS_PAGES_PER_BLOCK(fs)) < SPIFFS_OBJ_LOOKUP_PAGES(fs)) -// number of object lookup entries in all object lookup pages -#define SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs) \ - (SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs)) -// converts a block to physical address -#define SPIFFS_BLOCK_TO_PADDR(fs, block) \ - ( SPIFFS_CFG_PHYS_ADDR(fs) + (block)* SPIFFS_CFG_LOG_BLOCK_SZ(fs) ) -// converts a object lookup entry to page index -#define SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, block, entry) \ - ((block)*SPIFFS_PAGES_PER_BLOCK(fs) + (SPIFFS_OBJ_LOOKUP_PAGES(fs) + entry)) -// converts a object lookup entry to physical address of corresponding page -#define SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, block, entry) \ - (SPIFFS_BLOCK_TO_PADDR(fs, block) + (SPIFFS_OBJ_LOOKUP_PAGES(fs) + entry) * SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// converts a page to physical address -#define SPIFFS_PAGE_TO_PADDR(fs, page) \ - ( SPIFFS_CFG_PHYS_ADDR(fs) + (page) * SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// converts a physical address to page -#define SPIFFS_PADDR_TO_PAGE(fs, addr) \ - ( ((addr) - SPIFFS_CFG_PHYS_ADDR(fs)) / SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// gives index in page for a physical address -#define SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr) \ - ( ((addr) - SPIFFS_CFG_PHYS_ADDR(fs)) % SPIFFS_CFG_LOG_PAGE_SZ(fs) ) -// returns containing block for given page -#define SPIFFS_BLOCK_FOR_PAGE(fs, page) \ - ( (page) / SPIFFS_PAGES_PER_BLOCK(fs) ) -// returns starting page for block -#define SPIFFS_PAGE_FOR_BLOCK(fs, block) \ - ( (block) * SPIFFS_PAGES_PER_BLOCK(fs) ) -// converts page to entry in object lookup page -#define SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, page) \ - ( (page) % SPIFFS_PAGES_PER_BLOCK(fs) - SPIFFS_OBJ_LOOKUP_PAGES(fs) ) -// returns data size in a data page -#define SPIFFS_DATA_PAGE_SIZE(fs) \ - ( SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_header) ) -// returns physical address for block's erase count, -// always in the physical last entry of the last object lookup page -#define SPIFFS_ERASE_COUNT_PADDR(fs, bix) \ - ( SPIFFS_BLOCK_TO_PADDR(fs, bix) + SPIFFS_OBJ_LOOKUP_PAGES(fs) * SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_obj_id) ) -// returns physical address for block's magic, -// always in the physical second last entry of the last object lookup page -#define SPIFFS_MAGIC_PADDR(fs, bix) \ - ( SPIFFS_BLOCK_TO_PADDR(fs, bix) + SPIFFS_OBJ_LOOKUP_PAGES(fs) * SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_obj_id)*2 ) -// checks if there is any room for magic in the object luts -#define SPIFFS_CHECK_MAGIC_POSSIBLE(fs) \ - ( (SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs) % (SPIFFS_CFG_LOG_PAGE_SZ(fs)/sizeof(spiffs_obj_id))) * sizeof(spiffs_obj_id) \ - <= (SPIFFS_CFG_LOG_PAGE_SZ(fs)-sizeof(spiffs_obj_id)*2) ) - -// define helpers object - -// entries in an object header page index -#define SPIFFS_OBJ_HDR_IX_LEN(fs) \ - ((SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_object_ix_header))/sizeof(spiffs_page_ix)) -// entries in an object page index -#define SPIFFS_OBJ_IX_LEN(fs) \ - ((SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_object_ix))/sizeof(spiffs_page_ix)) -// object index entry for given data span index -#define SPIFFS_OBJ_IX_ENTRY(fs, spix) \ - ((spix) < SPIFFS_OBJ_HDR_IX_LEN(fs) ? (spix) : (((spix)-SPIFFS_OBJ_HDR_IX_LEN(fs))%SPIFFS_OBJ_IX_LEN(fs))) -// object index span index number for given data span index or entry -#define SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, spix) \ - ((spix) < SPIFFS_OBJ_HDR_IX_LEN(fs) ? 0 : (1+((spix)-SPIFFS_OBJ_HDR_IX_LEN(fs))/SPIFFS_OBJ_IX_LEN(fs))) - - -#define SPIFFS_OP_T_OBJ_LU (0<<0) -#define SPIFFS_OP_T_OBJ_LU2 (1<<0) -#define SPIFFS_OP_T_OBJ_IX (2<<0) -#define SPIFFS_OP_T_OBJ_DA (3<<0) -#define SPIFFS_OP_C_DELE (0<<2) -#define SPIFFS_OP_C_UPDT (1<<2) -#define SPIFFS_OP_C_MOVS (2<<2) -#define SPIFFS_OP_C_MOVD (3<<2) -#define SPIFFS_OP_C_FLSH (4<<2) -#define SPIFFS_OP_C_READ (5<<2) -#define SPIFFS_OP_C_WRTHRU (6<<2) - -#define SPIFFS_OP_TYPE_MASK (3<<0) -#define SPIFFS_OP_COM_MASK (7<<2) - - -// if 0, this page is written to, else clean -#define SPIFFS_PH_FLAG_USED (1<<0) -// if 0, writing is finalized, else under modification -#define SPIFFS_PH_FLAG_FINAL (1<<1) -// if 0, this is an index page, else a data page -#define SPIFFS_PH_FLAG_INDEX (1<<2) -// if 0, page is deleted, else valid -#define SPIFFS_PH_FLAG_DELET (1<<7) -// if 0, this index header is being deleted -#define SPIFFS_PH_FLAG_IXDELE (1<<6) - - -#define SPIFFS_CHECK_MOUNT(fs) \ - ((fs)->mounted != 0) - -#define SPIFFS_CHECK_CFG(fs) \ - ((fs)->config_magic == SPIFFS_CONFIG_MAGIC) - -#define SPIFFS_CHECK_RES(res) \ - do { \ - if ((res) < SPIFFS_OK) return (res); \ - } while (0); - -#define SPIFFS_API_CHECK_MOUNT(fs) \ - if (!SPIFFS_CHECK_MOUNT((fs))) { \ - (fs)->err_code = SPIFFS_ERR_NOT_MOUNTED; \ - return -1; \ - } - -#define SPIFFS_API_CHECK_CFG(fs) \ - if (!SPIFFS_CHECK_CFG((fs))) { \ - (fs)->err_code = SPIFFS_ERR_NOT_CONFIGURED; \ - return -1; \ - } - -#define SPIFFS_API_CHECK_RES(fs, res) \ - if ((res) < SPIFFS_OK) { \ - (fs)->err_code = (res); \ - return -1; \ - } - -#define SPIFFS_API_CHECK_RES_UNLOCK(fs, res) \ - if ((res) < SPIFFS_OK) { \ - (fs)->err_code = (res); \ - SPIFFS_UNLOCK(fs); \ - return -1; \ - } - -#define SPIFFS_VALIDATE_OBJIX(ph, objid, spix) \ - if (((ph).flags & SPIFFS_PH_FLAG_USED) != 0) return SPIFFS_ERR_IS_FREE; \ - if (((ph).flags & SPIFFS_PH_FLAG_DELET) == 0) return SPIFFS_ERR_DELETED; \ - if (((ph).flags & SPIFFS_PH_FLAG_FINAL) != 0) return SPIFFS_ERR_NOT_FINALIZED; \ - if (((ph).flags & SPIFFS_PH_FLAG_INDEX) != 0) return SPIFFS_ERR_NOT_INDEX; \ - if (((objid) & SPIFFS_OBJ_ID_IX_FLAG) == 0) return SPIFFS_ERR_NOT_INDEX; \ - if ((ph).span_ix != (spix)) return SPIFFS_ERR_INDEX_SPAN_MISMATCH; - //if ((spix) == 0 && ((ph).flags & SPIFFS_PH_FLAG_IXDELE) == 0) return SPIFFS_ERR_DELETED; - -#define SPIFFS_VALIDATE_DATA(ph, objid, spix) \ - if (((ph).flags & SPIFFS_PH_FLAG_USED) != 0) return SPIFFS_ERR_IS_FREE; \ - if (((ph).flags & SPIFFS_PH_FLAG_DELET) == 0) return SPIFFS_ERR_DELETED; \ - if (((ph).flags & SPIFFS_PH_FLAG_FINAL) != 0) return SPIFFS_ERR_NOT_FINALIZED; \ - if (((ph).flags & SPIFFS_PH_FLAG_INDEX) == 0) return SPIFFS_ERR_IS_INDEX; \ - if ((objid) & SPIFFS_OBJ_ID_IX_FLAG) return SPIFFS_ERR_IS_INDEX; \ - if ((ph).span_ix != (spix)) return SPIFFS_ERR_DATA_SPAN_MISMATCH; - - -// check id -#define SPIFFS_VIS_CHECK_ID (1<<0) -// report argument object id to visitor - else object lookup id is reported -#define SPIFFS_VIS_CHECK_PH (1<<1) -// stop searching at end of all look up pages -#define SPIFFS_VIS_NO_WRAP (1<<2) - -#if SPIFFS_CACHE - -#define SPIFFS_CACHE_FLAG_DIRTY (1<<0) -#define SPIFFS_CACHE_FLAG_WRTHRU (1<<1) -#define SPIFFS_CACHE_FLAG_OBJLU (1<<2) -#define SPIFFS_CACHE_FLAG_OBJIX (1<<3) -#define SPIFFS_CACHE_FLAG_DATA (1<<4) -#define SPIFFS_CACHE_FLAG_TYPE_WR (1<<7) - -#define SPIFFS_CACHE_PAGE_SIZE(fs) \ - (sizeof(spiffs_cache_page) + SPIFFS_CFG_LOG_PAGE_SZ(fs)) - -#define spiffs_get_cache(fs) \ - ((spiffs_cache *)((fs)->cache)) - -#define spiffs_get_cache_page_hdr(fs, c, ix) \ - ((spiffs_cache_page *)(&((c)->cpages[(ix) * SPIFFS_CACHE_PAGE_SIZE(fs)]))) - -#define spiffs_get_cache_page(fs, c, ix) \ - ((u8_t *)(&((c)->cpages[(ix) * SPIFFS_CACHE_PAGE_SIZE(fs)])) + sizeof(spiffs_cache_page)) - -// cache page struct -typedef struct { - // cache flags - u8_t flags; - // cache page index - u8_t ix; - // last access of this cache page - u32_t last_access; - union { - // type read cache - struct { - // read cache page index - spiffs_page_ix pix; - }; -#if SPIFFS_CACHE_WR - // type write cache - struct { - // write cache - spiffs_obj_id obj_id; - // offset in cache page - u32_t offset; - // size of cache page - u16_t size; - }; -#endif - }; -} spiffs_cache_page; - -// cache struct -typedef struct { - u8_t cpage_count; - u32_t last_access; - u32_t cpage_use_map; - u32_t cpage_use_mask; - u8_t *cpages; -} spiffs_cache; - -#endif - - -// spiffs nucleus file descriptor -typedef struct { - // the filesystem of this descriptor - spiffs *fs; - // number of file descriptor - if 0, the file descriptor is closed - spiffs_file file_nbr; - // object id - if SPIFFS_OBJ_ID_ERASED, the file was deleted - spiffs_obj_id obj_id; - // size of the file - u32_t size; - // cached object index header page index - spiffs_page_ix objix_hdr_pix; - // cached offset object index page index - spiffs_page_ix cursor_objix_pix; - // cached offset object index span index - spiffs_span_ix cursor_objix_spix; - // current absolute offset - u32_t offset; - // current file descriptor offset - u32_t fdoffset; - // fd flags - spiffs_flags flags; -#if SPIFFS_CACHE_WR - spiffs_cache_page *cache_page; -#endif -} spiffs_fd; - - -// object structs - -// page header, part of each page except object lookup pages -// NB: this is always aligned when the data page is an object index, -// as in this case struct spiffs_page_object_ix is used -typedef struct __attribute(( packed )) { - // object id - spiffs_obj_id obj_id; - // object span index - spiffs_span_ix span_ix; - // flags - u8_t flags; -} spiffs_page_header; - -// object index header page header -typedef struct __attribute(( packed )) -#if SPIFFS_ALIGNED_OBJECT_INDEX_TABLES - __attribute(( aligned(sizeof(spiffs_page_ix)) )) -#endif -{ - // common page header - spiffs_page_header p_hdr; - // alignment - u8_t _align[4 - (sizeof(spiffs_page_header)&3)==0 ? 4 : (sizeof(spiffs_page_header)&3)]; - // size of object - u32_t size; - // type of object - spiffs_obj_type type; - // name of object - u8_t name[SPIFFS_OBJ_NAME_LEN]; -} spiffs_page_object_ix_header; - -// object index page header -typedef struct __attribute(( packed )) { - spiffs_page_header p_hdr; - u8_t _align[4 - (sizeof(spiffs_page_header)&3)==0 ? 4 : (sizeof(spiffs_page_header)&3)]; -} spiffs_page_object_ix; - -// callback func for object lookup visitor -typedef s32_t (*spiffs_visitor_f)(spiffs *fs, spiffs_obj_id id, spiffs_block_ix bix, int ix_entry, - u32_t user_data, void *user_p); - - -#if SPIFFS_CACHE -#define _spiffs_rd(fs, op, fh, addr, len, dst) \ - spiffs_phys_rd((fs), (op), (fh), (addr), (len), (dst)) -#define _spiffs_wr(fs, op, fh, addr, len, src) \ - spiffs_phys_wr((fs), (op), (fh), (addr), (len), (src)) -#else -#define _spiffs_rd(fs, op, fh, addr, len, dst) \ - spiffs_phys_rd((fs), (addr), (len), (dst)) -#define _spiffs_wr(fs, op, fh, addr, len, src) \ - spiffs_phys_wr((fs), (addr), (len), (src)) -#endif - -#ifndef MIN -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#endif -#ifndef MAX -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#endif - -// --------------- - -s32_t spiffs_phys_rd( - spiffs *fs, -#if SPIFFS_CACHE - u8_t op, - spiffs_file fh, -#endif - u32_t addr, - u32_t len, - u8_t *dst); - -s32_t spiffs_phys_wr( - spiffs *fs, -#if SPIFFS_CACHE - u8_t op, - spiffs_file fh, -#endif - u32_t addr, - u32_t len, - u8_t *src); - -s32_t spiffs_phys_cpy( - spiffs *fs, - spiffs_file fh, - u32_t dst, - u32_t src, - u32_t len); - -s32_t spiffs_phys_count_free_blocks( - spiffs *fs); - -s32_t spiffs_obj_lu_find_entry_visitor( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - u8_t flags, - spiffs_obj_id obj_id, - spiffs_visitor_f v, - u32_t user_data, - void *user_p, - spiffs_block_ix *block_ix, - int *lu_entry); - -s32_t spiffs_erase_block( - spiffs *fs, - spiffs_block_ix bix); - -// --------------- - -s32_t spiffs_obj_lu_scan( - spiffs *fs); - -s32_t spiffs_obj_lu_find_free_obj_id( - spiffs *fs, - spiffs_obj_id *obj_id, - u8_t *conflicting_name); - -s32_t spiffs_obj_lu_find_free( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - spiffs_block_ix *block_ix, - int *lu_entry); - -s32_t spiffs_obj_lu_find_id( - spiffs *fs, - spiffs_block_ix starting_block, - int starting_lu_entry, - spiffs_obj_id obj_id, - spiffs_block_ix *block_ix, - int *lu_entry); - -s32_t spiffs_obj_lu_find_id_and_span( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix exclusion_pix, - spiffs_page_ix *pix); - -s32_t spiffs_obj_lu_find_id_and_span_by_phdr( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix exclusion_pix, - spiffs_page_ix *pix); - -// --------------- - -s32_t spiffs_page_allocate_data( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_page_header *ph, - u8_t *data, - u32_t len, - u32_t page_offs, - u8_t finalize, - spiffs_page_ix *pix); - -s32_t spiffs_page_move( - spiffs *fs, - spiffs_file fh, - u8_t *page_data, - spiffs_obj_id obj_id, - spiffs_page_header *page_hdr, - spiffs_page_ix src_pix, - spiffs_page_ix *dst_pix); - -s32_t spiffs_page_delete( - spiffs *fs, - spiffs_page_ix pix); - -// --------------- - -s32_t spiffs_object_create( - spiffs *fs, - spiffs_obj_id obj_id, - u8_t name[SPIFFS_OBJ_NAME_LEN], - spiffs_obj_type type, - spiffs_page_ix *objix_hdr_pix); - -s32_t spiffs_object_update_index_hdr( - spiffs *fs, - spiffs_fd *fd, - spiffs_obj_id obj_id, - spiffs_page_ix objix_hdr_pix, - u8_t *new_objix_hdr_data, - u8_t name[SPIFFS_OBJ_NAME_LEN], - u32_t size, - spiffs_page_ix *new_pix); - -void spiffs_cb_object_event( - spiffs *fs, - spiffs_fd *fd, - int ev, - spiffs_obj_id obj_id, - spiffs_span_ix spix, - spiffs_page_ix new_pix, - u32_t new_size); - -s32_t spiffs_object_open_by_id( - spiffs *fs, - spiffs_obj_id obj_id, - spiffs_fd *f, - spiffs_flags flags, - spiffs_mode mode); - -s32_t spiffs_object_open_by_page( - spiffs *fs, - spiffs_page_ix pix, - spiffs_fd *f, - spiffs_flags flags, - spiffs_mode mode); - -s32_t spiffs_object_append( - spiffs_fd *fd, - u32_t offset, - u8_t *data, - u32_t len); - -s32_t spiffs_object_modify( - spiffs_fd *fd, - u32_t offset, - u8_t *data, - u32_t len); - -s32_t spiffs_object_read( - spiffs_fd *fd, - u32_t offset, - u32_t len, - u8_t *dst); - -s32_t spiffs_object_truncate( - spiffs_fd *fd, - u32_t new_len, - u8_t remove_object); - -s32_t spiffs_object_find_object_index_header_by_name( - spiffs *fs, - u8_t name[SPIFFS_OBJ_NAME_LEN], - spiffs_page_ix *pix); - -// --------------- - -s32_t spiffs_gc_check( - spiffs *fs, - u32_t len); - -s32_t spiffs_gc_erase_page_stats( - spiffs *fs, - spiffs_block_ix bix); - -s32_t spiffs_gc_find_candidate( - spiffs *fs, - spiffs_block_ix **block_candidate, - int *candidate_count, - char fs_crammed); - -s32_t spiffs_gc_clean( - spiffs *fs, - spiffs_block_ix bix); - -s32_t spiffs_gc_quick( - spiffs *fs); - -// --------------- - -s32_t spiffs_fd_find_new( - spiffs *fs, - spiffs_fd **fd); - -s32_t spiffs_fd_return( - spiffs *fs, - spiffs_file f); - -s32_t spiffs_fd_get( - spiffs *fs, - spiffs_file f, - spiffs_fd **fd); - -#if SPIFFS_CACHE -void spiffs_cache_init( - spiffs *fs); - -void spiffs_cache_drop_page( - spiffs *fs, - spiffs_page_ix pix); - -#if SPIFFS_CACHE_WR -spiffs_cache_page *spiffs_cache_page_allocate_by_fd( - spiffs *fs, - spiffs_fd *fd); - -void spiffs_cache_fd_release( - spiffs *fs, - spiffs_cache_page *cp); - -spiffs_cache_page *spiffs_cache_page_get_by_fd( - spiffs *fs, - spiffs_fd *fd); -#endif -#endif - -s32_t spiffs_lookup_consistency_check( - spiffs *fs, - u8_t check_all_objects); - -s32_t spiffs_page_consistency_check( - spiffs *fs); - -s32_t spiffs_object_index_consistency_check( - spiffs *fs); - -#endif /* SPIFFS_NUCLEUS_H_ */ diff --git a/sparkfun/esp8266/cores/esp8266/user_config.h b/sparkfun/esp8266/cores/esp8266/user_config.h deleted file mode 100644 index 8b137891..00000000 --- a/sparkfun/esp8266/cores/esp8266/user_config.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sparkfun/esp8266/cores/esp8266/wiring_private.h b/sparkfun/esp8266/cores/esp8266/wiring_private.h deleted file mode 100644 index 2c53565a..00000000 --- a/sparkfun/esp8266/cores/esp8266/wiring_private.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - wiring_private.h - Internal header file. - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2005-2006 David A. Mellis - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 239 2007-01-12 17:58:39Z mellis $ - */ - -#ifndef WiringPrivate_h -#define WiringPrivate_h - -#include -#include - -#include "Arduino.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*voidFuncPtr)(void); - -void initPins(); - -#ifdef __cplusplus -} // extern "C" -#endif - -#endif diff --git a/sparkfun/esp8266/firmwares/loader/Makefile b/sparkfun/esp8266/firmwares/loader/Makefile deleted file mode 100644 index 4306ac05..00000000 --- a/sparkfun/esp8266/firmwares/loader/Makefile +++ /dev/null @@ -1,108 +0,0 @@ -SRC_DIR := src -OBJ_DIR := obj -BIN_DIR := bin - -# todo: define path depending on the platform -BUILT_IDE_DIR ?= ../../../../../build/macosx/work/Arduino.app/Contents/Java - -GIT_REV := $(shell git rev-parse --short HEAD) - -CPPFLAGS+=-Iinclude -Isrc/include -DREVISION_STRING=\"$(GIT_REV)\" -CFLAGS += -std=c99 -CXXFLAGS += -std=c++0x - -OBJ_FILES := main.o - -OBJ_PATHS := $(addprefix $(SRC_DIR)/,$(OBJ_FILES)) - -TOOLS_DIR := $(BUILT_IDE_DIR)/hardware/tools/esp8266 - -XTENSA_TOOCHAIN := $(TOOLS_DIR)/xtensa-lx106-elf/bin -TOOLCHAIN_PREFIX := $(XTENSA_TOOCHAIN)/xtensa-lx106-elf- -CC := $(TOOLCHAIN_PREFIX)gcc -CXX := $(TOOLCHAIN_PREFIX)g++ -AR := $(TOOLCHAIN_PREFIX)ar -LD := $(TOOLCHAIN_PREFIX)gcc -OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy -SIZE := $(TOOLCHAIN_PREFIX)size -STRIP := $(TOOLCHAIN_PREFIX)strip -ESPTOOL := $(TOOLS_DIR)/esptool - -XTENSA_LIBS ?= $(shell $(CC) -print-sysroot) - -SDK_BASE ?= $(TOOLS_DIR)/sdk - -CPPFLAGS += -I$(XTENSA_LIBS)/include \ - -I$(SDK_BASE)/include \ - -I$(SRC_DIR) - -LDFLAGS += -L$(XTENSA_LIBS)/lib \ - -L$(XTENSA_LIBS)/arch/lib \ - -L$(SDK_BASE)/lib - -LIBS := c gcc hal phy net80211 wpa main pp lwip - -#-Werror -CFLAGS += -std=c99 -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -CXXFLAGS += -c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -std=c++11 -MMD - - -CPPFLAGS += -DESP_PLATFORM=1 -D__ets__ -DICACHE_FLASH - -LDFLAGS += -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static - -LD_SCRIPT := loader.ld - -APP_AR:=$(BIN_DIR)/loader.a -APP_OUT:=$(BIN_DIR)/loader.elf -APP_FW_S1 := $(BIN_DIR)/_loader_segm_1.bin -APP_FW_S2 := $(BIN_DIR)/_loader_segm_2.bin -APP_FW := $(BIN_DIR)/loader.bin - -# $(LWIP_AR) : $(LWIP_OBJ_PATHS) -# for file in $(LWIP_OBJ_PATHS); do \ -# $(OBJCOPY) \ -# --rename-section .text=.irom0.text \ -# --rename-section .literal=.irom0.literal \ -# $$file; \ -# done -# $(AR) cru $@ $^ - -$(APP_AR): $(OBJ_PATHS) $(SDK_DRIVER_OBJ_PATHS) - $(AR) cru $@ $^ - -$(APP_AR): | $(BIN_DIR) - -$(APP_OUT): $(APP_AR) $(LWIP_AR) - $(LD) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(addprefix -l,$(LIBS)) $(APP_AR) -Wl,--end-group -o $@ - $(SIZE) -A -x $@ | head -n 7 - - -$(APP_FW_S1): $(APP_OUT) - $(ESPTOOL) -eo $(APP_OUT) -bo $@ -bs .text -bs .data -bs .rodata -bc -ec - -$(APP_FW_S2): $(APP_OUT) - $(ESPTOOL) -eo $(APP_OUT) -es .irom0.text $@ -ec - -$(APP_FW): $(APP_FW_S1) $(APP_FW_S2) - dd if=/dev/zero ibs=4k count=56 | LC_ALL=C tr "\000" "\377" >$(APP_FW) - dd if=$(APP_FW_S1) of=$(APP_FW) bs=4k seek=0 conv=notrunc - dd if=$(APP_FW_S2) of=$(APP_FW) bs=4k seek=9 conv=notrunc - -firmware: $(APP_FW_S1) $(APP_FW_S2) $(APP_FW) - -all: firmware - -.PHONY: all firmware - - -$(BIN_DIR): - mkdir -p $(BIN_DIR) - -clean: - rm -f $(SRC_DIR)/*.o - rm -f $(SRC_DIR)/*.d - rm -rf $(BIN_DIR) - -.PHONY: clean - diff --git a/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_1.bin b/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_1.bin deleted file mode 100644 index 636d0b61..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_1.bin and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_2.bin b/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_2.bin deleted file mode 100644 index c874a2e2..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/_loader_segm_2.bin and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/bin/loader.a b/sparkfun/esp8266/firmwares/loader/bin/loader.a deleted file mode 100644 index e0744ada..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/loader.a and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/bin/loader.bin b/sparkfun/esp8266/firmwares/loader/bin/loader.bin deleted file mode 100644 index ab736ee1..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/loader.bin and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/bin/loader.data.elf b/sparkfun/esp8266/firmwares/loader/bin/loader.data.elf deleted file mode 100644 index d52ddbed..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/loader.data.elf and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/bin/loader.elf b/sparkfun/esp8266/firmwares/loader/bin/loader.elf deleted file mode 100644 index 206003fd..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/bin/loader.elf and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/loader.ld b/sparkfun/esp8266/firmwares/loader/loader.ld deleted file mode 100644 index 88664734..00000000 --- a/sparkfun/esp8266/firmwares/loader/loader.ld +++ /dev/null @@ -1,190 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP . */ -/* Linker Script for ld -N */ -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40209000, len = 0x29000 -} - -PHDRS -{ - dport0_0_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram1_0_phdr PT_LOAD; - irom0_0_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(call_user_start) -PROVIDE(_memmap_vecbase_reset = 0x40000000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x00000110; -_memmap_cacheattr_wt_base = 0x00000110; -_memmap_cacheattr_bp_base = 0x00000220; -_memmap_cacheattr_unused_mask = 0xFFFFF00F; -_memmap_cacheattr_wb_trapnull = 0x2222211F; -_memmap_cacheattr_wba_trapnull = 0x2222211F; -_memmap_cacheattr_wbna_trapnull = 0x2222211F; -_memmap_cacheattr_wt_trapnull = 0x2222211F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0xFFFFF11F; -_memmap_cacheattr_wt_strict = 0xFFFFF11F; -_memmap_cacheattr_bp_strict = 0xFFFFF22F; -_memmap_cacheattr_wb_allvalid = 0x22222112; -_memmap_cacheattr_wt_allvalid = 0x22222112; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .dport0.rodata : ALIGN(4) - { - _dport0_rodata_start = ABSOLUTE(.); - *(.dport0.rodata) - *(.dport.rodata) - _dport0_rodata_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.literal : ALIGN(4) - { - _dport0_literal_start = ABSOLUTE(.); - *(.dport0.literal) - *(.dport.literal) - _dport0_literal_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.data : ALIGN(4) - { - _dport0_data_start = ABSOLUTE(.); - *(.dport0.data) - *(.dport.data) - _dport0_data_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - *(.jcr) - _data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - *(.xt_except_table) - *(.gcc_except_table) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - *(.eh_frame) - . = (. + 3) & ~ 3; - /* C++ constructor and destructor tables, properly ordered: */ - __init_array_start = ABSOLUTE(.); - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __init_array_end = ABSOLUTE(.); - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .bss ALIGN(8) (NOLOAD) : ALIGN(4) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _heap_start = ABSOLUTE(.); -/* _stack_sentry = ALIGN(0x8); */ - } >dram0_0_seg :dram0_0_bss_phdr -/* __stack = 0x3ffc8000; */ - - .irom0.text : ALIGN(4) - { - _irom0_text_start = ABSOLUTE(.); - *core_esp8266_*.o(.literal*, .text*) - *.cpp.o(.literal*, .text*) - *libm.a:(.literal .text .literal.* .text.*) - *libsmartconfig.a:(.literal .text .literal.* .text.*) - *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) - _irom0_text_end = ABSOLUTE(.); - } >irom0_0_seg :irom0_0_phdr - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.entry.text) - *(.init.literal) - *(.init) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - *(.fini) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >iram1_0_seg :iram1_0_phdr - - .lit4 : ALIGN(4) - { - _lit4_start = ABSOLUTE(.); - *(*.lit4) - *(.lit4.*) - *(.gnu.linkonce.lit4.*) - _lit4_end = ABSOLUTE(.); - } >iram1_0_seg :iram1_0_phdr - - -} - -/* get ROM code address */ -INCLUDE "../ld/eagle.rom.addr.v6.ld" diff --git a/sparkfun/esp8266/firmwares/loader/src/Common.hpp b/sparkfun/esp8266/firmwares/loader/src/Common.hpp deleted file mode 100644 index 3616cf4b..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/Common.hpp +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef COMMON_HPP -#define COMMON_HPP - -#include -#include -#include -#include - -#define LWIP_INTERNAL - -extern "C" { - #include "ets_sys.h" - // #include "os_type.h" - #include "osapi.h" - // #include "mem.h" - // #include "user_interface.h" -} - -#include "lwip/opt.h" -#include "lwip/tcp.h" -#include "lwip/inet.h" - - -namespace update { - -enum Error { - OK = 0, - E_ALLOC_FAIL = 1, - E_BIND_FAIL = 2, -}; - -class Args { -public: - Args(const char* str) : - m_Str(0), m_Keys(0), m_Values(0), m_Count(0) { - int length = strlen(str); - m_Str = new char[length]; - - m_Count = 0; - for (int i = 0; i < length; ++i) { - if (m_Str[i] == '=') { - ++m_Count; - } - } - - if (!m_Count) - return; - - m_Keys = new const char*[m_Count]; - m_Values = new const char*[m_Count]; - - char* start = m_Str; - const char* end = m_Str + length; - int iArg; - for (iArg = 0; iArg < m_Count; ++iArg) { - char* next = strchr(start, '='); - if (!next) - break; - *next = 0; - m_Keys[iArg] = start; - start = next + 1; - - if (start >= end) - break; - - next = strchr(start, '&'); - if (!next) - break; - *next = 0; - m_Values[iArg] = start; - start = next + 1; - - if (start >= end) - break; - } - - m_Count = iArg; - } - - ~Args() { - delete[] m_Str; - delete[] m_Keys; - delete[] m_Values; - } - - const char* get(const char* key) { - for (int i = 0; i < m_Count; ++i) { - if (strcmp(key, m_Keys[i]) == 0) { - return m_Values[i]; - } - } - return 0; - } - -protected: - char* m_Str; - - int m_Count; - const char** m_Keys; - const char** m_Values; -}; - -class Sink { -public: - virtual Error begin(Args& args, size_t size) { return OK; } - virtual Error write(const uint8_t* data, size_t size) { return OK; } - virtual Error abort() { return OK; } - virtual Error end() { return OK; } -}; - -class Source { -public: - virtual Error begin(Args& args) = 0; -}; - -class AuthChecker { -public: - virtual Error check(Args& args, const uint8_t* contentHash, const uint8_t* hmac) { - return OK; - } -}; - - - - - -} // namespace update - - - -#endif //COMMON_HPP \ No newline at end of file diff --git a/sparkfun/esp8266/firmwares/loader/src/TcpServerSource.hpp b/sparkfun/esp8266/firmwares/loader/src/TcpServerSource.hpp deleted file mode 100644 index b8e443d7..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/TcpServerSource.hpp +++ /dev/null @@ -1,182 +0,0 @@ -#ifndef TCPSERVERSOURCE_H -#define TCPSERVERSOURCE_H - -#include "Common.hpp" -#include -/* - * Quick and dirty TCP server - * - */ - - -namespace update { - - - -class TcpServerSource : public Source { - -private: - enum State {S_IDLE, S_WAITING, S_ACCEPTED}; - -public: - static const int DEFAULT_PORT = 8266; - - TcpServerSource(Sink& sink, AuthChecker& authChecker) : - m_Sink(sink), - m_AuthChecker(authChecker), - m_State(S_IDLE), - m_rxBuf(0), - m_rxBufOffset(0) - { - - } - - virtual Error begin(Args& args) { - m_Port = 0; - const char* portStr; - if ((portStr = args.get("port")) != NULL) { - m_Port = atoi(portStr); - } - if (!m_Port) { - m_Port = DEFAULT_PORT; - } - - err_t err; - tcp_pcb* pcb = tcp_new(); - if (!pcb) - return E_ALLOC_FAIL; - - err = tcp_bind(pcb, INADDR_ANY, m_Port); - if (err != ERR_OK) - { - tcp_close(pcb); - return E_BIND_FAIL; - } - - tcp_pcb* listen_pcb = tcp_listen(pcb); - if (!listen_pcb) - { - tcp_close(pcb); - return E_ALLOC_FAIL; - } - - m_Pcb = listen_pcb; - tcp_arg(listen_pcb, (void*) this); - tcp_accept(listen_pcb, &TcpServerSource::_s_accept); - m_State = S_WAITING; - return OK; - } - - -protected: - static int8_t _s_accept(void *arg, tcp_pcb* newpcb, int8_t err) { - return reinterpret_cast(arg)->_accept(newpcb, err); - } - - static err_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err) { - return reinterpret_cast(arg)->_recv(tpcb, pb, err); - } - - static void _s_error(void *arg, err_t err) { - reinterpret_cast(arg)->_error(err); - } - - static err_t _s_poll(void *arg, struct tcp_pcb *tpcb) { - return reinterpret_cast(arg)->_poll(tpcb); - } - - static err_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) { - return reinterpret_cast(arg)->_sent(tpcb, len); - } - - int8_t _accept(tcp_pcb* apcb, int8_t err) { - if (m_State == S_ACCEPTED) { - tcp_abort(apcb); - return ERR_ABRT; - } - - m_State = S_ACCEPTED; - tcp_arg(apcb, this); - tcp_recv(apcb, &_s_recv); - tcp_sent(apcb, &_s_sent); - tcp_err(apcb, &_s_error); - m_ClientPcb = apcb; - - tcp_accepted(m_Pcb); - - return ERR_OK; - } - - err_t _recv(tcp_pcb* pcb, pbuf* pb, err_t err) { - - if(pb == 0) // connection closed - { - tcp_arg(pcb, NULL); - tcp_sent(pcb, NULL); - tcp_recv(pcb, NULL); - tcp_err(pcb, NULL); - tcp_abort(pcb); - m_Pcb = 0; - return ERR_ABRT; - } - - if(m_rxBuf) { - // there is some unread data - // chain the new pbuf to the existing one - // DEBUGV(":rch %d, %d\r\n", _rx_buf->tot_len, pb->tot_len); - pbuf_cat(m_rxBuf, pb); - } else { - // DEBUGV(":rn %d\r\n", pb->tot_len); - m_rxBuf = pb; - m_rxBufOffset = 0; - } - // tcp_recved(pcb, received); - // pbuf_free(pb); - return ERR_OK; - } - - void _error(err_t err) { - // DEBUGV(":er %d\r\n", err); - - if(m_ClientPcb) { - tcp_arg(m_ClientPcb, NULL); - tcp_sent(m_ClientPcb, NULL); - tcp_recv(m_ClientPcb, NULL); - tcp_err(m_ClientPcb, NULL); - err = tcp_close(m_ClientPcb); - if(err != ERR_OK) { - // DEBUGV(":tc err %d\r\n", err); - tcp_abort(m_Pcb); - } - } - m_ClientPcb = 0; - } - - err_t _poll(tcp_pcb* pcb) { - return ERR_OK; - } - - err_t _sent(tcp_pcb* pcb, uint16_t len) { - // DEBUGV(":sent %d\r\n", len); - // _size_sent -= len; - // if(_size_sent == 0 && _send_waiting) esp_schedule(); - return ERR_OK; - } - - - Sink& m_Sink; - AuthChecker& m_AuthChecker; - uint32_t m_Port; - tcp_pcb* m_Pcb; - tcp_pcb* m_ClientPcb; - State m_State; - pbuf* m_rxBuf; - size_t m_rxBufOffset; -}; - - - -} // namespace update - -#endif //TCPSERVERSOURCE_H - diff --git a/sparkfun/esp8266/firmwares/loader/src/abi.cpp b/sparkfun/esp8266/firmwares/loader/src/abi.cpp deleted file mode 100644 index 03514b12..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/abi.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include -#include -#include - -extern "C" { - #include "ets_sys.h" - #include "os_type.h" - #include "osapi.h" - #include "mem.h" - #include "user_interface.h" -} - -extern "C" void abort() { - while(1) { - } -} - -void *operator new(size_t size) { - return os_malloc(size); -} - -void *operator new[](size_t size) { - return os_malloc(size); -} - -void operator delete(void * ptr) { - os_free(ptr); -} - -void operator delete[](void * ptr) { - os_free(ptr); -} - -extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); -extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); - -void __cxa_pure_virtual(void) { - abort(); -} - -void __cxa_deleted_virtual(void) { - abort(); -} - -namespace std { -void __throw_bad_function_call() { - abort(); -} -} diff --git a/sparkfun/esp8266/firmwares/loader/src/arch/cc.h b/sparkfun/esp8266/firmwares/loader/src/arch/cc.h deleted file mode 100644 index ff03b307..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/arch/cc.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __ARCH_CC_H__ -#define __ARCH_CC_H__ - -//#include -#include "c_types.h" -#include "ets_sys.h" -#include "osapi.h" -#define EFAULT 14 - -//#define LWIP_PROVIDE_ERRNO - -#if (1) -#define BYTE_ORDER LITTLE_ENDIAN -#else -#define BYTE_ORDER BIG_ENDIAN -#endif - - -typedef unsigned char u8_t; -typedef signed char s8_t; -typedef unsigned short u16_t; -typedef signed short s16_t; -typedef unsigned long u32_t; -typedef signed long s32_t; -typedef unsigned long mem_ptr_t; - -#define S16_F "d" -#define U16_F "d" -#define X16_F "x" - -#define S32_F "d" -#define U32_F "d" -#define X32_F "x" - - - -//#define PACK_STRUCT_FIELD(x) x __attribute__((packed)) -#define PACK_STRUCT_FIELD(x) x -#define PACK_STRUCT_STRUCT __attribute__((packed)) -#define PACK_STRUCT_BEGIN -#define PACK_STRUCT_END - -//#define LWIP_DEBUG - -#ifdef LWIP_DEBUG -#define LWIP_PLATFORM_DIAG(x) os_printf x -#define LWIP_PLATFORM_ASSERT(x) ETS_ASSERT(x) -#else -#define LWIP_PLATFORM_DIAG(x) -#define LWIP_PLATFORM_ASSERT(x) -#endif - -#define SYS_ARCH_DECL_PROTECT(x) -#define SYS_ARCH_PROTECT(x) -#define SYS_ARCH_UNPROTECT(x) - -#define LWIP_PLATFORM_BYTESWAP 1 -#define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff))) -#define LWIP_PLATFORM_HTONL(_n) ((u32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) )) - -#if LWIP_RAW -extern u8_t memp_memory_RAW_PCB_base[]; -#endif /* LWIP_RAW */ - -#if LWIP_UDP -extern u8_t memp_memory_UDP_PCB_base[]; -#endif /* LWIP_UDP */ - -#if LWIP_TCP -extern u8_t memp_memory_TCP_PCB_base[]; -extern u8_t memp_memory_TCP_PCB_LISTEN_base[]; -extern u8_t memp_memory_TCP_SEG_base[] SHMEM_ATTR; -#endif /* LWIP_TCP */ - -#if (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) /* LWIP_TIMERS */ -extern u8_t memp_memory_SYS_TIMEOUT_base[]; -#endif /* LWIP_TIMERS */ - -extern u8_t memp_memory_PBUF_base[]; -extern u8_t memp_memory_PBUF_POOL_base[]; - - - -#endif /* __ARCH_CC_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/arch/perf.h b/sparkfun/esp8266/firmwares/loader/src/arch/perf.h deleted file mode 100644 index 089facac..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/arch/perf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __PERF_H__ -#define __PERF_H__ - -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ - -#endif /* __PERF_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/arch/sys_arch.h b/sparkfun/esp8266/firmwares/loader/src/arch/sys_arch.h deleted file mode 100644 index e69de29b..00000000 diff --git a/sparkfun/esp8266/firmwares/loader/src/include/lwipopts.h b/sparkfun/esp8266/firmwares/loader/src/include/lwipopts.h deleted file mode 100644 index 1678a402..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/include/lwipopts.h +++ /dev/null @@ -1,2037 +0,0 @@ -/** - * @file - * - * lwIP Options Configuration - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - - -#define EBUF_LWIP 1 -#define LWIP_ESP 1 -#define EP_OFFSET 36 -/* - ----------------------------------------------- - ---------- Platform specific locking ---------- - ----------------------------------------------- -*/ - -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#ifndef SYS_LIGHTWEIGHT_PROT -#define SYS_LIGHTWEIGHT_PROT 0 -#endif - -/** - * NO_SYS==1: Provides VERY minimal functionality. Otherwise, - * use lwIP facilities. - */ -#ifndef NO_SYS -#define NO_SYS 1 -#endif - -/** - * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1 - * Mainly for compatibility to old versions. - */ -#ifndef NO_SYS_NO_TIMERS -#define NO_SYS_NO_TIMERS 0 -#endif - -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#ifndef MEMCPY -#define MEMCPY(dst,src,len) os_memcpy(dst,src,len) -#endif - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#ifndef SMEMCPY -#define SMEMCPY(dst,src,len) os_memcpy(dst,src,len) -#endif - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#ifndef MEM_LIBC_MALLOC -#define MEM_LIBC_MALLOC 1 -#endif - -/** -* MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. -* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution -* speed and usage from interrupts! -*/ -#ifndef MEMP_MEM_MALLOC -#define MEMP_MEM_MALLOC 1 -#endif - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#ifndef MEM_ALIGNMENT -#define MEM_ALIGNMENT 4 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#ifndef MEM_SIZE -#define MEM_SIZE 16000 -#endif - -/** - * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array. - * This can be used to individually change the location of each pool. - * Default is one big array for all pools - */ -#ifndef MEMP_SEPARATE_POOLS -#define MEMP_SEPARATE_POOLS 1 -#endif - -/** - * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable - * amount of bytes before and after each memp element in every pool and fills - * it with a prominent default value. - * MEMP_OVERFLOW_CHECK == 0 no checking - * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed - * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time - * memp_malloc() or memp_free() is called (useful but slow!) - */ -#ifndef MEMP_OVERFLOW_CHECK -#define MEMP_OVERFLOW_CHECK 0 -#endif - -/** - * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make - * sure that there are no cycles in the linked lists. - */ -#ifndef MEMP_SANITY_CHECK -#define MEMP_SANITY_CHECK 1 -#endif - -/** - * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set - * of memory pools of various sizes. When mem_malloc is called, an element of - * the smallest pool that can provide the length needed is returned. - * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. - */ -#ifndef MEM_USE_POOLS -#define MEM_USE_POOLS 0 -#endif - -/** - * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next - * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more - * reliable. */ -#ifndef MEM_USE_POOLS_TRY_BIGGER_POOL -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 -#endif - -/** - * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h - * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. - */ -#ifndef MEMP_USE_CUSTOM_POOLS -#define MEMP_USE_CUSTOM_POOLS 0 -#endif - -/** - * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from - * interrupt context (or another context that doesn't allow waiting for a - * semaphore). - * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, - * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs - * with each loop so that mem_free can run. - * - * ATTENTION: As you can see from the above description, this leads to dis-/ - * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc - * can need longer. - * - * If you don't want that, at least for NO_SYS=0, you can still use the following - * functions to enqueue a deallocation call which then runs in the tcpip_thread - * context: - * - pbuf_free_callback(p); - * - mem_free_callback(m); - */ -#ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT -#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 -#endif - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ -/** - * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). - * If the application sends a lot of data out of ROM (or other static memory), - * this should be set high. - */ -#ifndef MEMP_NUM_PBUF -#define MEMP_NUM_PBUF 10 -#endif - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#ifndef MEMP_NUM_RAW_PCB -#define MEMP_NUM_RAW_PCB 4 -#endif - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#ifndef MEMP_NUM_UDP_PCB -#define MEMP_NUM_UDP_PCB 4 -#endif - -/** - * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB -#define MEMP_NUM_TCP_PCB (*((volatile uint32*)0x600011FC)) -#endif - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB_LISTEN -#define MEMP_NUM_TCP_PCB_LISTEN 2 -#endif - -/** - * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_SEG -#define MEMP_NUM_TCP_SEG 16 -#endif - -/** - * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for - * reassembly (whole packets, not fragments!) - */ -#ifndef MEMP_NUM_REASSDATA -#define MEMP_NUM_REASSDATA 0 -#endif - -/** - * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent - * (fragments, not whole packets!). - * This is only used with IP_FRAG_USES_STATIC_BUF==0 and - * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs - * where the packet is not yet sent when netif->output returns. - */ -#ifndef MEMP_NUM_FRAG_PBUF -#define MEMP_NUM_FRAG_PBUF 0 -#endif - -/** - * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing - * packets (pbufs) that are waiting for an ARP request (to resolve - * their destination address) to finish. - * (requires the ARP_QUEUEING option) - */ -#ifndef MEMP_NUM_ARP_QUEUE -#define MEMP_NUM_ARP_QUEUE 10 -#endif - -/** - * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces - * can be members et the same time (one per netif - allsystems group -, plus one - * per netif membership). - * (requires the LWIP_IGMP option) - */ -#ifndef MEMP_NUM_IGMP_GROUP -#define MEMP_NUM_IGMP_GROUP 8 -#endif - -/** - * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. - * (requires NO_SYS==0) - */ -#ifndef MEMP_NUM_SYS_TIMEOUT -#define MEMP_NUM_SYS_TIMEOUT 6 -#endif - -/** - * MEMP_NUM_NETBUF: the number of struct netbufs. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETBUF -#define MEMP_NUM_NETBUF 0 -#endif - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETCONN -#define MEMP_NUM_NETCONN 0 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_API -#define MEMP_NUM_TCPIP_MSG_API 4 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_INPKT -#define MEMP_NUM_TCPIP_MSG_INPKT 4 -#endif - -/** - * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree. - */ -#ifndef MEMP_NUM_SNMP_NODE -#define MEMP_NUM_SNMP_NODE 0 -#endif - -/** - * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree. - * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least! - */ -#ifndef MEMP_NUM_SNMP_ROOTNODE -#define MEMP_NUM_SNMP_ROOTNODE 0 -#endif - -/** - * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to - * be changed normally) - 2 of these are used per request (1 for input, - * 1 for output) - */ -#ifndef MEMP_NUM_SNMP_VARBIND -#define MEMP_NUM_SNMP_VARBIND 0 -#endif - -/** - * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used - * (does not have to be changed normally) - 3 of these are used per request - * (1 for the value read and 2 for OIDs - input and output) - */ -#ifndef MEMP_NUM_SNMP_VALUE -#define MEMP_NUM_SNMP_VALUE 0 -#endif - -/** - * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls - * (before freeing the corresponding memory using lwip_freeaddrinfo()). - */ -#ifndef MEMP_NUM_NETDB -#define MEMP_NUM_NETDB 0 -#endif - -/** - * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list - * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. - */ -#ifndef MEMP_NUM_LOCALHOSTLIST -#define MEMP_NUM_LOCALHOSTLIST 0 -#endif - -/** - * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE - * interfaces (only used with PPPOE_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOE_INTERFACES -#define MEMP_NUM_PPPOE_INTERFACES 0 -#endif - -/** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. - */ -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 10 -#endif - -/* - --------------------------------- - ---------- ARP options ---------- - --------------------------------- -*/ -/** - * LWIP_ARP==1: Enable ARP functionality. - */ -#ifndef LWIP_ARP -#define LWIP_ARP 1 -#endif - -/** - * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. - */ -#ifndef ARP_TABLE_SIZE -#define ARP_TABLE_SIZE 10 -#endif - -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#ifndef ARP_QUEUEING -#define ARP_QUEUEING 1 -#endif - -/** - * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be - * updated with the source MAC and IP addresses supplied in the packet. - * You may want to disable this if you do not trust LAN peers to have the - * correct addresses, or as a limited approach to attempt to handle - * spoofing. If disabled, lwIP will need to make a new ARP request if - * the peer is not already in the ARP table, adding a little latency. - * The peer *is* in the ARP table if it requested our address before. - * Also notice that this slows down input processing of every IP packet! - */ -#ifndef ETHARP_TRUST_IP_MAC -#define ETHARP_TRUST_IP_MAC 1 -#endif - -/** - * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header. - * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. - * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. - * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. - */ -#ifndef ETHARP_SUPPORT_VLAN -#define ETHARP_SUPPORT_VLAN 0 -#endif - -/** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP - * might be disabled - */ -#ifndef LWIP_ETHERNET -#define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT) -#endif - -/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure - * alignment of payload after that header. Since the header is 14 bytes long, - * without this padding e.g. addresses in the IP header will not be aligned - * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. - */ -#ifndef ETH_PAD_SIZE -#define ETH_PAD_SIZE 0 -#endif - -/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table - * entries (using etharp_add_static_entry/etharp_remove_static_entry). - */ -#ifndef ETHARP_SUPPORT_STATIC_ENTRIES -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 -#endif - - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * IP_FORWARD==1: Enables the ability to forward IP packets across network - * interfaces. If you are going to run lwIP on a device with only one network - * interface, define this to 0. - */ -#ifndef IP_FORWARD -#define IP_FORWARD 0 -#endif - -/** - * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. - * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. - * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). - */ -#ifndef IP_OPTIONS_ALLOWED -#define IP_OPTIONS_ALLOWED 1 -#endif - -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#ifndef IP_REASSEMBLY -#define IP_REASSEMBLY 0 -#endif - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#ifndef IP_FRAG -#define IP_FRAG 0 -#endif - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#ifndef IP_REASS_MAXAGE -#define IP_REASS_MAXAGE 0 -#endif - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#ifndef IP_REASS_MAX_PBUFS -#define IP_REASS_MAX_PBUFS 0 -#endif - -/** - * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP - * fragmentation. Otherwise pbufs are allocated and reference the original - * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1, - * new PBUF_RAM pbufs are used for fragments). - * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs! - */ -#ifndef IP_FRAG_USES_STATIC_BUF -#define IP_FRAG_USES_STATIC_BUF 1 -#endif - -/** - * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer - * (requires IP_FRAG_USES_STATIC_BUF==1) - */ -#if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) -#define IP_FRAG_MAX_MTU 1500 -#endif - -/** - * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. - */ -#ifndef IP_DEFAULT_TTL -#define IP_DEFAULT_TTL 255 -#endif - -/** - * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast - * filter per pcb on udp and raw send operations. To enable broadcast filter - * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. - */ -#ifndef IP_SOF_BROADCAST -#define IP_SOF_BROADCAST 0 -#endif - -/** - * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast - * filter on recv operations. - */ -#ifndef IP_SOF_BROADCAST_RECV -#define IP_SOF_BROADCAST_RECV 0 -#endif - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_ICMP==1: Enable ICMP module inside the IP stack. - * Be careful, disable that make your product non-compliant to RFC1122 - */ -#ifndef LWIP_ICMP -#define LWIP_ICMP 1 -#endif - -/** - * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. - */ -#ifndef ICMP_TTL -#define ICMP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) - */ -#ifndef LWIP_BROADCAST_PING -#define LWIP_BROADCAST_PING 0 -#endif - -/** - * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) - */ -#ifndef LWIP_MULTICAST_PING -#define LWIP_MULTICAST_PING 0 -#endif - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef LWIP_RAW -#define LWIP_RAW 0 -#endif - -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef RAW_TTL -#define RAW_TTL (IP_DEFAULT_TTL) -#endif - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#ifndef LWIP_DHCP -#define LWIP_DHCP 1 -#endif - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#ifndef DHCP_DOES_ARP_CHECK -#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -/** - * LWIP_AUTOIP==1: Enable AUTOIP module. - */ -#ifndef LWIP_AUTOIP -#define LWIP_AUTOIP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on - * the same interface at the same time. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP -#define LWIP_DHCP_AUTOIP_COOP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes - * that should be sent before falling back on AUTOIP. This can be set - * as low as 1 to get an AutoIP address very quickly, but you should - * be prepared to handle a changing IP address when DHCP overrides - * AutoIP. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP_TRIES -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 -#endif - -/* - ---------------------------------- - ---------- SNMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP - * transport. - */ -#ifndef LWIP_SNMP -#define LWIP_SNMP 0 -#endif - -/** - * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will - * allow. At least one request buffer is required. - */ -#ifndef SNMP_CONCURRENT_REQUESTS -#define SNMP_CONCURRENT_REQUESTS 0 -#endif - -/** - * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap - * destination is required - */ -#ifndef SNMP_TRAP_DESTINATIONS -#define SNMP_TRAP_DESTINATIONS 0 -#endif - -/** - * SNMP_PRIVATE_MIB: - */ -#ifndef SNMP_PRIVATE_MIB -#define SNMP_PRIVATE_MIB 0 -#endif - -/** - * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not - * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). - * Unsafe requests are disabled by default! - */ -#ifndef SNMP_SAFE_REQUESTS -#define SNMP_SAFE_REQUESTS 0 -#endif - -/** - * The maximum length of strings used. This affects the size of - * MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_OCTET_STRING_LEN -#define SNMP_MAX_OCTET_STRING_LEN 127 -#endif - -/** - * The maximum depth of the SNMP tree. - * With private MIBs enabled, this depends on your MIB! - * This affects the size of MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_TREE_DEPTH -#define SNMP_MAX_TREE_DEPTH 15 -#endif - -/** - * The size of the MEMP_SNMP_VALUE elements, normally calculated from - * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH. - */ -#ifndef SNMP_MAX_VALUE_SIZE -#define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH)) -#endif - -/* - ---------------------------------- - ---------- IGMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#ifndef LWIP_IGMP -#define LWIP_IGMP 1 -#endif - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#ifndef LWIP_DNS -#define LWIP_DNS 1 -#endif - -/** DNS maximum number of entries to maintain locally. */ -#ifndef DNS_TABLE_SIZE -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#ifndef DNS_MAX_NAME_LENGTH -#define DNS_MAX_NAME_LENGTH 256 -#endif - -/** The maximum of DNS servers */ -#ifndef DNS_MAX_SERVERS -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS do a name checking between the query and the response. */ -#ifndef DNS_DOES_NAME_CHECK -#define DNS_DOES_NAME_CHECK 1 -#endif - -/** DNS message max. size. Default value is RFC compliant. */ -#ifndef DNS_MSG_SIZE -#define DNS_MSG_SIZE 512 -#endif - -/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, - * you have to define - * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}} - * (an array of structs name/address, where address is an u32_t in network - * byte order). - * - * Instead, you can also use an external function: - * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name) - * that returns the IP address or INADDR_NONE if not found. - */ -#ifndef DNS_LOCAL_HOSTLIST -#define DNS_LOCAL_HOSTLIST 0 -#endif /* DNS_LOCAL_HOSTLIST */ - -/** If this is turned on, the local host-list can be dynamically changed - * at runtime. */ -#ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/** - * LWIP_UDP==1: Turn on UDP. - */ -#ifndef LWIP_UDP -#define LWIP_UDP 1 -#endif - -/** - * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) - */ -#ifndef LWIP_UDPLITE -#define LWIP_UDPLITE 0 -#endif - -/** - * UDP_TTL: Default Time-To-Live value. - */ -#ifndef UDP_TTL -#define UDP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. - */ -#ifndef LWIP_NETBUF_RECVINFO -#define LWIP_NETBUF_RECVINFO 0 -#endif - -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ -/** - * LWIP_TCP==1: Turn on TCP. - */ -#ifndef LWIP_TCP -#define LWIP_TCP 1 -#endif - -/** - * TCP_TTL: Default Time-To-Live value. - */ -#ifndef TCP_TTL -#define TCP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * TCP_WND: The size of a TCP window. This must be at least - * (2 * TCP_MSS) for things to work well - */ -#ifndef TCP_WND -#define TCP_WND (4 * TCP_MSS) -#endif - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#ifndef TCP_MAXRTX -#define TCP_MAXRTX 5 -#endif - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#ifndef TCP_SYNMAXRTX -#define TCP_SYNMAXRTX 5 -#endif - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#ifndef TCP_QUEUE_OOSEQ -#define TCP_QUEUE_OOSEQ 0 -#endif - -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#ifndef TCP_MSS -#define TCP_MSS 1460 -#endif - -/** - * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really - * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which - * reflects the available reassembly buffer size at the remote host) and the - * largest size permitted by the IP layer" (RFC 1122) - * Setting this to 1 enables code that checks TCP_MSS against the MTU of the - * netif used for a connection and limits the MSS if it would be too big otherwise. - */ -#ifndef TCP_CALCULATE_EFF_SEND_MSS -#define TCP_CALCULATE_EFF_SEND_MSS 1 -#endif - - -/** - * TCP_SND_BUF: TCP sender buffer space (bytes). - */ -#ifndef TCP_SND_BUF -#define TCP_SND_BUF 2 * TCP_MSS -#endif - -/** - * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least - * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. - */ -#ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) -#endif - -/** - * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than - * TCP_SND_BUF. It is the amount of space which must be available in the - * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). - */ -#ifndef TCP_SNDLOWAT -#define TCP_SNDLOWAT ((TCP_SND_BUF)/2) -#endif - -/** - * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater - * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below - * this number, select returns writable (combined with TCP_SNDLOWAT). - */ -#ifndef TCP_SNDQUEUELOWAT -#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) -#endif - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#ifndef TCP_LISTEN_BACKLOG -#define TCP_LISTEN_BACKLOG 0 -#endif - -/** - * The maximum allowed backlog for TCP listen netconns. - * This backlog is used unless another is explicitly specified. - * 0xff is the maximum (u8_t). - */ -#ifndef TCP_DEFAULT_LISTEN_BACKLOG -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff -#endif - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time in an attempt to create shorter pbuf chains - * for transmission. The meaningful range is 0 to TCP_MSS. Some - * suggested values are: - * - * 0: Disable oversized allocation. Each tcp_write() allocates a new - pbuf (old behaviour). - * 1: Allocate size-aligned pbufs with minimal excess. Use this if your - * scatter-gather DMA requires aligned fragments. - * 128: Limit the pbuf/memory overhead to 20%. - * TCP_MSS: Try to create unfragmented TCP packets. - * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. - */ -#ifndef TCP_OVERSIZE -#define TCP_OVERSIZE TCP_MSS -#endif - -/** - * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. - */ -#ifndef LWIP_TCP_TIMESTAMPS -#define LWIP_TCP_TIMESTAMPS 0 -#endif - -/** - * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an - * explicit window update - */ -#ifndef TCP_WND_UPDATE_THRESHOLD -#define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4) -#endif - -/** - * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. - */ -#ifndef LWIP_EVENT_API -#define LWIP_EVENT_API 0 -#define LWIP_CALLBACK_API 1 -#else -#define LWIP_EVENT_API 1 -#define LWIP_CALLBACK_API 0 -#endif - - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ -/** - * PBUF_LINK_HLEN: the number of bytes that should be allocated for a - * link level header. The default is 14, the standard value for - * Ethernet. - */ -#ifndef PBUF_LINK_HLEN -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) -#endif - -/** - * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size TCP frame in one pbuf, including - * TCP_MSS, IP header, and link header. - */ -#ifndef PBUF_POOL_BUFSIZE -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) -#endif - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#ifndef LWIP_NETIF_HOSTNAME -#define LWIP_NETIF_HOSTNAME 0 -#endif - -/** - * LWIP_NETIF_API==1: Support netif api (in netifapi.c) - */ -#ifndef LWIP_NETIF_API -#define LWIP_NETIF_API 0 -#endif - -/** - * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface - * changes its up/down status (i.e., due to DHCP IP acquistion) - */ -#ifndef LWIP_NETIF_STATUS_CALLBACK -#define LWIP_NETIF_STATUS_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface - * whenever the link changes (i.e., link down) - */ -#ifndef LWIP_NETIF_LINK_CALLBACK -#define LWIP_NETIF_LINK_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table - * indices) in struct netif. TCP and UDP can make use of this to prevent - * scanning the ARP table for every sent packet. While this is faster for big - * ARP tables or many concurrent connections, it might be counterproductive - * if you have a tiny ARP table or if there never are concurrent connections. - */ -#ifndef LWIP_NETIF_HWADDRHINT -#define LWIP_NETIF_HWADDRHINT 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#ifndef LWIP_NETIF_LOOPBACK -#define LWIP_NETIF_LOOPBACK 0 -#endif - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#ifndef LWIP_LOOPBACK_MAX_PBUFS -#define LWIP_LOOPBACK_MAX_PBUFS 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in - * the system, as netifs must change how they behave depending on this setting - * for the LWIP_NETIF_LOOPBACK option to work. - * Setting this is needed to avoid reentering non-reentrant functions like - * tcp_input(). - * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a - * multithreaded environment like tcpip.c. In this case, netif->input() - * is called directly. - * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. - * The packets are put on a list and netif_poll() must be called in - * the main application loop. - */ -#ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) -#endif - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#ifndef LWIP_NETIF_TX_SINGLE_PBUF -#define LWIP_NETIF_TX_SINGLE_PBUF 1 -#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c - */ -#ifndef LWIP_HAVE_LOOPIF -#define LWIP_HAVE_LOOPIF 0 -#endif - -/* - ------------------------------------ - ---------- SLIPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c - */ -#ifndef LWIP_HAVE_SLIPIF -#define LWIP_HAVE_SLIPIF 0 -#endif - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#ifndef TCPIP_THREAD_NAME -#define TCPIP_THREAD_NAME "tcpip_thread" -#endif - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_STACKSIZE -#define TCPIP_THREAD_STACKSIZE 0 -#endif - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_PRIO -#define TCPIP_THREAD_PRIO 1 -#endif - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#ifndef TCPIP_MBOX_SIZE -#define TCPIP_MBOX_SIZE 0 -#endif - -/** - * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. - */ -#ifndef SLIPIF_THREAD_NAME -#define SLIPIF_THREAD_NAME "slipif_loop" -#endif - -/** - * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_STACKSIZE -#define SLIPIF_THREAD_STACKSIZE 0 -#endif - -/** - * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_PRIO -#define SLIPIF_THREAD_PRIO 1 -#endif - -/** - * PPP_THREAD_NAME: The name assigned to the pppInputThread. - */ -#ifndef PPP_THREAD_NAME -#define PPP_THREAD_NAME "pppInputThread" -#endif - -/** - * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_STACKSIZE -#define PPP_THREAD_STACKSIZE 0 -#endif - -/** - * PPP_THREAD_PRIO: The priority assigned to the pppInputThread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_PRIO -#define PPP_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. - */ -#ifndef DEFAULT_THREAD_NAME -#define DEFAULT_THREAD_NAME "lwIP" -#endif - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_STACKSIZE -#define DEFAULT_THREAD_STACKSIZE 0 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_PRIO -#define DEFAULT_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_RAW_RECVMBOX_SIZE -#define DEFAULT_RAW_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_UDP_RECVMBOX_SIZE -#define DEFAULT_UDP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_TCP_RECVMBOX_SIZE -#define DEFAULT_TCP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#ifndef DEFAULT_ACCEPTMBOX_SIZE -#define DEFAULT_ACCEPTMBOX_SIZE 0 -#endif - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING -#define LWIP_TCPIP_CORE_LOCKING 0 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING_INPUT -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 -#endif - -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#ifndef LWIP_NETCONN -#define LWIP_NETCONN 0 -#endif - -/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create - * timers running in tcpip_thread from another thread. - */ -#ifndef LWIP_TCPIP_TIMEOUT -#define LWIP_TCPIP_TIMEOUT 1 -#endif - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#ifndef LWIP_SOCKET -#define LWIP_SOCKET 0 -#endif - -/** - * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. - * (only used if you use sockets.c) - */ -#ifndef LWIP_COMPAT_SOCKETS -#define LWIP_COMPAT_SOCKETS 0 -#endif - -/** - * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. - * Disable this option if you use a POSIX operating system that uses the same - * names (read, write & close). (only used if you use sockets.c) - */ -#ifndef LWIP_POSIX_SOCKETS_IO_NAMES -#define LWIP_POSIX_SOCKETS_IO_NAMES 0 -#endif - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#ifndef LWIP_TCP_KEEPALIVE -#define LWIP_TCP_KEEPALIVE 1 -#endif - -/** - * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. - */ -#ifndef LWIP_SO_RCVTIMEO -#define LWIP_SO_RCVTIMEO 0 -#endif - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#ifndef LWIP_SO_RCVBUF -#define LWIP_SO_RCVBUF 0 -#endif - -/** - * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. - */ -#ifndef RECV_BUFSIZE_DEFAULT -#define RECV_BUFSIZE_DEFAULT INT_MAX -#endif - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - */ -#ifndef SO_REUSE -#define SO_REUSE 0 -#endif - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#ifndef SO_REUSE_RXTOALL -#define SO_REUSE_RXTOALL 0 -#endif - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#ifndef LWIP_STATS -#define LWIP_STATS 0 -#endif - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#ifndef LWIP_STATS_DISPLAY -#define LWIP_STATS_DISPLAY 0 -#endif - -/** - * LINK_STATS==1: Enable link stats. - */ -#ifndef LINK_STATS -#define LINK_STATS 1 -#endif - -/** - * ETHARP_STATS==1: Enable etharp stats. - */ -#ifndef ETHARP_STATS -#define ETHARP_STATS (LWIP_ARP) -#endif - -/** - * IP_STATS==1: Enable IP stats. - */ -#ifndef IP_STATS -#define IP_STATS 1 -#endif - -/** - * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is - * on if using either frag or reass. - */ -#ifndef IPFRAG_STATS -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) -#endif - -/** - * ICMP_STATS==1: Enable ICMP stats. - */ -#ifndef ICMP_STATS -#define ICMP_STATS 1 -#endif - -/** - * IGMP_STATS==1: Enable IGMP stats. - */ -#ifndef IGMP_STATS -#define IGMP_STATS (LWIP_IGMP) -#endif - -/** - * UDP_STATS==1: Enable UDP stats. Default is on if - * UDP enabled, otherwise off. - */ -#ifndef UDP_STATS -#define UDP_STATS (LWIP_UDP) -#endif - -/** - * TCP_STATS==1: Enable TCP stats. Default is on if TCP - * enabled, otherwise off. - */ -#ifndef TCP_STATS -#define TCP_STATS (LWIP_TCP) -#endif - -/** - * MEM_STATS==1: Enable mem.c stats. - */ -#ifndef MEM_STATS -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) -#endif - -/** - * MEMP_STATS==1: Enable memp.c pool stats. - */ -#ifndef MEMP_STATS -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) -#endif - -/** - * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). - */ -#ifndef SYS_STATS -#define SYS_STATS (NO_SYS == 0) -#endif - -#else -#define ETHARP_STATS 0 -#define LINK_STATS 0 -#define IP_STATS 0 -#define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define IGMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define SYS_STATS 0 -#define LWIP_STATS_DISPLAY 0 - -#endif /* LWIP_STATS */ - -/* - --------------------------------- - ---------- PPP options ---------- - --------------------------------- -*/ -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#ifndef PPP_SUPPORT -#define PPP_SUPPORT 0 -#endif - -/** - * PPPOE_SUPPORT==1: Enable PPP Over Ethernet - */ -#ifndef PPPOE_SUPPORT -#define PPPOE_SUPPORT 0 -#endif - -/** - * PPPOS_SUPPORT==1: Enable PPP Over Serial - */ -#ifndef PPPOS_SUPPORT -#define PPPOS_SUPPORT PPP_SUPPORT -#endif - -#if PPP_SUPPORT - -/** - * NUM_PPP: Max PPP sessions. - */ -#ifndef NUM_PPP -#define NUM_PPP 1 -#endif - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#ifndef PAP_SUPPORT -#define PAP_SUPPORT 0 -#endif - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#ifndef CHAP_SUPPORT -#define CHAP_SUPPORT 0 -#endif - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 0 -#endif - -/** - * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CBCP_SUPPORT -#define CBCP_SUPPORT 0 -#endif - -/** - * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CCP_SUPPORT -#define CCP_SUPPORT 0 -#endif - -/** - * VJ_SUPPORT==1: Support VJ header compression. - */ -#ifndef VJ_SUPPORT -#define VJ_SUPPORT 0 -#endif - -/** - * MD5_SUPPORT==1: Support MD5 (see also CHAP). - */ -#ifndef MD5_SUPPORT -#define MD5_SUPPORT 0 -#endif - -/* - * Timeouts - */ -#ifndef FSM_DEFTIMEOUT -#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef FSM_DEFMAXTERMREQS -#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXCONFREQS -#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXNAKLOOPS -#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ -#endif - -#ifndef UPAP_DEFTIMEOUT -#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ -#endif - -#ifndef UPAP_DEFREQTIME -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#endif - -#ifndef CHAP_DEFTIMEOUT -#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef CHAP_DEFTRANSMITS -#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ -#endif - -/* Interval in seconds between keepalive echo requests, 0 to disable. */ -#ifndef LCP_ECHOINTERVAL -#define LCP_ECHOINTERVAL 0 -#endif - -/* Number of unanswered echo requests before failure. */ -#ifndef LCP_MAXECHOFAILS -#define LCP_MAXECHOFAILS 3 -#endif - -/* Max Xmit idle time (in jiffies) before resend flag char. */ -#ifndef PPP_MAXIDLEFLAG -#define PPP_MAXIDLEFLAG 100 -#endif - -/* - * Packet sizes - * - * Note - lcp shouldn't be allowed to negotiate stuff outside these - * limits. See lcp.h in the pppd directory. - * (XXX - these constants should simply be shared by lcp.c instead - * of living in lcp.h) - */ -#define PPP_MTU 1500 /* Default MTU (size of Info field) */ -#ifndef PPP_MAXMTU -/* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */ -#define PPP_MAXMTU 1500 /* Largest MTU we allow */ -#endif -#define PPP_MINMTU 64 -#define PPP_MRU 1500 /* default MRU = max length of info field */ -#define PPP_MAXMRU 1500 /* Largest MRU we allow */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 296 /* Try for this */ -#endif -#define PPP_MINMRU 128 /* No MRUs below this */ - -#ifndef MAXNAMELEN -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ -#endif -#ifndef MAXSECRETLEN -#define MAXSECRETLEN 256 /* max length of password or secret */ -#endif - -#endif /* PPP_SUPPORT */ - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ -/** - * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. - */ -#ifndef CHECKSUM_GEN_IP -#define CHECKSUM_GEN_IP 1 -#endif - -/** - * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. - */ -#ifndef CHECKSUM_GEN_UDP -#define CHECKSUM_GEN_UDP 1 -#endif - -/** - * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. - */ -#ifndef CHECKSUM_GEN_TCP -#define CHECKSUM_GEN_TCP 1 -#endif - -/** - * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. - */ -#ifndef CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 1 -#endif - -/** - * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. - */ -#ifndef CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 1 -#endif - -/** - * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. - */ -#ifndef CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 1 -#endif - -/** - * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from - * application buffers to pbufs. - */ -#ifndef LWIP_CHECKSUM_ON_COPY -#define LWIP_CHECKSUM_ON_COPY 0 -#endif - -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - */ -#ifndef LWIP_DBG_MIN_LEVEL -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL -#endif - -/** - * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable - * debug messages of certain types. - */ -#ifndef LWIP_DBG_TYPES_ON -#define LWIP_DBG_TYPES_ON LWIP_DBG_OFF -#endif - -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#ifndef ETHARP_DEBUG -#define ETHARP_DEBUG LWIP_DBG_OFF -#endif - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#ifndef NETIF_DEBUG -#define NETIF_DEBUG LWIP_DBG_OFF -#endif - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#ifndef PBUF_DEBUG -#define PBUF_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#ifndef API_LIB_DEBUG -#define API_LIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_MSG_DEBUG: Enable debugging in api_msg.c. - */ -#ifndef API_MSG_DEBUG -#define API_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#ifndef SOCKETS_DEBUG -#define SOCKETS_DEBUG LWIP_DBG_OFF -#endif - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#ifndef ICMP_DEBUG -#define ICMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IGMP_DEBUG: Enable debugging in igmp.c. - */ -#ifndef IGMP_DEBUG -#define IGMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * INET_DEBUG: Enable debugging in inet.c. - */ -#ifndef INET_DEBUG -#define INET_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#ifndef IP_DEBUG -#define IP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. - */ -#ifndef IP_REASS_DEBUG -#define IP_REASS_DEBUG LWIP_DBG_OFF -#endif - -/** - * RAW_DEBUG: Enable debugging in raw.c. - */ -#ifndef RAW_DEBUG -#define RAW_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEM_DEBUG: Enable debugging in mem.c. - */ -#ifndef MEM_DEBUG -#define MEM_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#ifndef MEMP_DEBUG -#define MEMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SYS_DEBUG: Enable debugging in sys.c. - */ -#ifndef SYS_DEBUG -#define SYS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TIMERS_DEBUG: Enable debugging in timers.c. - */ -#ifndef TIMERS_DEBUG -#define TIMERS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_DEBUG: Enable debugging for TCP. - */ -#ifndef TCP_DEBUG -#define TCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#ifndef TCP_INPUT_DEBUG -#define TCP_INPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. - */ -#ifndef TCP_FR_DEBUG -#define TCP_FR_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit - * timeout. - */ -#ifndef TCP_RTO_DEBUG -#define TCP_RTO_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. - */ -#ifndef TCP_CWND_DEBUG -#define TCP_CWND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. - */ -#ifndef TCP_WND_DEBUG -#define TCP_WND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#ifndef TCP_OUTPUT_DEBUG -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. - */ -#ifndef TCP_RST_DEBUG -#define TCP_RST_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. - */ -#ifndef TCP_QLEN_DEBUG -#define TCP_QLEN_DEBUG LWIP_DBG_OFF -#endif - -/** - * UDP_DEBUG: Enable debugging in UDP. - */ -#ifndef UDP_DEBUG -#define UDP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#ifndef TCPIP_DEBUG -#define TCPIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#ifndef PPP_DEBUG -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SLIP_DEBUG: Enable debugging in slipif.c. - */ -#ifndef SLIP_DEBUG -#define SLIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#ifndef DHCP_DEBUG -#define DHCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * AUTOIP_DEBUG: Enable debugging in autoip.c. - */ -#ifndef AUTOIP_DEBUG -#define AUTOIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. - */ -#ifndef SNMP_MSG_DEBUG -#define SNMP_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. - */ -#ifndef SNMP_MIB_DEBUG -#define SNMP_MIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * DNS_DEBUG: Enable debugging for DNS. - */ -#ifndef DNS_DEBUG -#define DNS_DEBUG LWIP_DBG_OFF -#endif - -#endif /* __LWIP_OPT_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/api.h b/sparkfun/esp8266/firmwares/loader/src/lwip/api.h deleted file mode 100644 index 91b9e5d2..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/api.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_API_H__ -#define __LWIP_API_H__ - -#include "lwip/opt.h" - -#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/netbuf.h" -#include "lwip/sys.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ - -/* Flags for netconn_write (u8_t) */ -#define NETCONN_NOFLAG 0x00 -#define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */ -#define NETCONN_COPY 0x01 -#define NETCONN_MORE 0x02 -#define NETCONN_DONTBLOCK 0x04 - -/* Flags for struct netconn.flags (u8_t) */ -/** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores whether to wake up the original application task - if data couldn't be sent in the first try. */ -#define NETCONN_FLAG_WRITE_DELAYED 0x01 -/** Should this netconn avoid blocking? */ -#define NETCONN_FLAG_NON_BLOCKING 0x02 -/** Was the last connect action a non-blocking one? */ -#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 -/** If this is set, a TCP netconn must call netconn_recved() to update - the TCP receive window (done automatically if not set). */ -#define NETCONN_FLAG_NO_AUTO_RECVED 0x08 -/** If a nonblocking write has been rejected before, poll_tcp needs to - check if the netconn is writable again */ -#define NETCONN_FLAG_CHECK_WRITESPACE 0x10 - - -/* Helpers to process several netconn_types by the same code */ -#define NETCONNTYPE_GROUP(t) (t&0xF0) -#define NETCONNTYPE_DATAGRAM(t) (t&0xE0) - -/** Protocol family and type of the netconn */ -enum netconn_type { - NETCONN_INVALID = 0, - /* NETCONN_TCP Group */ - NETCONN_TCP = 0x10, - /* NETCONN_UDP Group */ - NETCONN_UDP = 0x20, - NETCONN_UDPLITE = 0x21, - NETCONN_UDPNOCHKSUM= 0x22, - /* NETCONN_RAW Group */ - NETCONN_RAW = 0x40 -}; - -/** Current state of the netconn. Non-TCP netconns are always - * in state NETCONN_NONE! */ -enum netconn_state { - NETCONN_NONE, - NETCONN_WRITE, - NETCONN_LISTEN, - NETCONN_CONNECT, - NETCONN_CLOSE -}; - -/** Use to inform the callback function about changes */ -enum netconn_evt { - NETCONN_EVT_RCVPLUS, - NETCONN_EVT_RCVMINUS, - NETCONN_EVT_SENDPLUS, - NETCONN_EVT_SENDMINUS, - NETCONN_EVT_ERROR -}; - -#if LWIP_IGMP -/** Used for netconn_join_leave_group() */ -enum netconn_igmp { - NETCONN_JOIN, - NETCONN_LEAVE -}; -#endif /* LWIP_IGMP */ - -/* forward-declare some structs to avoid to include their headers */ -struct ip_pcb; -struct tcp_pcb; -struct udp_pcb; -struct raw_pcb; -struct netconn; -struct api_msg_msg; - -/** A callback prototype to inform about events for a netconn */ -typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len); - -/** A netconn descriptor */ -struct netconn { - /** type of the netconn (TCP, UDP or RAW) */ - enum netconn_type type; - /** current state of the netconn */ - enum netconn_state state; - /** the lwIP internal protocol control block */ - union { - struct ip_pcb *ip; - struct tcp_pcb *tcp; - struct udp_pcb *udp; - struct raw_pcb *raw; - } pcb; - /** the last error this netconn had */ - err_t last_err; - /** sem that is used to synchroneously execute functions in the core context */ - sys_sem_t op_completed; - /** mbox where received packets are stored until they are fetched - by the netconn application thread (can grow quite big) */ - sys_mbox_t recvmbox; -#if LWIP_TCP - /** mbox where new connections are stored until processed - by the application thread */ - sys_mbox_t acceptmbox; -#endif /* LWIP_TCP */ - /** only used for socket layer */ -#if LWIP_SOCKET - int socket; -#endif /* LWIP_SOCKET */ -#if LWIP_SO_RCVTIMEO - /** timeout to wait for new data to be received - (or connections to arrive for listening netconns) */ - int recv_timeout; -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF - /** maximum amount of bytes queued in recvmbox - not used for TCP: adjust TCP_WND instead! */ - int recv_bufsize; - /** number of bytes currently in recvmbox to be received, - tested against recv_bufsize to limit bytes on recvmbox - for UDP and RAW, used for FIONREAD */ - s16_t recv_avail; -#endif /* LWIP_SO_RCVBUF */ - /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */ - u8_t flags; -#if LWIP_TCP - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores how much is already sent. */ - size_t write_offset; - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores the message. - Also used during connect and close. */ - struct api_msg_msg *current_msg; -#endif /* LWIP_TCP */ - /** A callback function that is informed about events for this netconn */ - netconn_callback callback; -}; - -/** Register an Network connection event */ -#define API_EVENT(c,e,l) if (c->callback) { \ - (*c->callback)(c, e, l); \ - } - -/** Set conn->last_err to err but don't overwrite fatal errors */ -#define NETCONN_SET_SAFE_ERR(conn, err) do { \ - SYS_ARCH_DECL_PROTECT(lev); \ - SYS_ARCH_PROTECT(lev); \ - if (!ERR_IS_FATAL((conn)->last_err)) { \ - (conn)->last_err = err; \ - } \ - SYS_ARCH_UNPROTECT(lev); \ -} while(0); - -/* Network connection functions: */ -#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) -#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c) -struct -netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, - netconn_callback callback); -err_t netconn_delete(struct netconn *conn); -/** Get the type of a netconn (as enum netconn_type). */ -#define netconn_type(conn) (conn->type) - -err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr, - u16_t *port, u8_t local); -#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0) -#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1) - -err_t netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port); -err_t netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port); -err_t netconn_disconnect (struct netconn *conn); -err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog); -#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) -err_t netconn_accept(struct netconn *conn, struct netconn **new_conn); -err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf); -err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf); -void netconn_recved(struct netconn *conn, u32_t length); -err_t netconn_sendto(struct netconn *conn, struct netbuf *buf, - ip_addr_t *addr, u16_t port); -err_t netconn_send(struct netconn *conn, struct netbuf *buf); -err_t netconn_write(struct netconn *conn, const void *dataptr, size_t size, - u8_t apiflags); -err_t netconn_close(struct netconn *conn); -err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx); - -#if LWIP_IGMP -err_t netconn_join_leave_group(struct netconn *conn, ip_addr_t *multiaddr, - ip_addr_t *netif_addr, enum netconn_igmp join_or_leave); -#endif /* LWIP_IGMP */ -#if LWIP_DNS -err_t netconn_gethostbyname(const char *name, ip_addr_t *addr); -#endif /* LWIP_DNS */ - -#define netconn_err(conn) ((conn)->last_err) -#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize) - -/** Set the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_set_nonblocking(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0) -/** Get the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) - -/** TCP: Set the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_set_noautorecved(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NO_AUTO_RECVED; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NO_AUTO_RECVED; }} while(0) -/** TCP: Get the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_get_noautorecved(conn) (((conn)->flags & NETCONN_FLAG_NO_AUTO_RECVED) != 0) - -#if LWIP_SO_RCVTIMEO -/** Set the receive timeout in milliseconds */ -#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout)) -/** Get the receive timeout in milliseconds */ -#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout) -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF -/** Set the receive buffer in bytes */ -#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize)) -/** Get the receive buffer in bytes */ -#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize) -#endif /* LWIP_SO_RCVBUF*/ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN */ - -#endif /* __LWIP_API_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/api_msg.h b/sparkfun/esp8266/firmwares/loader/src/lwip/api_msg.h deleted file mode 100644 index f99d8c3b..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/api_msg.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_API_MSG_H__ -#define __LWIP_API_MSG_H__ - -#include "lwip/opt.h" - -#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/sys.h" -#include "lwip/igmp.h" -#include "lwip/api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* For the netconn API, these values are use as a bitmask! */ -#define NETCONN_SHUT_RD 1 -#define NETCONN_SHUT_WR 2 -#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR) - -/* IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ -/** This struct includes everything that is necessary to execute a function - for a netconn in another thread context (mainly used to process netconns - in the tcpip_thread context to be thread safe). */ -struct api_msg_msg { - /** The netconn which to process - always needed: it includes the semaphore - which is used to block the application thread until the function finished. */ - struct netconn *conn; - /** The return value of the function executed in tcpip_thread. */ - err_t err; - /** Depending on the executed function, one of these union members is used */ - union { - /** used for do_send */ - struct netbuf *b; - /** used for do_newconn */ - struct { - u8_t proto; - } n; - /** used for do_bind and do_connect */ - struct { - ip_addr_t *ipaddr; - u16_t port; - } bc; - /** used for do_getaddr */ - struct { - ip_addr_t *ipaddr; - u16_t *port; - u8_t local; - } ad; - /** used for do_write */ - struct { - const void *dataptr; - size_t len; - u8_t apiflags; - } w; - /** used for do_recv */ - struct { - u32_t len; - } r; - /** used for do_close (/shutdown) */ - struct { - u8_t shut; - } sd; -#if LWIP_IGMP - /** used for do_join_leave_group */ - struct { - ip_addr_t *multiaddr; - ip_addr_t *netif_addr; - enum netconn_igmp join_or_leave; - } jl; -#endif /* LWIP_IGMP */ -#if TCP_LISTEN_BACKLOG - struct { - u8_t backlog; - } lb; -#endif /* TCP_LISTEN_BACKLOG */ - } msg; -}; - -/** This struct contains a function to execute in another thread context and - a struct api_msg_msg that serves as an argument for this function. - This is passed to tcpip_apimsg to execute functions in tcpip_thread context. */ -struct api_msg { - /** function to execute in tcpip_thread context */ - void (* function)(struct api_msg_msg *msg); - /** arguments for this function */ - struct api_msg_msg msg; -}; - -#if LWIP_DNS -/** As do_gethostbyname requires more arguments but doesn't require a netconn, - it has its own struct (to avoid struct api_msg getting bigger than necessary). - do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg - (see netconn_gethostbyname). */ -struct dns_api_msg { - /** Hostname to query or dotted IP address string */ - const char *name; - /** Rhe resolved address is stored here */ - ip_addr_t *addr; - /** This semaphore is posted when the name is resolved, the application thread - should wait on it. */ - sys_sem_t *sem; - /** Errors are given back here */ - err_t *err; -}; -#endif /* LWIP_DNS */ - -void do_newconn ( struct api_msg_msg *msg); -void do_delconn ( struct api_msg_msg *msg); -void do_bind ( struct api_msg_msg *msg); -void do_connect ( struct api_msg_msg *msg); -void do_disconnect ( struct api_msg_msg *msg); -void do_listen ( struct api_msg_msg *msg); -void do_send ( struct api_msg_msg *msg); -void do_recv ( struct api_msg_msg *msg); -void do_write ( struct api_msg_msg *msg); -void do_getaddr ( struct api_msg_msg *msg); -void do_close ( struct api_msg_msg *msg); -void do_shutdown ( struct api_msg_msg *msg); -#if LWIP_IGMP -void do_join_leave_group( struct api_msg_msg *msg); -#endif /* LWIP_IGMP */ - -#if LWIP_DNS -void do_gethostbyname(void *arg); -#endif /* LWIP_DNS */ - -struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback); -void netconn_free(struct netconn *conn); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN */ - -#endif /* __LWIP_API_MSG_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/arch.h b/sparkfun/esp8266/firmwares/loader/src/lwip/arch.h deleted file mode 100644 index 524af6be..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/arch.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ARCH_H__ -#define __LWIP_ARCH_H__ - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif - -#include "arch/cc.h" - -/** Temporary: define format string for size_t if not defined in cc.h */ -#ifndef SZT_F -#define SZT_F U32_F -#endif /* SZT_F */ -/** Temporary upgrade helper: define format string for u8_t as hex if not - defined in cc.h */ -#ifndef X8_F -#define X8_F "02x" -#endif /* X8_F */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PACK_STRUCT_BEGIN -#define PACK_STRUCT_BEGIN -#endif /* PACK_STRUCT_BEGIN */ - -#ifndef PACK_STRUCT_END -#define PACK_STRUCT_END -#endif /* PACK_STRUCT_END */ - -#ifndef PACK_STRUCT_FIELD -#define PACK_STRUCT_FIELD(x) x -#endif /* PACK_STRUCT_FIELD */ - - -#ifndef LWIP_UNUSED_ARG -#define LWIP_UNUSED_ARG(x) (void)x -#endif /* LWIP_UNUSED_ARG */ - - -#ifdef LWIP_PROVIDE_ERRNO - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ - - -#define ENSROK 0 /* DNS server returned answer with no data */ -#define ENSRNODATA 160 /* DNS server returned answer with no data */ -#define ENSRFORMERR 161 /* DNS server claims query was misformatted */ -#define ENSRSERVFAIL 162 /* DNS server returned general failure */ -#define ENSRNOTFOUND 163 /* Domain name not found */ -#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */ -#define ENSRREFUSED 165 /* DNS server refused query */ -#define ENSRBADQUERY 166 /* Misformatted DNS query */ -#define ENSRBADNAME 167 /* Misformatted domain name */ -#define ENSRBADFAMILY 168 /* Unsupported address family */ -#define ENSRBADRESP 169 /* Misformatted DNS reply */ -#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */ -#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */ -#define ENSROF 172 /* End of file */ -#define ENSRFILE 173 /* Error reading file */ -#define ENSRNOMEM 174 /* Out of memory */ -#define ENSRDESTRUCTION 175 /* Application terminated lookup */ -#define ENSRQUERYDOMAINTOOLONG 176 /* Domain name is too long */ -#define ENSRCNAMELOOP 177 /* Domain name is too long */ - -#ifndef errno -extern int errno; -#endif - -#endif /* LWIP_PROVIDE_ERRNO */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ARCH_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/autoip.h b/sparkfun/esp8266/firmwares/loader/src/lwip/autoip.h deleted file mode 100644 index 23c264a1..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/autoip.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file - * - * AutoIP Automatic LinkLocal IP Configuration - */ - -/* - * - * Copyright (c) 2007 Dominik Spies - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Dominik Spies - * - * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform - * with RFC 3927. - * - * - * Please coordinate changes and requests with Dominik Spies - * - */ - -#ifndef __LWIP_AUTOIP_H__ -#define __LWIP_AUTOIP_H__ - -#include "lwip/opt.h" - -#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -#include "lwip/udp.h" -#include "netif/etharp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* AutoIP Timing */ -#define AUTOIP_TMR_INTERVAL 100 -#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) - -/* RFC 3927 Constants */ -#define PROBE_WAIT 1 /* second (initial random delay) */ -#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ -#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ -#define PROBE_NUM 3 /* (number of probe packets) */ -#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ -#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ -#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ -#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ -#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ -#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ - -/* AutoIP client states */ -#define AUTOIP_STATE_OFF 0 -#define AUTOIP_STATE_PROBING 1 -#define AUTOIP_STATE_ANNOUNCING 2 -#define AUTOIP_STATE_BOUND 3 - -struct autoip -{ - ip_addr_t llipaddr; /* the currently selected, probed, announced or used LL IP-Address */ - u8_t state; /* current AutoIP state machine state */ - u8_t sent_num; /* sent number of probes or announces, dependent on state */ - u16_t ttw; /* ticks to wait, tick is AUTOIP_TMR_INTERVAL long */ - u8_t lastconflict; /* ticks until a conflict can be solved by defending */ - u8_t tried_llipaddr; /* total number of probed/used Link Local IP-Addresses */ -}; - - -/** Init srand, has to be called before entering mainloop */ -void autoip_init(void); - -/** Set a struct autoip allocated by the application to work with */ -void autoip_set_struct(struct netif *netif, struct autoip *autoip); - -/** Start AutoIP client */ -err_t autoip_start(struct netif *netif); - -/** Stop AutoIP client */ -err_t autoip_stop(struct netif *netif); - -/** Handles every incoming ARP Packet, called by etharp_arp_input */ -void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr); - -/** Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds */ -void autoip_tmr(void); - -/** Handle a possible change in the network configuration */ -void autoip_network_changed(struct netif *netif); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_AUTOIP */ - -#endif /* __LWIP_AUTOIP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/debug.h b/sparkfun/esp8266/firmwares/loader/src/lwip/debug.h deleted file mode 100644 index d8359ea3..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/debug.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_DEBUG_H__ -#define __LWIP_DEBUG_H__ - -#include "lwip/arch.h" - -/** lower two bits indicate debug level - * - 0 all - * - 1 warning - * - 2 serious - * - 3 severe - */ -#define LWIP_DBG_LEVEL_ALL 0x00 -#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */ -#define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */ -#define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */ -#define LWIP_DBG_LEVEL_SEVERE 0x03 -#define LWIP_DBG_MASK_LEVEL 0x03 - -/** flag for LWIP_DEBUGF to enable that debug message */ -#define LWIP_DBG_ON 0x80U -/** flag for LWIP_DEBUGF to disable that debug message */ -#define LWIP_DBG_OFF 0x00U - -/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ -#define LWIP_DBG_TRACE 0x40U -/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ -#define LWIP_DBG_STATE 0x20U -/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ -#define LWIP_DBG_FRESH 0x10U -/** flag for LWIP_DEBUGF to halt after printing this debug message */ -#define LWIP_DBG_HALT 0x08U - -#ifndef LWIP_NOASSERT -#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \ - LWIP_PLATFORM_ASSERT(message); } while(0) -#else /* LWIP_NOASSERT */ -#define LWIP_ASSERT(message, assertion) -#endif /* LWIP_NOASSERT */ - -/** if "expression" isn't true, then print "message" and execute "handler" expression */ -#ifndef LWIP_ERROR -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - LWIP_PLATFORM_ASSERT(message); handler;}} while(0) -#endif /* LWIP_ERROR */ - -#ifdef LWIP_DEBUG -/** print debug message only if debug message type is enabled... - * AND is of correct type AND is at least LWIP_DBG_LEVEL - */ -#define LWIP_DEBUGF(debug, message) do { \ - if ( \ - ((debug) & LWIP_DBG_ON) && \ - ((debug) & LWIP_DBG_TYPES_ON) && \ - ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ - LWIP_PLATFORM_DIAG(message); \ - if ((debug) & LWIP_DBG_HALT) { \ - while(1); \ - } \ - } \ - } while(0) - -#else /* LWIP_DEBUG */ -#define LWIP_DEBUGF(debug, message) -#endif /* LWIP_DEBUG */ - -#endif /* __LWIP_DEBUG_H__ */ - diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/def.h b/sparkfun/esp8266/firmwares/loader/src/lwip/def.h deleted file mode 100644 index 9b6de6a8..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/def.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_DEF_H__ -#define __LWIP_DEF_H__ - -/* arch.h might define NULL already */ -#include "lwip/arch.h" -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) -#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) - -#ifndef NULL -#define NULL ((void *)0) -#endif - -/** Get the absolute difference between 2 u32_t values (correcting overflows) - * 'a' is expected to be 'higher' (without overflow) than 'b'. */ -#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1))) - -/* Endianess-optimized shifting of two u8_t to create one u16_t */ -#if BYTE_ORDER == LITTLE_ENDIAN -#define LWIP_MAKE_U16(a, b) ((a << 8) | b) -#else -#define LWIP_MAKE_U16(a, b) ((b << 8) | a) -#endif - -#ifndef LWIP_PLATFORM_BYTESWAP -#define LWIP_PLATFORM_BYTESWAP 0 -#endif - -#ifndef LWIP_PREFIX_BYTEORDER_FUNCS -/* workaround for naming collisions on some platforms */ - -#ifdef htons -#undef htons -#endif /* htons */ -#ifdef htonl -#undef htonl -#endif /* htonl */ -#ifdef ntohs -#undef ntohs -#endif /* ntohs */ -#ifdef ntohl -#undef ntohl -#endif /* ntohl */ - -#define htons(x) lwip_htons(x) -#define ntohs(x) lwip_ntohs(x) -#define htonl(x) lwip_htonl(x) -#define ntohl(x) lwip_ntohl(x) -#endif /* LWIP_PREFIX_BYTEORDER_FUNCS */ - -#if BYTE_ORDER == BIG_ENDIAN -#define lwip_htons(x) (x) -#define lwip_ntohs(x) (x) -#define lwip_htonl(x) (x) -#define lwip_ntohl(x) (x) -#define PP_HTONS(x) (x) -#define PP_NTOHS(x) (x) -#define PP_HTONL(x) (x) -#define PP_NTOHL(x) (x) -#else /* BYTE_ORDER != BIG_ENDIAN */ -#if LWIP_PLATFORM_BYTESWAP -#define lwip_htons(x) LWIP_PLATFORM_HTONS(x) -#define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x) -#define lwip_htonl(x) LWIP_PLATFORM_HTONL(x) -#define lwip_ntohl(x) LWIP_PLATFORM_HTONL(x) -#else /* LWIP_PLATFORM_BYTESWAP */ -u16_t lwip_htons(u16_t x); -u16_t lwip_ntohs(u16_t x); -u32_t lwip_htonl(u32_t x); -u32_t lwip_ntohl(u32_t x); -#endif /* LWIP_PLATFORM_BYTESWAP */ - -/* These macros should be calculated by the preprocessor and are used - with compile-time constants only (so that there is no little-endian - overhead at runtime). */ -#define PP_HTONS(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) -#define PP_NTOHS(x) PP_HTONS(x) -#define PP_HTONL(x) ((((x) & 0xff) << 24) | \ - (((x) & 0xff00) << 8) | \ - (((x) & 0xff0000UL) >> 8) | \ - (((x) & 0xff000000UL) >> 24)) -#define PP_NTOHL(x) PP_HTONL(x) - -#endif /* BYTE_ORDER == BIG_ENDIAN */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_DEF_H__ */ - diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/dhcp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/dhcp.h deleted file mode 100644 index ba21068c..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/dhcp.h +++ /dev/null @@ -1,243 +0,0 @@ -/** @file - */ - -#ifndef __LWIP_DHCP_H__ -#define __LWIP_DHCP_H__ - -#include "lwip/opt.h" - -#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -#include "lwip/udp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** period (in seconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_SECS 60 -/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) -/** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 - -#define DHCP_CHADDR_LEN 16U -#define DHCP_SNAME_LEN 64U -#define DHCP_FILE_LEN 128U - -struct dhcp -{ - /** transaction identifier of last sent request */ - u32_t xid; - /** our connection to the DHCP server */ - struct udp_pcb *pcb; - /** incoming msg */ - struct dhcp_msg *msg_in; - /** current DHCP state machine state */ - u8_t state; - /** retries of current request */ - u8_t tries; -#if LWIP_DHCP_AUTOIP_COOP - u8_t autoip_coop_state; -#endif - u8_t subnet_mask_given; - - struct pbuf *p_out; /* pbuf of outcoming msg */ - struct dhcp_msg *msg_out; /* outgoing msg */ - u16_t options_out_len; /* outgoing msg options length */ - u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */ - u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ - u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ - ip_addr_t server_ip_addr; /* dhcp server address that offered this lease */ - ip_addr_t offered_ip_addr; - ip_addr_t offered_sn_mask; - ip_addr_t offered_gw_addr; - - u32_t offered_t0_lease; /* lease period (in seconds) */ - u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ - u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */ - /* @todo: LWIP_DHCP_BOOTP_FILE configuration option? - integrate with possible TFTP-client for booting? */ -#define LWIP_DHCP_BOOTP_FILE 0 -#if LWIP_DHCP_BOOTP_FILE - ip_addr_t offered_si_addr; - char boot_file_name[DHCP_FILE_LEN]; -#endif /* LWIP_DHCP_BOOTPFILE */ -}; - -/* MUST be compiled with "pack structs" or equivalent! */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** minimum set of fields of any DHCP message */ -struct dhcp_msg -{ - PACK_STRUCT_FIELD(u8_t op); - PACK_STRUCT_FIELD(u8_t htype); - PACK_STRUCT_FIELD(u8_t hlen); - PACK_STRUCT_FIELD(u8_t hops); - PACK_STRUCT_FIELD(u32_t xid); - PACK_STRUCT_FIELD(u16_t secs); - PACK_STRUCT_FIELD(u16_t flags); - PACK_STRUCT_FIELD(ip_addr_p_t ciaddr); - PACK_STRUCT_FIELD(ip_addr_p_t yiaddr); - PACK_STRUCT_FIELD(ip_addr_p_t siaddr); - PACK_STRUCT_FIELD(ip_addr_p_t giaddr); - PACK_STRUCT_FIELD(u8_t chaddr[DHCP_CHADDR_LEN]); - PACK_STRUCT_FIELD(u8_t sname[DHCP_SNAME_LEN]); - PACK_STRUCT_FIELD(u8_t file[DHCP_FILE_LEN]); - PACK_STRUCT_FIELD(u32_t cookie); -#define DHCP_MIN_OPTIONS_LEN 68U -/** make sure user does not configure this too small */ -#if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) -# undef DHCP_OPTIONS_LEN -#endif -/** allow this to be configured in lwipopts.h, but not too small */ -#if (!defined(DHCP_OPTIONS_LEN)) -/** set this to be sufficient for your options in outgoing DHCP msgs */ -# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN -#endif - PACK_STRUCT_FIELD(u8_t options[DHCP_OPTIONS_LEN]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp); -/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */ -#define dhcp_remove_struct(netif) do { (netif)->dhcp = NULL; } while(0) -void dhcp_cleanup(struct netif *netif); -/** start DHCP configuration */ -err_t dhcp_start(struct netif *netif); -/** enforce early lease renewal (not needed normally)*/ -err_t dhcp_renew(struct netif *netif); -/** release the DHCP lease, usually called before dhcp_stop()*/ -err_t dhcp_release(struct netif *netif); -/** stop DHCP configuration */ -void dhcp_stop(struct netif *netif); -/** inform server of our manual IP address */ -void dhcp_inform(struct netif *netif); -/** Handle a possible change in the network configuration */ -void dhcp_network_changed(struct netif *netif); - -/** if enabled, check whether the offered IP address is not in use, using ARP */ -#if DHCP_DOES_ARP_CHECK -void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr); -#endif - -/** to be called every minute */ -void dhcp_coarse_tmr(void); -/** to be called every half second */ -void dhcp_fine_tmr(void); - -/** DHCP message item offsets and length */ -#define DHCP_OP_OFS 0 -#define DHCP_HTYPE_OFS 1 -#define DHCP_HLEN_OFS 2 -#define DHCP_HOPS_OFS 3 -#define DHCP_XID_OFS 4 -#define DHCP_SECS_OFS 8 -#define DHCP_FLAGS_OFS 10 -#define DHCP_CIADDR_OFS 12 -#define DHCP_YIADDR_OFS 16 -#define DHCP_SIADDR_OFS 20 -#define DHCP_GIADDR_OFS 24 -#define DHCP_CHADDR_OFS 28 -#define DHCP_SNAME_OFS 44 -#define DHCP_FILE_OFS 108 -#define DHCP_MSG_LEN 236 - -#define DHCP_COOKIE_OFS DHCP_MSG_LEN -#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4) - -#define DHCP_CLIENT_PORT 68 -#define DHCP_SERVER_PORT 67 - -/** DHCP client states */ -#define DHCP_OFF 0 -#define DHCP_REQUESTING 1 -#define DHCP_INIT 2 -#define DHCP_REBOOTING 3 -#define DHCP_REBINDING 4 -#define DHCP_RENEWING 5 -#define DHCP_SELECTING 6 -#define DHCP_INFORMING 7 -#define DHCP_CHECKING 8 -#define DHCP_PERMANENT 9 -#define DHCP_BOUND 10 -/** not yet implemented #define DHCP_RELEASING 11 */ -#define DHCP_BACKING_OFF 12 - -/** AUTOIP cooperatation flags */ -#define DHCP_AUTOIP_COOP_STATE_OFF 0 -#define DHCP_AUTOIP_COOP_STATE_ON 1 - -#define DHCP_BOOTREQUEST 1 -#define DHCP_BOOTREPLY 2 - -/** DHCP message types */ -#define DHCP_DISCOVER 1 -#define DHCP_OFFER 2 -#define DHCP_REQUEST 3 -#define DHCP_DECLINE 4 -#define DHCP_ACK 5 -#define DHCP_NAK 6 -#define DHCP_RELEASE 7 -#define DHCP_INFORM 8 - -/** DHCP hardware type, currently only ethernet is supported */ -#define DHCP_HTYPE_ETH 1 - -#define DHCP_MAGIC_COOKIE 0x63825363UL - -/* This is a list of options for BOOTP and DHCP, see RFC 2132 for descriptions */ - -/** BootP options */ -#define DHCP_OPTION_PAD 0 -#define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ -#define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 -#define DHCP_OPTION_HOSTNAME 12 -#define DHCP_OPTION_IP_TTL 23 -#define DHCP_OPTION_MTU 26 -#define DHCP_OPTION_BROADCAST 28 -#define DHCP_OPTION_TCP_TTL 37 -#define DHCP_OPTION_END 255 - -/** DHCP options */ -#define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */ -#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ -#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ - -#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ -#define DHCP_OPTION_MESSAGE_TYPE_LEN 1 - -#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ -#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */ - -#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ -#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 - -#define DHCP_OPTION_T1 58 /* T1 renewal time */ -#define DHCP_OPTION_T2 59 /* T2 rebinding time */ -#define DHCP_OPTION_US 60 -#define DHCP_OPTION_CLIENT_ID 61 -#define DHCP_OPTION_TFTP_SERVERNAME 66 -#define DHCP_OPTION_BOOTFILE 67 - -/** possible combinations of overloading the file and sname fields with options */ -#define DHCP_OVERLOAD_NONE 0 -#define DHCP_OVERLOAD_FILE 1 -#define DHCP_OVERLOAD_SNAME 2 -#define DHCP_OVERLOAD_SNAME_FILE 3 - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DHCP */ - -#endif /*__LWIP_DHCP_H__*/ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/dns.h b/sparkfun/esp8266/firmwares/loader/src/lwip/dns.h deleted file mode 100644 index 6c7d9b07..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/dns.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * lwip DNS resolver header file. - - * Author: Jim Pettinato - * April 2007 - - * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LWIP_DNS_H__ -#define __LWIP_DNS_H__ - -#include "lwip/opt.h" - -#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** DNS timer period */ -#define DNS_TMR_INTERVAL 1000 - -/** DNS field TYPE used for "Resource Records" */ -#define DNS_RRTYPE_A 1 /* a host address */ -#define DNS_RRTYPE_NS 2 /* an authoritative name server */ -#define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */ -#define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */ -#define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */ -#define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */ -#define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */ -#define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */ -#define DNS_RRTYPE_WKS 11 /* a well known service description */ -#define DNS_RRTYPE_PTR 12 /* a domain name pointer */ -#define DNS_RRTYPE_HINFO 13 /* host information */ -#define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */ -#define DNS_RRTYPE_MX 15 /* mail exchange */ -#define DNS_RRTYPE_TXT 16 /* text strings */ - -/** DNS field CLASS used for "Resource Records" */ -#define DNS_RRCLASS_IN 1 /* the Internet */ -#define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */ -#define DNS_RRCLASS_CH 3 /* the CHAOS class */ -#define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */ -#define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */ - -/* The size used for the next line is rather a hack, but it prevents including socket.h in all files - that include memp.h, and that would possibly break portability (since socket.h defines some types - and constants possibly already define by the OS). - Calculation rule: - sizeof(struct addrinfo) + sizeof(struct sockaddr_in) + DNS_MAX_NAME_LENGTH + 1 byte zero-termination */ -#define NETDB_ELEM_SIZE (32 + 16 + DNS_MAX_NAME_LENGTH + 1) - -#if DNS_LOCAL_HOSTLIST -/** struct used for local host-list */ -struct local_hostlist_entry { - /** static hostname */ - const char *name; - /** static host address in network byteorder */ - ip_addr_t addr; - struct local_hostlist_entry *next; -}; -#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN -#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH -#endif -#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1)) -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#endif /* DNS_LOCAL_HOSTLIST */ - -/** Callback which is invoked when a hostname is found. - * A function of this type must be implemented by the application using the DNS resolver. - * @param name pointer to the name that was looked up. - * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname, - * or NULL if the name could not be found (or on any other error). - * @param callback_arg a user-specified callback argument passed to dns_gethostbyname -*/ -typedef void (*dns_found_callback)(const char *name, ip_addr_t *ipaddr, void *callback_arg); - -void dns_init(void); -void dns_tmr(void); -void dns_setserver(u8_t numdns, ip_addr_t *dnsserver); -ip_addr_t dns_getserver(u8_t numdns); -err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, - dns_found_callback found, void *callback_arg); - -#if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC -int dns_local_removehost(const char *hostname, const ip_addr_t *addr); -err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr); -#endif /* DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS */ - -#endif /* __LWIP_DNS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/err.h b/sparkfun/esp8266/firmwares/loader/src/lwip/err.h deleted file mode 100644 index cb69a9f4..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/err.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ERR_H__ -#define __LWIP_ERR_H__ - -#include "lwip/opt.h" -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Define LWIP_ERR_T in cc.h if you want to use - * a different type for your platform (must be signed). */ -#ifdef LWIP_ERR_T -typedef LWIP_ERR_T err_t; -#else /* LWIP_ERR_T */ -typedef s8_t err_t; -#endif /* LWIP_ERR_T*/ - -/* Definitions for error constants. */ - -#define ERR_OK 0 /* No error, everything OK. */ -#define ERR_MEM -1 /* Out of memory error. */ -#define ERR_BUF -2 /* Buffer error. */ -#define ERR_TIMEOUT -3 /* Timeout. */ -#define ERR_RTE -4 /* Routing problem. */ -#define ERR_INPROGRESS -5 /* Operation in progress */ -#define ERR_VAL -6 /* Illegal value. */ -#define ERR_WOULDBLOCK -7 /* Operation would block. */ - -#define ERR_IS_FATAL(e) ((e) < ERR_WOULDBLOCK) - -#define ERR_ABRT -8 /* Connection aborted. */ -#define ERR_RST -9 /* Connection reset. */ -#define ERR_CLSD -10 /* Connection closed. */ -#define ERR_CONN -11 /* Not connected. */ - -#define ERR_ARG -12 /* Illegal argument. */ - -#define ERR_USE -13 /* Address in use. */ - -#define ERR_IF -14 /* Low-level netif error */ -#define ERR_ISCONN -15 /* Already connected. */ - - -#ifdef LWIP_DEBUG -extern const char *lwip_strerr(err_t err)ICACHE_FLASH_ATTR; -#else -#define lwip_strerr(x) "" -#endif /* LWIP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ERR_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/icmp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/icmp.h deleted file mode 100644 index 9bcb7bc4..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/icmp.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ICMP_H__ -#define __LWIP_ICMP_H__ - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ICMP_ER 0 /* echo reply */ -#define ICMP_DUR 3 /* destination unreachable */ -#define ICMP_SQ 4 /* source quench */ -#define ICMP_RD 5 /* redirect */ -#define ICMP_ECHO 8 /* echo */ -#define ICMP_TE 11 /* time exceeded */ -#define ICMP_PP 12 /* parameter problem */ -#define ICMP_TS 13 /* timestamp */ -#define ICMP_TSR 14 /* timestamp reply */ -#define ICMP_IRQ 15 /* information request */ -#define ICMP_IR 16 /* information reply */ - -enum icmp_dur_type { - ICMP_DUR_NET = 0, /* net unreachable */ - ICMP_DUR_HOST = 1, /* host unreachable */ - ICMP_DUR_PROTO = 2, /* protocol unreachable */ - ICMP_DUR_PORT = 3, /* port unreachable */ - ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */ - ICMP_DUR_SR = 5 /* source route failed */ -}; - -enum icmp_te_type { - ICMP_TE_TTL = 0, /* time to live exceeded in transit */ - ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */ -}; - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -/** This is the standard ICMP header only that the u32_t data - * is splitted to two u16_t like ICMP echo needs it. - * This header is also used for other ICMP types that do not - * use the data part. - * ¶¨ÒåICMP»ØËÍÇëÇó±¨ÎÄÊײ¿½á¹¹£¬ - * ÓÉÓÚËùÓÐICMP±¨ÎÄÊײ¿ÓкܴóÏàËÆÐÔ£¬ - * ¸Ã½á¹¹Í¬ÑùÊÊÓÃÓÚÆäËüICMP±¨ÎÄ¡£ - */ -PACK_STRUCT_BEGIN -struct icmp_echo_hdr { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FIELD(u16_t seqno); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -//¶ÁÈ¡ICMPÊײ¿ÖÐ×Ö¶Î -#define ICMPH_TYPE(hdr) ((hdr)->type) -#define ICMPH_CODE(hdr) ((hdr)->code) - -/** Combines type and code to an u16_t ÏòICMP±¨ÎÄÊײ¿×Ö¶ÎÖÐдÈëÏàÓ¦Öµ*/ -#define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) -#define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) - - -#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ - -void icmp_input(struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)ICACHE_FLASH_ATTR; -void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)ICACHE_FLASH_ATTR; - -#endif /* LWIP_ICMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ICMP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/igmp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/igmp.h deleted file mode 100644 index 8cf9a481..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/igmp.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2002 CITEL Technologies Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is a contribution to the lwIP TCP/IP stack. - * The Swedish Institute of Computer Science and Adam Dunkels - * are specifically granted permission to redistribute this - * source code. -*/ - -#ifndef __LWIP_IGMP_H__ -#define __LWIP_IGMP_H__ - -#include "lwip/opt.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" -#include "lwip/pbuf.h" - -#if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* IGMP timer */ -#define IGMP_TMR_INTERVAL 100 /* Milliseconds */ -#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL) -#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL) - -/* MAC Filter Actions, these are passed to a netif's - * igmp_mac_filter callback function. */ -#define IGMP_DEL_MAC_FILTER 0 -#define IGMP_ADD_MAC_FILTER 1 - - -/** - * igmp group structure - there is - * a list of groups for each interface - * these should really be linked from the interface, but - * if we keep them separate we will not affect the lwip original code - * too much - * - * There will be a group for the all systems group address but this - * will not run the state machine as it is used to kick off reports - * from all the other groups - */ -struct igmp_group { - /** next link */ - struct igmp_group *next; - /** interface on which the group is active */ - struct netif *netif; - /** multicast address */ - ip_addr_t group_address; - /** signifies we were the last person to report */ - u8_t last_reporter_flag; - /** current state of the group */ - u8_t group_state; - /** timer for reporting, negative is OFF */ - u16_t timer; - /** counter of simultaneous uses */ - u8_t use; -}; - -/* Prototypes */ -void igmp_init(void)ICACHE_FLASH_ATTR; -err_t igmp_start(struct netif *netif)ICACHE_FLASH_ATTR; -err_t igmp_stop(struct netif *netif)ICACHE_FLASH_ATTR; -void igmp_report_groups(struct netif *netif)ICACHE_FLASH_ATTR; -struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr)ICACHE_FLASH_ATTR; -void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest)ICACHE_FLASH_ATTR; -err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR; -err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR; -void igmp_tmr(void)ICACHE_FLASH_ATTR; -#define LWIP_RAND() rand() -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IGMP */ - -#endif /* __LWIP_IGMP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/inet.h b/sparkfun/esp8266/firmwares/loader/src/lwip/inet.h deleted file mode 100644 index 7bff49b5..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/inet.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INET_H__ -#define __LWIP_INET_H__ - -#include "lwip/opt.h" -#include "lwip/def.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** For compatibility with BSD code */ -struct in_addr { - u32_t s_addr; -}; - -/** 255.255.255.255 */ -#define INADDR_NONE IPADDR_NONE -/** 127.0.0.1 */ -#define INADDR_LOOPBACK IPADDR_LOOPBACK -/** 0.0.0.0 */ -#define INADDR_ANY IPADDR_ANY -/** 255.255.255.255 */ -#define INADDR_BROADCAST IPADDR_BROADCAST - -/* Definitions of the bits in an Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IN_CLASSA(a) IP_CLASSA(a) -#define IN_CLASSA_NET IP_CLASSA_NET -#define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT -#define IN_CLASSA_HOST IP_CLASSA_HOST -#define IN_CLASSA_MAX IP_CLASSA_MAX - -#define IN_CLASSB(b) IP_CLASSB(b) -#define IN_CLASSB_NET IP_CLASSB_NET -#define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT -#define IN_CLASSB_HOST IP_CLASSB_HOST -#define IN_CLASSB_MAX IP_CLASSB_MAX - -#define IN_CLASSC(c) IP_CLASSC(c) -#define IN_CLASSC_NET IP_CLASSC_NET -#define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT -#define IN_CLASSC_HOST IP_CLASSC_HOST -#define IN_CLASSC_MAX IP_CLASSC_MAX - -#define IN_CLASSD(d) IP_CLASSD(d) -#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */ -#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */ -#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */ -#define IN_CLASSD_MAX IP_CLASSD_MAX - -#define IN_MULTICAST(a) IP_MULTICAST(a) - -#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a) -#define IN_BADCLASS(a) IP_BADCLASS(a) - -#define IN_LOOPBACKNET IP_LOOPBACKNET - -#define inet_addr_from_ipaddr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr)) -#define inet_addr_to_ipaddr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr)) -/* ATTENTION: the next define only works because both s_addr and ip_addr_t are an u32_t effectively! */ -#define inet_addr_to_ipaddr_p(target_ipaddr_p, source_inaddr) ((target_ipaddr_p) = (ip_addr_t*)&((source_inaddr)->s_addr)) - -/* directly map this to the lwip internal functions */ -#define inet_addr(cp) ipaddr_addr(cp) -#define inet_aton(cp, addr) ipaddr_aton(cp, (ip_addr_t*)addr) -#define inet_ntoa(addr) ipaddr_ntoa((ip_addr_t*)&(addr)) -#define inet_ntoa_r(addr, buf, buflen) ipaddr_ntoa_r((ip_addr_t*)&(addr), buf, buflen) - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INET_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/inet_chksum.h b/sparkfun/esp8266/firmwares/loader/src/lwip/inet_chksum.h deleted file mode 100644 index 41be6415..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/inet_chksum.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INET_CHKSUM_H__ -#define __LWIP_INET_CHKSUM_H__ - -#include "lwip/opt.h" - -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" - -/** Swap the bytes in an u16_t: much like htons() for little-endian */ -#ifndef SWAP_BYTES_IN_WORD -#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) -/* little endian and PLATFORM_BYTESWAP defined */ -#define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) -#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) */ -/* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ -#define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) -#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)*/ -#endif /* SWAP_BYTES_IN_WORD */ - -/** Split an u32_t in two u16_ts and add them up */ -#ifndef FOLD_U32T -#define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) -#endif - -#if LWIP_CHECKSUM_ON_COPY -/** Function-like macro: same as MEMCPY but returns the checksum of copied data - as u16_t */ -#ifndef LWIP_CHKSUM_COPY -#define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) -#ifndef LWIP_CHKSUM_COPY_ALGORITHM -#define LWIP_CHKSUM_COPY_ALGORITHM 1 -#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ -#endif /* LWIP_CHKSUM_COPY */ -#else /* LWIP_CHECKSUM_ON_COPY */ -#define LWIP_CHKSUM_COPY_ALGORITHM 0 -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -extern "C" { -#endif - -u16_t inet_chksum(void *dataptr, u16_t len)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pbuf(struct pbuf *p)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pseudo(struct pbuf *p, - ip_addr_t *src, ip_addr_t *dest, - u8_t proto, u16_t proto_len)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pseudo_partial(struct pbuf *p, - ip_addr_t *src, ip_addr_t *dest, - u8_t proto, u16_t proto_len, u16_t chksum_len)ICACHE_FLASH_ATTR; -#if LWIP_CHKSUM_COPY_ALGORITHM -u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INET_H__ */ - diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/init.h b/sparkfun/esp8266/firmwares/loader/src/lwip/init.h deleted file mode 100644 index 7a58aece..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/init.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INIT_H__ -#define __LWIP_INIT_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** X.x.x: Major version of the stack */ -#define LWIP_VERSION_MAJOR 1U -/** x.X.x: Minor version of the stack */ -#define LWIP_VERSION_MINOR 4U -/** x.x.X: Revision of the stack */ -#define LWIP_VERSION_REVISION 0U -/** For release candidates, this is set to 1..254 - * For official releases, this is set to 255 (LWIP_RC_RELEASE) - * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ -#define LWIP_VERSION_RC 2U - -/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ -#define LWIP_RC_RELEASE 255U -/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ -#define LWIP_RC_DEVELOPMENT 0U - -#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) -#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) -#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) - -/** Provides the version of the stack */ -#define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ - LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) - -/* Modules initialization */ -void lwip_init(void) ICACHE_FLASH_ATTR; -//void lwip_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INIT_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/ip.h b/sparkfun/esp8266/firmwares/loader/src/lwip/ip.h deleted file mode 100644 index 1f361fa4..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/ip.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_IP_H__ -#define __LWIP_IP_H__ - -#include "lwip/opt.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Currently, the function ip_output_if_opt() is only used with IGMP */ -#define IP_OPTIONS_SEND LWIP_IGMP - -#define IP_HLEN 20 - -#define IP_PROTO_ICMP 1 -#define IP_PROTO_IGMP 2 -#define IP_PROTO_UDP 17 -#define IP_PROTO_UDPLITE 136 -#define IP_PROTO_TCP 6 - -/* This is passed as the destination address to ip_output_if (not - to ip_output), meaning that an IP header already is constructed - in the pbuf. This is used when TCP retransmits. */ -#ifdef IP_HDRINCL -#undef IP_HDRINCL -#endif /* IP_HDRINCL */ -#define IP_HDRINCL NULL - -#if LWIP_NETIF_HWADDRHINT -#define IP_PCB_ADDRHINT ;u8_t addr_hint -#else -#define IP_PCB_ADDRHINT -#endif /* LWIP_NETIF_HWADDRHINT */ - -/* This is the common part of all PCB types. It needs to be at the - beginning of a PCB type definition. It is located here so that - changes to this common part are made in one location instead of - having to change all PCB structs. */ -#define IP_PCB \ - /* ip addresses in network byte order */ \ - ip_addr_t local_ip; \ - ip_addr_t remote_ip; \ - /* Socket options */ \ - u8_t so_options; \ - /* Type Of Service */ \ - u8_t tos; \ - /* Time To Live */ \ - u8_t ttl \ - /* link layer address resolution hint */ \ - IP_PCB_ADDRHINT - -struct ip_pcb { -/* Common members of all PCB types */ - IP_PCB; -}; - -/* - * Option flags per-socket. These are the same like SO_XXX. - */ -/*#define SOF_DEBUG (u8_t)0x01U Unimplemented: turn on debugging info recording */ -#define SOF_ACCEPTCONN (u8_t)0x02U /* socket has had listen() */ -#define SOF_REUSEADDR (u8_t)0x04U /* allow local address reuse */ -#define SOF_KEEPALIVE (u8_t)0x08U /* keep connections alive */ -/*#define SOF_DONTROUTE (u8_t)0x10U Unimplemented: just use interface addresses */ -#define SOF_BROADCAST (u8_t)0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ -/*#define SOF_USELOOPBACK (u8_t)0x40U Unimplemented: bypass hardware when possible */ -#define SOF_LINGER (u8_t)0x80U /* linger on close if data present */ -/*#define SOF_OOBINLINE (u16_t)0x0100U Unimplemented: leave received OOB data in line */ -/*#define SOF_REUSEPORT (u16_t)0x0200U Unimplemented: allow local address & port reuse */ - -/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */ -#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE|SOF_LINGER/*|SOF_DEBUG|SOF_DONTROUTE|SOF_OOBINLINE*/) - - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_hdr { - /* version / header length / type of service */ - PACK_STRUCT_FIELD(u16_t _v_hl_tos); - /* total length */ - PACK_STRUCT_FIELD(u16_t _len); - /* identification */ - PACK_STRUCT_FIELD(u16_t _id); - /* fragment offset field */ - PACK_STRUCT_FIELD(u16_t _offset); -#define IP_RF 0x8000 /* reserved fragment flag */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ - /* time to live */ - PACK_STRUCT_FIELD(u8_t _ttl); - /* protocol*/ - PACK_STRUCT_FIELD(u8_t _proto); - /* checksum */ - PACK_STRUCT_FIELD(u16_t _chksum); - /* source and destination IP addresses */ - PACK_STRUCT_FIELD(ip_addr_p_t src); - PACK_STRUCT_FIELD(ip_addr_p_t dest); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12) -#define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f) -#define IPH_TOS(hdr) (ntohs((hdr)->_v_hl_tos) & 0xff) -#define IPH_LEN(hdr) ((hdr)->_len) -#define IPH_ID(hdr) ((hdr)->_id) -#define IPH_OFFSET(hdr) ((hdr)->_offset) -#define IPH_TTL(hdr) ((hdr)->_ttl) -#define IPH_PROTO(hdr) ((hdr)->_proto) -#define IPH_CHKSUM(hdr) ((hdr)->_chksum) - -#define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos))) -#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) -#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) -#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) -#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl) -#define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto) -#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) - -/** The interface that provided the packet for the current callback invocation. */ -extern struct netif *current_netif; -/** Header of the input packet currently being processed. */ -extern const struct ip_hdr *current_header; -/** Source IP address of current_header */ -extern ip_addr_t current_iphdr_src; -/** Destination IP address of current_header */ -extern ip_addr_t current_iphdr_dest; - -#define ip_init() /* Compatibility define, not init needed. */ -struct netif *ip_route(ip_addr_t *dest)ICACHE_FLASH_ATTR; -struct netif *ip_router(ip_addr_t *dest, ip_addr_t *source); - -err_t ip_input(struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -err_t ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto)ICACHE_FLASH_ATTR; -err_t ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, - struct netif *netif)ICACHE_FLASH_ATTR; -#if LWIP_NETIF_HWADDRHINT -err_t ip_output_hinted(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if IP_OPTIONS_SEND -err_t ip_output_if_opt(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, - u16_t optlen)ICACHE_FLASH_ATTR; -#endif /* IP_OPTIONS_SEND */ -/** Get the interface that received the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_netif() (current_netif) -/** Get the IP header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_header() (current_header) -/** Source IP address of current_header */ -#define ip_current_src_addr() (¤t_iphdr_src) -/** Destination IP address of current_header */ -#define ip_current_dest_addr() (¤t_iphdr_dest) - -#if IP_DEBUG -void ip_debug_print(struct pbuf *p)ICACHE_FLASH_ATTR; -#else -#define ip_debug_print(p) -#endif /* IP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_H__ */ - - diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/ip_addr.h b/sparkfun/esp8266/firmwares/loader/src/lwip/ip_addr.h deleted file mode 100644 index cfc10f80..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/ip_addr.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_IP_ADDR_H__ -#define __LWIP_IP_ADDR_H__ - -#include "lwip/opt.h" -#include "lwip/def.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* This is the aligned version of ip_addr_t, - used as local variable, on the stack, etc. */ -struct ip_addr { - u32_t addr; -}; - -/* This is the packed version of ip_addr_t, - used in network headers that are itself packed */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_addr_packed { - PACK_STRUCT_FIELD(u32_t addr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** ip_addr_t uses a struct for convenience only, so that the same defines can - * operate both on ip_addr_t as well as on ip_addr_p_t. */ -typedef struct ip_addr ip_addr_t; -typedef struct ip_addr_packed ip_addr_p_t; - -/* - * struct ipaddr2 is used in the definition of the ARP packet format in - * order to support compilers that don't have structure packing. - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_addr2 { - PACK_STRUCT_FIELD(u16_t addrw[2]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Forward declaration to not include netif.h */ -struct netif; - -extern const ip_addr_t ip_addr_any; -extern const ip_addr_t ip_addr_broadcast; - -/** IP_ADDR_ can be used as a fixed IP address - * for the wildcard and the broadcast address - */ -#define IP_ADDR_ANY ((ip_addr_t *)&ip_addr_any) -#define IP_ADDR_BROADCAST ((ip_addr_t *)&ip_addr_broadcast) - -/** 255.255.255.255 */ -#define IPADDR_NONE ((u32_t)0xffffffffUL) -/** 127.0.0.1 */ -#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL) -/** 0.0.0.0 */ -#define IPADDR_ANY ((u32_t)0x00000000UL) -/** 255.255.255.255 */ -#define IPADDR_BROADCAST ((u32_t)0xffffffffUL) - -/* Definitions of the bits in an Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IP_CLASSA(a) ((((u32_t)(a)) & 0x80000000UL) == 0) -#define IP_CLASSA_NET 0xff000000 -#define IP_CLASSA_NSHIFT 24 -#define IP_CLASSA_HOST (0xffffffff & ~IP_CLASSA_NET) -#define IP_CLASSA_MAX 128 - -#define IP_CLASSB(a) ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL) -#define IP_CLASSB_NET 0xffff0000 -#define IP_CLASSB_NSHIFT 16 -#define IP_CLASSB_HOST (0xffffffff & ~IP_CLASSB_NET) -#define IP_CLASSB_MAX 65536 - -#define IP_CLASSC(a) ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL) -#define IP_CLASSC_NET 0xffffff00 -#define IP_CLASSC_NSHIFT 8 -#define IP_CLASSC_HOST (0xffffffff & ~IP_CLASSC_NET) - -#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL) -#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */ -#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */ -#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */ -#define IP_MULTICAST(a) IP_CLASSD(a) - -#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) -#define IP_BADCLASS(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) - -#define IP_LOOPBACKNET 127 /* official! */ - - -#if BYTE_ORDER == BIG_ENDIAN -/** Set an IP address given by the four byte-parts */ -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((u32_t)((a) & 0xff) << 24) | \ - ((u32_t)((b) & 0xff) << 16) | \ - ((u32_t)((c) & 0xff) << 8) | \ - (u32_t)((d) & 0xff) -#else -/** Set an IP address given by the four byte-parts. - Little-endian version that prevents the use of htonl. */ -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((u32_t)((d) & 0xff) << 24) | \ - ((u32_t)((c) & 0xff) << 16) | \ - ((u32_t)((b) & 0xff) << 8) | \ - (u32_t)((a) & 0xff) -#endif - -/** MEMCPY-like copying of IP addresses where addresses are known to be - * 16-bit-aligned if the port is correctly configured (so a port could define - * this to copying 2 u16_t's) - no NULL-pointer-checking needed. */ -#ifndef IPADDR2_COPY -#define IPADDR2_COPY(dest, src) SMEMCPY(dest, src, sizeof(ip_addr_t)) -#endif - -/** Copy IP address - faster than ip_addr_set: no NULL check */ -#define ip_addr_copy(dest, src) ((dest).addr = (src).addr) -/** Safely copy one IP address to another (src may be NULL) */ -#define ip_addr_set(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0 : \ - (src)->addr)) -/** Set complete address to zero */ -#define ip_addr_set_zero(ipaddr) ((ipaddr)->addr = 0) -/** Set address to IPADDR_ANY (no need for htonl()) */ -#define ip_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY) -/** Set address to loopback address */ -#define ip_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) -/** Safely copy one IP address to another and change byte order - * from host- to network-order. */ -#define ip_addr_set_hton(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0:\ - htonl((src)->addr))) -/** IPv4 only: set the IP address given as an u32_t */ -#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) -/** IPv4 only: get the IP address as an u32_t */ -#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr) - -/** Get the network address by combining host address with netmask */ -#define ip_addr_get_network(target, host, netmask) ((target)->addr = ((host)->addr) & ((netmask)->addr)) - -/** - * Determine if two address are on the same network. - * - * @arg addr1 IP address 1 - * @arg addr2 IP address 2 - * @arg mask network identifier mask - * @return !0 if the network identifiers of both address match - */ -#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ - (mask)->addr) == \ - ((addr2)->addr & \ - (mask)->addr)) -#define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr) - -#define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == IPADDR_ANY) - -#define ip_addr_isbroadcast(ipaddr, netif) ip4_addr_isbroadcast((ipaddr)->addr, (netif)) -u8_t ip4_addr_isbroadcast(u32_t addr, const struct netif *netif)ICACHE_FLASH_ATTR; - -#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr) -u8_t ip4_addr_netmask_valid(u32_t netmask)ICACHE_FLASH_ATTR; - -#define ip_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL)) - -#define ip_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL)) - -#define ip_addr_debug_print(debug, ipaddr) \ - LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, \ - ipaddr != NULL ? ip4_addr1_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr2_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr3_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr4_16(ipaddr) : 0)) - -/* Get one byte from the 4-byte address */ -#define ip4_addr1(ipaddr) (((u8_t*)(ipaddr))[0]) -#define ip4_addr2(ipaddr) (((u8_t*)(ipaddr))[1]) -#define ip4_addr3(ipaddr) (((u8_t*)(ipaddr))[2]) -#define ip4_addr4(ipaddr) (((u8_t*)(ipaddr))[3]) -/* These are cast to u16_t, with the intent that they are often arguments - * to printf using the U16_F format from cc.h. */ -#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr)) -#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr)) -#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr)) -#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr)) - -/** For backwards compatibility */ -#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr) - -u32_t ipaddr_addr(const char *cp)ICACHE_FLASH_ATTR; -int ipaddr_aton(const char *cp, ip_addr_t *addr)ICACHE_FLASH_ATTR; -/** returns ptr to static buffer; not reentrant! */ -char *ipaddr_ntoa(const ip_addr_t *addr)ICACHE_FLASH_ATTR; -char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen)ICACHE_FLASH_ATTR; - -#define IP2STR(ipaddr) ip4_addr1_16(ipaddr), \ - ip4_addr2_16(ipaddr), \ - ip4_addr3_16(ipaddr), \ - ip4_addr4_16(ipaddr) - -#define IPSTR "%d.%d.%d.%d" - -struct ip_info { - struct ip_addr ip; - struct ip_addr netmask; - struct ip_addr gw; -}; -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_ADDR_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/ip_frag.h b/sparkfun/esp8266/firmwares/loader/src/lwip/ip_frag.h deleted file mode 100644 index df6db5f5..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/ip_frag.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Jani Monoses - * - */ - -#ifndef __LWIP_IP_FRAG_H__ -#define __LWIP_IP_FRAG_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if IP_REASSEMBLY -/* The IP reassembly timer interval in milliseconds. */ -#define IP_TMR_INTERVAL 1000 - -/* IP reassembly helper struct. - * This is exported because memp needs to know the size. - */ -struct ip_reassdata { - struct ip_reassdata *next; - struct pbuf *p; - struct ip_hdr iphdr; - u16_t datagram_len; - u8_t flags; - u8_t timer; -}; - -void ip_reass_init(void)ICACHE_FLASH_ATTR; -void ip_reass_tmr(void)ICACHE_FLASH_ATTR; -struct pbuf * ip_reass(struct pbuf *p)ICACHE_FLASH_ATTR; -#endif /* IP_REASSEMBLY */ - -#if IP_FRAG -#if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF -/** A custom pbuf that holds a reference to another pbuf, which is freed - * when this custom pbuf is freed. This is used to create a custom PBUF_REF - * that points into the original pbuf. */ -struct pbuf_custom_ref { - /** 'base class' */ - struct pbuf_custom pc; - /** pointer to the original pbuf that is referenced */ - struct pbuf *original; -}; -#endif /* !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ - -err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)ICACHE_FLASH_ATTR; -#endif /* IP_FRAG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_FRAG_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/mem.h b/sparkfun/esp8266/firmwares/loader/src/lwip/mem.h deleted file mode 100644 index 7a4febcc..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/mem.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_MEM_H__ -#define __LWIP_MEM_H__ - -#include "lwip/opt.h" -#include "mem_manager.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if MEM_LIBC_MALLOC - -#include /* for size_t */ - -typedef size_t mem_size_t; - -/* aliases for C library malloc() */ -#define mem_init() -/* in case C library malloc() needs extra protection, - * allow these defines to be overridden. - */ -#ifndef mem_free -#define mem_free vPortFree -#endif -#ifndef mem_malloc -#define mem_malloc pvPortMalloc -#endif -#ifndef mem_calloc -#define mem_calloc pvPortCalloc -#endif -#ifndef mem_realloc -#define mem_realloc pvPortRealloc -#endif -#ifndef mem_zalloc -#define mem_zalloc pvPortZalloc -#endif - -#ifndef os_malloc -#define os_malloc(s) mem_malloc((s)) -#endif -#ifndef os_realloc -#define os_realloc(p, s) mem_realloc((p), (s)) -#endif -#ifndef os_zalloc -#define os_zalloc(s) mem_zalloc((s)) -#endif -#ifndef os_free -#define os_free(p) mem_free((p)) -#endif - -/* Since there is no C library allocation function to shrink memory without - moving it, define this to nothing. */ -#ifndef mem_trim -#define mem_trim(mem, size) (mem) -#endif -#else /* MEM_LIBC_MALLOC */ - -/* MEM_SIZE would have to be aligned, but using 64000 here instead of - * 65535 leaves some room for alignment... - */ -#if MEM_SIZE > 64000l -typedef u32_t mem_size_t; -#define MEM_SIZE_F U32_F -#else -typedef u16_t mem_size_t; -#define MEM_SIZE_F U16_F -#endif /* MEM_SIZE > 64000 */ - -#if MEM_USE_POOLS -/** mem_init is not used when using pools instead of a heap */ -#define mem_init() -/** mem_trim is not used when using pools instead of a heap: - we can't free part of a pool element and don't want to copy the rest */ -#define mem_trim(mem, size) (mem) -#else /* MEM_USE_POOLS */ -/* lwIP alternative malloc */ -void mem_init(void)ICACHE_FLASH_ATTR; -void *mem_trim(void *mem, mem_size_t size)ICACHE_FLASH_ATTR; -#endif /* MEM_USE_POOLS */ -void *mem_malloc(mem_size_t size)ICACHE_FLASH_ATTR; -void *mem_calloc(mem_size_t count, mem_size_t size)ICACHE_FLASH_ATTR; -void mem_free(void *mem)ICACHE_FLASH_ATTR; -#endif /* MEM_LIBC_MALLOC */ - -/** Calculate memory size for an aligned buffer - returns the next highest - * multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and - * LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4). - */ -#ifndef LWIP_MEM_ALIGN_SIZE -#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1)) -#endif - -/** Calculate safe memory size for an aligned buffer when using an unaligned - * type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the - * start (e.g. if buffer is u8_t[] and actual data will be u32_t*) - */ -#ifndef LWIP_MEM_ALIGN_BUFFER -#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1)) -#endif - -/** Align a memory pointer to the alignment defined by MEM_ALIGNMENT - * so that ADDR % MEM_ALIGNMENT == 0 - */ -#ifndef LWIP_MEM_ALIGN -#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_MEM_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/mem_manager.h b/sparkfun/esp8266/firmwares/loader/src/lwip/mem_manager.h deleted file mode 100644 index 03559689..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/mem_manager.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __MEM_MANAGER_H__ -#define __MEM_MANAGER_H__ - -#include "c_types.h" - -/*------------------------±äÁ¿¶¨Òå------------------------*/ - -#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE -#ifndef IOT_SIP_MODE -//#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 0x3fffc000 - (uint32)&_heap_start ) )//fix 16000 to 24000 on 14.2.26 -#else -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 8000 ) ) -#endif -#define portBYTE_ALIGNMENT 8 -#define pdFALSE 0 -#define pdTRUE 1 - -#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE -#if portBYTE_ALIGNMENT == 8 - #define portBYTE_ALIGNMENT_MASK ( 0x0007 ) -#endif - -#if portBYTE_ALIGNMENT == 4 - #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) -#endif - -#if portBYTE_ALIGNMENT == 2 - #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) -#endif - -#if portBYTE_ALIGNMENT == 1 - #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) -#endif - -#ifndef portBYTE_ALIGNMENT_MASK - #error "Invalid portBYTE_ALIGNMENT definition" -#endif - -#define configUSE_MALLOC_FAILED_HOOK 1 -#define portPOINTER_SIZE_TYPE unsigned int - -#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) ) - -//#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT ) - -//static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ]; -//static unsigned char *ucHeap; - -typedef struct A_BLOCK_LINK -{ - struct A_BLOCK_LINK *pxNextFreeBlock; //The next free block in the list. - size_t xBlockSize; //The size of the free block. -} xBlockLink; - -static const unsigned short heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + portBYTE_ALIGNMENT - ( sizeof( xBlockLink ) % portBYTE_ALIGNMENT ) ); - -//static const size_t xTotalHeapSize = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK ); - -//static xBlockLink xStart, *pxEnd = NULL; - -//static size_t xFreeBytesRemaining = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK ); - - -/*------------------------º¯ÊýÉùÃ÷-----------------------------------*/ - -//static void prvInsertBlockIntoFreeList( xBlockLink *pxBlockToInsert ) ;//ICACHE_FLASH_ATTR; - -//static void prvHeapInit( void ) ;//ICACHE_FLASH_ATTR; - -void vApplicationMallocFailedHook( void ) ;//ICACHE_FLASH_ATTR; - -void *pvPortMalloc( size_t xWantedSize ) ;//ICACHE_FLASH_ATTR; - -void vPortFree( void *pv ) ;//ICACHE_FLASH_ATTR; - -size_t xPortGetFreeHeapSize( void ) ;//ICACHE_FLASH_ATTR; - -void vPortInitialiseBlocks( void ) ;//ICACHE_FLASH_ATTR; -/*-----------------------------------------------------------*/ - -#endif diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/memp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/memp.h deleted file mode 100644 index 764dedb1..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/memp.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -#ifndef __LWIP_MEMP_H__ -#define __LWIP_MEMP_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */ -typedef enum { -#define LWIP_MEMPOOL(name,num,size,desc, attr) MEMP_##name, -#include "lwip/memp_std.h" - MEMP_MAX -} memp_t; - -#if MEM_USE_POOLS -/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */ -typedef enum { - /* Get the first (via: - MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/ - MEMP_POOL_HELPER_FIRST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START 1 -#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0 -#define LWIP_MALLOC_MEMPOOL_END -#include "lwip/memp_std.h" - ) , - /* Get the last (via: - MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */ - MEMP_POOL_HELPER_LAST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size * -#define LWIP_MALLOC_MEMPOOL_END 1 -#include "lwip/memp_std.h" - ) -} memp_pool_helper_t; - -/* The actual start and stop values are here (cast them over) - We use this helper type and these defines so we can avoid using const memp_t values */ -#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST) -#define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST) -#endif /* MEM_USE_POOLS */ - -#if MEMP_MEM_MALLOC || MEM_USE_POOLS -extern const u16_t memp_sizes[MEMP_MAX]; -#endif /* MEMP_MEM_MALLOC || MEM_USE_POOLS */ - -#if MEMP_MEM_MALLOC - -#include "mem.h" - -#define memp_init() -#define memp_malloc(type) mem_malloc(memp_sizes[type]) -#define memp_free(type, mem) mem_free(mem) - -#else /* MEMP_MEM_MALLOC */ - -#if MEM_USE_POOLS -/** This structure is used to save the pool one element came from. */ -struct memp_malloc_helper -{ - memp_t poolnr; -}; -#endif /* MEM_USE_POOLS */ - -void memp_init(void)ICACHE_FLASH_ATTR; - -#if MEMP_OVERFLOW_CHECK -void *memp_malloc_fn(memp_t type, const char* file, const int line)ICACHE_FLASH_ATTR; -#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__) -#else -void *memp_malloc(memp_t type)ICACHE_FLASH_ATTR; -#endif -void memp_free(memp_t type, void *mem)ICACHE_FLASH_ATTR; - -#endif /* MEMP_MEM_MALLOC */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_MEMP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/memp_std.h b/sparkfun/esp8266/firmwares/loader/src/lwip/memp_std.h deleted file mode 100644 index b20a2405..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/memp_std.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * SETUP: Make sure we define everything we will need. - * - * We have create three types of pools: - * 1) MEMPOOL - standard pools - * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c - * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct - * - * If the include'r doesn't require any special treatment of each of the types - * above, then will declare #2 & #3 to be just standard mempools. - */ -#ifndef LWIP_MALLOC_MEMPOOL -/* This treats "malloc pools" just like any other pool. - The pools are a little bigger to provide 'size' as the amount of user data. */ -#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size, attr) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL_END -#endif /* LWIP_MALLOC_MEMPOOL */ - -#ifndef LWIP_PBUF_MEMPOOL -/* This treats "pbuf pools" just like any other pool. - * Allocates buffers for a pbuf struct AND a payload size */ -#define LWIP_PBUF_MEMPOOL(name, num, payload, desc, attr) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc, attr) -#endif /* LWIP_PBUF_MEMPOOL */ - - -/* - * A list of internal pools used by LWIP. - * - * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - */ -#if LWIP_RAW -LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB", DMEM_ATTR) -#endif /* LWIP_RAW */ - -#if LWIP_UDP -LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB", DMEM_ATTR) -#endif /* LWIP_UDP */ - -#if LWIP_TCP -LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB", DMEM_ATTR) -LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN", DMEM_ATTR) -LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG", DMEM_ATTR) -#endif /* LWIP_TCP */ - -#if IP_REASSEMBLY -LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA", DMEM_ATTR) -#endif /* IP_REASSEMBLY */ -#if IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF -LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF", DMEM_ATTR) -#endif /* IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ - -#if LWIP_NETCONN -LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") -LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") -#endif /* LWIP_NETCONN */ - -#if NO_SYS==0 -LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") -#if !LWIP_TCPIP_CORE_LOCKING_INPUT -LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") -#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ -#endif /* NO_SYS==0 */ - -#if ARP_QUEUEING -LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE", DMEM_ATTR) -#endif /* ARP_QUEUEING */ - -#if LWIP_IGMP -LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP", DMEM_ATTR) -#endif /* LWIP_IGMP */ - -#if (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) /* LWIP_TIMERS */ -LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT", DMEM_ATTR) -#endif /* LWIP_TIMERS */ - -#if LWIP_SNMP -LWIP_MEMPOOL(SNMP_ROOTNODE, MEMP_NUM_SNMP_ROOTNODE, sizeof(struct mib_list_rootnode), "SNMP_ROOTNODE") -LWIP_MEMPOOL(SNMP_NODE, MEMP_NUM_SNMP_NODE, sizeof(struct mib_list_node), "SNMP_NODE") -LWIP_MEMPOOL(SNMP_VARBIND, MEMP_NUM_SNMP_VARBIND, sizeof(struct snmp_varbind), "SNMP_VARBIND") -LWIP_MEMPOOL(SNMP_VALUE, MEMP_NUM_SNMP_VALUE, SNMP_MAX_VALUE_SIZE, "SNMP_VALUE") -#endif /* LWIP_SNMP */ -#if LWIP_DNS && LWIP_SOCKET -LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") -#endif /* LWIP_DNS && LWIP_SOCKET */ -#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC -LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST") -#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#if PPP_SUPPORT && PPPOE_SUPPORT -LWIP_MEMPOOL(PPPOE_IF, MEMP_NUM_PPPOE_INTERFACES, sizeof(struct pppoe_softc), "PPPOE_IF") -#endif /* PPP_SUPPORT && PPPOE_SUPPORT */ - -/* - * A list of pools of pbuf's used by LWIP. - * - * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - * This allocates enough space for the pbuf struct and a payload. - * (Example: pbuf_payload_size=0 allocates only size for the struct) - */ -LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM", DMEM_ATTR) - -/* XXX: need to align to 4 byte as memp strcut is 4-byte long. otherwise will crash */ -#define LWIP_MEM_ALIGN4_SIZE(size) (((size) + 4 - 1) & ~(4-1)) - -LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, LWIP_MEM_ALIGN4_SIZE(PBUF_POOL_BUFSIZE), "PBUF_POOL", DMEM_ATTR) - - -/* - * Allow for user-defined pools; this must be explicitly set in lwipopts.h - * since the default is to NOT look for lwippools.h - */ -#if MEMP_USE_CUSTOM_POOLS -#include "lwippools.h" -#endif /* MEMP_USE_CUSTOM_POOLS */ - -/* - * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later - * (#undef is ignored for something that is not defined) - */ -#undef LWIP_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL_START -#undef LWIP_MALLOC_MEMPOOL_END -#undef LWIP_PBUF_MEMPOOL diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/netbuf.h b/sparkfun/esp8266/firmwares/loader/src/lwip/netbuf.h deleted file mode 100644 index b554a579..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/netbuf.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_NETBUF_H__ -#define __LWIP_NETBUF_H__ - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** This netbuf has dest-addr/port set */ -#define NETBUF_FLAG_DESTADDR 0x01 -/** This netbuf includes a checksum */ -#define NETBUF_FLAG_CHKSUM 0x02 - -struct netbuf { - struct pbuf *p, *ptr; - ip_addr_t addr; - u16_t port; -#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY -#if LWIP_CHECKSUM_ON_COPY - u8_t flags; -#endif /* LWIP_CHECKSUM_ON_COPY */ - u16_t toport_chksum; -#if LWIP_NETBUF_RECVINFO - ip_addr_t toaddr; -#endif /* LWIP_NETBUF_RECVINFO */ -#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */ -}; - -/* Network buffer functions: */ -struct netbuf * netbuf_new (void)ICACHE_FLASH_ATTR; -void netbuf_delete (struct netbuf *buf)ICACHE_FLASH_ATTR; -void * netbuf_alloc (struct netbuf *buf, u16_t size)ICACHE_FLASH_ATTR; -void netbuf_free (struct netbuf *buf)ICACHE_FLASH_ATTR; -err_t netbuf_ref (struct netbuf *buf, - const void *dataptr, u16_t size)ICACHE_FLASH_ATTR; -void netbuf_chain (struct netbuf *head, - struct netbuf *tail)ICACHE_FLASH_ATTR; - -err_t netbuf_data (struct netbuf *buf, - void **dataptr, u16_t *len)ICACHE_FLASH_ATTR; -s8_t netbuf_next (struct netbuf *buf)ICACHE_FLASH_ATTR; -void netbuf_first (struct netbuf *buf)ICACHE_FLASH_ATTR; - - -#define netbuf_copy_partial(buf, dataptr, len, offset) \ - pbuf_copy_partial((buf)->p, (dataptr), (len), (offset)) -#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) -#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) -#define netbuf_len(buf) ((buf)->p->tot_len) -#define netbuf_fromaddr(buf) (&((buf)->addr)) -#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set((&(buf)->addr), fromaddr) -#define netbuf_fromport(buf) ((buf)->port) -#if LWIP_NETBUF_RECVINFO -#define netbuf_destaddr(buf) (&((buf)->toaddr)) -#define netbuf_set_destaddr(buf, destaddr) ip_addr_set((&(buf)->addr), destaddr) -#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0) -#endif /* LWIP_NETBUF_RECVINFO */ -#if LWIP_CHECKSUM_ON_COPY -#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \ - (buf)->toport_chksum = chksum; } while(0) -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_NETBUF_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/netdb.h b/sparkfun/esp8266/firmwares/loader/src/lwip/netdb.h deleted file mode 100644 index 7587e2f2..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/netdb.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Simon Goldschmidt - * - */ -#ifndef __LWIP_NETDB_H__ -#define __LWIP_NETDB_H__ - -#include "lwip/opt.h" - -#if LWIP_DNS && LWIP_SOCKET - -#include /* for size_t */ - -#include "lwip/inet.h" -#include "lwip/sockets.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* some rarely used options */ -#ifndef LWIP_DNS_API_DECLARE_H_ERRNO -#define LWIP_DNS_API_DECLARE_H_ERRNO 1 -#endif - -#ifndef LWIP_DNS_API_DEFINE_ERRORS -#define LWIP_DNS_API_DEFINE_ERRORS 1 -#endif - -#ifndef LWIP_DNS_API_DECLARE_STRUCTS -#define LWIP_DNS_API_DECLARE_STRUCTS 1 -#endif - -#if LWIP_DNS_API_DEFINE_ERRORS -/** Errors used by the DNS API functions, h_errno can be one of them */ -#define EAI_NONAME 200 -#define EAI_SERVICE 201 -#define EAI_FAIL 202 -#define EAI_MEMORY 203 - -#define HOST_NOT_FOUND 210 -#define NO_DATA 211 -#define NO_RECOVERY 212 -#define TRY_AGAIN 213 -#endif /* LWIP_DNS_API_DEFINE_ERRORS */ - -#if LWIP_DNS_API_DECLARE_STRUCTS -struct hostent { - char *h_name; /* Official name of the host. */ - char **h_aliases; /* A pointer to an array of pointers to alternative host names, - terminated by a null pointer. */ - int h_addrtype; /* Address type. */ - int h_length; /* The length, in bytes, of the address. */ - char **h_addr_list; /* A pointer to an array of pointers to network addresses (in - network byte order) for the host, terminated by a null pointer. */ -#define h_addr h_addr_list[0] /* for backward compatibility */ -}; - -struct addrinfo { - int ai_flags; /* Input flags. */ - int ai_family; /* Address family of socket. */ - int ai_socktype; /* Socket type. */ - int ai_protocol; /* Protocol of socket. */ - socklen_t ai_addrlen; /* Length of socket address. */ - struct sockaddr *ai_addr; /* Socket address of socket. */ - char *ai_canonname; /* Canonical name of service location. */ - struct addrinfo *ai_next; /* Pointer to next in list. */ -}; -#endif /* LWIP_DNS_API_DECLARE_STRUCTS */ - -#if LWIP_DNS_API_DECLARE_H_ERRNO -/* application accessable error code set by the DNS API functions */ -extern int h_errno; -#endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ - -struct hostent *lwip_gethostbyname(const char *name); -int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, - size_t buflen, struct hostent **result, int *h_errnop); -void lwip_freeaddrinfo(struct addrinfo *ai); -int lwip_getaddrinfo(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct addrinfo **res); - -#if LWIP_COMPAT_SOCKETS -#define gethostbyname(name) lwip_gethostbyname(name) -#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ - lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) -#define getaddrinfo(nodname, servname, hints, res) \ - lwip_getaddrinfo(nodname, servname, hints, res) -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS && LWIP_SOCKET */ - -#endif /* __LWIP_NETDB_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/netif.h b/sparkfun/esp8266/firmwares/loader/src/lwip/netif.h deleted file mode 100644 index 8bf13752..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/netif.h +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_NETIF_H__ -#define __LWIP_NETIF_H__ - -#include "lwip/opt.h" - -#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) - -#include "lwip/err.h" - -#include "lwip/ip_addr.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#if LWIP_DHCP -struct dhcp; -#endif -#if LWIP_AUTOIP -struct autoip; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses are expected to be in - * the same byte order as in IP_PCB. */ - -/** must be the maximum of all used hardware address lengths - across all types of interfaces in use */ -#define NETIF_MAX_HWADDR_LEN 6U - -/** Whether the network interface is 'up'. This is - * a software flag used to control whether this network - * interface is enabled and processes traffic. - * It is set by the startup code (for static IP configuration) or - * by dhcp/autoip when an address has been assigned. - */ -#define NETIF_FLAG_UP 0x01U -/** If set, the netif has broadcast capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_BROADCAST 0x02U -/** If set, the netif is one end of a point-to-point connection. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_POINTTOPOINT 0x04U -/** If set, the interface is configured using DHCP. - * Set by the DHCP code when starting or stopping DHCP. */ -#define NETIF_FLAG_DHCP 0x08U -/** If set, the interface has an active link - * (set by the network interface driver). - * Either set by the netif driver in its init function (if the link - * is up at that time) or at a later point once the link comes up - * (if link detection is supported by the hardware). */ -#define NETIF_FLAG_LINK_UP 0x10U -/** If set, the netif is an ethernet device using ARP. - * Set by the netif driver in its init function. - * Used to check input packet types and use of DHCP. */ -#define NETIF_FLAG_ETHARP 0x20U -/** If set, the netif is an ethernet device. It might not use - * ARP or TCP/IP if it is used for PPPoE only. - */ -#define NETIF_FLAG_ETHERNET 0x40U -/** If set, the netif has IGMP capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_IGMP 0x80U - -/** Function prototype for netif init functions. Set up flags and output/linkoutput - * callback functions in this function. - * - * @param netif The netif to initialize - */ -typedef err_t (*netif_init_fn)(struct netif *netif); -/** Function prototype for netif->input functions. This function is saved as 'input' - * callback function in the netif struct. Call it when a packet has been received. - * - * @param p The received packet, copied into a pbuf - * @param inp The netif which received the packet - */ -typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp); -/** Function prototype for netif->output functions. Called by lwIP when a packet - * shall be sent. For ethernet netif, set this to 'etharp_output' and set - * 'linkoutput'. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (p->payload points to IP header) - * @param ipaddr The IP address to which the packet shall be sent - */ -typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p, - ip_addr_t *ipaddr); -/** Function prototype for netif->linkoutput functions. Only used for ethernet - * netifs. This function is called by ARP when a packet shall be sent. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (raw ethernet packet) - */ -typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p); -/** Function prototype for netif status- or link-callback functions. */ -typedef void (*netif_status_callback_fn)(struct netif *netif); -/** Function prototype for netif igmp_mac_filter functions */ -typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif, - ip_addr_t *group, u8_t action); - -/** Generic data structure used for all lwIP network interfaces. - * The following fields should be filled in by the initialization - * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */ -struct netif { - /** pointer to next in linked list */ - struct netif *next; - - /** IP address configuration in network byte order */ - ip_addr_t ip_addr; - ip_addr_t netmask; - ip_addr_t gw; - - /** This function is called by the network device driver - * to pass a packet up the TCP/IP stack. ÏòIP²ãÊäÈëÊý¾Ý°ü*/ - netif_input_fn input; - /** This function is called by the IP module when it wants - * to send a packet on the interface. This function typically - * first resolves the hardware address, then sends the packet. ·¢ËÍIPÊý¾Ý°ü*/ - netif_output_fn output; - /** This function is called by the ARP module when it wants - * to send a packet on the interface. This function outputs - * the pbuf as-is on the link medium. µ×²ãÊý¾Ý°ü·¢ËÍ*/ - netif_linkoutput_fn linkoutput; -#if LWIP_NETIF_STATUS_CALLBACK - /** This function is called when the netif state is set to up or down - */ - netif_status_callback_fn status_callback; -#endif /* LWIP_NETIF_STATUS_CALLBACK */ -#if LWIP_NETIF_LINK_CALLBACK - /** This function is called when the netif link is set to up or down - */ - netif_status_callback_fn link_callback; -#endif /* LWIP_NETIF_LINK_CALLBACK */ - /** This field can be set by the device driver and could point - * to state information for the device. ×ÔÓÉÉèÖÃ×ֶΣ¬±ÈÈçÖ¸Ïòµ×²ãÉ豸Ïà¹ØÐÅÏ¢*/ - void *state; -#if LWIP_DHCP - /** the DHCP client state information for this netif */ - struct dhcp *dhcp; -#endif /* LWIP_DHCP */ -#if LWIP_AUTOIP - /** the AutoIP client state information for this netif */ - struct autoip *autoip; -#endif -#if LWIP_NETIF_HOSTNAME - /* the hostname for this netif, NULL is a valid value */ - char* hostname; -#endif /* LWIP_NETIF_HOSTNAME */ - /** maximum transfer unit (in bytes) ¸Ã½Ó¿ÚÔÊÐíµÄ×î´óÊý¾Ý°ü³¤¶È£¬¶àÊÇ1500*/ - u16_t mtu; - /** number of bytes used in hwaddr¸Ã½Ó¿ÚÎïÀíµØÖ·³¤¶È */ - u8_t hwaddr_len; - /** link level hardware address of this interface ¸Ã½Ó¿ÚÎïÀíµØÖ·*/ - u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; - /** flags (see NETIF_FLAG_ above) ¸Ã½Ó¿Ú״̬¡¢ÊôÐÔ×Ö¶Î*/ - u8_t flags; - /** descriptive abbreviation ¸Ã½Ó¿ÚµÄÃû×Ö*/ - char name[2]; - /** number of this interface ¸Ã½Ó¿ÚµÄ±àºÅ*/ - u8_t num; -#if LWIP_SNMP - /** link type (from "snmp_ifType" enum from snmp.h) */ - u8_t link_type; - /** (estimate) link speed */ - u32_t link_speed; - /** timestamp at last change made (up/down) */ - u32_t ts; - /** counters */ - u32_t ifinoctets; - u32_t ifinucastpkts; - u32_t ifinnucastpkts; - u32_t ifindiscards; - u32_t ifoutoctets; - u32_t ifoutucastpkts; - u32_t ifoutnucastpkts; - u32_t ifoutdiscards; -#endif /* LWIP_SNMP */ -#if LWIP_IGMP - /** This function could be called to add or delete a entry in the multicast - filter table of the ethernet MAC.*/ - netif_igmp_mac_filter_fn igmp_mac_filter; -#endif /* LWIP_IGMP */ -#if LWIP_NETIF_HWADDRHINT - u8_t *addr_hint; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if ENABLE_LOOPBACK - /* List of packets to be queued for ourselves. Ö¸Ïò·¢Ë͸ø×Ô¼ºµÄÊý¾Ý°üµÄpbuf*/ - struct pbuf *loop_first;//µÚÒ»¸ö - struct pbuf *loop_last;//×îºóÒ»¸ö -#if LWIP_LOOPBACK_MAX_PBUFS - u16_t loop_cnt_current; -#endif /* LWIP_LOOPBACK_MAX_PBUFS */ -#endif /* ENABLE_LOOPBACK */ -}; - -#if LWIP_SNMP -#define NETIF_INIT_SNMP(netif, type, speed) \ - /* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \ - (netif)->link_type = (type); \ - /* your link speed here (units: bits per second) */ \ - (netif)->link_speed = (speed); \ - (netif)->ts = 0; \ - (netif)->ifinoctets = 0; \ - (netif)->ifinucastpkts = 0; \ - (netif)->ifinnucastpkts = 0; \ - (netif)->ifindiscards = 0; \ - (netif)->ifoutoctets = 0; \ - (netif)->ifoutucastpkts = 0; \ - (netif)->ifoutnucastpkts = 0; \ - (netif)->ifoutdiscards = 0 -#else /* LWIP_SNMP */ -#define NETIF_INIT_SNMP(netif, type, speed) -#endif /* LWIP_SNMP */ - - -/** The list of network interfaces. */ -extern struct netif *netif_list; -/** The default network interface. */ -extern struct netif *netif_default; - -void netif_init(void)ICACHE_FLASH_ATTR; - -struct netif *netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, - ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)ICACHE_FLASH_ATTR; - -void -netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, - ip_addr_t *gw)ICACHE_FLASH_ATTR; -void netif_remove(struct netif * netif)ICACHE_FLASH_ATTR; - -/* Returns a network interface given its name. The name is of the form - "et0", where the first two letters are the "name" field in the - netif structure, and the digit is in the num field in the same - structure. */ -struct netif *netif_find(char *name)ICACHE_FLASH_ATTR; - -void netif_set_default(struct netif *netif)ICACHE_FLASH_ATTR; - -void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -void netif_set_netmask(struct netif *netif, ip_addr_t *netmask)ICACHE_FLASH_ATTR; -void netif_set_gw(struct netif *netif, ip_addr_t *gw)ICACHE_FLASH_ATTR; - -void netif_set_up(struct netif *netif)ICACHE_FLASH_ATTR; -void netif_set_down(struct netif *netif)ICACHE_FLASH_ATTR; -/** Ask if an interface is up */ -#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) - -#if LWIP_NETIF_STATUS_CALLBACK -void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_STATUS_CALLBACK */ - -void netif_set_link_up(struct netif *netif)ICACHE_FLASH_ATTR; -void netif_set_link_down(struct netif *netif)ICACHE_FLASH_ATTR; -/** Ask if a link is up */ -#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) - -#if LWIP_NETIF_LINK_CALLBACK -void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_LINK_CALLBACK */ - -#if LWIP_NETIF_HOSTNAME -#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) -#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) -#endif /* LWIP_NETIF_HOSTNAME */ - -#if LWIP_IGMP -#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) -#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL) -#endif /* LWIP_IGMP */ - -#if ENABLE_LOOPBACK -err_t netif_loop_output(struct netif *netif, struct pbuf *p, ip_addr_t *dest_ip)ICACHE_FLASH_ATTR; -void netif_poll(struct netif *netif)ICACHE_FLASH_ATTR; -#if !LWIP_NETIF_LOOPBACK_MULTITHREADING -void netif_poll_all(void)ICACHE_FLASH_ATTR; -#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ -#endif /* ENABLE_LOOPBACK */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_NETIF_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/netifapi.h b/sparkfun/esp8266/firmwares/loader/src/lwip/netifapi.h deleted file mode 100644 index 33318efa..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/netifapi.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - */ - -#ifndef __LWIP_NETIFAPI_H__ -#define __LWIP_NETIFAPI_H__ - -#include "lwip/opt.h" - -#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/dhcp.h" -#include "lwip/autoip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*netifapi_void_fn)(struct netif *netif); -typedef err_t (*netifapi_errt_fn)(struct netif *netif); - -struct netifapi_msg_msg { -#if !LWIP_TCPIP_CORE_LOCKING - sys_sem_t sem; -#endif /* !LWIP_TCPIP_CORE_LOCKING */ - err_t err; - struct netif *netif; - union { - struct { - ip_addr_t *ipaddr; - ip_addr_t *netmask; - ip_addr_t *gw; - void *state; - netif_init_fn init; - netif_input_fn input; - } add; - struct { - netifapi_void_fn voidfunc; - netifapi_errt_fn errtfunc; - } common; - } msg; -}; - -struct netifapi_msg { - void (* function)(struct netifapi_msg_msg *msg); - struct netifapi_msg_msg msg; -}; - - -/* API for application */ -err_t netifapi_netif_add ( struct netif *netif, - ip_addr_t *ipaddr, - ip_addr_t *netmask, - ip_addr_t *gw, - void *state, - netif_init_fn init, - netif_input_fn input); - -err_t netifapi_netif_set_addr ( struct netif *netif, - ip_addr_t *ipaddr, - ip_addr_t *netmask, - ip_addr_t *gw ); - -err_t netifapi_netif_common ( struct netif *netif, - netifapi_void_fn voidfunc, - netifapi_errt_fn errtfunc); - -#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL) -#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL) -#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL) -#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL) -#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start) -#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL) -#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start) -#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETIF_API */ - -#endif /* __LWIP_NETIFAPI_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/opt.h b/sparkfun/esp8266/firmwares/loader/src/lwip/opt.h deleted file mode 100644 index 1a681c99..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/opt.h +++ /dev/null @@ -1,2043 +0,0 @@ -/** - * @file - * - * lwIP Options Configuration - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_OPT_H__ -#define __LWIP_OPT_H__ - -/* - * Include user defined options first. Anything not defined in these files - * will be set to standard values. Override anything you dont like! - */ -#include "include/lwipopts.h" -#include "lwip/debug.h" - -/* - ----------------------------------------------- - ---------- Platform specific locking ---------- - ----------------------------------------------- -*/ - -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#ifndef SYS_LIGHTWEIGHT_PROT -#define SYS_LIGHTWEIGHT_PROT 0 -#endif - -/** - * NO_SYS==1: Provides VERY minimal functionality. Otherwise, - * use lwIP facilities. - */ -#ifndef NO_SYS -#define NO_SYS 1 -#endif - -/** - * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1 - * Mainly for compatibility to old versions. - */ -#ifndef NO_SYS_NO_TIMERS -#define NO_SYS_NO_TIMERS 1 -#endif - -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#ifndef MEMCPY -#define MEMCPY(dst,src,len) memcpy(dst,src,len) -#endif - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#ifndef SMEMCPY -#define SMEMCPY(dst,src,len) memcpy(dst,src,len) -#endif - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#ifndef MEM_LIBC_MALLOC -#define MEM_LIBC_MALLOC 0 -#endif - -/** -* MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. -* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution -* speed and usage from interrupts! -*/ -#ifndef MEMP_MEM_MALLOC -#define MEMP_MEM_MALLOC 0 -#endif - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#ifndef MEM_ALIGNMENT -#define MEM_ALIGNMENT 1 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#ifndef MEM_SIZE -#define MEM_SIZE 1600 -#endif - -/** - * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array. - * This can be used to individually change the location of each pool. - * Default is one big array for all pools - */ -#ifndef MEMP_SEPARATE_POOLS -#define MEMP_SEPARATE_POOLS 0 -#endif - -/** - * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable - * amount of bytes before and after each memp element in every pool and fills - * it with a prominent default value. - * MEMP_OVERFLOW_CHECK == 0 no checking - * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed - * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time - * memp_malloc() or memp_free() is called (useful but slow!) - */ -#ifndef MEMP_OVERFLOW_CHECK -#define MEMP_OVERFLOW_CHECK 0 -#endif - -/** - * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make - * sure that there are no cycles in the linked lists. - */ -#ifndef MEMP_SANITY_CHECK -#define MEMP_SANITY_CHECK 0 -#endif - -/** - * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set - * of memory pools of various sizes. When mem_malloc is called, an element of - * the smallest pool that can provide the length needed is returned. - * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. - */ -#ifndef MEM_USE_POOLS -#define MEM_USE_POOLS 0 -#endif - -/** - * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next - * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more - * reliable. */ -#ifndef MEM_USE_POOLS_TRY_BIGGER_POOL -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 -#endif - -/** - * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h - * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. - */ -#ifndef MEMP_USE_CUSTOM_POOLS -#define MEMP_USE_CUSTOM_POOLS 0 -#endif - -/** - * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from - * interrupt context (or another context that doesn't allow waiting for a - * semaphore). - * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, - * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs - * with each loop so that mem_free can run. - * - * ATTENTION: As you can see from the above description, this leads to dis-/ - * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc - * can need longer. - * - * If you don't want that, at least for NO_SYS=0, you can still use the following - * functions to enqueue a deallocation call which then runs in the tcpip_thread - * context: - * - pbuf_free_callback(p); - * - mem_free_callback(m); - */ -#ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT -#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 -#endif - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ -/** - * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). - * If the application sends a lot of data out of ROM (or other static memory), - * this should be set high. - */ -#ifndef MEMP_NUM_PBUF -#define MEMP_NUM_PBUF 16 -#endif - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#ifndef MEMP_NUM_RAW_PCB -#define MEMP_NUM_RAW_PCB 4 -#endif - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#ifndef MEMP_NUM_UDP_PCB -#define MEMP_NUM_UDP_PCB 4 -#endif - -/** - * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB -#define MEMP_NUM_TCP_PCB 5 -#endif - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB_LISTEN -#define MEMP_NUM_TCP_PCB_LISTEN 8 -#endif - -/** - * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_SEG -#define MEMP_NUM_TCP_SEG 16 -#endif - -/** - * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for - * reassembly (whole packets, not fragments!) - */ -#ifndef MEMP_NUM_REASSDATA -#define MEMP_NUM_REASSDATA 5 -#endif - -/** - * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent - * (fragments, not whole packets!). - * This is only used with IP_FRAG_USES_STATIC_BUF==0 and - * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs - * where the packet is not yet sent when netif->output returns. - */ -#ifndef MEMP_NUM_FRAG_PBUF -#define MEMP_NUM_FRAG_PBUF 15 -#endif - -/** - * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing - * packets (pbufs) that are waiting for an ARP request (to resolve - * their destination address) to finish. - * (requires the ARP_QUEUEING option) - */ -#ifndef MEMP_NUM_ARP_QUEUE -#define MEMP_NUM_ARP_QUEUE 30 -#endif - -/** - * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces - * can be members et the same time (one per netif - allsystems group -, plus one - * per netif membership). - * (requires the LWIP_IGMP option) - */ -#ifndef MEMP_NUM_IGMP_GROUP -#define MEMP_NUM_IGMP_GROUP 8 -#endif - -/** - * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. - * (requires NO_SYS==0) - */ -#ifndef MEMP_NUM_SYS_TIMEOUT -#define MEMP_NUM_SYS_TIMEOUT 3 -#endif - -/** - * MEMP_NUM_NETBUF: the number of struct netbufs. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETBUF -#define MEMP_NUM_NETBUF 2 -#endif - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETCONN -#define MEMP_NUM_NETCONN 4 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_API -#define MEMP_NUM_TCPIP_MSG_API 8 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_INPKT -#define MEMP_NUM_TCPIP_MSG_INPKT 8 -#endif - -/** - * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree. - */ -#ifndef MEMP_NUM_SNMP_NODE -#define MEMP_NUM_SNMP_NODE 50 -#endif - -/** - * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree. - * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least! - */ -#ifndef MEMP_NUM_SNMP_ROOTNODE -#define MEMP_NUM_SNMP_ROOTNODE 30 -#endif - -/** - * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to - * be changed normally) - 2 of these are used per request (1 for input, - * 1 for output) - */ -#ifndef MEMP_NUM_SNMP_VARBIND -#define MEMP_NUM_SNMP_VARBIND 2 -#endif - -/** - * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used - * (does not have to be changed normally) - 3 of these are used per request - * (1 for the value read and 2 for OIDs - input and output) - */ -#ifndef MEMP_NUM_SNMP_VALUE -#define MEMP_NUM_SNMP_VALUE 3 -#endif - -/** - * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls - * (before freeing the corresponding memory using lwip_freeaddrinfo()). - */ -#ifndef MEMP_NUM_NETDB -#define MEMP_NUM_NETDB 1 -#endif - -/** - * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list - * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. - */ -#ifndef MEMP_NUM_LOCALHOSTLIST -#define MEMP_NUM_LOCALHOSTLIST 1 -#endif - -/** - * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE - * interfaces (only used with PPPOE_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOE_INTERFACES -#define MEMP_NUM_PPPOE_INTERFACES 1 -#endif - -/** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. - */ -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 16 -#endif - -/* - --------------------------------- - ---------- ARP options ---------- - --------------------------------- -*/ -/** - * LWIP_ARP==1: Enable ARP functionality. - */ -#ifndef LWIP_ARP -#define LWIP_ARP 1 -#endif - -/** - * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. - */ -#ifndef ARP_TABLE_SIZE -#define ARP_TABLE_SIZE 10 -#endif - -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#ifndef ARP_QUEUEING -#define ARP_QUEUEING 0 -#endif - -/** - * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be - * updated with the source MAC and IP addresses supplied in the packet. - * You may want to disable this if you do not trust LAN peers to have the - * correct addresses, or as a limited approach to attempt to handle - * spoofing. If disabled, lwIP will need to make a new ARP request if - * the peer is not already in the ARP table, adding a little latency. - * The peer *is* in the ARP table if it requested our address before. - * Also notice that this slows down input processing of every IP packet! - */ -#ifndef ETHARP_TRUST_IP_MAC -#define ETHARP_TRUST_IP_MAC 0 -#endif - -/** - * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header. - * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. - * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. - * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. - */ -#ifndef ETHARP_SUPPORT_VLAN -#define ETHARP_SUPPORT_VLAN 0 -#endif - -/** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP - * might be disabled - */ -#ifndef LWIP_ETHERNET -#define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT) -#endif - -/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure - * alignment of payload after that header. Since the header is 14 bytes long, - * without this padding e.g. addresses in the IP header will not be aligned - * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. - */ -#ifndef ETH_PAD_SIZE -#define ETH_PAD_SIZE 0 -#endif - -/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table - * entries (using etharp_add_static_entry/etharp_remove_static_entry). - */ -#ifndef ETHARP_SUPPORT_STATIC_ENTRIES -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 -#endif - - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * IP_FORWARD==1: Enables the ability to forward IP packets across network - * interfaces. If you are going to run lwIP on a device with only one network - * interface, define this to 0. - */ -#ifndef IP_FORWARD -#define IP_FORWARD 0 -#endif - -/** - * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. - * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. - * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). - */ -#ifndef IP_OPTIONS_ALLOWED -#define IP_OPTIONS_ALLOWED 1 -#endif - -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#ifndef IP_REASSEMBLY -#define IP_REASSEMBLY 0 -#endif - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#ifndef IP_FRAG -#define IP_FRAG 1 -#endif - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#ifndef IP_REASS_MAXAGE -#define IP_REASS_MAXAGE 3 -#endif - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#ifndef IP_REASS_MAX_PBUFS -#define IP_REASS_MAX_PBUFS 10 -#endif - -/** - * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP - * fragmentation. Otherwise pbufs are allocated and reference the original - * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1, - * new PBUF_RAM pbufs are used for fragments). - * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs! - */ -#ifndef IP_FRAG_USES_STATIC_BUF -#define IP_FRAG_USES_STATIC_BUF 0 -#endif - -/** - * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer - * (requires IP_FRAG_USES_STATIC_BUF==1) - */ -#if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) -#define IP_FRAG_MAX_MTU 1500 -#endif - -/** - * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. - */ -#ifndef IP_DEFAULT_TTL -#define IP_DEFAULT_TTL 255 -#endif - -/** - * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast - * filter per pcb on udp and raw send operations. To enable broadcast filter - * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. - */ -#ifndef IP_SOF_BROADCAST -#define IP_SOF_BROADCAST 0 -#endif - -/** - * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast - * filter on recv operations. - */ -#ifndef IP_SOF_BROADCAST_RECV -#define IP_SOF_BROADCAST_RECV 0 -#endif - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_ICMP==1: Enable ICMP module inside the IP stack. - * Be careful, disable that make your product non-compliant to RFC1122 - */ -#ifndef LWIP_ICMP -#define LWIP_ICMP 1 -#endif - -/** - * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. - */ -#ifndef ICMP_TTL -#define ICMP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) - */ -#ifndef LWIP_BROADCAST_PING -#define LWIP_BROADCAST_PING 0 -#endif - -/** - * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) - */ -#ifndef LWIP_MULTICAST_PING -#define LWIP_MULTICAST_PING 0 -#endif - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef LWIP_RAW -#define LWIP_RAW 1 -#endif - -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef RAW_TTL -#define RAW_TTL (IP_DEFAULT_TTL) -#endif - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#ifndef LWIP_DHCP -#define LWIP_DHCP 0 -#endif - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#ifndef DHCP_DOES_ARP_CHECK -#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -/** - * LWIP_AUTOIP==1: Enable AUTOIP module. - */ -#ifndef LWIP_AUTOIP -#define LWIP_AUTOIP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on - * the same interface at the same time. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP -#define LWIP_DHCP_AUTOIP_COOP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes - * that should be sent before falling back on AUTOIP. This can be set - * as low as 1 to get an AutoIP address very quickly, but you should - * be prepared to handle a changing IP address when DHCP overrides - * AutoIP. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP_TRIES -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 -#endif - -/* - ---------------------------------- - ---------- SNMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP - * transport. - */ -#ifndef LWIP_SNMP -#define LWIP_SNMP 0 -#endif - -/** - * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will - * allow. At least one request buffer is required. - * Does not have to be changed unless external MIBs answer request asynchronously - */ -#ifndef SNMP_CONCURRENT_REQUESTS -#define SNMP_CONCURRENT_REQUESTS 1 -#endif - -/** - * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap - * destination is required - */ -#ifndef SNMP_TRAP_DESTINATIONS -#define SNMP_TRAP_DESTINATIONS 1 -#endif - -/** - * SNMP_PRIVATE_MIB: - * When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. - */ -#ifndef SNMP_PRIVATE_MIB -#define SNMP_PRIVATE_MIB 0 -#endif - -/** - * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not - * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). - * Unsafe requests are disabled by default! - */ -#ifndef SNMP_SAFE_REQUESTS -#define SNMP_SAFE_REQUESTS 1 -#endif - -/** - * The maximum length of strings used. This affects the size of - * MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_OCTET_STRING_LEN -#define SNMP_MAX_OCTET_STRING_LEN 127 -#endif - -/** - * The maximum depth of the SNMP tree. - * With private MIBs enabled, this depends on your MIB! - * This affects the size of MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_TREE_DEPTH -#define SNMP_MAX_TREE_DEPTH 15 -#endif - -/** - * The size of the MEMP_SNMP_VALUE elements, normally calculated from - * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH. - */ -#ifndef SNMP_MAX_VALUE_SIZE -#define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH)) -#endif - -/* - ---------------------------------- - ---------- IGMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#ifndef LWIP_IGMP -#define LWIP_IGMP 0 -#endif - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#ifndef LWIP_DNS -#define LWIP_DNS 0 -#endif - -/** DNS maximum number of entries to maintain locally. */ -#ifndef DNS_TABLE_SIZE -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#ifndef DNS_MAX_NAME_LENGTH -#define DNS_MAX_NAME_LENGTH 256 -#endif - -/** The maximum of DNS servers */ -#ifndef DNS_MAX_SERVERS -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS do a name checking between the query and the response. */ -#ifndef DNS_DOES_NAME_CHECK -#define DNS_DOES_NAME_CHECK 1 -#endif - -/** DNS message max. size. Default value is RFC compliant. */ -#ifndef DNS_MSG_SIZE -#define DNS_MSG_SIZE 512 -#endif - -/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, - * you have to define - * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}} - * (an array of structs name/address, where address is an u32_t in network - * byte order). - * - * Instead, you can also use an external function: - * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name) - * that returns the IP address or INADDR_NONE if not found. - */ -#ifndef DNS_LOCAL_HOSTLIST -#define DNS_LOCAL_HOSTLIST 0 -#endif /* DNS_LOCAL_HOSTLIST */ - -/** If this is turned on, the local host-list can be dynamically changed - * at runtime. */ -#ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/** - * LWIP_UDP==1: Turn on UDP. - */ -#ifndef LWIP_UDP -#define LWIP_UDP 1 -#endif - -/** - * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) - */ -#ifndef LWIP_UDPLITE -#define LWIP_UDPLITE 0 -#endif - -/** - * UDP_TTL: Default Time-To-Live value. - */ -#ifndef UDP_TTL -#define UDP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. - */ -#ifndef LWIP_NETBUF_RECVINFO -#define LWIP_NETBUF_RECVINFO 0 -#endif - -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ -/** - * LWIP_TCP==1: Turn on TCP. - */ -#ifndef LWIP_TCP -#define LWIP_TCP 1 -#endif - -/** - * TCP_TTL: Default Time-To-Live value. - */ -#ifndef TCP_TTL -#define TCP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * TCP_WND: The size of a TCP window. This must be at least - * (2 * TCP_MSS) for things to work well - */ -#ifndef TCP_WND -#define TCP_WND (4 * TCP_MSS) -#endif - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#ifndef TCP_MAXRTX -#define TCP_MAXRTX 12 -#endif - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#ifndef TCP_SYNMAXRTX -#define TCP_SYNMAXRTX 6 -#endif - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#ifndef TCP_QUEUE_OOSEQ -#define TCP_QUEUE_OOSEQ (LWIP_TCP) -#endif - -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#ifndef TCP_MSS -#define TCP_MSS 536 -#endif - -/** - * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really - * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which - * reflects the available reassembly buffer size at the remote host) and the - * largest size permitted by the IP layer" (RFC 1122) - * Setting this to 1 enables code that checks TCP_MSS against the MTU of the - * netif used for a connection and limits the MSS if it would be too big otherwise. - */ -#ifndef TCP_CALCULATE_EFF_SEND_MSS -#define TCP_CALCULATE_EFF_SEND_MSS 1 -#endif - - -/** - * TCP_SND_BUF: TCP sender buffer space (bytes). - */ -#ifndef TCP_SND_BUF -#define TCP_SND_BUF 256 -#endif - -/** - * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least - * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. - */ -#ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) -#endif - -/** - * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than - * TCP_SND_BUF. It is the amount of space which must be available in the - * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). - */ -#ifndef TCP_SNDLOWAT -#define TCP_SNDLOWAT ((TCP_SND_BUF)/2) -#endif - -/** - * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater - * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below - * this number, select returns writable (combined with TCP_SNDLOWAT). - */ -#ifndef TCP_SNDQUEUELOWAT -#define TCP_SNDQUEUELOWAT ((TCP_SND_QUEUELEN)/2) -#endif - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#ifndef TCP_LISTEN_BACKLOG -#define TCP_LISTEN_BACKLOG 0 -#endif - -/** - * The maximum allowed backlog for TCP listen netconns. - * This backlog is used unless another is explicitly specified. - * 0xff is the maximum (u8_t). - */ -#ifndef TCP_DEFAULT_LISTEN_BACKLOG -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff -#endif - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time in an attempt to create shorter pbuf chains - * for transmission. The meaningful range is 0 to TCP_MSS. Some - * suggested values are: - * - * 0: Disable oversized allocation. Each tcp_write() allocates a new - pbuf (old behaviour). - * 1: Allocate size-aligned pbufs with minimal excess. Use this if your - * scatter-gather DMA requires aligned fragments. - * 128: Limit the pbuf/memory overhead to 20%. - * TCP_MSS: Try to create unfragmented TCP packets. - * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. - */ -#ifndef TCP_OVERSIZE -#define TCP_OVERSIZE TCP_MSS -#endif - -/** - * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. - */ -#ifndef LWIP_TCP_TIMESTAMPS -#define LWIP_TCP_TIMESTAMPS 0 -#endif - -/** - * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an - * explicit window update - */ -#ifndef TCP_WND_UPDATE_THRESHOLD -#define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4) -#endif - -/** - * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. - */ -//#ifndef LWIP_EVENT_API -//#define LWIP_EVENT_API 0 -//#define LWIP_CALLBACK_API 1 -//#else -//#define LWIP_EVENT_API 1 -//#define LWIP_CALLBACK_API 0 -//#endif - - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ -/** - * PBUF_LINK_HLEN: the number of bytes that should be allocated for a - * link level header. The default is 14, the standard value for - * Ethernet. - */ -#ifndef PBUF_LINK_HLEN -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) -#endif - -/** - * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size TCP frame in one pbuf, including - * TCP_MSS, IP header, and link header. - */ -#ifndef PBUF_POOL_BUFSIZE -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) -#endif - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#ifndef LWIP_NETIF_HOSTNAME -#define LWIP_NETIF_HOSTNAME 0 -#endif - -/** - * LWIP_NETIF_API==1: Support netif api (in netifapi.c) - */ -#ifndef LWIP_NETIF_API -#define LWIP_NETIF_API 0 -#endif - -/** - * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface - * changes its up/down status (i.e., due to DHCP IP acquistion) - */ -#ifndef LWIP_NETIF_STATUS_CALLBACK -#define LWIP_NETIF_STATUS_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface - * whenever the link changes (i.e., link down) - */ -#ifndef LWIP_NETIF_LINK_CALLBACK -#define LWIP_NETIF_LINK_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table - * indices) in struct netif. TCP and UDP can make use of this to prevent - * scanning the ARP table for every sent packet. While this is faster for big - * ARP tables or many concurrent connections, it might be counterproductive - * if you have a tiny ARP table or if there never are concurrent connections. - */ -#ifndef LWIP_NETIF_HWADDRHINT -#define LWIP_NETIF_HWADDRHINT 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#ifndef LWIP_NETIF_LOOPBACK -#define LWIP_NETIF_LOOPBACK 1 -#endif - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#ifndef LWIP_LOOPBACK_MAX_PBUFS -#define LWIP_LOOPBACK_MAX_PBUFS 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in - * the system, as netifs must change how they behave depending on this setting - * for the LWIP_NETIF_LOOPBACK option to work. - * Setting this is needed to avoid reentering non-reentrant functions like - * tcp_input(). - * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a - * multithreaded environment like tcpip.c. In this case, netif->input() - * is called directly. - * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. - * The packets are put on a list and netif_poll() must be called in - * the main application loop. - */ -#ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) -#endif - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#ifndef LWIP_NETIF_TX_SINGLE_PBUF -#define LWIP_NETIF_TX_SINGLE_PBUF 0 -#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c - */ -#ifndef LWIP_HAVE_LOOPIF -#define LWIP_HAVE_LOOPIF 1 -#endif - -/* - ------------------------------------ - ---------- SLIPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c - */ -#ifndef LWIP_HAVE_SLIPIF -#define LWIP_HAVE_SLIPIF 0 -#endif - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#ifndef TCPIP_THREAD_NAME -#define TCPIP_THREAD_NAME "tcpip_thread" -#endif - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_STACKSIZE -#define TCPIP_THREAD_STACKSIZE 0 -#endif - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_PRIO -#define TCPIP_THREAD_PRIO 1 -#endif - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#ifndef TCPIP_MBOX_SIZE -#define TCPIP_MBOX_SIZE 0 -#endif - -/** - * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. - */ -#ifndef SLIPIF_THREAD_NAME -#define SLIPIF_THREAD_NAME "slipif_loop" -#endif - -/** - * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_STACKSIZE -#define SLIPIF_THREAD_STACKSIZE 0 -#endif - -/** - * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_PRIO -#define SLIPIF_THREAD_PRIO 1 -#endif - -/** - * PPP_THREAD_NAME: The name assigned to the pppInputThread. - */ -#ifndef PPP_THREAD_NAME -#define PPP_THREAD_NAME "pppInputThread" -#endif - -/** - * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_STACKSIZE -#define PPP_THREAD_STACKSIZE 0 -#endif - -/** - * PPP_THREAD_PRIO: The priority assigned to the pppInputThread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_PRIO -#define PPP_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. - */ -#ifndef DEFAULT_THREAD_NAME -#define DEFAULT_THREAD_NAME "lwIP" -#endif - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_STACKSIZE -#define DEFAULT_THREAD_STACKSIZE 0 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_PRIO -#define DEFAULT_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_RAW_RECVMBOX_SIZE -#define DEFAULT_RAW_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_UDP_RECVMBOX_SIZE -#define DEFAULT_UDP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_TCP_RECVMBOX_SIZE -#define DEFAULT_TCP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#ifndef DEFAULT_ACCEPTMBOX_SIZE -#define DEFAULT_ACCEPTMBOX_SIZE 0 -#endif - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING -#define LWIP_TCPIP_CORE_LOCKING 0 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING_INPUT -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 -#endif - -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#ifndef LWIP_NETCONN -#define LWIP_NETCONN 0 -#endif - -/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create - * timers running in tcpip_thread from another thread. - */ -#ifndef LWIP_TCPIP_TIMEOUT -#define LWIP_TCPIP_TIMEOUT 1 -#endif - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#ifndef LWIP_SOCKET -#define LWIP_SOCKET 0 -#endif - -/** - * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. - * (only used if you use sockets.c) - */ -#ifndef LWIP_COMPAT_SOCKETS -#define LWIP_COMPAT_SOCKETS 1 -#endif - -/** - * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. - * Disable this option if you use a POSIX operating system that uses the same - * names (read, write & close). (only used if you use sockets.c) - */ -#ifndef LWIP_POSIX_SOCKETS_IO_NAMES -#define LWIP_POSIX_SOCKETS_IO_NAMES 1 -#endif - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#ifndef LWIP_TCP_KEEPALIVE -#define LWIP_TCP_KEEPALIVE 0 -#endif - -/** - * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. - */ -#ifndef LWIP_SO_RCVTIMEO -#define LWIP_SO_RCVTIMEO 0 -#endif - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#ifndef LWIP_SO_RCVBUF -#define LWIP_SO_RCVBUF 0 -#endif - -/** - * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. - */ -#ifndef RECV_BUFSIZE_DEFAULT -#define RECV_BUFSIZE_DEFAULT INT_MAX -#endif - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - */ -#ifndef SO_REUSE -#define SO_REUSE 0 -#endif - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#ifndef SO_REUSE_RXTOALL -#define SO_REUSE_RXTOALL 0 -#endif - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#ifndef LWIP_STATS -#define LWIP_STATS 1 -#endif - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#ifndef LWIP_STATS_DISPLAY -#define LWIP_STATS_DISPLAY 0 -#endif - -/** - * LINK_STATS==1: Enable link stats. - */ -#ifndef LINK_STATS -#define LINK_STATS 1 -#endif - -/** - * ETHARP_STATS==1: Enable etharp stats. - */ -#ifndef ETHARP_STATS -#define ETHARP_STATS (LWIP_ARP) -#endif - -/** - * IP_STATS==1: Enable IP stats. - */ -#ifndef IP_STATS -#define IP_STATS 1 -#endif - -/** - * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is - * on if using either frag or reass. - */ -#ifndef IPFRAG_STATS -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) -#endif - -/** - * ICMP_STATS==1: Enable ICMP stats. - */ -#ifndef ICMP_STATS -#define ICMP_STATS 1 -#endif - -/** - * IGMP_STATS==1: Enable IGMP stats. - */ -#ifndef IGMP_STATS -#define IGMP_STATS (LWIP_IGMP) -#endif - -/** - * UDP_STATS==1: Enable UDP stats. Default is on if - * UDP enabled, otherwise off. - */ -#ifndef UDP_STATS -#define UDP_STATS (LWIP_UDP) -#endif - -/** - * TCP_STATS==1: Enable TCP stats. Default is on if TCP - * enabled, otherwise off. - */ -#ifndef TCP_STATS -#define TCP_STATS (LWIP_TCP) -#endif - -/** - * MEM_STATS==1: Enable mem.c stats. - */ -#ifndef MEM_STATS -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) -#endif - -/** - * MEMP_STATS==1: Enable memp.c pool stats. - */ -#ifndef MEMP_STATS -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) -#endif - -/** - * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). - */ -#ifndef SYS_STATS -#define SYS_STATS (NO_SYS == 0) -#endif - -#else - -#define LINK_STATS 0 -#define IP_STATS 0 -#define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define IGMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define SYS_STATS 0 -#define LWIP_STATS_DISPLAY 0 - -#endif /* LWIP_STATS */ - -/* - --------------------------------- - ---------- PPP options ---------- - --------------------------------- -*/ -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#ifndef PPP_SUPPORT -#define PPP_SUPPORT 0 -#endif - -/** - * PPPOE_SUPPORT==1: Enable PPP Over Ethernet - */ -#ifndef PPPOE_SUPPORT -#define PPPOE_SUPPORT 0 -#endif - -/** - * PPPOS_SUPPORT==1: Enable PPP Over Serial - */ -#ifndef PPPOS_SUPPORT -#define PPPOS_SUPPORT PPP_SUPPORT -#endif - -#if PPP_SUPPORT - -/** - * NUM_PPP: Max PPP sessions. - */ -#ifndef NUM_PPP -#define NUM_PPP 1 -#endif - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#ifndef PAP_SUPPORT -#define PAP_SUPPORT 0 -#endif - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#ifndef CHAP_SUPPORT -#define CHAP_SUPPORT 0 -#endif - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 0 -#endif - -/** - * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CBCP_SUPPORT -#define CBCP_SUPPORT 0 -#endif - -/** - * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CCP_SUPPORT -#define CCP_SUPPORT 0 -#endif - -/** - * VJ_SUPPORT==1: Support VJ header compression. - */ -#ifndef VJ_SUPPORT -#define VJ_SUPPORT 0 -#endif - -/** - * MD5_SUPPORT==1: Support MD5 (see also CHAP). - */ -#ifndef MD5_SUPPORT -#define MD5_SUPPORT 0 -#endif - -/* - * Timeouts - */ -#ifndef FSM_DEFTIMEOUT -#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef FSM_DEFMAXTERMREQS -#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXCONFREQS -#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXNAKLOOPS -#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ -#endif - -#ifndef UPAP_DEFTIMEOUT -#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ -#endif - -#ifndef UPAP_DEFREQTIME -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#endif - -#ifndef CHAP_DEFTIMEOUT -#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef CHAP_DEFTRANSMITS -#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ -#endif - -/* Interval in seconds between keepalive echo requests, 0 to disable. */ -#ifndef LCP_ECHOINTERVAL -#define LCP_ECHOINTERVAL 0 -#endif - -/* Number of unanswered echo requests before failure. */ -#ifndef LCP_MAXECHOFAILS -#define LCP_MAXECHOFAILS 3 -#endif - -/* Max Xmit idle time (in jiffies) before resend flag char. */ -#ifndef PPP_MAXIDLEFLAG -#define PPP_MAXIDLEFLAG 100 -#endif - -/* - * Packet sizes - * - * Note - lcp shouldn't be allowed to negotiate stuff outside these - * limits. See lcp.h in the pppd directory. - * (XXX - these constants should simply be shared by lcp.c instead - * of living in lcp.h) - */ -#define PPP_MTU 1500 /* Default MTU (size of Info field) */ -#ifndef PPP_MAXMTU -/* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */ -#define PPP_MAXMTU 1500 /* Largest MTU we allow */ -#endif -#define PPP_MINMTU 64 -#define PPP_MRU 1500 /* default MRU = max length of info field */ -#define PPP_MAXMRU 1500 /* Largest MRU we allow */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 296 /* Try for this */ -#endif -#define PPP_MINMRU 128 /* No MRUs below this */ - -#ifndef MAXNAMELEN -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ -#endif -#ifndef MAXSECRETLEN -#define MAXSECRETLEN 256 /* max length of password or secret */ -#endif - -#endif /* PPP_SUPPORT */ - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ -/** - * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. - */ -#ifndef CHECKSUM_GEN_IP -#define CHECKSUM_GEN_IP 1 -#endif - -/** - * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. - */ -#ifndef CHECKSUM_GEN_UDP -#define CHECKSUM_GEN_UDP 1 -#endif - -/** - * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. - */ -#ifndef CHECKSUM_GEN_TCP -#define CHECKSUM_GEN_TCP 1 -#endif - -/** - * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. - */ -#ifndef CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 1 -#endif - -/** - * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. - */ -#ifndef CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 1 -#endif - -/** - * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. - */ -#ifndef CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 1 -#endif - -/** - * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from - * application buffers to pbufs. - */ -#ifndef LWIP_CHECKSUM_ON_COPY -#define LWIP_CHECKSUM_ON_COPY 0 -#endif - -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - */ -#ifndef LWIP_DBG_MIN_LEVEL -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL -#endif - -/** - * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable - * debug messages of certain types. - */ -#ifndef LWIP_DBG_TYPES_ON -#define LWIP_DBG_TYPES_ON LWIP_DBG_ON -#endif - -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#ifndef ETHARP_DEBUG -#define ETHARP_DEBUG LWIP_DBG_OFF -#endif - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#ifndef NETIF_DEBUG -#define NETIF_DEBUG LWIP_DBG_OFF -#endif - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#ifndef PBUF_DEBUG -#define PBUF_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#ifndef API_LIB_DEBUG -#define API_LIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_MSG_DEBUG: Enable debugging in api_msg.c. - */ -#ifndef API_MSG_DEBUG -#define API_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#ifndef SOCKETS_DEBUG -#define SOCKETS_DEBUG LWIP_DBG_OFF -#endif - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#ifndef ICMP_DEBUG -#define ICMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IGMP_DEBUG: Enable debugging in igmp.c. - */ -#ifndef IGMP_DEBUG -#define IGMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * INET_DEBUG: Enable debugging in inet.c. - */ -#ifndef INET_DEBUG -#define INET_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#ifndef IP_DEBUG -#define IP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. - */ -#ifndef IP_REASS_DEBUG -#define IP_REASS_DEBUG LWIP_DBG_OFF -#endif - -/** - * RAW_DEBUG: Enable debugging in raw.c. - */ -#ifndef RAW_DEBUG -#define RAW_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEM_DEBUG: Enable debugging in mem.c. - */ -#ifndef MEM_DEBUG -#define MEM_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#ifndef MEMP_DEBUG -#define MEMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SYS_DEBUG: Enable debugging in sys.c. - */ -#ifndef SYS_DEBUG -#define SYS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TIMERS_DEBUG: Enable debugging in timers.c. - */ -#ifndef TIMERS_DEBUG -#define TIMERS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_DEBUG: Enable debugging for TCP. - */ -#ifndef TCP_DEBUG -#define TCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#ifndef TCP_INPUT_DEBUG -#define TCP_INPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. - */ -#ifndef TCP_FR_DEBUG -#define TCP_FR_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit - * timeout. - */ -#ifndef TCP_RTO_DEBUG -#define TCP_RTO_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. - */ -#ifndef TCP_CWND_DEBUG -#define TCP_CWND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. - */ -#ifndef TCP_WND_DEBUG -#define TCP_WND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#ifndef TCP_OUTPUT_DEBUG -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. - */ -#ifndef TCP_RST_DEBUG -#define TCP_RST_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. - */ -#ifndef TCP_QLEN_DEBUG -#define TCP_QLEN_DEBUG LWIP_DBG_OFF -#endif - -/** - * UDP_DEBUG: Enable debugging in UDP. - */ -#ifndef UDP_DEBUG -#define UDP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#ifndef TCPIP_DEBUG -#define TCPIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#ifndef PPP_DEBUG -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SLIP_DEBUG: Enable debugging in slipif.c. - */ -#ifndef SLIP_DEBUG -#define SLIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#ifndef DHCP_DEBUG -#define DHCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * AUTOIP_DEBUG: Enable debugging in autoip.c. - */ -#ifndef AUTOIP_DEBUG -#define AUTOIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. - */ -#ifndef SNMP_MSG_DEBUG -#define SNMP_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. - */ -#ifndef SNMP_MIB_DEBUG -#define SNMP_MIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * DNS_DEBUG: Enable debugging for DNS. - */ -#ifndef DNS_DEBUG -#define DNS_DEBUG LWIP_DBG_OFF -#endif - -#endif /* __LWIP_OPT_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/pbuf.h b/sparkfun/esp8266/firmwares/loader/src/lwip/pbuf.h deleted file mode 100644 index 3d24db4d..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/pbuf.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -#ifndef __LWIP_PBUF_H__ -#define __LWIP_PBUF_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Currently, the pbuf_custom code is only needed for one specific configuration - * of IP_FRAG */ -#define LWIP_SUPPORT_CUSTOM_PBUF (IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) - -#define PBUF_TRANSPORT_HLEN 20 -#define PBUF_IP_HLEN 20 - -typedef enum { - PBUF_TRANSPORT, - PBUF_IP, - PBUF_LINK, - PBUF_RAW -} pbuf_layer; - -typedef enum { - PBUF_RAM, /* pbuf data is stored in RAM */ - PBUF_ROM, /* pbuf data is stored in ROM */ - PBUF_REF, /* pbuf comes from the pbuf pool */ - PBUF_POOL, /* pbuf payload refers to RAM */ -#ifdef EBUF_LWIP - PBUF_ESF_RX /* pbuf payload is from WLAN */ -#endif /* ESF_LWIP */ -} pbuf_type; - - -/** indicates this packet's data should be immediately passed to the application */ -#define PBUF_FLAG_PUSH 0x01U -/** indicates this is a custom pbuf: pbuf_free and pbuf_header handle such a - a pbuf differently */ -#define PBUF_FLAG_IS_CUSTOM 0x02U -/** indicates this pbuf is UDP multicast to be looped back */ -#define PBUF_FLAG_MCASTLOOP 0x04U - -struct pbuf { - /** next pbuf in singly linked pbuf chain */ - struct pbuf *next; - - /** pointer to the actual data in the buffer */ - void *payload; - - /** - * total length of this buffer and all next buffers in chain - * belonging to the same packet. - * - * For non-queue packet chains this is the invariant: - * p->tot_len == p->len + (p->next? p->next->tot_len: 0) - */ - u16_t tot_len; - - /** length of this buffer */ - u16_t len; - - /** pbuf_type as u8_t instead of enum to save space */ - u8_t /*pbuf_type*/ type; - - /** misc flags */ - u8_t flags; - - /** - * the reference count always equals the number of pointers - * that refer to this pbuf. This can be pointers from an application, - * the stack itself, or pbuf->next pointers from a chain. - */ - u16_t ref; - - /* add a pointer for esf_buf */ - void * eb; -}; - -#if LWIP_SUPPORT_CUSTOM_PBUF -/** Prototype for a function to free a custom pbuf */ -typedef void (*pbuf_free_custom_fn)(struct pbuf *p); - -/** A custom pbuf: like a pbuf, but following a function pointer to free it. */ -struct pbuf_custom { - /** The actual pbuf */ - struct pbuf pbuf; - /** This function is called when pbuf_free deallocates this pbuf(_custom) */ - pbuf_free_custom_fn custom_free_function; -}; -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ - -/* Initializes the pbuf module. This call is empty for now, but may not be in future. */ -#define pbuf_init() - -struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type)ICACHE_FLASH_ATTR; -#if LWIP_SUPPORT_CUSTOM_PBUF -struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, - struct pbuf_custom *p, void *payload_mem, - u16_t payload_mem_len)ICACHE_FLASH_ATTR; -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -void pbuf_realloc(struct pbuf *p, u16_t size)ICACHE_FLASH_ATTR; -u8_t pbuf_header(struct pbuf *p, s16_t header_size)ICACHE_FLASH_ATTR; -void pbuf_ref(struct pbuf *p)ICACHE_FLASH_ATTR; -u8_t pbuf_free(struct pbuf *p)ICACHE_FLASH_ATTR; -u8_t pbuf_clen(struct pbuf *p)ICACHE_FLASH_ATTR; -void pbuf_cat(struct pbuf *head, struct pbuf *tail)ICACHE_FLASH_ATTR; -void pbuf_chain(struct pbuf *head, struct pbuf *tail)ICACHE_FLASH_ATTR; -struct pbuf *pbuf_dechain(struct pbuf *p)ICACHE_FLASH_ATTR; -err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)ICACHE_FLASH_ATTR; -u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset)ICACHE_FLASH_ATTR; -err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)ICACHE_FLASH_ATTR; -struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer)ICACHE_FLASH_ATTR; -#if LWIP_CHECKSUM_ON_COPY -err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr, - u16_t len, u16_t *chksum)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHECKSUM_ON_COPY */ - -u8_t pbuf_get_at(struct pbuf* p, u16_t offset)ICACHE_FLASH_ATTR; -u16_t pbuf_memcmp(struct pbuf* p, u16_t offset, const void* s2, u16_t n)ICACHE_FLASH_ATTR; -u16_t pbuf_memfind(struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset)ICACHE_FLASH_ATTR; -u16_t pbuf_strstr(struct pbuf* p, const char* substr)ICACHE_FLASH_ATTR; - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_PBUF_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/raw.h b/sparkfun/esp8266/firmwares/loader/src/lwip/raw.h deleted file mode 100644 index c9c40871..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/raw.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_RAW_H__ -#define __LWIP_RAW_H__ - -#include "lwip/opt.h" - -#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/def.h" -#include "lwip/ip.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct raw_pcb; - -/** Function prototype for raw pcb receive callback functions. - * @param arg user supplied argument (raw_pcb.recv_arg) - * @param pcb the raw_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @return 1 if the packet was 'eaten' (aka. deleted), - * 0 if the packet lives on - * If returning 1, the callback is responsible for freeing the pbuf - * if it's not used any more. - */ -typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, - ip_addr_t *addr); - -struct raw_pcb { - /* Common members of all PCB types */ - IP_PCB; - - struct raw_pcb *next; - - u8_t protocol; - - /** receive callback function */ - raw_recv_fn recv; - /* user-supplied argument for the recv callback */ - void *recv_arg; -}; - -/* The following functions is the application layer interface to the - RAW code. */ -struct raw_pcb * raw_new (u8_t proto)ICACHE_FLASH_ATTR; -void raw_remove (struct raw_pcb *pcb)ICACHE_FLASH_ATTR; -err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; - -void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg)ICACHE_FLASH_ATTR; -err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); - -/* The following functions are the lower layer interface to RAW. */ -u8_t raw_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -#define raw_init() /* Compatibility define, not init needed. */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_RAW */ - -#endif /* __LWIP_RAW_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/sio.h b/sparkfun/esp8266/firmwares/loader/src/lwip/sio.h deleted file mode 100644 index 228c8577..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/sio.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - */ - -/* - * This is the interface to the platform specific serial IO module - * It needs to be implemented by those platforms which need SLIP or PPP - */ - -#ifndef __SIO_H__ -#define __SIO_H__ - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* If you want to define sio_fd_t elsewhere or differently, - define this in your cc.h file. */ -#ifndef __sio_fd_t_defined -typedef void * sio_fd_t; -#endif - -/* The following functions can be defined to something else in your cc.h file - or be implemented in your custom sio.c file. */ - -#ifndef sio_open -/** - * Opens a serial device for communication. - * - * @param devnum device number - * @return handle to serial device if successful, NULL otherwise - */ -sio_fd_t sio_open(u8_t devnum)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_send -/** - * Sends a single character to the serial device. - * - * @param c character to send - * @param fd serial device handle - * - * @note This function will block until the character can be sent. - */ -void sio_send(u8_t c, sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_recv -/** - * Receives a single character from the serial device. - * - * @param fd serial device handle - * - * @note This function will block until a character is received. - */ -u8_t sio_recv(sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_read -/** - * Reads from the serial device. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - may be 0 if aborted by sio_read_abort - * - * @note This function will block until data can be received. The blocking - * can be cancelled by calling sio_read_abort(). - */ -u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_tryread -/** - * Tries to read from the serial device. Same as sio_read but returns - * immediately if no data is available and never blocks. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - */ -u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_write -/** - * Writes to the serial device. - * - * @param fd serial device handle - * @param data pointer to data to send - * @param len length (in bytes) of data to send - * @return number of bytes actually sent - * - * @note This function will block until all data can be sent. - */ -u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_read_abort -/** - * Aborts a blocking sio_read() call. - * - * @param fd serial device handle - */ -void sio_read_abort(sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __SIO_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/snmp.h deleted file mode 100644 index 2ed043dd..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp.h +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 2001, 2002 Leon Woestenberg - * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Leon Woestenberg - * - */ -#ifndef __LWIP_SNMP_H__ -#define __LWIP_SNMP_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lwip/ip_addr.h" - -struct udp_pcb; -struct netif; - -/** - * @see RFC1213, "MIB-II, 6. Definitions" - */ -enum snmp_ifType { - snmp_ifType_other=1, /* none of the following */ - snmp_ifType_regular1822, - snmp_ifType_hdh1822, - snmp_ifType_ddn_x25, - snmp_ifType_rfc877_x25, - snmp_ifType_ethernet_csmacd, - snmp_ifType_iso88023_csmacd, - snmp_ifType_iso88024_tokenBus, - snmp_ifType_iso88025_tokenRing, - snmp_ifType_iso88026_man, - snmp_ifType_starLan, - snmp_ifType_proteon_10Mbit, - snmp_ifType_proteon_80Mbit, - snmp_ifType_hyperchannel, - snmp_ifType_fddi, - snmp_ifType_lapb, - snmp_ifType_sdlc, - snmp_ifType_ds1, /* T-1 */ - snmp_ifType_e1, /* european equiv. of T-1 */ - snmp_ifType_basicISDN, - snmp_ifType_primaryISDN, /* proprietary serial */ - snmp_ifType_propPointToPointSerial, - snmp_ifType_ppp, - snmp_ifType_softwareLoopback, - snmp_ifType_eon, /* CLNP over IP [11] */ - snmp_ifType_ethernet_3Mbit, - snmp_ifType_nsip, /* XNS over IP */ - snmp_ifType_slip, /* generic SLIP */ - snmp_ifType_ultra, /* ULTRA technologies */ - snmp_ifType_ds3, /* T-3 */ - snmp_ifType_sip, /* SMDS */ - snmp_ifType_frame_relay -}; - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -/** SNMP "sysuptime" Interval */ -#define SNMP_SYSUPTIME_INTERVAL 10 - -/** fixed maximum length for object identifier type */ -#define LWIP_SNMP_OBJ_ID_LEN 32 - -/** internal object identifier representation */ -struct snmp_obj_id -{ - u8_t len; - s32_t id[LWIP_SNMP_OBJ_ID_LEN]; -}; - -/* system */ -void snmp_set_sysdesr(u8_t* str, u8_t* len); -void snmp_set_sysobjid(struct snmp_obj_id *oid); -void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid); -void snmp_inc_sysuptime(void); -void snmp_add_sysuptime(u32_t value); -void snmp_get_sysuptime(u32_t *value); -void snmp_set_syscontact(u8_t *ocstr, u8_t *ocstrlen); -void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen); -void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen); - -/* network interface */ -void snmp_add_ifinoctets(struct netif *ni, u32_t value); -void snmp_inc_ifinucastpkts(struct netif *ni); -void snmp_inc_ifinnucastpkts(struct netif *ni); -void snmp_inc_ifindiscards(struct netif *ni); -void snmp_add_ifoutoctets(struct netif *ni, u32_t value); -void snmp_inc_ifoutucastpkts(struct netif *ni); -void snmp_inc_ifoutnucastpkts(struct netif *ni); -void snmp_inc_ifoutdiscards(struct netif *ni); -void snmp_inc_iflist(void); -void snmp_dec_iflist(void); - -/* ARP (for atTable and ipNetToMediaTable) */ -void snmp_insert_arpidx_tree(struct netif *ni, ip_addr_t *ip); -void snmp_delete_arpidx_tree(struct netif *ni, ip_addr_t *ip); - -/* IP */ -void snmp_inc_ipinreceives(void); -void snmp_inc_ipinhdrerrors(void); -void snmp_inc_ipinaddrerrors(void); -void snmp_inc_ipforwdatagrams(void); -void snmp_inc_ipinunknownprotos(void); -void snmp_inc_ipindiscards(void); -void snmp_inc_ipindelivers(void); -void snmp_inc_ipoutrequests(void); -void snmp_inc_ipoutdiscards(void); -void snmp_inc_ipoutnoroutes(void); -void snmp_inc_ipreasmreqds(void); -void snmp_inc_ipreasmoks(void); -void snmp_inc_ipreasmfails(void); -void snmp_inc_ipfragoks(void); -void snmp_inc_ipfragfails(void); -void snmp_inc_ipfragcreates(void); -void snmp_inc_iproutingdiscards(void); -void snmp_insert_ipaddridx_tree(struct netif *ni); -void snmp_delete_ipaddridx_tree(struct netif *ni); -void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni); -void snmp_delete_iprteidx_tree(u8_t dflt, struct netif *ni); - -/* ICMP */ -void snmp_inc_icmpinmsgs(void); -void snmp_inc_icmpinerrors(void); -void snmp_inc_icmpindestunreachs(void); -void snmp_inc_icmpintimeexcds(void); -void snmp_inc_icmpinparmprobs(void); -void snmp_inc_icmpinsrcquenchs(void); -void snmp_inc_icmpinredirects(void); -void snmp_inc_icmpinechos(void); -void snmp_inc_icmpinechoreps(void); -void snmp_inc_icmpintimestamps(void); -void snmp_inc_icmpintimestampreps(void); -void snmp_inc_icmpinaddrmasks(void); -void snmp_inc_icmpinaddrmaskreps(void); -void snmp_inc_icmpoutmsgs(void); -void snmp_inc_icmpouterrors(void); -void snmp_inc_icmpoutdestunreachs(void); -void snmp_inc_icmpouttimeexcds(void); -void snmp_inc_icmpoutparmprobs(void); -void snmp_inc_icmpoutsrcquenchs(void); -void snmp_inc_icmpoutredirects(void); -void snmp_inc_icmpoutechos(void); -void snmp_inc_icmpoutechoreps(void); -void snmp_inc_icmpouttimestamps(void); -void snmp_inc_icmpouttimestampreps(void); -void snmp_inc_icmpoutaddrmasks(void); -void snmp_inc_icmpoutaddrmaskreps(void); - -/* TCP */ -void snmp_inc_tcpactiveopens(void); -void snmp_inc_tcppassiveopens(void); -void snmp_inc_tcpattemptfails(void); -void snmp_inc_tcpestabresets(void); -void snmp_inc_tcpinsegs(void); -void snmp_inc_tcpoutsegs(void); -void snmp_inc_tcpretranssegs(void); -void snmp_inc_tcpinerrs(void); -void snmp_inc_tcpoutrsts(void); - -/* UDP */ -void snmp_inc_udpindatagrams(void); -void snmp_inc_udpnoports(void); -void snmp_inc_udpinerrors(void); -void snmp_inc_udpoutdatagrams(void); -void snmp_insert_udpidx_tree(struct udp_pcb *pcb); -void snmp_delete_udpidx_tree(struct udp_pcb *pcb); - -/* SNMP */ -void snmp_inc_snmpinpkts(void); -void snmp_inc_snmpoutpkts(void); -void snmp_inc_snmpinbadversions(void); -void snmp_inc_snmpinbadcommunitynames(void); -void snmp_inc_snmpinbadcommunityuses(void); -void snmp_inc_snmpinasnparseerrs(void); -void snmp_inc_snmpintoobigs(void); -void snmp_inc_snmpinnosuchnames(void); -void snmp_inc_snmpinbadvalues(void); -void snmp_inc_snmpinreadonlys(void); -void snmp_inc_snmpingenerrs(void); -void snmp_add_snmpintotalreqvars(u8_t value); -void snmp_add_snmpintotalsetvars(u8_t value); -void snmp_inc_snmpingetrequests(void); -void snmp_inc_snmpingetnexts(void); -void snmp_inc_snmpinsetrequests(void); -void snmp_inc_snmpingetresponses(void); -void snmp_inc_snmpintraps(void); -void snmp_inc_snmpouttoobigs(void); -void snmp_inc_snmpoutnosuchnames(void); -void snmp_inc_snmpoutbadvalues(void); -void snmp_inc_snmpoutgenerrs(void); -void snmp_inc_snmpoutgetrequests(void); -void snmp_inc_snmpoutgetnexts(void); -void snmp_inc_snmpoutsetrequests(void); -void snmp_inc_snmpoutgetresponses(void); -void snmp_inc_snmpouttraps(void); -void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid); -void snmp_set_snmpenableauthentraps(u8_t *value); -void snmp_get_snmpenableauthentraps(u8_t *value); - -/* LWIP_SNMP support not available */ -/* define everything to be empty */ -#else - -/* system */ -#define snmp_set_sysdesr(str, len) -#define snmp_set_sysobjid(oid); -#define snmp_get_sysobjid_ptr(oid) -#define snmp_inc_sysuptime() -#define snmp_add_sysuptime(value) -#define snmp_get_sysuptime(value) -#define snmp_set_syscontact(ocstr, ocstrlen); -#define snmp_set_sysname(ocstr, ocstrlen); -#define snmp_set_syslocation(ocstr, ocstrlen); - -/* network interface */ -#define snmp_add_ifinoctets(ni,value) -#define snmp_inc_ifinucastpkts(ni) -#define snmp_inc_ifinnucastpkts(ni) -#define snmp_inc_ifindiscards(ni) -#define snmp_add_ifoutoctets(ni,value) -#define snmp_inc_ifoutucastpkts(ni) -#define snmp_inc_ifoutnucastpkts(ni) -#define snmp_inc_ifoutdiscards(ni) -#define snmp_inc_iflist() -#define snmp_dec_iflist() - -/* ARP */ -#define snmp_insert_arpidx_tree(ni,ip) -#define snmp_delete_arpidx_tree(ni,ip) - -/* IP */ -#define snmp_inc_ipinreceives() -#define snmp_inc_ipinhdrerrors() -#define snmp_inc_ipinaddrerrors() -#define snmp_inc_ipforwdatagrams() -#define snmp_inc_ipinunknownprotos() -#define snmp_inc_ipindiscards() -#define snmp_inc_ipindelivers() -#define snmp_inc_ipoutrequests() -#define snmp_inc_ipoutdiscards() -#define snmp_inc_ipoutnoroutes() -#define snmp_inc_ipreasmreqds() -#define snmp_inc_ipreasmoks() -#define snmp_inc_ipreasmfails() -#define snmp_inc_ipfragoks() -#define snmp_inc_ipfragfails() -#define snmp_inc_ipfragcreates() -#define snmp_inc_iproutingdiscards() -#define snmp_insert_ipaddridx_tree(ni) -#define snmp_delete_ipaddridx_tree(ni) -#define snmp_insert_iprteidx_tree(dflt, ni) -#define snmp_delete_iprteidx_tree(dflt, ni) - -/* ICMP */ -#define snmp_inc_icmpinmsgs() -#define snmp_inc_icmpinerrors() -#define snmp_inc_icmpindestunreachs() -#define snmp_inc_icmpintimeexcds() -#define snmp_inc_icmpinparmprobs() -#define snmp_inc_icmpinsrcquenchs() -#define snmp_inc_icmpinredirects() -#define snmp_inc_icmpinechos() -#define snmp_inc_icmpinechoreps() -#define snmp_inc_icmpintimestamps() -#define snmp_inc_icmpintimestampreps() -#define snmp_inc_icmpinaddrmasks() -#define snmp_inc_icmpinaddrmaskreps() -#define snmp_inc_icmpoutmsgs() -#define snmp_inc_icmpouterrors() -#define snmp_inc_icmpoutdestunreachs() -#define snmp_inc_icmpouttimeexcds() -#define snmp_inc_icmpoutparmprobs() -#define snmp_inc_icmpoutsrcquenchs() -#define snmp_inc_icmpoutredirects() -#define snmp_inc_icmpoutechos() -#define snmp_inc_icmpoutechoreps() -#define snmp_inc_icmpouttimestamps() -#define snmp_inc_icmpouttimestampreps() -#define snmp_inc_icmpoutaddrmasks() -#define snmp_inc_icmpoutaddrmaskreps() -/* TCP */ -#define snmp_inc_tcpactiveopens() -#define snmp_inc_tcppassiveopens() -#define snmp_inc_tcpattemptfails() -#define snmp_inc_tcpestabresets() -#define snmp_inc_tcpinsegs() -#define snmp_inc_tcpoutsegs() -#define snmp_inc_tcpretranssegs() -#define snmp_inc_tcpinerrs() -#define snmp_inc_tcpoutrsts() - -/* UDP */ -#define snmp_inc_udpindatagrams() -#define snmp_inc_udpnoports() -#define snmp_inc_udpinerrors() -#define snmp_inc_udpoutdatagrams() -#define snmp_insert_udpidx_tree(pcb) -#define snmp_delete_udpidx_tree(pcb) - -/* SNMP */ -#define snmp_inc_snmpinpkts() -#define snmp_inc_snmpoutpkts() -#define snmp_inc_snmpinbadversions() -#define snmp_inc_snmpinbadcommunitynames() -#define snmp_inc_snmpinbadcommunityuses() -#define snmp_inc_snmpinasnparseerrs() -#define snmp_inc_snmpintoobigs() -#define snmp_inc_snmpinnosuchnames() -#define snmp_inc_snmpinbadvalues() -#define snmp_inc_snmpinreadonlys() -#define snmp_inc_snmpingenerrs() -#define snmp_add_snmpintotalreqvars(value) -#define snmp_add_snmpintotalsetvars(value) -#define snmp_inc_snmpingetrequests() -#define snmp_inc_snmpingetnexts() -#define snmp_inc_snmpinsetrequests() -#define snmp_inc_snmpingetresponses() -#define snmp_inc_snmpintraps() -#define snmp_inc_snmpouttoobigs() -#define snmp_inc_snmpoutnosuchnames() -#define snmp_inc_snmpoutbadvalues() -#define snmp_inc_snmpoutgenerrs() -#define snmp_inc_snmpoutgetrequests() -#define snmp_inc_snmpoutgetnexts() -#define snmp_inc_snmpoutsetrequests() -#define snmp_inc_snmpoutgetresponses() -#define snmp_inc_snmpouttraps() -#define snmp_get_snmpgrpid_ptr(oid) -#define snmp_set_snmpenableauthentraps(value) -#define snmp_get_snmpenableauthentraps(value) - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_SNMP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_asn1.h b/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_asn1.h deleted file mode 100644 index 605fa3f1..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_asn1.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file - * Abstract Syntax Notation One (ISO 8824, 8825) codec. - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_ASN1_H__ -#define __LWIP_SNMP_ASN1_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" -#include "lwip/snmp.h" - -#if LWIP_SNMP - -#ifdef __cplusplus -extern "C" { -#endif - -#define SNMP_ASN1_UNIV (0) /* (!0x80 | !0x40) */ -#define SNMP_ASN1_APPLIC (0x40) /* (!0x80 | 0x40) */ -#define SNMP_ASN1_CONTXT (0x80) /* ( 0x80 | !0x40) */ - -#define SNMP_ASN1_CONSTR (0x20) /* ( 0x20) */ -#define SNMP_ASN1_PRIMIT (0) /* (!0x20) */ - -/* universal tags */ -#define SNMP_ASN1_INTEG 2 -#define SNMP_ASN1_OC_STR 4 -#define SNMP_ASN1_NUL 5 -#define SNMP_ASN1_OBJ_ID 6 -#define SNMP_ASN1_SEQ 16 - -/* application specific (SNMP) tags */ -#define SNMP_ASN1_IPADDR 0 /* octet string size(4) */ -#define SNMP_ASN1_COUNTER 1 /* u32_t */ -#define SNMP_ASN1_GAUGE 2 /* u32_t */ -#define SNMP_ASN1_TIMETICKS 3 /* u32_t */ -#define SNMP_ASN1_OPAQUE 4 /* octet string */ - -/* context specific (SNMP) tags */ -#define SNMP_ASN1_PDU_GET_REQ 0 -#define SNMP_ASN1_PDU_GET_NEXT_REQ 1 -#define SNMP_ASN1_PDU_GET_RESP 2 -#define SNMP_ASN1_PDU_SET_REQ 3 -#define SNMP_ASN1_PDU_TRAP 4 - -err_t snmp_asn1_dec_type(struct pbuf *p, u16_t ofs, u8_t *type); -err_t snmp_asn1_dec_length(struct pbuf *p, u16_t ofs, u8_t *octets_used, u16_t *length); -err_t snmp_asn1_dec_u32t(struct pbuf *p, u16_t ofs, u16_t len, u32_t *value); -err_t snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value); -err_t snmp_asn1_dec_oid(struct pbuf *p, u16_t ofs, u16_t len, struct snmp_obj_id *oid); -err_t snmp_asn1_dec_raw(struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_t *raw); - -void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed); -void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed); -void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed); -void snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed); -err_t snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type); -err_t snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length); -err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value); -err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value); -err_t snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident); -err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_ASN1_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_msg.h b/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_msg.h deleted file mode 100644 index 1183e3a9..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_msg.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @file - * SNMP Agent message handling structures. - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_MSG_H__ -#define __LWIP_SNMP_MSG_H__ - -#include "lwip/opt.h" -#include "lwip/snmp.h" -#include "lwip/snmp_structs.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#if LWIP_SNMP - -#if SNMP_PRIVATE_MIB -/* When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. */ -#include "private_mib.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* The listen port of the SNMP agent. Clients have to make their requests to - this port. Most standard clients won't work if you change this! */ -#ifndef SNMP_IN_PORT -#define SNMP_IN_PORT 161 -#endif -/* The remote port the SNMP agent sends traps to. Most standard trap sinks won't - work if you change this! */ -#ifndef SNMP_TRAP_PORT -#define SNMP_TRAP_PORT 162 -#endif - -#define SNMP_ES_NOERROR 0 -#define SNMP_ES_TOOBIG 1 -#define SNMP_ES_NOSUCHNAME 2 -#define SNMP_ES_BADVALUE 3 -#define SNMP_ES_READONLY 4 -#define SNMP_ES_GENERROR 5 - -#define SNMP_GENTRAP_COLDSTART 0 -#define SNMP_GENTRAP_WARMSTART 1 -#define SNMP_GENTRAP_AUTHFAIL 4 -#define SNMP_GENTRAP_ENTERPRISESPC 6 - -struct snmp_varbind -{ - /* next pointer, NULL for last in list */ - struct snmp_varbind *next; - /* previous pointer, NULL for first in list */ - struct snmp_varbind *prev; - - /* object identifier length (in s32_t) */ - u8_t ident_len; - /* object identifier array */ - s32_t *ident; - - /* object value ASN1 type */ - u8_t value_type; - /* object value length (in u8_t) */ - u8_t value_len; - /* object value */ - void *value; - - /* encoding varbind seq length length */ - u8_t seqlenlen; - /* encoding object identifier length length */ - u8_t olenlen; - /* encoding object value length length */ - u8_t vlenlen; - /* encoding varbind seq length */ - u16_t seqlen; - /* encoding object identifier length */ - u16_t olen; - /* encoding object value length */ - u16_t vlen; -}; - -struct snmp_varbind_root -{ - struct snmp_varbind *head; - struct snmp_varbind *tail; - /* number of variable bindings in list */ - u8_t count; - /* encoding varbind-list seq length length */ - u8_t seqlenlen; - /* encoding varbind-list seq length */ - u16_t seqlen; -}; - -/** output response message header length fields */ -struct snmp_resp_header_lengths -{ - /* encoding error-index length length */ - u8_t erridxlenlen; - /* encoding error-status length length */ - u8_t errstatlenlen; - /* encoding request id length length */ - u8_t ridlenlen; - /* encoding pdu length length */ - u8_t pdulenlen; - /* encoding community length length */ - u8_t comlenlen; - /* encoding version length length */ - u8_t verlenlen; - /* encoding sequence length length */ - u8_t seqlenlen; - - /* encoding error-index length */ - u16_t erridxlen; - /* encoding error-status length */ - u16_t errstatlen; - /* encoding request id length */ - u16_t ridlen; - /* encoding pdu length */ - u16_t pdulen; - /* encoding community length */ - u16_t comlen; - /* encoding version length */ - u16_t verlen; - /* encoding sequence length */ - u16_t seqlen; -}; - -/** output response message header length fields */ -struct snmp_trap_header_lengths -{ - /* encoding timestamp length length */ - u8_t tslenlen; - /* encoding specific-trap length length */ - u8_t strplenlen; - /* encoding generic-trap length length */ - u8_t gtrplenlen; - /* encoding agent-addr length length */ - u8_t aaddrlenlen; - /* encoding enterprise-id length length */ - u8_t eidlenlen; - /* encoding pdu length length */ - u8_t pdulenlen; - /* encoding community length length */ - u8_t comlenlen; - /* encoding version length length */ - u8_t verlenlen; - /* encoding sequence length length */ - u8_t seqlenlen; - - /* encoding timestamp length */ - u16_t tslen; - /* encoding specific-trap length */ - u16_t strplen; - /* encoding generic-trap length */ - u16_t gtrplen; - /* encoding agent-addr length */ - u16_t aaddrlen; - /* encoding enterprise-id length */ - u16_t eidlen; - /* encoding pdu length */ - u16_t pdulen; - /* encoding community length */ - u16_t comlen; - /* encoding version length */ - u16_t verlen; - /* encoding sequence length */ - u16_t seqlen; -}; - -/* Accepting new SNMP messages. */ -#define SNMP_MSG_EMPTY 0 -/* Search for matching object for variable binding. */ -#define SNMP_MSG_SEARCH_OBJ 1 -/* Perform SNMP operation on in-memory object. - Pass-through states, for symmetry only. */ -#define SNMP_MSG_INTERNAL_GET_OBJDEF 2 -#define SNMP_MSG_INTERNAL_GET_VALUE 3 -#define SNMP_MSG_INTERNAL_SET_TEST 4 -#define SNMP_MSG_INTERNAL_GET_OBJDEF_S 5 -#define SNMP_MSG_INTERNAL_SET_VALUE 6 -/* Perform SNMP operation on object located externally. - In theory this could be used for building a proxy agent. - Practical use is for an enterprise spc. app. gateway. */ -#define SNMP_MSG_EXTERNAL_GET_OBJDEF 7 -#define SNMP_MSG_EXTERNAL_GET_VALUE 8 -#define SNMP_MSG_EXTERNAL_SET_TEST 9 -#define SNMP_MSG_EXTERNAL_GET_OBJDEF_S 10 -#define SNMP_MSG_EXTERNAL_SET_VALUE 11 - -#define SNMP_COMMUNITY_STR_LEN 64 -struct snmp_msg_pstat -{ - /* lwIP local port (161) binding */ - struct udp_pcb *pcb; - /* source IP address */ - ip_addr_t sip; - /* source UDP port */ - u16_t sp; - /* request type */ - u8_t rt; - /* request ID */ - s32_t rid; - /* error status */ - s32_t error_status; - /* error index */ - s32_t error_index; - /* community name (zero terminated) */ - u8_t community[SNMP_COMMUNITY_STR_LEN + 1]; - /* community string length (exclusive zero term) */ - u8_t com_strlen; - /* one out of MSG_EMPTY, MSG_DEMUX, MSG_INTERNAL, MSG_EXTERNAL_x */ - u8_t state; - /* saved arguments for MSG_EXTERNAL_x */ - struct mib_external_node *ext_mib_node; - struct snmp_name_ptr ext_name_ptr; - struct obj_def ext_object_def; - struct snmp_obj_id ext_oid; - /* index into input variable binding list */ - u8_t vb_idx; - /* ptr into input variable binding list */ - struct snmp_varbind *vb_ptr; - /* list of variable bindings from input */ - struct snmp_varbind_root invb; - /* list of variable bindings to output */ - struct snmp_varbind_root outvb; - /* output response lengths used in ASN encoding */ - struct snmp_resp_header_lengths rhl; -}; - -struct snmp_msg_trap -{ - /* lwIP local port (161) binding */ - struct udp_pcb *pcb; - /* destination IP address in network order */ - ip_addr_t dip; - - /* source enterprise ID (sysObjectID) */ - struct snmp_obj_id *enterprise; - /* source IP address, raw network order format */ - u8_t sip_raw[4]; - /* generic trap code */ - u32_t gen_trap; - /* specific trap code */ - u32_t spc_trap; - /* timestamp */ - u32_t ts; - /* list of variable bindings to output */ - struct snmp_varbind_root outvb; - /* output trap lengths used in ASN encoding */ - struct snmp_trap_header_lengths thl; -}; - -/** Agent Version constant, 0 = v1 oddity */ -extern const s32_t snmp_version; -/** Agent default "public" community string */ -extern const char snmp_publiccommunity[7]; - -extern struct snmp_msg_trap trap_msg; - -/** Agent setup, start listening to port 161. */ -void snmp_init(void); -void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable); -void snmp_trap_dst_ip_set(u8_t dst_idx, ip_addr_t *dst); - -/** Varbind-list functions. */ -struct snmp_varbind* snmp_varbind_alloc(struct snmp_obj_id *oid, u8_t type, u8_t len); -void snmp_varbind_free(struct snmp_varbind *vb); -void snmp_varbind_list_free(struct snmp_varbind_root *root); -void snmp_varbind_tail_add(struct snmp_varbind_root *root, struct snmp_varbind *vb); -struct snmp_varbind* snmp_varbind_tail_remove(struct snmp_varbind_root *root); - -/** Handle an internal (recv) or external (private response) event. */ -void snmp_msg_event(u8_t request_id); -err_t snmp_send_response(struct snmp_msg_pstat *m_stat); -err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap); -void snmp_coldstart_trap(void); -void snmp_authfail_trap(void); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_MSG_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_structs.h b/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_structs.h deleted file mode 100644 index 0d3b46a9..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/snmp_structs.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @file - * Generic MIB tree structures. - * - * @todo namespace prefixes - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_STRUCTS_H__ -#define __LWIP_SNMP_STRUCTS_H__ - -#include "lwip/opt.h" - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/snmp.h" - -#if SNMP_PRIVATE_MIB -/* When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. */ -#include "private_mib.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* MIB object instance */ -#define MIB_OBJECT_NONE 0 -#define MIB_OBJECT_SCALAR 1 -#define MIB_OBJECT_TAB 2 - -/* MIB access types */ -#define MIB_ACCESS_READ 1 -#define MIB_ACCESS_WRITE 2 - -/* MIB object access */ -#define MIB_OBJECT_READ_ONLY MIB_ACCESS_READ -#define MIB_OBJECT_READ_WRITE (MIB_ACCESS_READ | MIB_ACCESS_WRITE) -#define MIB_OBJECT_WRITE_ONLY MIB_ACCESS_WRITE -#define MIB_OBJECT_NOT_ACCESSIBLE 0 - -/** object definition returned by (get_object_def)() */ -struct obj_def -{ - /* MIB_OBJECT_NONE (0), MIB_OBJECT_SCALAR (1), MIB_OBJECT_TAB (2) */ - u8_t instance; - /* 0 read-only, 1 read-write, 2 write-only, 3 not-accessible */ - u8_t access; - /* ASN type for this object */ - u8_t asn_type; - /* value length (host length) */ - u16_t v_len; - /* length of instance part of supplied object identifier */ - u8_t id_inst_len; - /* instance part of supplied object identifier */ - s32_t *id_inst_ptr; -}; - -struct snmp_name_ptr -{ - u8_t ident_len; - s32_t *ident; -}; - -/** MIB const scalar (.0) node */ -#define MIB_NODE_SC 0x01 -/** MIB const array node */ -#define MIB_NODE_AR 0x02 -/** MIB array node (mem_malloced from RAM) */ -#define MIB_NODE_RA 0x03 -/** MIB list root node (mem_malloced from RAM) */ -#define MIB_NODE_LR 0x04 -/** MIB node for external objects */ -#define MIB_NODE_EX 0x05 - -/** node "base class" layout, the mandatory fields for a node */ -struct mib_node -{ - /** returns struct obj_def for the given object identifier */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - /** returns object value for the given object identifier, - @note the caller must allocate at least len bytes for the value */ - void (*get_value)(struct obj_def *od, u16_t len, void *value); - /** tests length and/or range BEFORE setting */ - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - /** sets object value, only to be called when set_test() */ - void (*set_value)(struct obj_def *od, u16_t len, void *value); - /** One out of MIB_NODE_AR, MIB_NODE_LR or MIB_NODE_EX */ - u8_t node_type; - /* array or max list length */ - u16_t maxlength; -}; - -/** derived node for scalars .0 index */ -typedef struct mib_node mib_scalar_node; - -/** derived node, points to a fixed size const array - of sub-identifiers plus a 'child' pointer */ -struct mib_array_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - const s32_t *objid; - struct mib_node* const *nptr; -}; - -/** derived node, points to a fixed size mem_malloced array - of sub-identifiers plus a 'child' pointer */ -struct mib_ram_array_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* aditional struct members */ - s32_t *objid; - struct mib_node **nptr; -}; - -struct mib_list_node -{ - struct mib_list_node *prev; - struct mib_list_node *next; - s32_t objid; - struct mib_node *nptr; -}; - -/** derived node, points to a doubly linked list - of sub-identifiers plus a 'child' pointer */ -struct mib_list_rootnode -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - struct mib_list_node *head; - struct mib_list_node *tail; - /* counts list nodes in list */ - u16_t count; -}; - -/** derived node, has access functions for mib object in external memory or device - using 'tree_level' and 'idx', with a range 0 .. (level_length() - 1) */ -struct mib_external_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - /** points to an external (in memory) record of some sort of addressing - information, passed to and interpreted by the funtions below */ - void* addr_inf; - /** tree levels under this node */ - u8_t tree_levels; - /** number of objects at this level */ - u16_t (*level_length)(void* addr_inf, u8_t level); - /** compares object sub identifier with external id - return zero when equal, nonzero when unequal */ - s32_t (*ident_cmp)(void* addr_inf, u8_t level, u16_t idx, s32_t sub_id); - void (*get_objid)(void* addr_inf, u8_t level, u16_t idx, s32_t *sub_id); - - /** async Questions */ - void (*get_object_def_q)(void* addr_inf, u8_t rid, u8_t ident_len, s32_t *ident); - void (*get_value_q)(u8_t rid, struct obj_def *od); - void (*set_test_q)(u8_t rid, struct obj_def *od); - void (*set_value_q)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Answers */ - void (*get_object_def_a)(u8_t rid, u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - u8_t (*set_test_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - void (*set_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Panic Close (agent returns error reply, - e.g. used for external transaction cleanup) */ - void (*get_object_def_pc)(u8_t rid, u8_t ident_len, s32_t *ident); - void (*get_value_pc)(u8_t rid, struct obj_def *od); - void (*set_test_pc)(u8_t rid, struct obj_def *od); - void (*set_value_pc)(u8_t rid, struct obj_def *od); -}; - -/** export MIB tree from mib2.c */ -extern const struct mib_array_node internet; - -/** dummy function pointers for non-leaf MIB nodes from mib2.c */ -void noleafs_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od); -void noleafs_get_value(struct obj_def *od, u16_t len, void *value); -u8_t noleafs_set_test(struct obj_def *od, u16_t len, void *value); -void noleafs_set_value(struct obj_def *od, u16_t len, void *value); - -void snmp_oidtoip(s32_t *ident, ip_addr_t *ip); -void snmp_iptooid(ip_addr_t *ip, s32_t *ident); -void snmp_ifindextonetif(s32_t ifindex, struct netif **netif); -void snmp_netiftoifindex(struct netif *netif, s32_t *ifidx); - -struct mib_list_node* snmp_mib_ln_alloc(s32_t id); -void snmp_mib_ln_free(struct mib_list_node *ln); -struct mib_list_rootnode* snmp_mib_lrn_alloc(void); -void snmp_mib_lrn_free(struct mib_list_rootnode *lrn); - -s8_t snmp_mib_node_insert(struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **insn); -s8_t snmp_mib_node_find(struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **fn); -struct mib_list_rootnode *snmp_mib_node_delete(struct mib_list_rootnode *rn, struct mib_list_node *n); - -struct mib_node* snmp_search_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_name_ptr *np); -struct mib_node* snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret); -u8_t snmp_iso_prefix_tst(u8_t ident_len, s32_t *ident); -u8_t snmp_iso_prefix_expand(u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_STRUCTS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/sockets.h b/sparkfun/esp8266/firmwares/loader/src/lwip/sockets.h deleted file mode 100644 index 3c8fed24..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/sockets.h +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - - -#ifndef __LWIP_SOCKETS_H__ -#define __LWIP_SOCKETS_H__ - -#include "lwip/opt.h" - -#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/ip_addr.h" -#include "lwip/inet.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* members are in network byte order */ -struct sockaddr_in { - u8_t sin_len; - u8_t sin_family; - u16_t sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - -struct sockaddr { - u8_t sa_len; - u8_t sa_family; - char sa_data[14]; -}; - -#ifndef socklen_t -# define socklen_t u32_t -#endif - -/* Socket protocol types (TCP/UDP/RAW) */ -#define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 - -/* - * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) - */ -#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* Allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* Unimplemented: just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ -#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* Unimplemented: leave received OOB data in line */ -#define SO_REUSEPORT 0x0200 /* Unimplemented: allow local address & port reuse */ - -#define SO_DONTLINGER ((int)(~SO_LINGER)) - -/* - * Additional options, not kept in so_options. - */ -#define SO_SNDBUF 0x1001 /* Unimplemented: send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* Unimplemented: send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* Unimplemented: receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* Unimplemented: send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ -#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */ -#define SO_NO_CHECK 0x100a /* don't create UDP checksum */ - - -/* - * Structure used for manipulating linger option. - */ -struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time */ -}; - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xfff /* options for socket level */ - - -#define AF_UNSPEC 0 -#define AF_INET 2 -#define PF_INET AF_INET -#define PF_UNSPEC AF_UNSPEC - -#define IPPROTO_IP 0 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 -#define IPPROTO_UDPLITE 136 - -/* Flags we can use with send and recv. */ -#define MSG_PEEK 0x01 /* Peeks at an incoming message */ -#define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */ -#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */ -#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */ -#define MSG_MORE 0x10 /* Sender will send more */ - - -/* - * Options for level IPPROTO_IP - */ -#define IP_TOS 1 -#define IP_TTL 2 - -#if LWIP_TCP -/* - * Options for level IPPROTO_TCP - */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ -#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */ -#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ -#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ -#endif /* LWIP_TCP */ - -#if LWIP_UDP && LWIP_UDPLITE -/* - * Options for level IPPROTO_UDPLITE - */ -#define UDPLITE_SEND_CSCOV 0x01 /* sender checksum coverage */ -#define UDPLITE_RECV_CSCOV 0x02 /* minimal receiver checksum coverage */ -#endif /* LWIP_UDP && LWIP_UDPLITE*/ - - -#if LWIP_IGMP -/* - * Options and types for UDP multicast traffic handling - */ -#define IP_ADD_MEMBERSHIP 3 -#define IP_DROP_MEMBERSHIP 4 -#define IP_MULTICAST_TTL 5 -#define IP_MULTICAST_IF 6 -#define IP_MULTICAST_LOOP 7 - -typedef struct ip_mreq { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ -} ip_mreq; -#endif /* LWIP_IGMP */ - -/* - * The Type of Service provides an indication of the abstract - * parameters of the quality of service desired. These parameters are - * to be used to guide the selection of the actual service parameters - * when transmitting a datagram through a particular network. Several - * networks offer service precedence, which somehow treats high - * precedence traffic as more important than other traffic (generally - * by accepting only traffic above a certain precedence at time of high - * load). The major choice is a three way tradeoff between low-delay, - * high-reliability, and high-throughput. - * The use of the Delay, Throughput, and Reliability indications may - * increase the cost (in some sense) of the service. In many networks - * better performance for one of these parameters is coupled with worse - * performance on another. Except for very unusual cases at most two - * of these three indications should be set. - */ -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) -#define IPTOS_LOWDELAY 0x10 -#define IPTOS_THROUGHPUT 0x08 -#define IPTOS_RELIABILITY 0x04 -#define IPTOS_LOWCOST 0x02 -#define IPTOS_MINCOST IPTOS_LOWCOST - -/* - * The Network Control precedence designation is intended to be used - * within a network only. The actual use and control of that - * designation is up to each network. The Internetwork Control - * designation is intended for use by gateway control originators only. - * If the actual use of these precedence designations is of concern to - * a particular network, it is the responsibility of that network to - * control the access to, and use of, those precedence designations. - */ -#define IPTOS_PREC_MASK 0xe0 -#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) -#define IPTOS_PREC_NETCONTROL 0xe0 -#define IPTOS_PREC_INTERNETCONTROL 0xc0 -#define IPTOS_PREC_CRITIC_ECP 0xa0 -#define IPTOS_PREC_FLASHOVERRIDE 0x80 -#define IPTOS_PREC_FLASH 0x60 -#define IPTOS_PREC_IMMEDIATE 0x40 -#define IPTOS_PREC_PRIORITY 0x20 -#define IPTOS_PREC_ROUTINE 0x00 - - -/* - * Commands for ioctlsocket(), taken from the BSD file fcntl.h. - * lwip_ioctl only supports FIONREAD and FIONBIO, for now - * - * Ioctl's have the command encoded in the lower word, - * and the size of any in or out parameters in the upper - * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 128 bytes. - */ -#if !defined(FIONREAD) || !defined(FIONBIO) -#define IOCPARM_MASK 0x7fU /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000UL /* no parameters */ -#define IOC_OUT 0x40000000UL /* copy out parameters */ -#define IOC_IN 0x80000000UL /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ -#define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) - -#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) - -#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) -#endif /* !defined(FIONREAD) || !defined(FIONBIO) */ - -#ifndef FIONREAD -#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */ -#endif -#ifndef FIONBIO -#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */ -#endif - -/* Socket I/O Controls: unimplemented */ -#ifndef SIOCSHIWAT -#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */ -#endif - -/* commands for fnctl */ -#ifndef F_GETFL -#define F_GETFL 3 -#endif -#ifndef F_SETFL -#define F_SETFL 4 -#endif - -/* File status flags and file access modes for fnctl, - these are bits in an int. */ -#ifndef O_NONBLOCK -#define O_NONBLOCK 1 /* nonblocking I/O */ -#endif -#ifndef O_NDELAY -#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */ -#endif - -#ifndef SHUT_RD - #define SHUT_RD 0 - #define SHUT_WR 1 - #define SHUT_RDWR 2 -#endif - -/* FD_SET used for lwip_select */ -#ifndef FD_SET - #undef FD_SETSIZE - /* Make FD_SETSIZE match NUM_SOCKETS in socket.c */ - #define FD_SETSIZE MEMP_NUM_NETCONN - #define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7))) - #define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7))) - #define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7))) - #define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p))) - - typedef struct fd_set { - unsigned char fd_bits [(FD_SETSIZE+7)/8]; - } fd_set; - -#endif /* FD_SET */ - -/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided - * by your system, set this to 0 and include in cc.h */ -#ifndef LWIP_TIMEVAL_PRIVATE -#define LWIP_TIMEVAL_PRIVATE 1 -#endif - -#if LWIP_TIMEVAL_PRIVATE -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -#endif /* LWIP_TIMEVAL_PRIVATE */ - -void lwip_socket_init(void); - -int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_shutdown(int s, int how); -int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); -int lwip_close(int s); -int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_listen(int s, int backlog); -int lwip_recv(int s, void *mem, size_t len, int flags); -int lwip_read(int s, void *mem, size_t len); -int lwip_recvfrom(int s, void *mem, size_t len, int flags, - struct sockaddr *from, socklen_t *fromlen); -int lwip_send(int s, const void *dataptr, size_t size, int flags); -int lwip_sendto(int s, const void *dataptr, size_t size, int flags, - const struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_write(int s, const void *dataptr, size_t size); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, - struct timeval *timeout); -int lwip_ioctl(int s, long cmd, void *argp); -int lwip_fcntl(int s, int cmd, int val); - -#if LWIP_COMPAT_SOCKETS -#define accept(a,b,c) lwip_accept(a,b,c) -#define bind(a,b,c) lwip_bind(a,b,c) -#define shutdown(a,b) lwip_shutdown(a,b) -#define closesocket(s) lwip_close(s) -#define connect(a,b,c) lwip_connect(a,b,c) -#define getsockname(a,b,c) lwip_getsockname(a,b,c) -#define getpeername(a,b,c) lwip_getpeername(a,b,c) -#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e) -#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e) -#define listen(a,b) lwip_listen(a,b) -#define recv(a,b,c,d) lwip_recv(a,b,c,d) -#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f) -#define send(a,b,c,d) lwip_send(a,b,c,d) -#define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f) -#define socket(a,b,c) lwip_socket(a,b,c) -#define select(a,b,c,d,e) lwip_select(a,b,c,d,e) -#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c) - -#if LWIP_POSIX_SOCKETS_IO_NAMES -#define read(a,b,c) lwip_read(a,b,c) -#define write(a,b,c) lwip_write(a,b,c) -#define close(s) lwip_close(s) -#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ - -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SOCKET */ - -#endif /* __LWIP_SOCKETS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/stats.h b/sparkfun/esp8266/firmwares/loader/src/lwip/stats.h deleted file mode 100644 index 43883217..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/stats.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_STATS_H__ -#define __LWIP_STATS_H__ - -#include "lwip/opt.h" - -#include "lwip/mem.h" -#include "lwip/memp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_STATS - -#ifndef LWIP_STATS_LARGE -#define LWIP_STATS_LARGE 0 -#endif - -#if LWIP_STATS_LARGE -#define STAT_COUNTER u32_t -#define STAT_COUNTER_F U32_F -#else -#define STAT_COUNTER u16_t -#define STAT_COUNTER_F U16_F -#endif - -struct stats_proto { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER fw; /* Forwarded packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER rterr; /* Routing error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER opterr; /* Error in options. */ - STAT_COUNTER err; /* Misc error. */ - STAT_COUNTER cachehit; -}; - -struct stats_igmp { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER rx_v1; /* Received v1 frames. */ - STAT_COUNTER rx_group; /* Received group-specific queries. */ - STAT_COUNTER rx_general; /* Received general queries. */ - STAT_COUNTER rx_report; /* Received reports. */ - STAT_COUNTER tx_join; /* Sent joins. */ - STAT_COUNTER tx_leave; /* Sent leaves. */ - STAT_COUNTER tx_report; /* Sent reports. */ -}; - -struct stats_mem { -#ifdef LWIP_DEBUG - const char *name; -#endif /* LWIP_DEBUG */ - mem_size_t avail; - mem_size_t used; - mem_size_t max; - STAT_COUNTER err; - STAT_COUNTER illegal; -}; - -struct stats_syselem { - STAT_COUNTER used; - STAT_COUNTER max; - STAT_COUNTER err; -}; - -struct stats_sys { - struct stats_syselem sem; - struct stats_syselem mutex; - struct stats_syselem mbox; -}; - -struct stats_ { -#if LINK_STATS - struct stats_proto link; -#endif -#if ETHARP_STATS - struct stats_proto etharp; -#endif -#if IPFRAG_STATS - struct stats_proto ip_frag; -#endif -#if IP_STATS - struct stats_proto ip; -#endif -#if ICMP_STATS - struct stats_proto icmp; -#endif -#if IGMP_STATS - struct stats_igmp igmp; -#endif -#if UDP_STATS - struct stats_proto udp; -#endif -#if TCP_STATS - struct stats_proto tcp; -#endif -#if MEM_STATS - struct stats_mem mem; -#endif -#if MEMP_STATS - struct stats_mem memp[MEMP_MAX]; -#endif -#if SYS_STATS - struct stats_sys sys; -#endif -}; - -extern struct stats_ lwip_stats; - -void stats_init(void)ICACHE_FLASH_ATTR; - -#define STATS_INC(x) ++lwip_stats.x -#define STATS_DEC(x) --lwip_stats.x -#define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ - if (lwip_stats.x.max < lwip_stats.x.used) { \ - lwip_stats.x.max = lwip_stats.x.used; \ - } \ - } while(0) -#else /* LWIP_STATS */ -#define stats_init() -#define STATS_INC(x) -#define STATS_DEC(x) -#define STATS_INC_USED(x) -#endif /* LWIP_STATS */ - -#if TCP_STATS -#define TCP_STATS_INC(x) STATS_INC(x) -#define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") -#else -#define TCP_STATS_INC(x) -#define TCP_STATS_DISPLAY() -#endif - -#if UDP_STATS -#define UDP_STATS_INC(x) STATS_INC(x) -#define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") -#else -#define UDP_STATS_INC(x) -#define UDP_STATS_DISPLAY() -#endif - -#if ICMP_STATS -#define ICMP_STATS_INC(x) STATS_INC(x) -#define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") -#else -#define ICMP_STATS_INC(x) -#define ICMP_STATS_DISPLAY() -#endif - -#if IGMP_STATS -#define IGMP_STATS_INC(x) STATS_INC(x) -#define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp) -#else -#define IGMP_STATS_INC(x) -#define IGMP_STATS_DISPLAY() -#endif - -#if IP_STATS -#define IP_STATS_INC(x) STATS_INC(x) -#define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") -#else -#define IP_STATS_INC(x) -#define IP_STATS_DISPLAY() -#endif - -#if IPFRAG_STATS -#define IPFRAG_STATS_INC(x) STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") -#else -#define IPFRAG_STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() -#endif - -#if ETHARP_STATS -#define ETHARP_STATS_INC(x) STATS_INC(x) -#define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") -#else -#define ETHARP_STATS_INC(x) -#define ETHARP_STATS_DISPLAY() -#endif - -#if LINK_STATS -#define LINK_STATS_INC(x) STATS_INC(x) -#define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") -#else -#define LINK_STATS_INC(x) -#define LINK_STATS_DISPLAY() -#endif - -#if MEM_STATS -#define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y -#define MEM_STATS_INC(x) STATS_INC(mem.x) -#define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y) -#define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x -= y -#define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") -#else -#define MEM_STATS_AVAIL(x, y) -#define MEM_STATS_INC(x) -#define MEM_STATS_INC_USED(x, y) -#define MEM_STATS_DEC_USED(x, y) -#define MEM_STATS_DISPLAY() -#endif - -#if MEMP_STATS -#define MEMP_STATS_AVAIL(x, i, y) lwip_stats.memp[i].x = y -#define MEMP_STATS_INC(x, i) STATS_INC(memp[i].x) -#define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i].x) -#define MEMP_STATS_INC_USED(x, i) STATS_INC_USED(memp[i], 1) -#define MEMP_STATS_DISPLAY(i) stats_display_memp(&lwip_stats.memp[i], i) -#else -#define MEMP_STATS_AVAIL(x, i, y) -#define MEMP_STATS_INC(x, i) -#define MEMP_STATS_DEC(x, i) -#define MEMP_STATS_INC_USED(x, i) -#define MEMP_STATS_DISPLAY(i) -#endif - -#if SYS_STATS -#define SYS_STATS_INC(x) STATS_INC(sys.x) -#define SYS_STATS_DEC(x) STATS_DEC(sys.x) -#define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) -#define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) -#else -#define SYS_STATS_INC(x) -#define SYS_STATS_DEC(x) -#define SYS_STATS_INC_USED(x) -#define SYS_STATS_DISPLAY() -#endif - -/* Display of statistics */ -#if LWIP_STATS_DISPLAY -void stats_display(void)ICACHE_FLASH_ATTR; -void stats_display_proto(struct stats_proto *proto, char *name)ICACHE_FLASH_ATTR; -void stats_display_igmp(struct stats_igmp *igmp)ICACHE_FLASH_ATTR; -void stats_display_mem(struct stats_mem *mem, char *name)ICACHE_FLASH_ATTR; -void stats_display_memp(struct stats_mem *mem, int index)ICACHE_FLASH_ATTR; -void stats_display_sys(struct stats_sys *sys)ICACHE_FLASH_ATTR; -#else /* LWIP_STATS_DISPLAY */ -#define stats_display() -#define stats_display_proto(proto, name) -#define stats_display_igmp(igmp) -#define stats_display_mem(mem, name) -#define stats_display_memp(mem, index) -#define stats_display_sys(sys) -#endif /* LWIP_STATS_DISPLAY */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_STATS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/sys.h b/sparkfun/esp8266/firmwares/loader/src/lwip/sys.h deleted file mode 100644 index 31a9dea7..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/sys.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_SYS_H__ -#define __LWIP_SYS_H__ - -#include "lwip/opt.h" - -#include "eagle_soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if NO_SYS - -/* For a totally minimal and standalone system, we provide null - definitions of the sys_ functions. */ -typedef u8_t sys_sem_t; -typedef u8_t sys_mutex_t; -typedef u8_t sys_mbox_t; - -#define sys_sem_new(s, c) ERR_OK -#define sys_sem_signal(s) -#define sys_sem_wait(s) -#define sys_arch_sem_wait(s,t) -#define sys_sem_free(s) -#define sys_mutex_new(mu) ERR_OK -#define sys_mutex_lock(mu) -#define sys_mutex_unlock(mu) -#define sys_mutex_free(mu) -#define sys_mbox_new(m, s) ERR_OK -#define sys_mbox_fetch(m,d) -#define sys_mbox_tryfetch(m,d) -#define sys_mbox_post(m,d) -#define sys_mbox_trypost(m,d) -#define sys_mbox_free(m) - -#define sys_thread_new(n,t,a,s,p) - -#define sys_msleep(t) - -#else /* NO_SYS */ - -/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */ -#define SYS_ARCH_TIMEOUT 0xffffffffUL - -/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. - * For now we use the same magic value, but we allow this to change in future. - */ -#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT - -#include "lwip/err.h" -#include "arch/sys_arch.h" - -/** Function prototype for thread functions */ -typedef void (*lwip_thread_fn)(void *arg); - -/* Function prototypes for functions to be implemented by platform ports - (in sys_arch.c) */ - -/* Mutex functions: */ - -/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores - should be used instead */ -#if LWIP_COMPAT_MUTEX -/* for old ports that don't have mutexes: define them to binary semaphores */ -#define sys_mutex_t sys_sem_t -#define sys_mutex_new(mutex) sys_sem_new(mutex, 1) -#define sys_mutex_lock(mutex) sys_sem_wait(mutex) -#define sys_mutex_unlock(mutex) sys_sem_signal(mutex) -#define sys_mutex_free(mutex) sys_sem_free(mutex) -#define sys_mutex_valid(mutex) sys_sem_valid(mutex) -#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex) - -#else /* LWIP_COMPAT_MUTEX */ - -/** Create a new mutex - * @param mutex pointer to the mutex to create - * @return a new mutex */ -err_t sys_mutex_new(sys_mutex_t *mutex); -/** Lock a mutex - * @param mutex the mutex to lock */ -void sys_mutex_lock(sys_mutex_t *mutex); -/** Unlock a mutex - * @param mutex the mutex to unlock */ -void sys_mutex_unlock(sys_mutex_t *mutex); -/** Delete a semaphore - * @param mutex the mutex to delete */ -void sys_mutex_free(sys_mutex_t *mutex); -#ifndef sys_mutex_valid -/** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_mutex_valid(sys_mutex_t *mutex); -#endif -#ifndef sys_mutex_set_invalid -/** Set a mutex invalid so that sys_mutex_valid returns 0 */ -void sys_mutex_set_invalid(sys_mutex_t *mutex); -#endif -#endif /* LWIP_COMPAT_MUTEX */ - -/* Semaphore functions: */ - -/** Create a new semaphore - * @param sem pointer to the semaphore to create - * @param count initial count of the semaphore - * @return ERR_OK if successful, another err_t otherwise */ -err_t sys_sem_new(sys_sem_t *sem, u8_t count); -/** Signals a semaphore - * @param sem the semaphore to signal */ -void sys_sem_signal(sys_sem_t *sem); -/** Wait for a semaphore for the specified timeout - * @param sem the semaphore to wait for - * @param timeout timeout in milliseconds to wait (0 = wait forever) - * @return time (in milliseconds) waited for the semaphore - * or SYS_ARCH_TIMEOUT on timeout */ -u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout); -/** Delete a semaphore - * @param sem semaphore to delete */ -void sys_sem_free(sys_sem_t *sem); -/** Wait for a semaphore - forever/no timeout */ -#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) -#ifndef sys_sem_valid -/** Check if a sempahore is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_sem_valid(sys_sem_t *sem); -#endif -#ifndef sys_sem_set_invalid -/** Set a semaphore invalid so that sys_sem_valid returns 0 */ -void sys_sem_set_invalid(sys_sem_t *sem); -#endif - -/* Time functions. */ -#ifndef sys_msleep -void sys_msleep(u32_t ms); /* only has a (close to) 1 jiffy resolution. */ -#endif - -/* Mailbox functions. */ - -/** Create a new mbox of specified size - * @param mbox pointer to the mbox to create - * @param size (miminum) number of messages in this mbox - * @return ERR_OK if successful, another err_t otherwise */ -err_t sys_mbox_new(sys_mbox_t *mbox, int size); -/** Post a message to an mbox - may not fail - * -> blocks if full, only used from tasks not from ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) */ -void sys_mbox_post(sys_mbox_t *mbox, void *msg); -/** Try to post a message to an mbox - may fail if full or ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) */ -err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); -/** Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message - * @return time (in milliseconds) waited for a message, may be 0 if not waited - or SYS_ARCH_TIMEOUT on timeout - * The returned time has to be accurate to prevent timer jitter! */ -u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); -/* Allow port to override with a macro, e.g. special timout for sys_arch_mbox_fetch() */ -#ifndef sys_arch_mbox_tryfetch -/** Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message - * @return 0 (milliseconds) if a message has been received - * or SYS_MBOX_EMPTY if the mailbox is empty */ -u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); -#endif -/** For now, we map straight to sys_arch implementation. */ -#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) -/** Delete an mbox - * @param mbox mbox to delete */ -void sys_mbox_free(sys_mbox_t *mbox); -#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) -#ifndef sys_mbox_valid -/** Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_mbox_valid(sys_mbox_t *mbox); -#endif -#ifndef sys_mbox_set_invalid -/** Set an mbox invalid so that sys_mbox_valid returns 0 */ -void sys_mbox_set_invalid(sys_mbox_t *mbox); -#endif - -/** The only thread function: - * Creates a new thread - * @param name human-readable name for the thread (used for debugging purposes) - * @param thread thread-function - * @param arg parameter passed to 'thread' - * @param stacksize stack size in bytes for the new thread (may be ignored by ports) - * @param prio priority of the new thread (may be ignored by ports) */ -sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio); - -#endif /* NO_SYS */ - -/* sys_init() must be called before anthing else. */ -void sys_init(void)ICACHE_FLASH_ATTR; - -#ifndef sys_jiffies -/** Ticks/jiffies since power up. */ -u32_t sys_jiffies(void)ICACHE_FLASH_ATTR; -#endif - -/** Returns the current time in milliseconds, - * may be the same as sys_jiffies or at least based on it. */ -static inline u32_t sys_now(void) ICACHE_FLASH_ATTR; -static inline u32_t sys_now(void) -{ - return NOW()/(TIMER_CLK_FREQ/1000); -} - -/* Critical Region Protection */ -/* These functions must be implemented in the sys_arch.c file. - In some implementations they can provide a more light-weight protection - mechanism than using semaphores. Otherwise semaphores can be used for - implementation */ -#ifndef SYS_ARCH_PROTECT -/** SYS_LIGHTWEIGHT_PROT - * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection - * for certain critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#if SYS_LIGHTWEIGHT_PROT - -/** SYS_ARCH_DECL_PROTECT - * declare a protection variable. This macro will default to defining a variable of - * type sys_prot_t. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h. - */ -#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev -/** SYS_ARCH_PROTECT - * Perform a "fast" protect. This could be implemented by - * disabling interrupts for an embedded system or by using a semaphore or - * mutex. The implementation should allow calling SYS_ARCH_PROTECT when - * already protected. The old protection level is returned in the variable - * "lev". This macro will default to calling the sys_arch_protect() function - * which should be implemented in sys_arch.c. If a particular port needs a - * different implementation, then this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() -/** SYS_ARCH_UNPROTECT - * Perform a "fast" set of the protection level to "lev". This could be - * implemented by setting the interrupt level to "lev" within the MACRO or by - * using a semaphore or mutex. This macro will default to calling the - * sys_arch_unprotect() function which should be implemented in - * sys_arch.c. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) -sys_prot_t sys_arch_protect(void)ICACHE_FLASH_ATTR; -void sys_arch_unprotect(sys_prot_t pval)ICACHE_FLASH_ATTR; - -#else - -#define SYS_ARCH_DECL_PROTECT(lev) -#define SYS_ARCH_PROTECT(lev) lev = os_intr_lock() //fix by ives at 2014.3.24 -#define SYS_ARCH_UNPROTECT(lev) lev = os_intr_unlock() - -#endif /* SYS_LIGHTWEIGHT_PROT */ - -#endif /* SYS_ARCH_PROTECT */ - -/* - * Macros to set/get and increase/decrease variables in a thread-safe way. - * Use these for accessing variable that are used from more than one thread. - */ - -#ifndef SYS_ARCH_INC -#define SYS_ARCH_INC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var += val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_INC */ - -#ifndef SYS_ARCH_DEC -#define SYS_ARCH_DEC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var -= val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_DEC */ - -#ifndef SYS_ARCH_GET -#define SYS_ARCH_GET(var, ret) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - ret = var; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_GET */ - -#ifndef SYS_ARCH_SET -#define SYS_ARCH_SET(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var = val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_SET */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_SYS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/tcp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/tcp.h deleted file mode 100644 index 909ff9b7..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/tcp.h +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCP_H__ -#define __LWIP_TCP_H__ - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct tcp_pcb; - -/** Function prototype for tcp accept callback functions. Called when a new - * connection can be accepted on a listening pcb. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param newpcb The new connection pcb - * @param err An error code if there has been an error accepting. - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_accept_fn)(void *arg, struct tcp_pcb *newpcb, err_t err); - -/** Function prototype for tcp receive callback functions. Called when data has - * been received. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which received data - * @param p The received data (or NULL when the connection has been closed!) - * @param err An error code if there has been an error receiving - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_recv_fn)(void *arg, struct tcp_pcb *tpcb, - struct pbuf *p, err_t err); - -/** Function prototype for tcp sent callback functions. Called when sent data has - * been acknowledged by the remote side. Use it to free corresponding resources. - * This also means that the pcb has now space available to send new data. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb for which data has been acknowledged - * @param len The amount of bytes acknowledged - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_sent_fn)(void *arg, struct tcp_pcb *tpcb, - u16_t len); - -/** Function prototype for tcp poll callback functions. Called periodically as - * specified by @see tcp_poll. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb tcp pcb - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_poll_fn)(void *arg, struct tcp_pcb *tpcb); - -/** Function prototype for tcp error callback functions. Called when the pcb - * receives a RST or is unexpectedly closed for any other reason. - * - * @note The corresponding pcb is already freed when this callback is called! - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param err Error code to indicate why the pcb has been closed - * ERR_ABRT: aborted through tcp_abort or by a TCP timer - * ERR_RST: the connection was reset by the remote host - */ -typedef void (*tcp_err_fn)(void *arg, err_t err); - -/** Function prototype for tcp connected callback functions. Called when a pcb - * is connected to the remote side after initiating a connection attempt by - * calling tcp_connect(). - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which is connected - * @param err An unused error code, always ERR_OK currently ;-) TODO! - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - * - * @note When a connection attempt fails, the error callback is currently called! - */ -typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err); - -enum tcp_state { - CLOSED = 0, - LISTEN = 1, - SYN_SENT = 2, - SYN_RCVD = 3, - ESTABLISHED = 4, - FIN_WAIT_1 = 5, - FIN_WAIT_2 = 6, - CLOSE_WAIT = 7, - CLOSING = 8, - LAST_ACK = 9, - TIME_WAIT = 10 -}; - -#if LWIP_CALLBACK_API - /* Function to call when a listener has been connected. - * @param arg user-supplied argument (tcp_pcb.callback_arg) - * @param pcb a new tcp_pcb that now is connected - * @param err an error argument (TODO: that is current always ERR_OK?) - * @return ERR_OK: accept the new connection, - * any other err_t abortsthe new connection - */ -#define DEF_ACCEPT_CALLBACK tcp_accept_fn accept; -#else /* LWIP_CALLBACK_API */ -#define DEF_ACCEPT_CALLBACK -#endif /* LWIP_CALLBACK_API */ - -/** - * members common to struct tcp_pcb and struct tcp_listen_pcb - */ -#define TCP_PCB_COMMON(type) \ - type *next; /* for the linked list */ \ - enum tcp_state state; /* TCP state */ \ - u8_t prio; \ - void *callback_arg; \ - /* the accept callback for listen- and normal pcbs, if LWIP_CALLBACK_API */ \ - DEF_ACCEPT_CALLBACK \ - /* ports are in host byte order */ \ - u16_t local_port - - -/* the TCP protocol control block */ -struct tcp_pcb { -/** common PCB members */ - IP_PCB; -/** protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb); - - /* ports are in host byte order */ - u16_t remote_port; - - u8_t flags; -#define TF_ACK_DELAY ((u8_t)0x01U) /* Delayed ACK. */ -#define TF_ACK_NOW ((u8_t)0x02U) /* Immediate ACK. */ -#define TF_INFR ((u8_t)0x04U) /* In fast recovery. */ -#define TF_TIMESTAMP ((u8_t)0x08U) /* Timestamp option enabled */ -#define TF_RXCLOSED ((u8_t)0x10U) /* rx closed by tcp_shutdown */ -#define TF_FIN ((u8_t)0x20U) /* Connection was closed locally (FIN segment enqueued). */ -#define TF_NODELAY ((u8_t)0x40U) /* Disable Nagle algorithm */ -#define TF_NAGLEMEMERR ((u8_t)0x80U) /* nagle enabled, memerr, try to output to prevent delayed ACK to happen */ - - /* the rest of the fields are in host byte order - as we have to do some math with them */ - /* receiver variables */ - u32_t rcv_nxt; /* next seqno expected */ - u16_t rcv_wnd; /* receiver window available */ - u16_t rcv_ann_wnd; /* receiver window to announce */ - u32_t rcv_ann_right_edge; /* announced right edge of window */ - - /* Timers */ - u32_t tmr; - u8_t polltmr, pollinterval; - - /* Retransmission timer. */ - s16_t rtime; - - u16_t mss; /* maximum segment size */ - - /* RTT (round trip time) estimation variables */ - u32_t rttest; /* RTT estimate in 500ms ticks */ - u32_t rtseq; /* sequence number being timed */ - s16_t sa, sv; /* @todo document this */ - - s16_t rto; /* retransmission time-out */ - u8_t nrtx; /* number of retransmissions */ - - /* fast retransmit/recovery */ - u32_t lastack; /* Highest acknowledged seqno. */ - u8_t dupacks; - - /* congestion avoidance/control variables */ - u16_t cwnd; - u16_t ssthresh; - - /* sender variables */ - u32_t snd_nxt; /* next new seqno to be sent */ - u16_t snd_wnd; /* sender window */ - u32_t snd_wl1, snd_wl2; /* Sequence and acknowledgement numbers of last - window update. */ - u32_t snd_lbb; /* Sequence number of next byte to be buffered. */ - - u16_t acked; - - u16_t snd_buf; /* Available buffer space for sending (in bytes). */ -#define TCP_SNDQUEUELEN_OVERFLOW (0xffff-3) - u16_t snd_queuelen; /* Available buffer space for sending (in tcp_segs). */ - -#if TCP_OVERSIZE - /* Extra bytes available at the end of the last pbuf in unsent. */ - u16_t unsent_oversize; -#endif /* TCP_OVERSIZE */ - - /* These are ordered by sequence number: */ - struct tcp_seg *unsent; /* Unsent (queued) segments. */ - struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ -#if TCP_QUEUE_OOSEQ - struct tcp_seg *ooseq; /* Received out of sequence segments. */ -#endif /* TCP_QUEUE_OOSEQ */ - - struct pbuf *refused_data; /* Data previously received but not yet taken by upper layer */ - -#if LWIP_CALLBACK_API - /* Function to be called when more send buffer space is available. */ - tcp_sent_fn sent; - /* Function to be called when (in-sequence) data has arrived. */ - tcp_recv_fn recv; - /* Function to be called when a connection has been set up. */ - tcp_connected_fn connected; - /* Function which is called periodically. */ - tcp_poll_fn poll; - /* Function to be called whenever a fatal error occurs. */ - tcp_err_fn errf; -#endif /* LWIP_CALLBACK_API */ - -#if LWIP_TCP_TIMESTAMPS - u32_t ts_lastacksent; - u32_t ts_recent; -#endif /* LWIP_TCP_TIMESTAMPS */ - - /* idle time before KEEPALIVE is sent */ - u32_t keep_idle; -#if LWIP_TCP_KEEPALIVE - u32_t keep_intvl; - u32_t keep_cnt; -#endif /* LWIP_TCP_KEEPALIVE */ - - /* Persist timer counter */ - u32_t persist_cnt; - /* Persist timer back-off */ - u8_t persist_backoff; - - /* KEEPALIVE counter */ - u8_t keep_cnt_sent; -}; - -struct tcp_pcb_listen { -/* Common members of all PCB types */ - IP_PCB; -/* Protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb_listen); - -#if TCP_LISTEN_BACKLOG - u8_t backlog; - u8_t accepts_pending; -#endif /* TCP_LISTEN_BACKLOG */ -}; - -#if LWIP_EVENT_API - -enum lwip_event { - LWIP_EVENT_ACCEPT, - LWIP_EVENT_SENT, - LWIP_EVENT_RECV, - LWIP_EVENT_CONNECTED, - LWIP_EVENT_POLL, - LWIP_EVENT_ERR -}; - -err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb, - enum lwip_event, - struct pbuf *p, - u16_t size, - err_t err); - -#endif /* LWIP_EVENT_API */ - -/* Application program's interface: */ -struct tcp_pcb * tcp_new (void)ICACHE_FLASH_ATTR; - -void tcp_arg (struct tcp_pcb *pcb, void *arg) ICACHE_FLASH_ATTR; -void tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept) ICACHE_FLASH_ATTR; -void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv) ICACHE_FLASH_ATTR; -void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent)ICACHE_FLASH_ATTR; -void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)ICACHE_FLASH_ATTR; -void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err)ICACHE_FLASH_ATTR; - -#define tcp_mss(pcb) (((pcb)->flags & TF_TIMESTAMP) ? ((pcb)->mss - 12) : (pcb)->mss) -#define tcp_sndbuf(pcb) ((pcb)->snd_buf) -#define tcp_sndqueuelen(pcb) ((pcb)->snd_queuelen) -#define tcp_nagle_disable(pcb) ((pcb)->flags |= TF_NODELAY) -#define tcp_nagle_enable(pcb) ((pcb)->flags &= ~TF_NODELAY) -#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0) - -#if TCP_LISTEN_BACKLOG -#define tcp_accepted(pcb) do { \ - LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", pcb->state == LISTEN); \ - (((struct tcp_pcb_listen *)(pcb))->accepts_pending--); } while(0) -#else /* TCP_LISTEN_BACKLOG */ -#define tcp_accepted(pcb) LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", \ - pcb->state == LISTEN) -#endif /* TCP_LISTEN_BACKLOG */ - -void tcp_recved (struct tcp_pcb *pcb, u16_t len)ICACHE_FLASH_ATTR; -err_t tcp_bind (struct tcp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -err_t tcp_connect (struct tcp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port, tcp_connected_fn connected)ICACHE_FLASH_ATTR; - -struct tcp_pcb * tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)ICACHE_FLASH_ATTR; -#define tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) - -void tcp_abort (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_close (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)ICACHE_FLASH_ATTR; - -/* Flags for "apiflags" parameter in tcp_write */ -#define TCP_WRITE_FLAG_COPY 0x01 -#define TCP_WRITE_FLAG_MORE 0x02 - -err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len, - u8_t apiflags)ICACHE_FLASH_ATTR; - -void tcp_setprio (struct tcp_pcb *pcb, u8_t prio)ICACHE_FLASH_ATTR; - -#define TCP_PRIO_MIN 1 -#define TCP_PRIO_NORMAL 64 -#define TCP_PRIO_MAX 127 - -extern err_t tcp_output(struct tcp_pcb *pcb); - - -const char* tcp_debug_state_str(enum tcp_state s)ICACHE_FLASH_ATTR; - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* __LWIP_TCP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/tcp_impl.h b/sparkfun/esp8266/firmwares/loader/src/lwip/tcp_impl.h deleted file mode 100644 index f906c0d1..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/tcp_impl.h +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCP_IMPL_H__ -#define __LWIP_TCP_IMPL_H__ - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/tcp.h" -#include "lwip/sys.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Functions for interfacing with TCP: */ - -/* Lower layer interface to TCP: */ -#define tcp_init() /* Compatibility define, no init needed. */ -void tcp_tmr (void)ICACHE_FLASH_ATTR; /* Must be called every - TCP_TMR_INTERVAL - ms. (Typically 250 ms). */ -/* It is also possible to call these two functions at the right - intervals (instead of calling tcp_tmr()). */ -void tcp_slowtmr (void)ICACHE_FLASH_ATTR; -void tcp_fasttmr (void)ICACHE_FLASH_ATTR; - - -/* Only used by IP to pass a TCP segment to TCP: */ -void tcp_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -/* Used within the TCP code only: */ -struct tcp_pcb * tcp_alloc (u8_t prio)ICACHE_FLASH_ATTR; -void tcp_abandon (struct tcp_pcb *pcb, int reset)ICACHE_FLASH_ATTR; -err_t tcp_send_empty_ack(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit_rto (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit_fast (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -/** - * This is the Nagle algorithm: try to combine user data to send as few TCP - * segments as possible. Only send if - * - no previously transmitted data on the connection remains unacknowledged or - * - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or - * - the only unsent segment is at least pcb->mss bytes long (or there is more - * than one unsent segment - with lwIP, this can happen although unsent->len < mss) - * - or if we are in fast-retransmit (TF_INFR) - */ -#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ - ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \ - (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \ - ((tpcb)->unsent->len >= (tpcb)->mss))) \ - ) ? 1 : 0) -#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK) - - -#define TCP_SEQ_LT(a,b) ((s32_t)((a)-(b)) < 0) -#define TCP_SEQ_LEQ(a,b) ((s32_t)((a)-(b)) <= 0) -#define TCP_SEQ_GT(a,b) ((s32_t)((a)-(b)) > 0) -#define TCP_SEQ_GEQ(a,b) ((s32_t)((a)-(b)) >= 0) -/* is b<=a<=c? */ -#if 0 /* see bug #10548 */ -#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b)) -#endif -#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c)) -#define TCP_FIN 0x01U -#define TCP_SYN 0x02U -#define TCP_RST 0x04U -#define TCP_PSH 0x08U -#define TCP_ACK 0x10U -#define TCP_URG 0x20U -#define TCP_ECE 0x40U -#define TCP_CWR 0x80U - -#define TCP_FLAGS 0x3fU - -/* Length of the TCP header, excluding options. */ -#define TCP_HLEN 20 - -#ifndef TCP_TMR_INTERVAL -#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */ -#endif /* TCP_TMR_INTERVAL */ - -#ifndef TCP_FAST_INTERVAL -#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */ -#endif /* TCP_FAST_INTERVAL */ - -#ifndef TCP_SLOW_INTERVAL -#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */ -#endif /* TCP_SLOW_INTERVAL */ - -#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */ -#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */ - -#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */ - -#ifndef TCP_MSL -#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */ -#endif - -/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */ -#ifndef TCP_KEEPIDLE_DEFAULT -#define TCP_KEEPIDLE_DEFAULT 3000UL /* Default KEEPALIVE timer in milliseconds */ -#endif - -#ifndef TCP_KEEPINTVL_DEFAULT -#define TCP_KEEPINTVL_DEFAULT 1000UL /* Default Time between KEEPALIVE probes in milliseconds */ -#endif - -#ifndef TCP_KEEPCNT_DEFAULT -#define TCP_KEEPCNT_DEFAULT 3U /* Default Counter for KEEPALIVE probes */ -#endif - -#define TCP_MAXIDLE TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */ - -/* Fields are (of course) in network byte order. - * Some fields are converted to host byte order in tcp_input(). - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct tcp_hdr { - PACK_STRUCT_FIELD(u16_t src); //Ô´¶Ë¿Ú - PACK_STRUCT_FIELD(u16_t dest); //Ä¿µÄ¶Ë¿Ú - PACK_STRUCT_FIELD(u32_t seqno); //ÐòºÅ - PACK_STRUCT_FIELD(u32_t ackno); //Ó¦´ðÐòºÅ - PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags);//Êײ¿³¤¶È+±£Áôλ+±ê־λ - PACK_STRUCT_FIELD(u16_t wnd); //´°¿Ú´óС - PACK_STRUCT_FIELD(u16_t chksum); //УÑéºÍ - PACK_STRUCT_FIELD(u16_t urgp); //½ô¼±Ö¸Õë -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define TCPH_OFFSET(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 8) -#define TCPH_HDRLEN(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 12) -#define TCPH_FLAGS(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS) - -#define TCPH_OFFSET_SET(phdr, offset) (phdr)->_hdrlen_rsvd_flags = htons(((offset) << 8) | TCPH_FLAGS(phdr)) -#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | TCPH_FLAGS(phdr)) -#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS((u16_t)(~(u16_t)(TCP_FLAGS)))) | htons(flags)) -#define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | (flags)) - -#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | htons(flags)) -#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags)) ) - -#define TCP_TCPLEN(seg) ((seg)->len + ((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0)) - -/** Flags used on input processing, not on pcb->flags -*/ -#define TF_RESET (u8_t)0x08U /* Connection was reset. */ -#define TF_CLOSED (u8_t)0x10U /* Connection was sucessfully closed. */ -#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */ - - -#if LWIP_EVENT_API - -#define TCP_EVENT_ACCEPT(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_ACCEPT, NULL, 0, err) -#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_SENT, NULL, space, ERR_OK) -#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, (p), 0, (err)) -#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, NULL, 0, ERR_OK) -#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_CONNECTED, NULL, 0, (err)) -#define TCP_EVENT_POLL(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_POLL, NULL, 0, ERR_OK) -#define TCP_EVENT_ERR(errf,arg,err) lwip_tcp_event((arg), NULL, \ - LWIP_EVENT_ERR, NULL, 0, (err)) - -#else /* LWIP_EVENT_API */ - -#define TCP_EVENT_ACCEPT(pcb,err,ret) \ - do { \ - if((pcb)->accept != NULL) \ - (ret) = (pcb)->accept((pcb)->callback_arg,(pcb),(err)); \ - else (ret) = ERR_ARG; \ - } while (0) - -#define TCP_EVENT_SENT(pcb,space,ret) \ - do { \ - if((pcb)->sent != NULL) \ - (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_RECV(pcb,p,err,ret) \ - do { \ - if((pcb)->recv != NULL) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\ - } else { \ - (ret) = tcp_recv_null(NULL, (pcb), (p), (err)); \ - } \ - } while (0) - -#define TCP_EVENT_CLOSED(pcb,ret) \ - do { \ - if(((pcb)->recv != NULL)) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\ - } else { \ - (ret) = ERR_OK; \ - } \ - } while (0) - -#define TCP_EVENT_CONNECTED(pcb,err,ret) \ - do { \ - if((pcb)->connected != NULL) \ - (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_POLL(pcb,ret) \ - do { \ - if((pcb)->poll != NULL) \ - (ret) = (pcb)->poll((pcb)->callback_arg,(pcb)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_ERR(errf,arg,err) \ - do { \ - if((errf) != NULL) \ - (errf)((arg),(err)); \ - } while (0) - -#endif /* LWIP_EVENT_API */ - -/** Enabled extra-check for TCP_OVERSIZE if LWIP_DEBUG is enabled */ -#if TCP_OVERSIZE && defined(LWIP_DEBUG) -#define TCP_OVERSIZE_DBGCHECK 1 -#else -#define TCP_OVERSIZE_DBGCHECK 0 -#endif - -/** Don't generate checksum on copy if CHECKSUM_GEN_TCP is disabled */ -#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP) - -/* This structure represents a TCP segment on the unsent, unacked and ooseq queues */ -struct tcp_seg { - struct tcp_seg *next; /* used when putting segements on a queue */ - struct pbuf *p; /* buffer containing data + TCP header */ - void *dataptr; /* pointer to the TCP data in the pbuf */ - u16_t len; /* the TCP length of this segment */ -#if TCP_OVERSIZE_DBGCHECK - u16_t oversize_left; /* Extra bytes available at the end of the last - pbuf in unsent (used for asserting vs. - tcp_pcb.unsent_oversized only) */ -#endif /* TCP_OVERSIZE_DBGCHECK */ -#if TCP_CHECKSUM_ON_COPY - u16_t chksum; - u8_t chksum_swapped; -#endif /* TCP_CHECKSUM_ON_COPY */ - u8_t flags; -#define TF_SEG_OPTS_MSS (u8_t)0x01U /* Include MSS option. */ -#define TF_SEG_OPTS_TS (u8_t)0x02U /* Include timestamp option. */ -#define TF_SEG_DATA_CHECKSUMMED (u8_t)0x04U /* ALL data (not the header) is - checksummed into 'chksum' */ - struct tcp_hdr *tcphdr; /* the TCP header */ -}; - -#define LWIP_TCP_OPT_LENGTH(flags) \ - (flags & TF_SEG_OPTS_MSS ? 4 : 0) + \ - (flags & TF_SEG_OPTS_TS ? 12 : 0) - -/** This returns a TCP header option for MSS in an u32_t */ -#define TCP_BUILD_MSS_OPTION(x) (x) = PP_HTONL(((u32_t)2 << 24) | \ - ((u32_t)4 << 16) | \ - (((u32_t)TCP_MSS / 256) << 8) | \ - (TCP_MSS & 255)) - -/* Global variables: */ -extern struct tcp_pcb *tcp_input_pcb; -extern u32_t tcp_ticks; - -/* The TCP PCB lists. */ -union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ - struct tcp_pcb_listen *listen_pcbs; - struct tcp_pcb *pcbs; -}; -extern struct tcp_pcb *tcp_bound_pcbs; -extern union tcp_listen_pcbs_t tcp_listen_pcbs; -extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a - state in which they accept or send - data. */ -extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */ - -extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */ - -/* Axioms about the above lists: - 1) Every TCP PCB that is not CLOSED is in one of the lists. - 2) A PCB is only in one of the lists. - 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. - 4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state. -*/ -/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB - with a PCB list or removes a PCB from a list, respectively. */ -#ifndef TCP_DEBUG_PCB_LISTS -#define TCP_DEBUG_PCB_LISTS 0 -#endif -#if TCP_DEBUG_PCB_LISTS -#define TCP_REG(pcbs, npcb) do {\ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \ - for(tcp_tmp_pcb = *(pcbs); \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \ - } \ - LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \ - (npcb)->next = *(pcbs); \ - LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \ - *(pcbs) = (npcb); \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - tcp_timer_needed(); \ - } while(0) -#define TCP_RMV(pcbs, npcb) do { \ - LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \ - if(*(pcbs) == (npcb)) { \ - *(pcbs) = (*pcbs)->next; \ - } else for(tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - (npcb)->next = NULL; \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (npcb), *(pcbs))); \ - } while(0) - -#else /* LWIP_DEBUG */ - -#define TCP_REG(pcbs, npcb) \ - do { \ - (npcb)->next = *pcbs; \ - *(pcbs) = (npcb); \ - tcp_timer_needed(); \ - } while (0) - -#define TCP_RMV(pcbs, npcb) \ - do { \ - if(*(pcbs) == (npcb)) { \ - (*(pcbs)) = (*pcbs)->next; \ - } \ - else { \ - for(tcp_tmp_pcb = *pcbs; \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - } \ - (npcb)->next = NULL; \ - } while(0) - -#endif /* LWIP_DEBUG */ - - -/* Internal functions: */ -struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_pcb_purge(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -void tcp_segs_free(struct tcp_seg *seg)ICACHE_FLASH_ATTR; -void tcp_seg_free(struct tcp_seg *seg)ICACHE_FLASH_ATTR; -struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg)ICACHE_FLASH_ATTR; - -#define tcp_ack(pcb) \ - do { \ - if((pcb)->flags & TF_ACK_DELAY) { \ - (pcb)->flags &= ~TF_ACK_DELAY; \ - (pcb)->flags |= TF_ACK_NOW; \ - } \ - else { \ - (pcb)->flags |= TF_ACK_DELAY; \ - } \ - } while (0) - -#define tcp_ack_now(pcb) \ - do { \ - (pcb)->flags |= TF_ACK_NOW; \ - } while (0) - -err_t tcp_send_fin(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)ICACHE_FLASH_ATTR; - -void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg)ICACHE_FLASH_ATTR; - -void tcp_rst(u32_t seqno, u32_t ackno, - ip_addr_t *local_ip, ip_addr_t *remote_ip, - u16_t local_port, u16_t remote_port)ICACHE_FLASH_ATTR; - -u32_t tcp_next_iss(void)ICACHE_FLASH_ATTR; - -void tcp_keepalive(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_zero_window_probe(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -#if TCP_CALCULATE_EFF_SEND_MSS -u16_t tcp_eff_send_mss(u16_t sendmss, ip_addr_t *addr)ICACHE_FLASH_ATTR; -#endif /* TCP_CALCULATE_EFF_SEND_MSS */ - -#if LWIP_CALLBACK_API -err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)ICACHE_FLASH_ATTR; -#endif /* LWIP_CALLBACK_API */ - -#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG -void tcp_debug_print(struct tcp_hdr *tcphdr)ICACHE_FLASH_ATTR; -void tcp_debug_print_flags(u8_t flags)ICACHE_FLASH_ATTR; -void tcp_debug_print_state(enum tcp_state s)ICACHE_FLASH_ATTR; -void tcp_debug_print_pcbs(void)ICACHE_FLASH_ATTR; -s16_t tcp_pcbs_sane(void)ICACHE_FLASH_ATTR; -#else -# define tcp_debug_print(tcphdr) -# define tcp_debug_print_flags(flags) -# define tcp_debug_print_state(s) -# define tcp_debug_print_pcbs() -# define tcp_pcbs_sane() 1 -#endif /* TCP_DEBUG */ - -/** External function (implemented in timers.c), called when TCP detects - * that a timer is needed (i.e. active- or time-wait-pcb found). */ -void tcp_timer_needed(void)ICACHE_FLASH_ATTR; - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* __LWIP_TCP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/tcpip.h b/sparkfun/esp8266/firmwares/loader/src/lwip/tcpip.h deleted file mode 100644 index 995ba8ad..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/tcpip.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCPIP_H__ -#define __LWIP_TCPIP_H__ - -#include "lwip/opt.h" - -#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/api_msg.h" -#include "lwip/netifapi.h" -#include "lwip/pbuf.h" -#include "lwip/api.h" -#include "lwip/sys.h" -#include "lwip/timers.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Define this to something that triggers a watchdog. This is called from - * tcpip_thread after processing a message. */ -#ifndef LWIP_TCPIP_THREAD_ALIVE -#define LWIP_TCPIP_THREAD_ALIVE() -#endif - -#if LWIP_TCPIP_CORE_LOCKING -/** The global semaphore to lock the stack. */ -extern sys_mutex_t lock_tcpip_core; -#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) -#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) -#define TCPIP_APIMSG(m) tcpip_apimsg_lock(m) -#define TCPIP_APIMSG_ACK(m) -#define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m) -#define TCPIP_NETIFAPI_ACK(m) -#else /* LWIP_TCPIP_CORE_LOCKING */ -#define LOCK_TCPIP_CORE() -#define UNLOCK_TCPIP_CORE() -#define TCPIP_APIMSG(m) tcpip_apimsg(m) -#define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed) -#define TCPIP_NETIFAPI(m) tcpip_netifapi(m) -#define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem) -#endif /* LWIP_TCPIP_CORE_LOCKING */ - -/** Function prototype for the init_done function passed to tcpip_init */ -typedef void (*tcpip_init_done_fn)(void *arg); -/** Function prototype for functions passed to tcpip_callback() */ -typedef void (*tcpip_callback_fn)(void *ctx); - -void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg); - -#if LWIP_NETCONN -err_t tcpip_apimsg(struct api_msg *apimsg); -#if LWIP_TCPIP_CORE_LOCKING -err_t tcpip_apimsg_lock(struct api_msg *apimsg); -#endif /* LWIP_TCPIP_CORE_LOCKING */ -#endif /* LWIP_NETCONN */ - -err_t tcpip_input(struct pbuf *p, struct netif *inp); - -#if LWIP_NETIF_API -err_t tcpip_netifapi(struct netifapi_msg *netifapimsg); -#if LWIP_TCPIP_CORE_LOCKING -err_t tcpip_netifapi_lock(struct netifapi_msg *netifapimsg); -#endif /* LWIP_TCPIP_CORE_LOCKING */ -#endif /* LWIP_NETIF_API */ - -err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block); -#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) - -/* free pbufs or heap memory from another context without blocking */ -err_t pbuf_free_callback(struct pbuf *p); -err_t mem_free_callback(void *m); - -#if LWIP_TCPIP_TIMEOUT -err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg); -err_t tcpip_untimeout(sys_timeout_handler h, void *arg); -#endif /* LWIP_TCPIP_TIMEOUT */ - -enum tcpip_msg_type { -#if LWIP_NETCONN - TCPIP_MSG_API, -#endif /* LWIP_NETCONN */ - TCPIP_MSG_INPKT, -#if LWIP_NETIF_API - TCPIP_MSG_NETIFAPI, -#endif /* LWIP_NETIF_API */ -#if LWIP_TCPIP_TIMEOUT - TCPIP_MSG_TIMEOUT, - TCPIP_MSG_UNTIMEOUT, -#endif /* LWIP_TCPIP_TIMEOUT */ - TCPIP_MSG_CALLBACK -}; - -struct tcpip_msg { - enum tcpip_msg_type type; - sys_sem_t *sem; - union { -#if LWIP_NETCONN - struct api_msg *apimsg; -#endif /* LWIP_NETCONN */ -#if LWIP_NETIF_API - struct netifapi_msg *netifapimsg; -#endif /* LWIP_NETIF_API */ - struct { - struct pbuf *p; - struct netif *netif; - } inp; - struct { - tcpip_callback_fn function; - void *ctx; - } cb; -#if LWIP_TCPIP_TIMEOUT - struct { - u32_t msecs; - sys_timeout_handler h; - void *arg; - } tmo; -#endif /* LWIP_TCPIP_TIMEOUT */ - } msg; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* !NO_SYS */ - -#endif /* __LWIP_TCPIP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/timers.h b/sparkfun/esp8266/firmwares/loader/src/lwip/timers.h deleted file mode 100644 index e9db02a2..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/timers.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * Simon Goldschmidt - * - */ -#ifndef __LWIP_TIMERS_H__ -#define __LWIP_TIMERS_H__ - -#include "lwip/opt.h" - -/* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */ -#define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) - -#if LWIP_TIMERS - -#include "lwip/err.h" -#include "lwip/sys.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef LWIP_DEBUG_TIMERNAMES -#ifdef LWIP_DEBUG -#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG -#else /* LWIP_DEBUG */ -#define LWIP_DEBUG_TIMERNAMES 0 -#endif /* LWIP_DEBUG*/ -#endif - -/** Function prototype for a timeout callback function. Register such a function - * using sys_timeout(). - * - * @param arg Additional argument to pass to the function - set up by sys_timeout() - */ -typedef void (* sys_timeout_handler)(void *arg); - -struct sys_timeo { - struct sys_timeo *next; - u32_t time; - sys_timeout_handler h; - void *arg; -#if LWIP_DEBUG_TIMERNAMES - const char* handler_name; -#endif /* LWIP_DEBUG_TIMERNAMES */ -}; - -void sys_timeouts_init(void)ICACHE_FLASH_ATTR; - -#if LWIP_DEBUG_TIMERNAMES -void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)ICACHE_FLASH_ATTR; -#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) -#else /* LWIP_DEBUG_TIMERNAMES */ -void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)ICACHE_FLASH_ATTR; -#endif /* LWIP_DEBUG_TIMERNAMES */ - -void sys_untimeout(sys_timeout_handler handler, void *arg)ICACHE_FLASH_ATTR; -#if NO_SYS -void sys_check_timeouts(void)ICACHE_FLASH_ATTR; -void sys_restart_timeouts(void)ICACHE_FLASH_ATTR; -#else /* NO_SYS */ -void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); -#endif /* NO_SYS */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TIMERS */ -#endif /* __LWIP_TIMERS_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/lwip/udp.h b/sparkfun/esp8266/firmwares/loader/src/lwip/udp.h deleted file mode 100644 index cb53d33e..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/lwip/udp.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_UDP_H__ -#define __LWIP_UDP_H__ - -#include "lwip/opt.h" - -#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define UDP_HLEN 8 - -/* Fields are (of course) in network byte order. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct udp_hdr { - PACK_STRUCT_FIELD(u16_t src); - PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */ - PACK_STRUCT_FIELD(u16_t len); - PACK_STRUCT_FIELD(u16_t chksum); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define UDP_FLAGS_NOCHKSUM 0x01U -#define UDP_FLAGS_UDPLITE 0x02U -#define UDP_FLAGS_CONNECTED 0x04U -#define UDP_FLAGS_MULTICAST_LOOP 0x08U - -struct udp_pcb; - -/** Function prototype for udp pcb receive callback functions - * addr and port are in same byte order as in the pcb - * The callback is responsible for freeing the pbuf - * if it's not used any more. - * - * ATTENTION: Be aware that 'addr' points into the pbuf 'p' so freeing this pbuf - * makes 'addr' invalid, too. - * - * @param arg user supplied argument (udp_pcb.recv_arg) - * @param pcb the udp_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @param port the remote port from which the packet was received - */ -typedef void (*udp_recv_fn)(void *arg, struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *addr, u16_t port); - - -struct udp_pcb { -/* Common members of all PCB types */ - IP_PCB; - -/* Protocol specific PCB members */ - - struct udp_pcb *next; - - u8_t flags; - /** ports are in host byte order */ - u16_t local_port, remote_port; - -#if LWIP_IGMP - /** outgoing network interface for multicast packets */ - ip_addr_t multicast_ip; -#endif /* LWIP_IGMP */ - -#if LWIP_UDPLITE - /** used for UDP_LITE only */ - u16_t chksum_len_rx, chksum_len_tx; -#endif /* LWIP_UDPLITE */ - - /** receive callback function */ - udp_recv_fn recv; - /** user-supplied argument for the recv callback */ - void *recv_arg; -}; -/* udp_pcbs export for exernal reference (e.g. SNMP agent) */ -extern struct udp_pcb *udp_pcbs; - -/* The following functions is the application layer interface to the - UDP code. */ -struct udp_pcb * udp_new (void)ICACHE_FLASH_ATTR; -void udp_remove (struct udp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t udp_bind (struct udp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -err_t udp_connect (struct udp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -void udp_disconnect (struct udp_pcb *pcb)ICACHE_FLASH_ATTR; -void udp_recv (struct udp_pcb *pcb, udp_recv_fn recv, - void *recv_arg)ICACHE_FLASH_ATTR; -err_t udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif)ICACHE_FLASH_ATTR; -err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port)ICACHE_FLASH_ATTR; -err_t udp_send (struct udp_pcb *pcb, struct pbuf *p)ICACHE_FLASH_ATTR; - -#if LWIP_CHECKSUM_ON_COPY -err_t udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif, u8_t have_chksum, - u16_t chksum)ICACHE_FLASH_ATTR; -err_t udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR; -err_t udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, - u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#define udp_flags(pcb) ((pcb)->flags) -#define udp_setflags(pcb, f) ((pcb)->flags = (f)) - -/* The following functions are the lower layer interface to UDP. */ -void udp_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; - -#define udp_init() /* Compatibility define, not init needed. */ - -#if UDP_DEBUG -void udp_debug_print(struct udp_hdr *udphdr)ICACHE_FLASH_ATTR; -#else -#define udp_debug_print(udphdr) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_UDP */ - -#endif /* __LWIP_UDP_H__ */ diff --git a/sparkfun/esp8266/firmwares/loader/src/main.cpp b/sparkfun/esp8266/firmwares/loader/src/main.cpp deleted file mode 100644 index 23d44634..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/main.cpp +++ /dev/null @@ -1,21 +0,0 @@ - -#include "Common.hpp" -#include "TcpServerSource.hpp" - - -using namespace update; - - - - -extern "C" void user_init(void) -{ - Sink dummySink; - AuthChecker dummyAuth; - Args args(""); - - TcpServerSource server(dummySink, dummyAuth); - server.begin(args); -} - - diff --git a/sparkfun/esp8266/firmwares/loader/src/main.d b/sparkfun/esp8266/firmwares/loader/src/main.d deleted file mode 100644 index df3f289f..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/main.d +++ /dev/null @@ -1,13 +0,0 @@ -src/main.o: src/main.cpp src/Common.hpp \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/ets_sys.h \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/c_types.h \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/eagle_soc.h \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/osapi.h \ - src/user_config.h src/lwip/opt.h src/include/lwipopts.h src/lwip/debug.h \ - src/lwip/arch.h src/arch/cc.h \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/c_types.h \ - src/lwip/tcp.h src/lwip/opt.h src/lwip/sys.h \ - ../../../../../build/macosx/work/Arduino.app/Contents/Java/hardware/tools/esp8266/sdk/include/eagle_soc.h \ - src/lwip/mem.h src/lwip/mem_manager.h src/lwip/pbuf.h src/lwip/err.h \ - src/lwip/ip.h src/lwip/def.h src/lwip/ip_addr.h src/lwip/netif.h \ - src/lwip/icmp.h src/lwip/inet.h src/TcpServerSource.hpp diff --git a/sparkfun/esp8266/firmwares/loader/src/main.o b/sparkfun/esp8266/firmwares/loader/src/main.o deleted file mode 100644 index dbe7654b..00000000 Binary files a/sparkfun/esp8266/firmwares/loader/src/main.o and /dev/null differ diff --git a/sparkfun/esp8266/firmwares/loader/src/user_config.h b/sparkfun/esp8266/firmwares/loader/src/user_config.h deleted file mode 100644 index 8b137891..00000000 --- a/sparkfun/esp8266/firmwares/loader/src/user_config.h +++ /dev/null @@ -1 +0,0 @@ - diff --git a/sparkfun/esp8266/firmwares/loader/target.mk b/sparkfun/esp8266/firmwares/loader/target.mk deleted file mode 100644 index 94a2329a..00000000 --- a/sparkfun/esp8266/firmwares/loader/target.mk +++ /dev/null @@ -1,111 +0,0 @@ -include $(TARGET_DIR)/lwip.mk - -TARGET_OBJ_FILES := main.o \ - uart.o \ - interface_commands.o \ - info_commands.o \ - wifi_commands.o \ - ip_commands.o \ - ip_commands_info.o \ - ip_commands_common.o \ - ip_commands_socket.o \ - config_store.o \ - - -TARGET_OBJ_PATHS := $(addprefix $(TARGET_DIR)/,$(TARGET_OBJ_FILES)) - -TOOLCHAIN_PREFIX ?= xtensa-lx106-elf- -XTENSA_TOOCHAIN := ../xtensa-lx106-elf/bin -CC := $(TOOLCHAIN_PREFIX)gcc -AR := $(TOOLCHAIN_PREFIX)ar -LD := $(TOOLCHAIN_PREFIX)gcc -OBJCOPY := $(TOOLCHAIN_PREFIX)objcopy - - -XTENSA_LIBS ?= $(shell $(CC) -print-sysroot) - -ESPTOOL ?= ../esptool/esptool - -SDK_BASE ?= ../esp_iot_sdk_v0.9.3 - -SDK_EXAMPLE_DIR := $(SDK_BASE)/examples/IoT_Demo - -SDK_DRIVER_OBJ_FILES := -SDK_DRIVER_OBJ_PATHS := $(addprefix $(SDK_AT_DIR)/driver/,$(SDK_DRIVER_OBJ_FILES)) - -CPPFLAGS += -I$(XTENSA_LIBS)/include \ - -I$(SDK_BASE)/include \ - -I$(TARGET_DIR) \ - -I$(LWIP_DIR)/include \ - -I$(SDK_EXAMPLE_DIR)/include - -LDFLAGS += -L$(XTENSA_LIBS)/lib \ - -L$(XTENSA_LIBS)/arch/lib \ - -L$(SDK_BASE)/lib - -CFLAGS+=-std=c99 -CPPFLAGS+=-DESP_PLATFORM=1 - -LIBS := c gcc hal phy net80211 wpa main json ssl pp - -#-Werror -CFLAGS += -Os -g -O2 -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -D__ets__ -DICACHE_FLASH - -LDFLAGS += -nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static - -LD_SCRIPT := $(SDK_BASE)/ld/eagle.app.v6.ld - -LWIP_AR:=$(BIN_DIR)/lwipc.a - -APP_AR:=$(BIN_DIR)/app.a -APP_OUT:=$(BIN_DIR)/app.out -APP_FW_1 := $(BIN_DIR)/0x00000.bin -APP_FW_2 := $(BIN_DIR)/0x40000.bin -FULL_FW := $(BIN_DIR)/firmware.bin - -$(LWIP_AR) : $(LWIP_OBJ_PATHS) - for file in $(LWIP_OBJ_PATHS); do \ - $(OBJCOPY) \ - --rename-section .text=.irom0.text \ - --rename-section .literal=.irom0.literal \ - $$file; \ - done - $(AR) cru $@ $^ - -$(LWIP_AR): | $(BIN_DIR) - -$(APP_AR): $(COMMON_OBJ_PATHS) $(TARGET_OBJ_PATHS) $(SDK_DRIVER_OBJ_PATHS) - $(AR) cru $@ $^ - -$(APP_AR): | $(BIN_DIR) - -$(APP_OUT): $(APP_AR) $(LWIP_AR) - $(LD) -T$(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group $(addprefix -l,$(LIBS)) $(APP_AR) $(LWIP_AR) -Wl,--end-group -o $@ - -$(APP_FW_1): $(APP_OUT) - $(ESPTOOL) -eo $(APP_OUT) -bo $@ -bs .text -bs .data -bs .rodata -bc -ec - -$(APP_FW_2): $(APP_OUT) - $(ESPTOOL) -eo $(APP_OUT) -es .irom0.text $@ -ec - -$(FULL_FW): $(APP_FW_1) $(APP_FW_2) - dd if=/dev/zero ibs=4k count=124 | LC_ALL=C tr "\000" "\377" >$(FULL_FW) - dd if=$(APP_FW_1) of=$(FULL_FW) bs=4k seek=0 conv=notrunc - dd if=$(APP_FW_2) of=$(FULL_FW) bs=4k seek=64 conv=notrunc - -firmware: $(APP_FW_1) $(APP_FW_2) $(FULL_FW) - -all: firmware - -clean-driver: - rm -r $(SDK_DRIVER_OBJ_PATHS) - -clean-lwip: - rm -rf $(LWIP_OBJ_PATHS) - rm -rf $(LWIP_AR) - -clean: clean-lwip - -#clean: clean-driver - -.PHONY: all firmware diff --git a/sparkfun/esp8266/libraries/.DS_Store b/sparkfun/esp8266/libraries/.DS_Store deleted file mode 100644 index 78608c86..00000000 Binary files a/sparkfun/esp8266/libraries/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/libraries/EEPROM/EEPROM.cpp b/sparkfun/esp8266/libraries/EEPROM/EEPROM.cpp deleted file mode 100644 index 2d8b23db..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/EEPROM.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - EEPROM.cpp - esp8266 EEPROM emulation - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "Arduino.h" -#include "EEPROM.h" - - extern "C" { -#include "c_types.h" -#include "ets_sys.h" -#include "os_type.h" -#include "osapi.h" -#include "spi_flash.h" -extern uint32_t _SPIFFS_end; -} - -#define CONFIG_START_SECTOR (((uint32_t)_SPIFFS_end - 0x40200000) / 4096) -#define CONFIG_SECTOR (CONFIG_START_SECTOR + 0) -#define CONFIG_ADDR (SPI_FLASH_SEC_SIZE * CONFIG_SECTOR) - -EEPROMClass::EEPROMClass() -: _data(0), _size(0), _dirty(false) -{ -} - -void EEPROMClass::begin(size_t size) -{ - if (size <= 0) - return; - if (size > SPI_FLASH_SEC_SIZE) - size = SPI_FLASH_SEC_SIZE; - - _data = new uint8_t[size]; - _size = size; - - noInterrupts(); - spi_flash_read(CONFIG_ADDR, reinterpret_cast(_data), _size); - interrupts(); -} - -void EEPROMClass::end() -{ - if (!_size) - return; - - commit(); - if(_data) { - delete[] _data; - } - _data = 0; - _size = 0; -} - - -uint8_t EEPROMClass::read(int address) -{ - if (address < 0 || (size_t)address >= _size) - return 0; - if(!_data) - return 0; - - return _data[address]; -} - -void EEPROMClass::write(int address, uint8_t value) -{ - if (address < 0 || (size_t)address >= _size) - return; - if(!_data) - return; - - _data[address] = value; - _dirty = true; -} - -bool EEPROMClass::commit() -{ - bool ret = false; - if (!_size) - return false; - if(!_dirty) - return true; - if(!_data) - return false; - - noInterrupts(); - if(spi_flash_erase_sector(CONFIG_SECTOR) == SPI_FLASH_RESULT_OK) { - if(spi_flash_write(CONFIG_ADDR, reinterpret_cast(_data), _size) == SPI_FLASH_RESULT_OK) { - _dirty = false; - ret = true; - } - } - interrupts(); - - return ret; -} - -uint8_t * EEPROMClass::getDataPtr() -{ - _dirty = true; - return &_data[0]; -} - - -EEPROMClass EEPROM; diff --git a/sparkfun/esp8266/libraries/EEPROM/EEPROM.h b/sparkfun/esp8266/libraries/EEPROM/EEPROM.h deleted file mode 100644 index 97dd4c26..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/EEPROM.h +++ /dev/null @@ -1,71 +0,0 @@ -/* - EEPROM.cpp - esp8266 EEPROM emulation - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef EEPROM_h -#define EEPROM_h - -#include -#include -#include - -class EEPROMClass -{ - public: - EEPROMClass(); - void begin(size_t size); - uint8_t read(int address); - void write(int address, uint8_t val); - bool commit(); - void end(); - - uint8_t * getDataPtr(); - - template T &get(int address, T &t) - { - if (address < 0 || address + sizeof(T) > _size) - return t; - - uint8_t *ptr = (uint8_t*) &t; - memcpy(ptr, _data + address, sizeof(T)); - return t; - } - - template const T &put(int address, const T &t) - { - if (address < 0 || address + sizeof(T) > _size) - return t; - - const uint8_t *ptr = (const uint8_t*) &t; - memcpy(_data + address, ptr, sizeof(T)); - _dirty = true; - return t; - } - - protected: - uint8_t* _data; - size_t _size; - bool _dirty; -}; - -extern EEPROMClass EEPROM; - -#endif - diff --git a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino b/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino deleted file mode 100644 index 98b7ad74..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino +++ /dev/null @@ -1,26 +0,0 @@ -/* - * EEPROM Clear - * - * Sets all of the bytes of the EEPROM to 0. - * This example code is in the public domain. - - */ - -#include - -void setup() -{ - EEPROM.begin(512); - // write a 0 to all 512 bytes of the EEPROM - for (int i = 0; i < 512; i++) - EEPROM.write(i, 0); - - // turn the LED on when we're done - pinMode(13, OUTPUT); - digitalWrite(13, HIGH); - EEPROM.end(); -} - -void loop() -{ -} diff --git a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino b/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino deleted file mode 100644 index d1395b31..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino +++ /dev/null @@ -1,44 +0,0 @@ -/* - * EEPROM Read - * - * Reads the value of each byte of the EEPROM and prints it - * to the computer. - * This example code is in the public domain. - */ - -#include - -// start reading from the first byte (address 0) of the EEPROM -int address = 0; -byte value; - -void setup() -{ - // initialize serial and wait for port to open: - Serial.begin(9600); - while (!Serial) { - ; // wait for serial port to connect. Needed for Leonardo only - } - EEPROM.begin(512); -} - -void loop() -{ - // read a byte from the current address of the EEPROM - value = EEPROM.read(address); - - Serial.print(address); - Serial.print("\t"); - Serial.print(value, DEC); - Serial.println(); - - // advance to the next address of the EEPROM - address = address + 1; - - // there are only 512 bytes of EEPROM, from 0 to 511, so if we're - // on address 512, wrap around to address 0 - if (address == 512) - address = 0; - - delay(500); -} diff --git a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino b/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino deleted file mode 100644 index 3f1af8e4..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/examples/eeprom_write/eeprom_write.ino +++ /dev/null @@ -1,43 +0,0 @@ -/* - * EEPROM Write - * - * Stores values read from analog input 0 into the EEPROM. - * These values will stay in the EEPROM when the board is - * turned off and may be retrieved later by another sketch. - */ - -#include - -// the current address in the EEPROM (i.e. which byte -// we're going to write to next) -int addr = 0; - -void setup() -{ - EEPROM.begin(512); -} - -void loop() -{ - // need to divide by 4 because analog inputs range from - // 0 to 1023 and each byte of the EEPROM can only hold a - // value from 0 to 255. - int val = analogRead(0) / 4; - - // write the value to the appropriate byte of the EEPROM. - // these values will remain there when the board is - // turned off. - EEPROM.write(addr, val); - - // advance to the next address. there are 512 bytes in - // the EEPROM, so go back to 0 when we hit 512. - // save all changes to the flash. - addr = addr + 1; - if (addr == 512) - { - addr = 0; - EEPROM.commit(); - } - - delay(100); -} diff --git a/sparkfun/esp8266/libraries/EEPROM/library.properties b/sparkfun/esp8266/libraries/EEPROM/library.properties deleted file mode 100644 index fbd99086..00000000 --- a/sparkfun/esp8266/libraries/EEPROM/library.properties +++ /dev/null @@ -1,8 +0,0 @@ -name=EEPROM -version=1.0 -author=Ivan Grokhotkov -maintainer=Ivan Grokhotkov -sentence=Enables reading and writing data to the permanent FLASH storage, up to 4kb. -paragraph= -url=http://arduino.cc/en/Reference/EEPROM -architectures=esp8266 diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/.DS_Store b/sparkfun/esp8266/libraries/ESP8266WebServer/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/sparkfun/esp8266/libraries/ESP8266WebServer/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino b/sparkfun/esp8266/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino deleted file mode 100644 index 0ffdd717..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/AdvancedWebServer/AdvancedWebServer.ino +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) 2015, Majenko Technologies - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * * Neither the name of Majenko Technologies nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#include -#include -#include -#include - -const char *ssid = "YourSSIDHere"; -const char *password = "YourPSKHere"; -MDNSResponder mdns; - -ESP8266WebServer server ( 80 ); - -const int led = 13; - -void handleRoot() { - digitalWrite ( led, 1 ); - char temp[400]; - int sec = millis() / 1000; - int min = sec / 60; - int hr = min / 60; - - snprintf ( temp, 400, - -"\ - \ - \ - ESP8266 Demo\ - \ - \ - \ -

Hello from ESP8266!

\ -

Uptime: %02d:%02d:%02d

\ - \ - \ -", - - hr, min % 60, sec % 60 - ); - server.send ( 200, "text/html", temp ); - digitalWrite ( led, 0 ); -} - -void handleNotFound() { - digitalWrite ( led, 1 ); - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += ( server.method() == HTTP_GET ) ? "GET" : "POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - - for ( uint8_t i = 0; i < server.args(); i++ ) { - message += " " + server.argName ( i ) + ": " + server.arg ( i ) + "\n"; - } - - server.send ( 404, "text/plain", message ); - digitalWrite ( led, 0 ); -} - -void setup ( void ) { - pinMode ( led, OUTPUT ); - digitalWrite ( led, 0 ); - Serial.begin ( 115200 ); - WiFi.begin ( ssid, password ); - Serial.println ( "" ); - - // Wait for connection - while ( WiFi.status() != WL_CONNECTED ) { - delay ( 500 ); - Serial.print ( "." ); - } - - Serial.println ( "" ); - Serial.print ( "Connected to " ); - Serial.println ( ssid ); - Serial.print ( "IP address: " ); - Serial.println ( WiFi.localIP() ); - - if ( mdns.begin ( "esp8266", WiFi.localIP() ) ) { - Serial.println ( "MDNS responder started" ); - } - - server.on ( "/", handleRoot ); - server.on ( "/test.svg", drawGraph ); - server.on ( "/inline", []() { - server.send ( 200, "text/plain", "this works as well" ); - } ); - server.onNotFound ( handleNotFound ); - server.begin(); - Serial.println ( "HTTP server started" ); -} - -void loop ( void ) { - mdns.update(); - server.handleClient(); -} - -void drawGraph() { - String out = ""; - char temp[100]; - out += "\n"; - out += "\n"; - out += "\n"; - int y = rand() % 130; - for (int x = 10; x < 390; x+= 10) { - int y2 = rand() % 130; - sprintf(temp, "\n", x, 140 - y, x + 10, 140 - y2); - out += temp; - y = y2; - } - out += "\n\n"; - - server.send ( 200, "image/svg+xml", out); -} diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino b/sparkfun/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino deleted file mode 100644 index 4264aeca..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/HelloServer/HelloServer.ino +++ /dev/null @@ -1,73 +0,0 @@ -#include -#include -#include -#include - -const char* ssid = "........"; -const char* password = "........"; -MDNSResponder mdns; - -ESP8266WebServer server(80); - -const int led = 13; - -void handleRoot() { - digitalWrite(led, 1); - server.send(200, "text/plain", "hello from esp8266!"); - digitalWrite(led, 0); -} - -void handleNotFound(){ - digitalWrite(led, 1); - String message = "File Not Found\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET)?"GET":"POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i=0; i -#include -#include -#include -#include -#include - -#define DBG_OUTPUT_PORT Serial - -const char* ssid = "**********"; -const char* password = "**********"; -const char* hostname = "esp8266sd"; - -MDNSResponder mdns; -ESP8266WebServer server(80); - -static bool hasSD = false; -File uploadFile; - - -void returnOK() { - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(200, "text/plain", ""); -} - -void returnFail(String msg) { - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(500, "text/plain", msg + "\r\n"); -} - -bool loadFromSdCard(String path){ - String dataType = "text/plain"; - if(path.endsWith("/")) path += "index.htm"; - - if(path.endsWith(".src")) path = path.substring(0, path.lastIndexOf(".")); - else if(path.endsWith(".htm")) dataType = "text/html"; - else if(path.endsWith(".css")) dataType = "text/css"; - else if(path.endsWith(".js")) dataType = "application/javascript"; - else if(path.endsWith(".png")) dataType = "image/png"; - else if(path.endsWith(".gif")) dataType = "image/gif"; - else if(path.endsWith(".jpg")) dataType = "image/jpeg"; - else if(path.endsWith(".ico")) dataType = "image/x-icon"; - else if(path.endsWith(".xml")) dataType = "text/xml"; - else if(path.endsWith(".pdf")) dataType = "application/pdf"; - else if(path.endsWith(".zip")) dataType = "application/zip"; - - File dataFile = SD.open(path.c_str()); - if(dataFile.isDirectory()){ - path += "/index.htm"; - dataType = "text/html"; - dataFile = SD.open(path.c_str()); - } - - if (!dataFile) - return false; - - if(server.hasArg("download")) dataType = "application/octet-stream"; - - server.sendHeader("Content-Length", String(dataFile.size())); - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(200, dataType.c_str(), ""); - - WiFiClient client = server.client(); - size_t totalSize = dataFile.size(); - if (client.write(dataFile, HTTP_DOWNLOAD_UNIT_SIZE) != totalSize) { - DBG_OUTPUT_PORT.println("Sent less data than expected!"); - } - - dataFile.close(); - return true; -} - -void handleFileUpload(){ - if(server.uri() != "/edit") return; - HTTPUpload& upload = server.upload(); - if(upload.status == UPLOAD_FILE_START){ - if(SD.exists((char *)upload.filename.c_str())) SD.remove((char *)upload.filename.c_str()); - uploadFile = SD.open(upload.filename.c_str(), FILE_WRITE); - DBG_OUTPUT_PORT.print("Upload: START, filename: "); DBG_OUTPUT_PORT.println(upload.filename); - } else if(upload.status == UPLOAD_FILE_WRITE){ - if(uploadFile) uploadFile.write(upload.buf, upload.currentSize); - DBG_OUTPUT_PORT.print("Upload: WRITE, Bytes: "); DBG_OUTPUT_PORT.println(upload.currentSize); - } else if(upload.status == UPLOAD_FILE_END){ - if(uploadFile) uploadFile.close(); - DBG_OUTPUT_PORT.print("Upload: END, Size: "); DBG_OUTPUT_PORT.println(upload.totalSize); - } -} - -void deleteRecursive(String path){ - File file = SD.open((char *)path.c_str()); - if(!file.isDirectory()){ - file.close(); - SD.remove((char *)path.c_str()); - return; - } - - file.rewindDirectory(); - while(true) { - File entry = file.openNextFile(); - if (!entry) break; - String entryPath = path + "/" +entry.name(); - if(entry.isDirectory()){ - entry.close(); - deleteRecursive(entryPath); - } else { - entry.close(); - SD.remove((char *)entryPath.c_str()); - } - yield(); - } - - SD.rmdir((char *)path.c_str()); - file.close(); -} - -void handleDelete(){ - if(server.args() == 0) return returnFail("BAD ARGS"); - String path = server.arg(0); - if(path == "/" || !SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - deleteRecursive(path); - returnOK(); -} - -void handleCreate(){ - if(server.args() == 0) return returnFail("BAD ARGS"); - String path = server.arg(0); - if(path == "/" || SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - - if(path.indexOf('.') > 0){ - File file = SD.open((char *)path.c_str(), FILE_WRITE); - if(file){ - file.write((const char *)0); - file.close(); - } - } else { - SD.mkdir((char *)path.c_str()); - } - returnOK(); -} - -void printDirectory() { - if(!server.hasArg("dir")) return returnFail("BAD ARGS"); - String path = server.arg("dir"); - if(path != "/" && !SD.exists((char *)path.c_str())) return returnFail("BAD PATH"); - File dir = SD.open((char *)path.c_str()); - path = String(); - if(!dir.isDirectory()){ - dir.close(); - return returnFail("NOT DIR"); - } - dir.rewindDirectory(); - - server.send(200, "text/json", ""); - WiFiClient client = server.client(); - - for (int cnt = 0; true; ++cnt) { - File entry = dir.openNextFile(); - if (!entry) - break; - - String output; - if (cnt == 0) - output = '['; - else - output = ','; - - output += "{\"type\":\""; - output += (entry.isDirectory()) ? "dir" : "file"; - output += "\",\"name\":\""; - output += entry.name(); - output += "\""; - output += "}"; - server.sendContent(output); - entry.close(); - } - server.sendContent("]"); - dir.close(); -} - -void handleNotFound(){ - if(hasSD && loadFromSdCard(server.uri())) return; - String message = "SDCARD Not Detected\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET)?"GET":"POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i=0; i -#include -#include -#include -#include -#include - -#define DBG_OUTPUT_PORT Serial - -const char* ssid = "**********"; -const char* password = "**********"; -const char* hostname = "esp8266sd"; - -MDNSResponder mdns; -ESP8266WebServer server(80); - -static bool hasSD = false; -File uploadFile; - - -void returnOK() { - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(200, "text/plain", ""); -} - -void returnFail(String msg) { - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(500, "text/plain", msg + "\r\n"); -} - -bool loadFromSdCard(String path){ - String dataType = "text/plain"; - if(path.endsWith("/")) path += "index.htm"; - - if(path.endsWith(".src")) path = path.substring(0, path.lastIndexOf(".")); - else if(path.endsWith(".htm")) dataType = "text/html"; - else if(path.endsWith(".css")) dataType = "text/css"; - else if(path.endsWith(".js")) dataType = "application/javascript"; - else if(path.endsWith(".png")) dataType = "image/png"; - else if(path.endsWith(".gif")) dataType = "image/gif"; - else if(path.endsWith(".jpg")) dataType = "image/jpeg"; - else if(path.endsWith(".ico")) dataType = "image/x-icon"; - else if(path.endsWith(".xml")) dataType = "text/xml"; - else if(path.endsWith(".pdf")) dataType = "application/pdf"; - else if(path.endsWith(".zip")) dataType = "application/zip"; - - File dataFile = SD.open(path.c_str()); - if(dataFile.isDirectory()){ - path += "/index.htm"; - dataType = "text/html"; - dataFile = SD.open(path.c_str()); - } - - if (!dataFile) - return false; - - if(server.hasArg("download")) dataType = "application/octet-stream"; - -<<<<<<< HEAD - server.sendHeader("Content-Length", String(dataFile.size())); - server.sendHeader("Connection", "close"); - server.sendHeader("Access-Control-Allow-Origin", "*"); - server.send(200, dataType.c_str(), ""); - - WiFiClient client = server.client(); - size_t totalSize = dataFile.size(); - if (client.write(dataFile, PAYLOAD_UNIT_SIZE) != totalSize) { - DBG_OUTPUT_PORT.println("Sent less data than expected!"); -======= - if (dataFile) { - WiFiClient client = server.client(); - String head = "HTTP/1.1 200 OK\r\nContent-Type: "; - head += dataType; - head += "\r\nContent-Length: "; - head += dataFile.size(); - head += "\r\nConnection: close"; - head += "\r\nAccess-Control-Allow-Origin: *"; - head += "\r\n\r\n"; - client.print(head); - dataType = String(); - path = String(); - - if(client.write(dataFile) != dataFile.size()){ - DBG_OUTPUT_PORT.println("Sent less data than expected!"); - } - - dataFile.close(); - client.stop(); - return true; ->>>>>>> ficeto-esp8266 - } - - dataFile.close(); - return true; -} - -void handleFileUpload(){ - if(server.uri() != "/edit") return; - HTTPUpload& upload = server.upload(); - if(upload.status == UPLOAD_FILE_START){ - if(SD.exists((char *)upload.filename.c_str())) SD.remove((char *)upload.filename.c_str()); - uploadFile = SD.open(upload.filename.c_str(), FILE_WRITE); - DBG_OUTPUT_PORT.print("Upload: START, filename: "); DBG_OUTPUT_PORT.println(upload.filename); - } else if(upload.status == UPLOAD_FILE_WRITE){ - if(uploadFile) uploadFile.write(upload.buf, upload.currentSize); - DBG_OUTPUT_PORT.print("Upload: WRITE, Bytes: "); DBG_OUTPUT_PORT.println(upload.currentSize); - } else if(upload.status == UPLOAD_FILE_END){ - if(uploadFile) uploadFile.close(); - DBG_OUTPUT_PORT.print("Upload: END, Size: "); DBG_OUTPUT_PORT.println(upload.totalSize); - } -} - -void deleteRecursive(String path){ - File file = SD.open((char *)path.c_str()); - if(!file.isDirectory()){ - file.close(); - SD.remove((char *)path.c_str()); - return; - } - - file.rewindDirectory(); - while(true) { - File entry = file.openNextFile(); - if (!entry) break; - String entryPath = path + "/" +entry.name(); - if(entry.isDirectory()){ - entry.close(); - deleteRecursive(entryPath); - } else { - entry.close(); - SD.remove((char *)entryPath.c_str()); - } - yield(); - } - - SD.rmdir((char *)path.c_str()); - file.close(); -} - -void handleDelete(){ - if(server.args() == 0) return returnFail("BAD ARGS"); - String path = server.arg(0); - if(path == "/" || !SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - deleteRecursive(path); - returnOK(); -} - -void handleCreate(){ - if(server.args() == 0) return returnFail("BAD ARGS"); - String path = server.arg(0); - if(path == "/" || SD.exists((char *)path.c_str())) { - returnFail("BAD PATH"); - return; - } - - if(path.indexOf('.') > 0){ - File file = SD.open((char *)path.c_str(), FILE_WRITE); - if(file){ - file.write((const char *)0); - file.close(); - } - } else { - SD.mkdir((char *)path.c_str()); - } - returnOK(); -} - -void printDirectory() { - if(!server.hasArg("dir")) return returnFail("BAD ARGS"); - String path = server.arg("dir"); - if(path != "/" && !SD.exists((char *)path.c_str())) return returnFail("BAD PATH"); - File dir = SD.open((char *)path.c_str()); - path = String(); - if(!dir.isDirectory()){ - dir.close(); - return returnFail("NOT DIR"); - } - dir.rewindDirectory(); - - server.send(200, "text/json", ""); - WiFiClient client = server.client(); - - for (int cnt = 0; true; ++cnt) { - File entry = dir.openNextFile(); - if (!entry) - break; - - String output; - if (cnt == 0) - output = '['; - else - output = ','; - - output += "{\"type\":\""; - output += (entry.isDirectory()) ? "dir" : "file"; - output += "\",\"name\":\""; - output += entry.name(); - output += "\""; - output += "}"; - server.sendContent(output); - entry.close(); - } - server.sendContent("]"); - dir.close(); -} - -void handleNotFound(){ - if(hasSD && loadFromSdCard(server.uri())) return; - String message = "SDCARD Not Detected\n\n"; - message += "URI: "; - message += server.uri(); - message += "\nMethod: "; - message += (server.method() == HTTP_GET)?"GET":"POST"; - message += "\nArguments: "; - message += server.args(); - message += "\n"; - for (uint8_t i=0; i - - - SD Editor - - - - - -
-
-
- - - - diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/index.htm b/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/index.htm deleted file mode 100644 index 55fe5a66..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/index.htm +++ /dev/null @@ -1,22 +0,0 @@ - - - - - ESP Index - - - - -

ESP8266 Pin Functions

- - - diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/pins.png b/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/pins.png deleted file mode 100644 index ac7fc0f9..00000000 Binary files a/sparkfun/esp8266/libraries/ESP8266WebServer/examples/SDWebServer/SdRoot/pins.png and /dev/null differ diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/keywords.txt b/sparkfun/esp8266/libraries/ESP8266WebServer/keywords.txt deleted file mode 100644 index 6eee0f19..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/keywords.txt +++ /dev/null @@ -1,35 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -ESP8266WebServer KEYWORD1 -HTTPMethod KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -handleClient KEYWORD2 -on KEYWORD2 -uri KEYWORD2 -method KEYWORD2 -client KEYWORD2 -send KEYWORD2 -arg KEYWORD2 -argName KEYWORD2 -args KEYWORD2 -hasArg KEYWORD2 -onNotFound KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - -HTTP_GET LITERAL1 -HTTP_POST LITERAL1 -HTTP_ANY LITERAL1 diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/library.properties b/sparkfun/esp8266/libraries/ESP8266WebServer/library.properties deleted file mode 100644 index 4dd12d3b..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ESP8266WebServer -version=1.0 -author=Ivan Grokhotkov -maintainer=Ivan Grokhtkov -sentence=Simple web server library -paragraph=The library supports HTTP GET and POST requests, provides argument parsing, handles one client at a time. -category=Communication -url= -architectures=esp8266 diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp b/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp deleted file mode 100644 index 391cc556..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp +++ /dev/null @@ -1,241 +0,0 @@ -/* - ESP8266WebServer.cpp - Dead simple web-server. - Supports only one simultaneous client, knows how to handle GET and POST. - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - - -#include -#include "WiFiServer.h" -#include "WiFiClient.h" -#include "ESP8266WebServer.h" - -// #define DEBUG -#define DEBUG_OUTPUT Serial - -struct ESP8266WebServer::RequestHandler { - RequestHandler(ESP8266WebServer::THandlerFunction fn, const char* uri, HTTPMethod method) - : fn(fn) - , uri(uri) - , method(method) - , next(NULL) - { - } - - ESP8266WebServer::THandlerFunction fn; - String uri; - HTTPMethod method; - RequestHandler* next; - -}; - -ESP8266WebServer::ESP8266WebServer(int port) -: _server(port) -, _firstHandler(0) -, _lastHandler(0) -, _currentArgCount(0) -, _currentArgs(0) -{ -} - -ESP8266WebServer::~ESP8266WebServer() -{ - if (!_firstHandler) - return; - RequestHandler* handler = _firstHandler; - while (handler) { - RequestHandler* next = handler->next; - delete handler; - handler = next; - } -} - -void ESP8266WebServer::begin() { - _server.begin(); -} - - -void ESP8266WebServer::on(const char* uri, ESP8266WebServer::THandlerFunction handler) -{ - on(uri, HTTP_ANY, handler); -} - -void ESP8266WebServer::on(const char* uri, HTTPMethod method, ESP8266WebServer::THandlerFunction fn) -{ - RequestHandler* handler = new RequestHandler(fn, uri, method); - if (!_lastHandler) { - _firstHandler = handler; - _lastHandler = handler; - } - else { - _lastHandler->next = handler; - _lastHandler = handler; - } -} - -void ESP8266WebServer::handleClient() -{ - WiFiClient client = _server.available(); - if (!client) { - return; - } - -#ifdef DEBUG - DEBUG_OUTPUT.println("New client"); -#endif - - // Wait for data from client to become available - while(client.connected() && !client.available()){ - delay(1); - } - - if (!_parseRequest(client)) { - return; - } - - _currentClient = client; - _handleRequest(); -} - -void ESP8266WebServer::sendHeader(String name, String value, bool first) { - String headerLine = name; - headerLine += ": "; - headerLine += value; - headerLine += "\r\n"; - - if (first) { - _responseHeaders = headerLine + _responseHeaders; - } - else { - _responseHeaders += headerLine; - } -} - -void ESP8266WebServer::send(int code, const char* content_type, String content) { - String response = "HTTP/1.1 "; - response += String(code); - response += " "; - response += _responseCodeToString(code); - response += "\r\n"; - - if (!content_type) - content_type = "text/html"; - sendHeader("Content-Type", content_type, true); - - response += _responseHeaders; - response += "\r\n"; - response += content; - _responseHeaders = String(); - sendContent(response); -} - -void ESP8266WebServer::sendContent(String content) { - size_t size_to_send = content.length(); - size_t size_sent = 0; - while(size_to_send) { - const size_t unit_size = HTTP_DOWNLOAD_UNIT_SIZE; - size_t will_send = (size_to_send < unit_size) ? size_to_send : unit_size; - size_t sent = _currentClient.write(content.c_str() + size_sent, will_send); - size_to_send -= sent; - size_sent += sent; - if (sent == 0) { - break; - } - } -} - -String ESP8266WebServer::arg(const char* name) { - for (int i = 0; i < _currentArgCount; ++i) { - if (_currentArgs[i].key == name) - return _currentArgs[i].value; - } - return String(); -} - -String ESP8266WebServer::arg(int i) { - if (i < _currentArgCount) - return _currentArgs[i].value; - return String(); -} - -String ESP8266WebServer::argName(int i) { - if (i < _currentArgCount) - return _currentArgs[i].key; - return String(); -} - -int ESP8266WebServer::args() { - return _currentArgCount; -} - -bool ESP8266WebServer::hasArg(const char* name) { - for (int i = 0; i < _currentArgCount; ++i) { - if (_currentArgs[i].key == name) - return true; - } - return false; -} - -void ESP8266WebServer::onFileUpload(THandlerFunction fn) { - _fileUploadHandler = fn; -} - -void ESP8266WebServer::onNotFound(THandlerFunction fn) { - _notFoundHandler = fn; -} - -void ESP8266WebServer::_handleRequest() { - RequestHandler* handler; - for (handler = _firstHandler; handler; handler = handler->next) - { - if (handler->method != HTTP_ANY && handler->method != _currentMethod) - continue; - - if (handler->uri != _currentUri) - continue; - - handler->fn(); - break; - } - - if (!handler){ -#ifdef DEBUG - DEBUG_OUTPUT.println("request handler not found"); -#endif - - if(_notFoundHandler) { - _notFoundHandler(); - } - else { - send(404, "text/plain", String("Not found: ") + _currentUri); - } - } - - _currentClient = WiFiClient(); - _currentUri = String(); -} - -const char* ESP8266WebServer::_responseCodeToString(int code) { - switch (code) { - case 200: return "OK"; - case 404: return "Not found"; - case 500: return "Fail"; - default: return ""; - } -} diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp.orig b/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp.orig deleted file mode 100644 index ab0c2981..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp.orig +++ /dev/null @@ -1,515 +0,0 @@ -/* - ESP8266WebServer.cpp - Dead simple web-server. - Supports only one simultaneous client, knows how to handle GET and POST. - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - - -#include -#include "WiFiServer.h" -#include "WiFiClient.h" -#include "ESP8266WebServer.h" - -// #define DEBUG -#define DEBUG_OUTPUT Serial - -struct ESP8266WebServer::RequestHandler { - RequestHandler(ESP8266WebServer::THandlerFunction fn, const char* uri, HTTPMethod method) - : fn(fn) - , uri(uri) - , method(method) - , next(NULL) - { - } - - ESP8266WebServer::THandlerFunction fn; - String uri; - HTTPMethod method; - RequestHandler* next; - -}; - -ESP8266WebServer::ESP8266WebServer(int port) -: _server(port) -, _firstHandler(0) -, _lastHandler(0) -, _currentArgCount(0) -, _currentArgs(0) -{ -} - -ESP8266WebServer::~ESP8266WebServer() -{ - if (!_firstHandler) - return; - RequestHandler* handler = _firstHandler; - while (handler) { - RequestHandler* next = handler->next; - delete handler; - handler = next; - } -} - -void ESP8266WebServer::begin() { - _server.begin(); -} - - -void ESP8266WebServer::on(const char* uri, ESP8266WebServer::THandlerFunction handler) -{ - on(uri, HTTP_ANY, handler); -} - -void ESP8266WebServer::on(const char* uri, HTTPMethod method, ESP8266WebServer::THandlerFunction fn) -{ - RequestHandler* handler = new RequestHandler(fn, uri, method); - if (!_lastHandler) { - _firstHandler = handler; - _lastHandler = handler; - } - else { - _lastHandler->next = handler; - _lastHandler = handler; - } -} - -void ESP8266WebServer::handleClient() -{ - WiFiClient client = _server.available(); - if (!client) { - return; - } - -#ifdef DEBUG - DEBUG_OUTPUT.println("New client"); -#endif - - // Wait for data from client to become available - while(client.connected() && !client.available()){ - delay(1); - } - - if (!_parseRequest(client)) { - return; - } - - _currentClient = client; - _handleRequest(); -} - -void ESP8266WebServer::sendHeader(String name, String value, bool first) { - String headerLine = name; - headerLine += ": "; - headerLine += value; - headerLine += "\r\n"; - - if (first) { - _responseHeaders = headerLine + _responseHeaders; - } - else { - _responseHeaders += headerLine; - } -} - -void ESP8266WebServer::send(int code, const char* content_type, String content) { - String response = "HTTP/1.1 "; - response += String(code); - response += " "; - response += _responseCodeToString(code); - response += "\r\n"; - - if (!content_type) - content_type = "text/html"; - sendHeader("Content-Type", content_type, true); - - response += _responseHeaders; - response += "\r\n"; - response += content; - _responseHeaders = String(); - sendContent(response); -} - -void ESP8266WebServer::sendContent(String content) { - size_t size_to_send = content.length(); - size_t size_sent = 0; - while(size_to_send) { - const size_t unit_size = PAYLOAD_UNIT_SIZE; - size_t will_send = (size_to_send < unit_size) ? size_to_send : unit_size; - size_t sent = _currentClient.write(content.c_str() + size_sent, will_send); - size_to_send -= sent; - size_sent += sent; - if (sent == 0) { - break; - } - } -} - -String ESP8266WebServer::arg(const char* name) { - for (int i = 0; i < _currentArgCount; ++i) { - if (_currentArgs[i].key == name) - return _currentArgs[i].value; - } - return String(); -} - -String ESP8266WebServer::arg(int i) { - if (i < _currentArgCount) - return _currentArgs[i].value; - return String(); -} - -String ESP8266WebServer::argName(int i) { - if (i < _currentArgCount) - return _currentArgs[i].key; - return String(); -} - -int ESP8266WebServer::args() { - return _currentArgCount; -} - -bool ESP8266WebServer::hasArg(const char* name) { - for (int i = 0; i < _currentArgCount; ++i) { - if (_currentArgs[i].key == name) - return true; - } - return false; -} - -<<<<<<< HEAD -======= -void ESP8266WebServer::_parseArguments(String data) { -#ifdef DEBUG - DEBUG_OUTPUT.print("args: "); - DEBUG_OUTPUT.println(data); -#endif - if (_currentArgs) - delete[] _currentArgs; - _currentArgs = 0; - if (data.length() == 0) { - _currentArgCount = 0; - return; - } - _currentArgCount = 1; - - for (int i = 0; i < data.length(); ) { - i = data.indexOf('&', i); - if (i == -1) - break; - ++i; - ++_currentArgCount; - } -#ifdef DEBUG - DEBUG_OUTPUT.print("args count: "); - DEBUG_OUTPUT.println(_currentArgCount); -#endif - - _currentArgs = new RequestArgument[_currentArgCount]; - int pos = 0; - int iarg; - for (iarg = 0; iarg < _currentArgCount;) { - int equal_sign_index = data.indexOf('=', pos); - int next_arg_index = data.indexOf('&', pos); -#ifdef DEBUG - DEBUG_OUTPUT.print("pos "); - DEBUG_OUTPUT.print(pos); - DEBUG_OUTPUT.print("=@ "); - DEBUG_OUTPUT.print(equal_sign_index); - DEBUG_OUTPUT.print(" &@ "); - DEBUG_OUTPUT.println(next_arg_index); -#endif - if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) { -#ifdef DEBUG - DEBUG_OUTPUT.print("arg missing value: "); - DEBUG_OUTPUT.println(iarg); -#endif - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - continue; - } - RequestArgument& arg = _currentArgs[iarg]; - arg.key = data.substring(pos, equal_sign_index); - arg.value = data.substring(equal_sign_index + 1, next_arg_index); -#ifdef DEBUG - DEBUG_OUTPUT.print("arg "); - DEBUG_OUTPUT.print(iarg); - DEBUG_OUTPUT.print(" key: "); - DEBUG_OUTPUT.print(arg.key); - DEBUG_OUTPUT.print(" value: "); - DEBUG_OUTPUT.println(arg.value); -#endif - ++iarg; - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - } - _currentArgCount = iarg; -#ifdef DEBUG - DEBUG_OUTPUT.print("args count: "); - DEBUG_OUTPUT.println(_currentArgCount); -#endif - -} - -void ESP8266WebServer::_uploadWriteByte(uint8_t b){ - if(_currentUpload.buflen == HTTP_UPLOAD_BUFLEN){ - if(_fileUploadHandler) _fileUploadHandler(); - _currentUpload.size += _currentUpload.buflen; - _currentUpload.buflen = 0; - } - _currentUpload.buf[_currentUpload.buflen++] = b; -} - -void ESP8266WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t len){ - -#ifdef DEBUG - DEBUG_OUTPUT.print("Parse Form: Boundary: "); - DEBUG_OUTPUT.print(boundary); - DEBUG_OUTPUT.print("Length: "); - DEBUG_OUTPUT.println(len); -#endif - String line; - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - //start reading the form - if(line == ("--"+boundary)){ - RequestArgument* postArgs = new RequestArgument[32]; - int postArgsLen = 0; - while(1){ - String argName; - String argValue; - String argType; - String argFilename; - bool argIsFile = false; - - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if(line.startsWith("Content-Disposition")){ - int nameStart = line.indexOf('='); - if(nameStart != -1){ - argName = line.substring(nameStart+2); - nameStart = argName.indexOf('='); - if(nameStart == -1){ - argName = argName.substring(0, argName.length() - 1); - } else { - argFilename = argName.substring(nameStart+2, argName.length() - 1); - argName = argName.substring(0, argName.indexOf('"')); - argIsFile = true; - #ifdef DEBUG - DEBUG_OUTPUT.print("PostArg FileName: "); - DEBUG_OUTPUT.println(argFilename); - #endif - //use GET to set the filename if uploading using blob - if(argFilename == "blob" && hasArg("filename")) argFilename = arg("filename"); - } - #ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Name: "); - DEBUG_OUTPUT.println(argName); - #endif - argType = "text/plain"; - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if(line.startsWith("Content-Type")){ - argType = line.substring(line.indexOf(':')+2); - //skip next line - client.readStringUntil('\r'); - client.readStringUntil('\n'); - } - #ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Type: "); - DEBUG_OUTPUT.println(argType); - #endif - if(!argIsFile){ - while(1){ - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if(line.startsWith("--"+boundary)) break; - if(argValue.length() > 0) argValue += "\n"; - argValue += line; - } - #ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Value: "); - DEBUG_OUTPUT.println(argValue); - DEBUG_OUTPUT.println(); - #endif - - RequestArgument& arg = postArgs[postArgsLen++]; - arg.key = argName; - arg.value = argValue; - - if(line == ("--"+boundary+"--")){ - #ifdef DEBUG - DEBUG_OUTPUT.println("Done Parsing POST"); - #endif - break; - } - } else { - _currentUpload.status = UPLOAD_FILE_START; - _currentUpload.name = argName; - _currentUpload.filename = argFilename; - _currentUpload.type = argType; - _currentUpload.size = 0; - _currentUpload.buflen = 0; -#ifdef DEBUG - DEBUG_OUTPUT.print("Start File: "); - DEBUG_OUTPUT.print(_currentUpload.filename); - DEBUG_OUTPUT.print(" Type: "); - DEBUG_OUTPUT.println(_currentUpload.type); -#endif - if(_fileUploadHandler) _fileUploadHandler(); - _currentUpload.status = UPLOAD_FILE_WRITE; - uint8_t argByte = client.read(); -readfile: - while(argByte != 0x0D){ - _uploadWriteByte(argByte); - argByte = client.read(); - } - - argByte = client.read(); - if(argByte == 0x0A){ - argByte = client.read(); - if((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - goto readfile; - } else { - argByte = client.read(); - if((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - goto readfile; - } - } - - uint8_t endBuf[boundary.length()]; - client.readBytes(endBuf, boundary.length()); - - if(strstr((const char*)endBuf, (const char*)(boundary.c_str())) != NULL){ - if(_fileUploadHandler) _fileUploadHandler(); - _currentUpload.size += _currentUpload.buflen; - _currentUpload.status = UPLOAD_FILE_END; - if(_fileUploadHandler) _fileUploadHandler(); -#ifdef DEBUG - DEBUG_OUTPUT.print("End File: "); - DEBUG_OUTPUT.print(_currentUpload.filename); - DEBUG_OUTPUT.print(" Type: "); - DEBUG_OUTPUT.print(_currentUpload.type); - DEBUG_OUTPUT.print(" Size: "); - DEBUG_OUTPUT.println(_currentUpload.size); -#endif - line = client.readStringUntil(0x0D); - client.readStringUntil(0x0A); - if(line == "--"){ -#ifdef DEBUG - DEBUG_OUTPUT.println("Done Parsing POST"); -#endif - break; - } - continue; - } else { - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - uint32_t i = 0; - while(i < boundary.length()){ - _uploadWriteByte(endBuf[i++]); - } - argByte = client.read(); - goto readfile; - } - } else { - _uploadWriteByte(0x0D); - goto readfile; - } - break; - } - } - } - } - - int iarg; - int totalArgs = ((32 - postArgsLen) < _currentArgCount)?(32 - postArgsLen):_currentArgCount; - for (iarg = 0; iarg < totalArgs; iarg++){ - RequestArgument& arg = postArgs[postArgsLen++]; - arg.key = _currentArgs[iarg].key; - arg.value = _currentArgs[iarg].value; - } - if (_currentArgs) delete[] _currentArgs; - _currentArgs = new RequestArgument[postArgsLen]; - for (iarg = 0; iarg < postArgsLen; iarg++){ - RequestArgument& arg = _currentArgs[iarg]; - arg.key = postArgs[iarg].key; - arg.value = postArgs[iarg].value; - } - _currentArgCount = iarg; - if (postArgs) delete[] postArgs; - } -} - ->>>>>>> ficeto-esp8266 -void ESP8266WebServer::onFileUpload(THandlerFunction fn) { - _fileUploadHandler = fn; -} - -void ESP8266WebServer::onNotFound(THandlerFunction fn) { - _notFoundHandler = fn; -} - -void ESP8266WebServer::_handleRequest() { - RequestHandler* handler; - for (handler = _firstHandler; handler; handler = handler->next) - { - if (handler->method != HTTP_ANY && handler->method != _currentMethod) - continue; - - if (handler->uri != _currentUri) - continue; - - handler->fn(); - break; - } - - if (!handler){ -#ifdef DEBUG - DEBUG_OUTPUT.println("request handler not found"); -#endif - - if(_notFoundHandler) { - _notFoundHandler(); - } - else { - send(404, "text/plain", String("Not found: ") + _currentUri); - } - } - - _currentClient = WiFiClient(); - _currentUri = String(); -} - -const char* ESP8266WebServer::_responseCodeToString(int code) { - switch (code) { - case 200: return "OK"; - case 404: return "Not found"; - case 500: return "Fail"; - default: return ""; - } -} diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h deleted file mode 100644 index d957e15b..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ /dev/null @@ -1,128 +0,0 @@ -/* - ESP8266WebServer.h - Dead simple web-server. - Supports only one simultaneous client, knows how to handle GET and POST. - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - - -#ifndef ESP8266WEBSERVER_H -#define ESP8266WEBSERVER_H - -#include - -enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE }; -enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END }; - -#define HTTP_DOWNLOAD_UNIT_SIZE 1460 -#define HTTP_UPLOAD_BUFLEN 2048 - -typedef struct { - HTTPUploadStatus status; - String filename; - String name; - String type; - size_t totalSize; // file size - size_t currentSize; // size of data currently in buf - uint8_t buf[HTTP_UPLOAD_BUFLEN]; -} HTTPUpload; - -class ESP8266WebServer -{ -public: - ESP8266WebServer(int port = 80); - ~ESP8266WebServer(); - - void begin(); - void handleClient(); - - typedef std::function THandlerFunction; - void on(const char* uri, THandlerFunction handler); - void on(const char* uri, HTTPMethod method, THandlerFunction fn); - void onNotFound(THandlerFunction fn); //called when handler is not assigned - void onFileUpload(THandlerFunction fn); //handle file uploads - - String uri() { return _currentUri; } - HTTPMethod method() { return _currentMethod; } - WiFiClient client() { return _currentClient; } - HTTPUpload& upload() { return _currentUpload; } - - String arg(const char* name); // get request argument value by name - String arg(int i); // get request argument value by number - String argName(int i); // get request argument name by number - int args(); // get arguments count - bool hasArg(const char* name); // check if argument exists - - // send response to the client - // code - HTTP response code, can be 200 or 404 - // content_type - HTTP content type, like "text/plain" or "image/png" - // content - actual content body - void send(int code, const char* content_type = NULL, String content = String("")); - - void sendHeader(String name, String value, bool first = false); - void sendContent(String content); - -template size_t streamFile(T &file, String contentType){ - String head = "HTTP/1.1 200 OK\r\nContent-Type: "; - head += contentType; - head += "\r\nContent-Length: "; - head += file.size(); - head += "\r\nConnection: close"; - head += "\r\nAccess-Control-Allow-Origin: *"; - head += "\r\n\r\n"; - _currentClient.print(head); - head = String(); - return _currentClient.write(file, HTTP_DOWNLOAD_UNIT_SIZE); -} - -protected: - void _handleRequest(); - bool _parseRequest(WiFiClient& client); - void _parseArguments(String data); - static const char* _responseCodeToString(int code); - void _parseForm(WiFiClient& client, String boundary, uint32_t len); - void _uploadWriteByte(uint8_t b); - uint8_t _uploadReadByte(WiFiClient& client); - - struct RequestHandler; - struct RequestArgument { - String key; - String value; - }; - - WiFiServer _server; - - WiFiClient _currentClient; - HTTPMethod _currentMethod; - String _currentUri; - - size_t _currentArgCount; - RequestArgument* _currentArgs; - HTTPUpload _currentUpload; - - String _responseHeaders; - - RequestHandler* _firstHandler; - RequestHandler* _lastHandler; - THandlerFunction _notFoundHandler; - THandlerFunction _fileUploadHandler; - -}; - - -#endif //ESP8266WEBSERVER_H diff --git a/sparkfun/esp8266/libraries/ESP8266WebServer/src/Parsing.cpp b/sparkfun/esp8266/libraries/ESP8266WebServer/src/Parsing.cpp deleted file mode 100644 index 40a58d24..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WebServer/src/Parsing.cpp +++ /dev/null @@ -1,417 +0,0 @@ -/* - Parsing.cpp - HTTP request parsing. - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) -*/ - -#include -#include "WiFiServer.h" -#include "WiFiClient.h" -#include "ESP8266WebServer.h" - -// #define DEBUG -#define DEBUG_OUTPUT Serial1 - -bool ESP8266WebServer::_parseRequest(WiFiClient& client) { - // Read the first line of HTTP request - String req = client.readStringUntil('\r'); - client.readStringUntil('\n'); - - // First line of HTTP request looks like "GET /path HTTP/1.1" - // Retrieve the "/path" part by finding the spaces - int addr_start = req.indexOf(' '); - int addr_end = req.indexOf(' ', addr_start + 1); - if (addr_start == -1 || addr_end == -1) { -#ifdef DEBUG - DEBUG_OUTPUT.print("Invalid request: "); - DEBUG_OUTPUT.println(req); -#endif - return false; - } - - String methodStr = req.substring(0, addr_start); - String url = req.substring(addr_start + 1, addr_end); - String searchStr = ""; - int hasSearch = url.indexOf('?'); - if (hasSearch != -1){ - searchStr = url.substring(hasSearch + 1); - url = url.substring(0, hasSearch); - } - _currentUri = url; - - HTTPMethod method = HTTP_GET; - if (methodStr == "POST") { - method = HTTP_POST; - } else if (methodStr == "DELETE") { - method = HTTP_DELETE; - } else if (methodStr == "PUT") { - method = HTTP_PUT; - } else if (methodStr == "PATCH") { - method = HTTP_PATCH; - } - _currentMethod = method; - -#ifdef DEBUG - DEBUG_OUTPUT.print("method: "); - DEBUG_OUTPUT.print(methodStr); - DEBUG_OUTPUT.print(" url: "); - DEBUG_OUTPUT.print(url); - DEBUG_OUTPUT.print(" search: "); - DEBUG_OUTPUT.println(searchStr); -#endif - - String formData; - // below is needed only when POST type request - if (method == HTTP_POST || method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_DELETE){ - String boundaryStr; - String headerName; - String headerValue; - bool isForm = false; - uint32_t contentLength = 0; - //parse headers - while(1){ - req = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (req == "") break;//no moar headers - int headerDiv = req.indexOf(':'); - if (headerDiv == -1){ - break; - } - headerName = req.substring(0, headerDiv); - headerValue = req.substring(headerDiv + 2); - if (headerName == "Content-Type"){ - if (headerValue.startsWith("text/plain")){ - isForm = false; - } else if (headerValue.startsWith("multipart/form-data")){ - boundaryStr = headerValue.substring(headerValue.indexOf('=')+1); - isForm = true; - } - } else if (headerName == "Content-Length"){ - contentLength = headerValue.toInt(); - } - } - - if (!isForm){ - if (searchStr != "") searchStr += '&'; - searchStr += client.readStringUntil('\r'); - client.readStringUntil('\n'); - } - _parseArguments(searchStr); - if (isForm){ - _parseForm(client, boundaryStr, contentLength); - } - } else { - _parseArguments(searchStr); - } - client.flush(); - -#ifdef DEBUG - DEBUG_OUTPUT.print("Request: "); - DEBUG_OUTPUT.println(url); - DEBUG_OUTPUT.print(" Arguments: "); - DEBUG_OUTPUT.println(searchStr); -#endif - - return true; -} - - -void ESP8266WebServer::_parseArguments(String data) { -#ifdef DEBUG - DEBUG_OUTPUT.print("args: "); - DEBUG_OUTPUT.println(data); -#endif - if (_currentArgs) - delete[] _currentArgs; - _currentArgs = 0; - if (data.length() == 0) { - _currentArgCount = 0; - return; - } - _currentArgCount = 1; - - for (int i = 0; i < data.length(); ) { - i = data.indexOf('&', i); - if (i == -1) - break; - ++i; - ++_currentArgCount; - } -#ifdef DEBUG - DEBUG_OUTPUT.print("args count: "); - DEBUG_OUTPUT.println(_currentArgCount); -#endif - - _currentArgs = new RequestArgument[_currentArgCount]; - int pos = 0; - int iarg; - for (iarg = 0; iarg < _currentArgCount;) { - int equal_sign_index = data.indexOf('=', pos); - int next_arg_index = data.indexOf('&', pos); -#ifdef DEBUG - DEBUG_OUTPUT.print("pos "); - DEBUG_OUTPUT.print(pos); - DEBUG_OUTPUT.print("=@ "); - DEBUG_OUTPUT.print(equal_sign_index); - DEBUG_OUTPUT.print(" &@ "); - DEBUG_OUTPUT.println(next_arg_index); -#endif - if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) { -#ifdef DEBUG - DEBUG_OUTPUT.print("arg missing value: "); - DEBUG_OUTPUT.println(iarg); -#endif - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - continue; - } - RequestArgument& arg = _currentArgs[iarg]; - arg.key = data.substring(pos, equal_sign_index); - arg.value = data.substring(equal_sign_index + 1, next_arg_index); -#ifdef DEBUG - DEBUG_OUTPUT.print("arg "); - DEBUG_OUTPUT.print(iarg); - DEBUG_OUTPUT.print(" key: "); - DEBUG_OUTPUT.print(arg.key); - DEBUG_OUTPUT.print(" value: "); - DEBUG_OUTPUT.println(arg.value); -#endif - ++iarg; - if (next_arg_index == -1) - break; - pos = next_arg_index + 1; - } - _currentArgCount = iarg; -#ifdef DEBUG - DEBUG_OUTPUT.print("args count: "); - DEBUG_OUTPUT.println(_currentArgCount); -#endif - -} - -void ESP8266WebServer::_uploadWriteByte(uint8_t b){ - if (_currentUpload.currentSize == HTTP_UPLOAD_BUFLEN){ - if (_fileUploadHandler) _fileUploadHandler(); - _currentUpload.totalSize += _currentUpload.currentSize; - _currentUpload.currentSize = 0; - } - _currentUpload.buf[_currentUpload.currentSize++] = b; -} - -uint8_t ESP8266WebServer::_uploadReadByte(WiFiClient& client){ - int res = client.read(); - if(res == -1){ - while(!client.available()) - yield(); - res = client.read(); - } - return (uint8_t)res; -} - -void ESP8266WebServer::_parseForm(WiFiClient& client, String boundary, uint32_t len){ - -#ifdef DEBUG - DEBUG_OUTPUT.print("Parse Form: Boundary: "); - DEBUG_OUTPUT.print(boundary); - DEBUG_OUTPUT.print(" Length: "); - DEBUG_OUTPUT.println(len); -#endif - String line; - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - //start reading the form - if (line == ("--"+boundary)){ - RequestArgument* postArgs = new RequestArgument[32]; - int postArgsLen = 0; - while(1){ - String argName; - String argValue; - String argType; - String argFilename; - bool argIsFile = false; - - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.startsWith("Content-Disposition")){ - int nameStart = line.indexOf('='); - if (nameStart != -1){ - argName = line.substring(nameStart+2); - nameStart = argName.indexOf('='); - if (nameStart == -1){ - argName = argName.substring(0, argName.length() - 1); - } else { - argFilename = argName.substring(nameStart+2, argName.length() - 1); - argName = argName.substring(0, argName.indexOf('"')); - argIsFile = true; -#ifdef DEBUG - DEBUG_OUTPUT.print("PostArg FileName: "); - DEBUG_OUTPUT.println(argFilename); -#endif - //use GET to set the filename if uploading using blob - if (argFilename == "blob" && hasArg("filename")) argFilename = arg("filename"); - } -#ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Name: "); - DEBUG_OUTPUT.println(argName); -#endif - argType = "text/plain"; - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.startsWith("Content-Type")){ - argType = line.substring(line.indexOf(':')+2); - //skip next line - client.readStringUntil('\r'); - client.readStringUntil('\n'); - } -#ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Type: "); - DEBUG_OUTPUT.println(argType); -#endif - if (!argIsFile){ - while(1){ - line = client.readStringUntil('\r'); - client.readStringUntil('\n'); - if (line.startsWith("--"+boundary)) break; - if (argValue.length() > 0) argValue += "\n"; - argValue += line; - } -#ifdef DEBUG - DEBUG_OUTPUT.print("PostArg Value: "); - DEBUG_OUTPUT.println(argValue); - DEBUG_OUTPUT.println(); -#endif - - RequestArgument& arg = postArgs[postArgsLen++]; - arg.key = argName; - arg.value = argValue; - - if (line == ("--"+boundary+"--")){ -#ifdef DEBUG - DEBUG_OUTPUT.println("Done Parsing POST"); -#endif - break; - } - } else { - _currentUpload.status = UPLOAD_FILE_START; - _currentUpload.name = argName; - _currentUpload.filename = argFilename; - _currentUpload.type = argType; - _currentUpload.totalSize = 0; - _currentUpload.currentSize = 0; -#ifdef DEBUG - DEBUG_OUTPUT.print("Start File: "); - DEBUG_OUTPUT.print(_currentUpload.filename); - DEBUG_OUTPUT.print(" Type: "); - DEBUG_OUTPUT.println(_currentUpload.type); -#endif - if (_fileUploadHandler) _fileUploadHandler(); - _currentUpload.status = UPLOAD_FILE_WRITE; - uint8_t argByte = _uploadReadByte(client); -readfile: - while(argByte != 0x0D){ - _uploadWriteByte(argByte); - argByte = _uploadReadByte(client); - } - - argByte = _uploadReadByte(client); - if (argByte == 0x0A){ - argByte = _uploadReadByte(client); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - goto readfile; - } else { - argByte = _uploadReadByte(client); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - goto readfile; - } - } - - uint8_t endBuf[boundary.length()]; - client.readBytes(endBuf, boundary.length()); - - if (strstr((const char*)endBuf, boundary.c_str()) != NULL){ - if (_fileUploadHandler) _fileUploadHandler(); - _currentUpload.totalSize += _currentUpload.currentSize; - _currentUpload.status = UPLOAD_FILE_END; - if (_fileUploadHandler) _fileUploadHandler(); -#ifdef DEBUG - DEBUG_OUTPUT.print("End File: "); - DEBUG_OUTPUT.print(_currentUpload.filename); - DEBUG_OUTPUT.print(" Type: "); - DEBUG_OUTPUT.print(_currentUpload.type); - DEBUG_OUTPUT.print(" Size: "); - DEBUG_OUTPUT.println(_currentUpload.totalSize); -#endif - line = client.readStringUntil(0x0D); - client.readStringUntil(0x0A); - if (line == "--"){ -#ifdef DEBUG - DEBUG_OUTPUT.println("Done Parsing POST"); -#endif - break; - } - continue; - } else { - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - _uploadWriteByte((uint8_t)('-')); - uint32_t i = 0; - while(i < boundary.length()){ - _uploadWriteByte(endBuf[i++]); - } - argByte = _uploadReadByte(client); - goto readfile; - } - } else { - _uploadWriteByte(0x0D); - goto readfile; - } - break; - } - } - } - } - - int iarg; - int totalArgs = ((32 - postArgsLen) < _currentArgCount)?(32 - postArgsLen):_currentArgCount; - for (iarg = 0; iarg < totalArgs; iarg++){ - RequestArgument& arg = postArgs[postArgsLen++]; - arg.key = _currentArgs[iarg].key; - arg.value = _currentArgs[iarg].value; - } - if (_currentArgs) delete[] _currentArgs; - _currentArgs = new RequestArgument[postArgsLen]; - for (iarg = 0; iarg < postArgsLen; iarg++){ - RequestArgument& arg = _currentArgs[iarg]; - arg.key = postArgs[iarg].key; - arg.value = postArgs[iarg].value; - } - _currentArgCount = iarg; - if (postArgs) delete[] postArgs; - } -} - - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/.DS_Store b/sparkfun/esp8266/libraries/ESP8266WiFi/.DS_Store deleted file mode 100644 index 94e8e06d..00000000 Binary files a/sparkfun/esp8266/libraries/ESP8266WiFi/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/.DS_Store b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino deleted file mode 100644 index 4a9771b5..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/NTPClient/NTPClient.ino +++ /dev/null @@ -1,146 +0,0 @@ -/* - - Udp NTP Client - - Get the time from a Network Time Protocol (NTP) time server - Demonstrates use of UDP sendPacket and ReceivePacket - For more on NTP time servers and the messages needed to communicate with them, - see http://en.wikipedia.org/wiki/Network_Time_Protocol - - created 4 Sep 2010 - by Michael Margolis - modified 9 Apr 2012 - by Tom Igoe - updated for the ESP8266 12 Apr 2015 - by Ivan Grokhotkov - - This code is in the public domain. - - */ - -#include -#include - -char ssid[] = "*************"; // your network SSID (name) -char pass[] = "********"; // your network password - - -unsigned int localPort = 2390; // local port to listen for UDP packets - -IPAddress timeServer(129, 6, 15, 28); // time.nist.gov NTP server - -const int NTP_PACKET_SIZE = 48; // NTP time stamp is in the first 48 bytes of the message - -byte packetBuffer[ NTP_PACKET_SIZE]; //buffer to hold incoming and outgoing packets - -// A UDP instance to let us send and receive packets over UDP -WiFiUDP udp; - -void setup() -{ - Serial.begin(115200); - Serial.println(); - Serial.println(); - - // We start by connecting to a WiFi network - Serial.print("Connecting to "); - Serial.println(ssid); - WiFi.begin(ssid, pass); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - - Serial.println("Starting UDP"); - udp.begin(localPort); - Serial.print("Local port: "); - Serial.println(udp.localPort()); -} - -void loop() -{ - sendNTPpacket(timeServer); // send an NTP packet to a time server - // wait to see if a reply is available - delay(1000); - - int cb = udp.parsePacket(); - if (!cb) { - Serial.println("no packet yet"); - } - else { - Serial.print("packet received, length="); - Serial.println(cb); - // We've received a packet, read the data from it - udp.read(packetBuffer, NTP_PACKET_SIZE); // read the packet into the buffer - - //the timestamp starts at byte 40 of the received packet and is four bytes, - // or two words, long. First, esxtract the two words: - - unsigned long highWord = word(packetBuffer[40], packetBuffer[41]); - unsigned long lowWord = word(packetBuffer[42], packetBuffer[43]); - // combine the four bytes (two words) into a long integer - // this is NTP time (seconds since Jan 1 1900): - unsigned long secsSince1900 = highWord << 16 | lowWord; - Serial.print("Seconds since Jan 1 1900 = " ); - Serial.println(secsSince1900); - - // now convert NTP time into everyday time: - Serial.print("Unix time = "); - // Unix time starts on Jan 1 1970. In seconds, that's 2208988800: - const unsigned long seventyYears = 2208988800UL; - // subtract seventy years: - unsigned long epoch = secsSince1900 - seventyYears; - // print Unix time: - Serial.println(epoch); - - - // print the hour, minute and second: - Serial.print("The UTC time is "); // UTC is the time at Greenwich Meridian (GMT) - Serial.print((epoch % 86400L) / 3600); // print the hour (86400 equals secs per day) - Serial.print(':'); - if ( ((epoch % 3600) / 60) < 10 ) { - // In the first 10 minutes of each hour, we'll want a leading '0' - Serial.print('0'); - } - Serial.print((epoch % 3600) / 60); // print the minute (3600 equals secs per minute) - Serial.print(':'); - if ( (epoch % 60) < 10 ) { - // In the first 10 seconds of each minute, we'll want a leading '0' - Serial.print('0'); - } - Serial.println(epoch % 60); // print the second - } - // wait ten seconds before asking for the time again - delay(10000); -} - -// send an NTP request to the time server at the given address -unsigned long sendNTPpacket(IPAddress& address) -{ - Serial.println("sending NTP packet..."); - // set all bytes in the buffer to 0 - memset(packetBuffer, 0, NTP_PACKET_SIZE); - // Initialize values needed to form NTP request - // (see URL above for details on the packets) - packetBuffer[0] = 0b11100011; // LI, Version, Mode - packetBuffer[1] = 0; // Stratum, or type of clock - packetBuffer[2] = 6; // Polling Interval - packetBuffer[3] = 0xEC; // Peer Clock Precision - // 8 bytes of zero for Root Delay & Root Dispersion - packetBuffer[12] = 49; - packetBuffer[13] = 0x4E; - packetBuffer[14] = 49; - packetBuffer[15] = 52; - - // all NTP fields have been given values, now - // you can send a packet requesting a timestamp: - udp.beginPacket(address, 123); //NTP requests are to port 123 - udp.write(packetBuffer, NTP_PACKET_SIZE); - udp.endPacket(); -} diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino deleted file mode 100644 index 9bd39006..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiAccessPoint/WiFiAccessPoint.ino +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2015, Majenko Technologies - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, this - * list of conditions and the following disclaimer in the documentation and/or - * other materials provided with the distribution. - * - * * Neither the name of Majenko Technologies nor the names of its - * contributors may be used to endorse or promote products derived from - * this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR - * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON - * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* Create a WiFi access point and provide a web server on it. */ - -#include -#include -#include - -/* Set these to your desired credentials. */ -const char *ssid = "ESPap"; -const char *password = "thereisnospoon"; - -ESP8266WebServer server(80); - -/* Just a little test message. Go to http://192.168.4.1 in a web browser - * connected to this access point to see it. - */ -void handleRoot() { - server.send(200, "text/html", "

You are connected

"); -} - -void setup() { - delay(1000); - Serial.begin(115200); - Serial.println(); - Serial.print("Configuring access point..."); - /* You can remove the password parameter if you want the AP to be open. */ - WiFi.softAP(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } - - Serial.println("done"); - IPAddress myIP = WiFi.softAPIP(); - Serial.print("AP IP address: "); - Serial.println(myIP); - server.on("/", handleRoot); - server.begin(); - Serial.println("HTTP server started"); -} - -void loop() { - server.handleClient(); -} diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino deleted file mode 100644 index 7ffc78ac..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiClient/WiFiClient.ino +++ /dev/null @@ -1,85 +0,0 @@ -/* - * This sketch sends data via HTTP GET requests to data.sparkfun.com service. - * - * You need to get streamId and privateKey at data.sparkfun.com and paste them - * below. Or just customize this script to talk to other HTTP servers. - * - */ - -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -const char* host = "data.sparkfun.com"; -const char* streamId = "...................."; -const char* privateKey = "...................."; - -void setup() { - Serial.begin(115200); - delay(10); - - // We start by connecting to a WiFi network - - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); -} - -int value = 0; - -void loop() { - delay(5000); - ++value; - - Serial.print("connecting to "); - Serial.println(host); - - // Use WiFiClient class to create TCP connections - WiFiClient client; - const int httpPort = 80; - if (!client.connect(host, httpPort)) { - Serial.println("connection failed"); - return; - } - - // We now create a URI for the request - String url = "/input/"; - url += streamId; - url += "?private_key="; - url += privateKey; - url += "&value="; - url += value; - - Serial.print("Requesting URL: "); - Serial.println(url); - - // This will send the request to the server - client.print(String("GET ") + url + " HTTP/1.1\r\n" + - "Host: " + host + "\r\n" + - "Connection: close\r\n\r\n"); - delay(10); - - // Read all the lines of the reply from server and print them to Serial - while(client.available()){ - String line = client.readStringUntil('\r'); - Serial.print(line); - } - - Serial.println(); - Serial.println("closing connection"); -} - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiMulti/WiFiMulti.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiMulti/WiFiMulti.ino deleted file mode 100644 index 70803254..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiMulti/WiFiMulti.ino +++ /dev/null @@ -1,33 +0,0 @@ -/* - * This sketch trys to Connect to the best AP based on a given list - * - */ - -#include -#include - -ESP8266WiFiMulti wifiMulti; - -void setup() { - Serial.begin(115200); - delay(10); - - wifiMulti.addAP("ssid_from_AP_1", "your_password_for_AP_1"); - wifiMulti.addAP("ssid_from_AP_2", "your_password_for_AP_2"); - wifiMulti.addAP("ssid_from_AP_3", "your_password_for_AP_3"); - - Serial.println("Connecting Wifi..."); - if(wifiMulti.run() == WL_CONNECTED) { - Serial.println(""); - Serial.println("WiFi connected"); - Serial.println("IP address: "); - Serial.println(WiFi.localIP()); - } -} - -void loop() { - if(wifiMulti.run() != WL_CONNECTED) { - Serial.println("WiFi not connected!"); - delay(1000); - } -} \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino deleted file mode 100644 index 3e6ff736..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino +++ /dev/null @@ -1,48 +0,0 @@ -/* - * This sketch demonstrates how to scan WiFi networks. - * The API is almost the same as with the WiFi Shield library, - * the most obvious difference being the different file you need to include: - */ -#include "ESP8266WiFi.h" - -void setup() { - Serial.begin(115200); - - // Set WiFi to station mode and disconnect from an AP if it was previously connected - WiFi.mode(WIFI_STA); - WiFi.disconnect(); - delay(100); - - Serial.println("Setup done"); -} - -void loop() { - Serial.println("scan start"); - - // WiFi.scanNetworks will return the number of networks found - int n = WiFi.scanNetworks(); - Serial.println("scan done"); - if (n == 0) - Serial.println("no networks found"); - else - { - Serial.print(n); - Serial.println(" networks found"); - for (int i = 0; i < n; ++i) - { - // Print SSID and RSSI for each network found - Serial.print(i + 1); - Serial.print(": "); - Serial.print(WiFi.SSID(i)); - Serial.print(" ("); - Serial.print(WiFi.RSSI(i)); - Serial.print(")"); - Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE)?" ":"*"); - delay(10); - } - } - Serial.println(""); - - // Wait a bit before scanning again - delay(5000); -} diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino deleted file mode 100644 index 43a9d825..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino +++ /dev/null @@ -1,90 +0,0 @@ -/* - WiFiTelnetToSerial - Example Transparent UART to Telnet Server for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the ESP8266WiFi library for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#include - -//how many clients should be able to telnet to this ESP8266 -#define MAX_SRV_CLIENTS 1 -const char* ssid = "**********"; -const char* password = "**********"; - -WiFiServer server(21); -WiFiClient serverClients[MAX_SRV_CLIENTS]; - -void setup() { - Serial1.begin(115200); - WiFi.begin(ssid, password); - Serial1.print("\nConnecting to "); Serial1.println(ssid); - uint8_t i = 0; - while (WiFi.status() != WL_CONNECTED && i++ < 20) delay(500); - if(i == 21){ - Serial1.print("Could not connect to"); Serial1.println(ssid); - while(1) delay(500); - } - //start UART and the server - Serial.begin(115200); - server.begin(); - server.setNoDelay(true); - - Serial1.print("Ready! Use 'telnet "); - Serial1.print(WiFi.localIP()); - Serial1.println(" 21' to connect"); -} - -void loop() { - uint8_t i; - //check if there are any new clients - if (server.hasClient()){ - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - //find free/disconnected spot - if (!serverClients[i] || !serverClients[i].connected()){ - if(serverClients[i]) serverClients[i].stop(); - serverClients[i] = server.available(); - Serial1.print("New client: "); Serial1.print(i); - continue; - } - } - //no free/disconnected spot so reject - WiFiClient serverClient = server.available(); - serverClient.stop(); - } - //check clients for data - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - if (serverClients[i] && serverClients[i].connected()){ - if(serverClients[i].available()){ - //get data from the telnet client and push it to the UART - while(serverClients[i].available()) Serial.write(serverClients[i].read()); - } - } - } - //check UART for data - if(Serial.available()){ - size_t len = Serial.available(); - uint8_t sbuf[len]; - Serial.readBytes(sbuf, len); - //push UART data to all connected telnet clients - for(i = 0; i < MAX_SRV_CLIENTS; i++){ - if (serverClients[i] && serverClients[i].connected()){ - serverClients[i].write(sbuf, len); - delay(1); - } - } - } -} diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiWebServer/WiFiWebServer.ino b/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiWebServer/WiFiWebServer.ino deleted file mode 100644 index fa40678a..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/examples/WiFiWebServer/WiFiWebServer.ino +++ /dev/null @@ -1,98 +0,0 @@ -/* - * This sketch demonstrates how to set up a simple HTTP-like server. - * The server will set a GPIO pin depending on the request - * http://server_ip/gpio/0 will set the GPIO2 low, - * http://server_ip/gpio/1 will set the GPIO2 high - * server_ip is the IP address of the ESP8266 module, will be - * printed to Serial when the module is connected. - */ - -#include - -const char* ssid = "your-ssid"; -const char* password = "your-password"; - -// Create an instance of the server -// specify the port to listen on as an argument -WiFiServer server(80); - -void setup() { - Serial.begin(115200); - delay(10); - - // prepare GPIO2 - pinMode(2, OUTPUT); - digitalWrite(2, 0); - - // Connect to WiFi network - Serial.println(); - Serial.println(); - Serial.print("Connecting to "); - Serial.println(ssid); - - WiFi.begin(ssid, password); - - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.println("WiFi connected"); - - // Start the server - server.begin(); - Serial.println("Server started"); - - // Print the IP address - Serial.println(WiFi.localIP()); -} - -void loop() { - // Check if a client has connected - WiFiClient client = server.available(); - if (!client) { - return; - } - - // Wait until the client sends some data - Serial.println("new client"); - while(!client.available()){ - delay(1); - } - - // Read the first line of the request - String req = client.readStringUntil('\r'); - Serial.println(req); - client.flush(); - - // Match the request - int val; - if (req.indexOf("/gpio/0") != -1) - val = 0; - else if (req.indexOf("/gpio/1") != -1) - val = 1; - else { - Serial.println("invalid request"); - client.stop(); - return; - } - - // Set GPIO2 according to the request - digitalWrite(2, val); - - client.flush(); - - // Prepare the response - String s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\n\r\nGPIO is now "; - s += (val)?"high":"low"; - s += "\n"; - - // Send the response to the client - client.print(s); - delay(1); - Serial.println("Client disonnected"); - - // The client will actually be disconnected - // when the function returns and 'client' object is detroyed -} - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/keywords.txt b/sparkfun/esp8266/libraries/ESP8266WiFi/keywords.txt deleted file mode 100644 index e693ea4d..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/keywords.txt +++ /dev/null @@ -1,67 +0,0 @@ -####################################### -# Syntax Coloring Map For ESP8266WiFi -####################################### - -####################################### -# Library (KEYWORD3) -####################################### - -ESP8266WiFi KEYWORD3 - -####################################### -# Datatypes (KEYWORD1) -####################################### - -WiFi KEYWORD1 -WiFiClient KEYWORD1 -WiFiServer KEYWORD1 -WiFiUDP KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -status KEYWORD2 -mode KEYWORD2 -connect KEYWORD2 -write KEYWORD2 -available KEYWORD2 -config KEYWORD2 -setDNS KEYWORD2 -read KEYWORD2 -flush KEYWORD2 -stop KEYWORD2 -connected KEYWORD2 -begin KEYWORD2 -beginMulticast KEYWORD2 -disconnect KEYWORD2 -macAddress KEYWORD2 -localIP KEYWORD2 -subnetMask KEYWORD2 -gatewayIP KEYWORD2 -SSID KEYWORD2 -BSSID KEYWORD2 -RSSI KEYWORD2 -encryptionType KEYWORD2 -beginPacket KEYWORD2 -beginPacketMulticast KEYWORD2 -endPacket KEYWORD2 -parsePacket KEYWORD2 -destinationIP KEYWORD2 -remoteIP KEYWORD2 -remotePort KEYWORD2 -softAP KEYWORD2 -softAPIP KEYWORD2 -softAPmacAddress KEYWORD2 -softAPConfig KEYWORD2 -printDiag KEYWORD2 -hostByName KEYWORD2 -scanNetworks KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### -WIFI_AP LITERAL1 -WIFI_STA LITERAL1 -WIFI_AP_STA LITERAL1 - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/library.properties b/sparkfun/esp8266/libraries/ESP8266WiFi/library.properties deleted file mode 100644 index 3db731e8..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/library.properties +++ /dev/null @@ -1,9 +0,0 @@ -name=ESP8266WiFi -version=1.0 -author=Ivan Grokhotkov -maintainer=Ivan Grokhtkov -sentence=Enables network connection (local and Internet) using the ESP8266 built-in WiFi. -paragraph=With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. The shield can connect either to open or encrypted networks (WEP, WPA). The IP address can be assigned statically or through a DHCP. The library can also manage DNS. -category=Communication -url= -architectures=esp8266 diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp b/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp deleted file mode 100644 index 115b2376..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/* - ESP8266WiFi.cpp - WiFi library for esp8266 - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "ESP8266WiFi.h" -extern "C" { -#include "c_types.h" -#include "ets_sys.h" -#include "os_type.h" -#include "osapi.h" -#include "mem.h" -#include "user_interface.h" -#include "smartconfig.h" -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/dns.h" -} - - -extern "C" void esp_schedule(); -extern "C" void esp_yield(); - -ESP8266WiFiClass::ESP8266WiFiClass() -{ - -} - -void ESP8266WiFiClass::mode(WiFiMode m) -{ - ETS_UART_INTR_DISABLE(); - wifi_set_opmode(m); - ETS_UART_INTR_ENABLE(); -} - - -int ESP8266WiFiClass::begin(const char* ssid) -{ - return begin(ssid, 0); -} - - -int ESP8266WiFiClass::begin(const char* ssid, const char *passphrase) -{ - if ((wifi_get_opmode() & 1) == 0)//1 and 3 have STA enabled - { - // turn on AP+STA mode - mode(WIFI_AP_STA); - } - - struct station_config conf; - strcpy(reinterpret_cast(conf.ssid), ssid); - if (passphrase) - strcpy(reinterpret_cast(conf.password), passphrase); - else - *conf.password = 0; - - conf.bssid_set = 0; - - ETS_UART_INTR_DISABLE(); - wifi_station_set_config(&conf); - wifi_station_connect(); - ETS_UART_INTR_ENABLE(); - wifi_station_dhcpc_start(); - return status(); -} - -uint8_t ESP8266WiFiClass::waitForConnectResult(){ - if ((wifi_get_opmode() & 1) == 0)//1 and 3 have STA enabled - return WL_DISCONNECTED; - while (status() == WL_DISCONNECTED) - delay(100); - return status(); -} - -void ESP8266WiFiClass::config(IPAddress local_ip, IPAddress gateway, IPAddress subnet) -{ - struct ip_info info; - info.ip.addr = static_cast(local_ip); - info.gw.addr = static_cast(gateway); - info.netmask.addr = static_cast(subnet); - - wifi_station_dhcpc_stop(); - wifi_set_ip_info(STATION_IF, &info); -} - -int ESP8266WiFiClass::disconnect() -{ - struct station_config conf; - *conf.ssid = 0; - *conf.password = 0; - ETS_UART_INTR_DISABLE(); - wifi_station_set_config(&conf); - wifi_station_disconnect(); - ETS_UART_INTR_ENABLE(); - return 0; -} - -void ESP8266WiFiClass::softAP(const char* ssid) -{ - softAP(ssid, 0); -} - - -void ESP8266WiFiClass::softAP(const char* ssid, const char* passphrase, int channel) -{ - if (wifi_get_opmode() < WIFI_AP)//will be OFF or STA - { - // turn on AP+STA mode - mode(WIFI_AP_STA); - } - - struct softap_config conf; - wifi_softap_get_config(&conf); - strcpy(reinterpret_cast(conf.ssid), ssid); - conf.channel = channel; - conf.ssid_len = strlen(ssid); - conf.ssid_hidden = 0; - conf.max_connection = 4; - conf.beacon_interval = 100; - - if (!passphrase || strlen(passphrase) == 0) - { - conf.authmode = AUTH_OPEN; - *conf.password = 0; - } - else - { - conf.authmode = AUTH_WPA2_PSK; - strcpy(reinterpret_cast(conf.password), passphrase); - } - - ETS_UART_INTR_DISABLE(); - wifi_softap_set_config(&conf); - ETS_UART_INTR_ENABLE(); -} - -void ESP8266WiFiClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet) -{ - struct ip_info info; - info.ip.addr = static_cast(local_ip); - info.gw.addr = static_cast(gateway); - info.netmask.addr = static_cast(subnet); - wifi_softap_dhcps_stop(); - wifi_set_ip_info(SOFTAP_IF, &info); - wifi_softap_dhcps_start(); -} - -uint8_t* ESP8266WiFiClass::macAddress(uint8_t* mac) -{ - wifi_get_macaddr(STATION_IF, mac); - return mac; -} - -uint8_t* ESP8266WiFiClass::softAPmacAddress(uint8_t* mac) -{ - wifi_get_macaddr(SOFTAP_IF, mac); - return mac; -} - -IPAddress ESP8266WiFiClass::localIP() -{ - struct ip_info ip; - wifi_get_ip_info(STATION_IF, &ip); - return IPAddress(ip.ip.addr); -} - -IPAddress ESP8266WiFiClass::softAPIP() -{ - struct ip_info ip; - wifi_get_ip_info(SOFTAP_IF, &ip); - return IPAddress(ip.ip.addr); -} - -IPAddress ESP8266WiFiClass::subnetMask() -{ - struct ip_info ip; - wifi_get_ip_info(STATION_IF, &ip); - return IPAddress(ip.netmask.addr); -} - -IPAddress ESP8266WiFiClass::gatewayIP() -{ - struct ip_info ip; - wifi_get_ip_info(STATION_IF, &ip); - return IPAddress(ip.gw.addr); -} - -char* ESP8266WiFiClass::SSID() -{ - static struct station_config conf; - wifi_station_get_config(&conf); - return reinterpret_cast(conf.ssid); -} - -// uint8_t* ESP8266WiFiClass::BSSID(uint8_t* bssid) -// { -// uint8_t* _bssid = WiFiDrv::getCurrentBSSID(); -// memcpy(bssid, _bssid, WL_MAC_ADDR_LENGTH); -// return bssid; -// } - -// int32_t ESP8266WiFiClass::RSSI() -// { -// return WiFiDrv::getCurrentRSSI(); -// } - -// uint8_t ESP8266WiFiClass::encryptionType() -// { -// return WiFiDrv::getCurrentEncryptionType(); -// } - -extern "C" -{ - typedef STAILQ_HEAD(, bss_info) bss_info_head_t; -} - -void ESP8266WiFiClass::_scanDone(void* result, int status) -{ - if (status != OK) - { - ESP8266WiFiClass::_scanCount = 0; - ESP8266WiFiClass::_scanResult = 0; - } - else - { - - int i = 0; - bss_info_head_t* head = reinterpret_cast(result); - - for (bss_info* it = STAILQ_FIRST(head); it; it = STAILQ_NEXT(it, next), ++i); - ESP8266WiFiClass::_scanCount = i; - if (i == 0) - { - ESP8266WiFiClass::_scanResult = 0; - } - else - { - bss_info* copied_info = new bss_info[i]; - i = 0; - for (bss_info* it = STAILQ_FIRST(head); it; it = STAILQ_NEXT(it, next), ++i) - { - memcpy(copied_info + i, it, sizeof(bss_info)); - } - - ESP8266WiFiClass::_scanResult = copied_info; - } - - } - esp_schedule(); -} - - -int8_t ESP8266WiFiClass::scanNetworks() -{ - if ((wifi_get_opmode() & 1) == 0)//1 and 3 have STA enabled - { - mode(WIFI_AP_STA); - } - int status = wifi_station_get_connect_status(); - if (status != STATION_GOT_IP && status != STATION_IDLE) - { - disconnect(); - } - - if (ESP8266WiFiClass::_scanResult) - { - delete[] reinterpret_cast(ESP8266WiFiClass::_scanResult); - ESP8266WiFiClass::_scanResult = 0; - ESP8266WiFiClass::_scanCount = 0; - } - - struct scan_config config; - config.ssid = 0; - config.bssid = 0; - config.channel = 0; - config.show_hidden = 0; - wifi_station_scan(&config, reinterpret_cast(&ESP8266WiFiClass::_scanDone)); - esp_yield(); - return ESP8266WiFiClass::_scanCount; -} - -void * ESP8266WiFiClass::_getScanInfoByIndex(int i) -{ - if (!ESP8266WiFiClass::_scanResult || i > ESP8266WiFiClass::_scanCount) - { - return 0; - } - - return reinterpret_cast(ESP8266WiFiClass::_scanResult) + i; -} - -const char* ESP8266WiFiClass::SSID(uint8_t i) -{ - struct bss_info* it = reinterpret_cast(_getScanInfoByIndex(i)); - if (!it) - return 0; - - return reinterpret_cast(it->ssid); -} - -int32_t ESP8266WiFiClass::RSSI(uint8_t i) -{ - struct bss_info* it = reinterpret_cast(_getScanInfoByIndex(i)); - if (!it) - return 0; - - return it->rssi; -} - -uint8_t ESP8266WiFiClass::encryptionType(uint8_t i) -{ - struct bss_info* it = reinterpret_cast(_getScanInfoByIndex(i)); - if (!it) - return -1; - - int authmode = it->authmode; - if (authmode == AUTH_OPEN) - return ENC_TYPE_NONE; - if (authmode == AUTH_WEP) - return ENC_TYPE_WEP; - if (authmode == AUTH_WPA_PSK) - return ENC_TYPE_TKIP; - if (authmode == AUTH_WPA2_PSK) - return ENC_TYPE_CCMP; - if (authmode == AUTH_WPA_WPA2_PSK) - return ENC_TYPE_AUTO; - return -1; -} - -wl_status_t ESP8266WiFiClass::status() -{ - int status = wifi_station_get_connect_status(); - - if (status == STATION_GOT_IP) - return WL_CONNECTED; - else if (status == STATION_NO_AP_FOUND) - return WL_NO_SSID_AVAIL; - else if (status == STATION_CONNECT_FAIL || status == STATION_WRONG_PASSWORD) - return WL_CONNECT_FAILED; - else if (status == STATION_IDLE) - return WL_IDLE_STATUS; - else - return WL_DISCONNECTED; -} - -void wifi_dns_found_callback(const char *name, ip_addr_t *ipaddr, void *callback_arg) -{ - if (ipaddr) - (*reinterpret_cast(callback_arg)) = ipaddr->addr; - esp_schedule(); // resume the hostByName function -} - -int ESP8266WiFiClass::hostByName(const char* aHostname, IPAddress& aResult) -{ - ip_addr_t addr; - aResult = static_cast(0); - err_t err = dns_gethostbyname(aHostname, &addr, &wifi_dns_found_callback, &aResult); - if (err == ERR_OK) - { - aResult = addr.addr; - } - else if (err == ERR_INPROGRESS) - { - esp_yield(); - // will return here when dns_found_callback fires - } - - return (aResult != 0) ? 1 : 0; -} - -void ESP8266WiFiClass::beginSmartConfig() -{ - if (_smartConfigStarted) - return; - - if ((wifi_get_opmode() & 1) == 0)//1 and 3 have STA enabled - { - mode(WIFI_AP_STA); - } - - _smartConfigStarted = true; - - //SC_TYPE_ESPTOUCH use ESPTOUCH for smartconfig, or use SC_TYPE_AIRKISS for AIRKISS - smartconfig_start(SC_TYPE_ESPTOUCH, &ESP8266WiFiClass::_smartConfigDone); -} - -void ESP8266WiFiClass::stopSmartConfig() -{ - if (!_smartConfigStarted) - return; - - smartconfig_stop(); - _smartConfigStarted = false; -} - -bool ESP8266WiFiClass::smartConfigDone(){ - if (!_smartConfigStarted) - return false; - - return smartconfig_get_status() == SC_STATUS_LINK_OVER; -} - -void ESP8266WiFiClass::_smartConfigDone(void* result) -{ - station_config* sta_conf = reinterpret_cast(result); - - wifi_station_set_config(sta_conf); - wifi_station_disconnect(); - wifi_station_connect(); -} - - -void ESP8266WiFiClass::printDiag(Print& p) -{ - const char* modes[] = {"NULL", "STA", "AP", "STA+AP"}; - p.print("Mode: "); - p.println(modes[wifi_get_opmode()]); - - const char* phymodes[] = {"", "B", "G", "N"}; - p.print("PHY mode: "); - p.println(phymodes[(int) wifi_get_phy_mode()]); - - p.print("Channel: "); - p.println(wifi_get_channel()); - - p.print("AP id: "); - p.println(wifi_station_get_current_ap_id()); - - p.print("Status: "); - p.println(wifi_station_get_connect_status()); - - p.print("Auto connect: "); - p.println(wifi_station_get_auto_connect()); - - static struct station_config conf; - wifi_station_get_config(&conf); - - const char* ssid = reinterpret_cast(conf.ssid); - p.print("SSID ("); - p.print(strlen(ssid)); - p.print("): "); - p.println(ssid); - - const char* passphrase = reinterpret_cast(conf.password); - p.print("Passphrase ("); - p.print(strlen(passphrase)); - p.print("): "); - p.println(passphrase); - - p.print("BSSID set: "); - p.println(conf.bssid_set); - -} - -size_t ESP8266WiFiClass::_scanCount = 0; -void* ESP8266WiFiClass::_scanResult = 0; - - -ESP8266WiFiClass WiFi; diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h deleted file mode 100644 index feb18abf..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFi.h +++ /dev/null @@ -1,253 +0,0 @@ -/* - ESP8266WiFi.h - esp8266 Wifi support. - Based on WiFi.h from Ardiono WiFi shield library. - Copyright (c) 2011-2014 Arduino. All right reserved. - Modified by Ivan Grokhotkov, December 2014 - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef WiFi_h -#define WiFi_h - -#include - -extern "C" { - #include "include/wl_definitions.h" -} - -#include "IPAddress.h" -#include "WiFiClient.h" -#include "WiFiServer.h" - -enum WiFiMode { WIFI_OFF = 0, WIFI_STA = 1, WIFI_AP = 2, WIFI_AP_STA = 3 }; - -class ESP8266WiFiClass -{ -public: - - ESP8266WiFiClass(); - - void mode(WiFiMode); - - - /* Start Wifi connection for OPEN networks - * - * param ssid: Pointer to the SSID string. - */ - int begin(const char* ssid); - - /* Start Wifi connection with passphrase - * the most secure supported mode will be automatically selected - * - * param ssid: Pointer to the SSID string. - * param passphrase: Passphrase. Valid characters in a passphrase - * must be between ASCII 32-126 (decimal). - */ - int begin(const char* ssid, const char *passphrase); - - /* Wait for Wifi connection to reach a result - * returns the status reached or disconnect if STA is off - */ - uint8_t waitForConnectResult(); - - /* Set up an open access point - * - * param ssid: Pointer to the SSID string. - */ - void softAP(const char* ssid); - - - /* Set up a WPA2-secured access point - * - * param ssid: Pointer to the SSID string. - * param passphrase: Pointer to passphrase, 8 characters min. - * param channel: WiFi channel number, 1 - 13. - */ - void softAP(const char* ssid, const char* passphrase, int channel = 1); - - - /* Change Ip configuration settings disabling the dhcp client - * - * param local_ip: Static ip configuration - * param gateway: Static gateway configuration - * param subnet: Static Subnet mask - */ - void config(IPAddress local_ip, IPAddress gateway, IPAddress subnet); - - /* Configure access point - * - * param local_ip: access point IP - * param gateway: gateway IP - * param subnet: subnet mask - */ - void softAPConfig(IPAddress local_ip, IPAddress gateway, IPAddress subnet); - - /* - * Disconnect from the network - * - * return: one value of wl_status_t enum - */ - int disconnect(void); - - /* - * Get the station interface MAC address. - * - * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH - */ - uint8_t* macAddress(uint8_t* mac); - - /* - * Get the softAP interface MAC address. - * - * return: pointer to uint8_t array with length WL_MAC_ADDR_LENGTH - */ - uint8_t* softAPmacAddress(uint8_t* mac); - - /* - * Get the station interface IP address. - * - * return: Ip address value - */ - IPAddress localIP(); - - /* - * Get the softAP interface IP address. - * - * return: Ip address value - */ - IPAddress softAPIP(); - - /* - * Get the interface subnet mask address. - * - * return: subnet mask address value - */ - IPAddress subnetMask(); - - /* - * Get the gateway ip address. - * - * return: gateway ip address value - */ - IPAddress gatewayIP(); - - /* - * Return the current SSID associated with the network - * - * return: ssid string - */ - char* SSID(); - - /* - * Return the current network RSSI. Note: this is just a stub, there is no way to - * get the RSSI in the Espressif SDK yet. - * - * return: RSSI value (currently 0) - */ - - int32_t RSSI() { return 0; } - - /* - * Start scan WiFi networks available - * - * return: Number of discovered networks - */ - int8_t scanNetworks(); - - /* - * Return the SSID discovered during the network scan. - * - * param networkItem: specify from which network item want to get the information - * - * return: ssid string of the specified item on the networks scanned list - */ - const char* SSID(uint8_t networkItem); - - /* - * Return the encryption type of the networks discovered during the scanNetworks - * - * param networkItem: specify from which network item want to get the information - * - * return: encryption type (enum wl_enc_type) of the specified item on the networks scanned list - */ - uint8_t encryptionType(uint8_t networkItem); - - /* - * Return the RSSI of the networks discovered during the scanNetworks - * - * param networkItem: specify from which network item want to get the information - * - * return: signed value of RSSI of the specified item on the networks scanned list - */ - int32_t RSSI(uint8_t networkItem); - - /* - * Return Connection status. - * - * return: one of the value defined in wl_status_t - */ - wl_status_t status(); - - /* - * Resolve the given hostname to an IP address. - * param aHostname: Name to be resolved - * param aResult: IPAddress structure to store the returned IP address - * result: 1 if aIPAddrString was successfully converted to an IP address, - * else error code - */ - int hostByName(const char* aHostname, IPAddress& aResult); - - /* - * Output WiFi settings to an object derived from Print interface (like Serial). - * - */ - void printDiag(Print& dest); - - /* - * Start SmartConfig - * - */ - void beginSmartConfig(); - - /* - * Query SmartConfig status, to decide when stop config - * - */ - bool smartConfigDone(); - - /* - * Stop SmartConfig - * - */ - void stopSmartConfig(); - - friend class WiFiClient; - friend class WiFiServer; - -protected: - static void _scanDone(void* result, int status); - void * _getScanInfoByIndex(int i); - static void _smartConfigDone(void* result); - bool _smartConfigStarted = false; - - static size_t _scanCount; - static void* _scanResult; - -}; - -extern ESP8266WiFiClass WiFi; - -#endif diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp b/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp deleted file mode 100644 index cbe826d3..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/** - * - * @file ESP8266WiFiMulti.cpp - * @date 16.05.2015 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the esp8266 core for Arduino environment. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#include "ESP8266WiFiMulti.h" -#include - -ESP8266WiFiMulti::ESP8266WiFiMulti() { -} - -ESP8266WiFiMulti::~ESP8266WiFiMulti() { - APlistClean(); -} - -bool ESP8266WiFiMulti::addAP(const char* ssid, const char *passphrase) { - return APlistAdd(ssid, passphrase); -} - -wl_status_t ESP8266WiFiMulti::run(void) { - - wl_status_t status = WiFi.status(); - if(status == WL_DISCONNECTED || status == WL_NO_SSID_AVAIL || status == WL_IDLE_STATUS || status == WL_CONNECT_FAILED) { - - WifiAPlist_t bestNetwork { NULL, NULL }; - int bestNetworkDb = INT_MIN; - - // WiFi.scanNetworks will return the number of networks found - int8_t n = WiFi.scanNetworks(); - - DEBUG_WIFI_MULTI("[WIFI] scan done\n"); - delay(0); - - if(n <= 0) { - DEBUG_WIFI_MULTI("[WIFI] no networks found\n"); - } else { - DEBUG_WIFI_MULTI("[WIFI] %d networks found\n", n); - for(int8_t i = 0; i < n; ++i) { - const char * ssid_scan = WiFi.SSID(i); - int32_t rssi_scan = WiFi.RSSI(i); - uint8_t sec_scan = WiFi.encryptionType(i); - - bool known = false; - for(uint32_t x = 0; x < APlist.size(); x++) { - WifiAPlist_t entry = APlist[x]; - - if(strcmp(entry.ssid, ssid_scan) == 0) { // SSID match - known = true; - if(rssi_scan > bestNetworkDb) { // best network - if(sec_scan == ENC_TYPE_NONE || entry.passphrase) { // check for passphrase if not open wlan - bestNetworkDb = rssi_scan; - memcpy((void*) &bestNetwork, (void*) &entry, sizeof(bestNetwork)); - } - } - break; - } - } - - if(known) { - DEBUG_WIFI_MULTI(" ---> "); - } else { - DEBUG_WIFI_MULTI(" "); - } - - DEBUG_WIFI_MULTI(" %d: %s (%d) %c\n", i, ssid_scan, rssi_scan, (sec_scan == ENC_TYPE_NONE) ? ' ' : '*'); - delay(0); - } - } - - DEBUG_WIFI_MULTI("\n\n"); - delay(0); - - if(bestNetwork.ssid) { - DEBUG_WIFI_MULTI("[WIFI] Connecting SSID: %s (%d)\n", bestNetwork.ssid, bestNetworkDb); - - WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase); - status = WiFi.status(); - - // wait for connection or fail - while(status != WL_CONNECTED && status != WL_NO_SSID_AVAIL && status != WL_CONNECT_FAILED) { - delay(10); - status = WiFi.status(); - } - - IPAddress ip; - switch(status) { - case WL_CONNECTED: - ip = WiFi.localIP(); - DEBUG_WIFI_MULTI("[WIFI] Connecting done.\n"); - DEBUG_WIFI_MULTI("[WIFI] SSID: %s\n", WiFi.SSID()); - DEBUG_WIFI_MULTI("[WIFI] IP: %d.%d.%d.%d\n", ip[0], ip[1], ip[2], ip[3]); - break; - case WL_NO_SSID_AVAIL: - DEBUG_WIFI_MULTI("[WIFI] Connecting Faild AP not found.\n"); - break; - case WL_CONNECT_FAILED: - DEBUG_WIFI_MULTI("[WIFI] Connecting Faild.\n"); - break; - default: - DEBUG_WIFI_MULTI("[WIFI] Connecting Faild (%d).\n", status); - break; - } - } else { - DEBUG_WIFI_MULTI("[WIFI] no matching wifi found!\n"); - } - } - return status; -} - -// ################################################################################## - -bool ESP8266WiFiMulti::APlistAdd(const char* ssid, const char *passphrase) { - - WifiAPlist_t newAP; - - newAP.ssid = (char*) malloc(strlen(ssid)); - - if(!newAP.ssid) { - return false; - } - - strcpy(newAP.ssid, ssid); - - if(passphrase && *passphrase != 0x00) { - newAP.passphrase = (char*) malloc(strlen(passphrase)); - } - - if(!newAP.passphrase) { - free(newAP.ssid); - return false; - } - - strcpy(newAP.passphrase, passphrase); - - APlist.push_back(newAP); - return true; -} - -void ESP8266WiFiMulti::APlistClean(void) { - for(uint32_t i = 0; i < APlist.size(); i++) { - WifiAPlist_t entry = APlist[i]; - if(entry.ssid) { - free(entry.ssid); - } - if(entry.passphrase) { - free(entry.passphrase); - } - } - APlist.clear(); -} - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.h deleted file mode 100644 index 5e8411f9..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/ESP8266WiFiMulti.h +++ /dev/null @@ -1,62 +0,0 @@ -/** - * - * @file ESP8266WiFiMulti.h - * @date 16.05.2015 - * @author Markus Sattler - * - * Copyright (c) 2015 Markus Sattler. All rights reserved. - * This file is part of the esp8266 core for Arduino environment. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - - -#ifndef WIFICLIENTMULTI_H_ -#define WIFICLIENTMULTI_H_ - -#include "ESP8266WiFi.h" -#undef min -#undef max -#include - -//#define DEBUG_WIFI_MULTI(...) os_printf( __VA_ARGS__ ) - -#ifndef DEBUG_WIFI_MULTI -#define DEBUG_WIFI_MULTI(...) -#endif - -typedef struct { - char * ssid; - char * passphrase; -} WifiAPlist_t; - -class ESP8266WiFiMulti { - public: - ESP8266WiFiMulti(); - ~ESP8266WiFiMulti(); - - bool addAP(const char* ssid, const char *passphrase = NULL); - - wl_status_t run(void); - - private: - std::vector APlist; - bool APlistAdd(const char* ssid, const char *passphrase = NULL); - void APlistClean(void); - -}; - -#endif /* WIFICLIENTMULTI_H_ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.cpp b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.cpp deleted file mode 100644 index 534c7fa8..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.cpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - WiFiClient.cpp - TCP/IP client for esp8266, mostly compatible - with Arduino WiFi shield library - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#define LWIP_INTERNAL - -extern "C" -{ - #include "include/wl_definitions.h" - #include "osapi.h" - #include "ets_sys.h" -} - -#include "debug.h" -#include "ESP8266WiFi.h" -#include "WiFiClient.h" -#include "WiFiServer.h" -#include "lwip/opt.h" -#include "lwip/tcp.h" -#include "lwip/inet.h" -#include "cbuf.h" -#include "include/ClientContext.h" -#include "c_types.h" - -ICACHE_FLASH_ATTR WiFiClient::WiFiClient() -: _client(0) -{ -} - -ICACHE_FLASH_ATTR WiFiClient::WiFiClient(ClientContext* client) : _client(client) -{ - _client->ref(); -} - -ICACHE_FLASH_ATTR WiFiClient::~WiFiClient() -{ - if (_client) - _client->unref(); -} - -ICACHE_FLASH_ATTR WiFiClient::WiFiClient(const WiFiClient& other) -{ - _client = other._client; - if (_client) - _client->ref(); -} - -WiFiClient& ICACHE_FLASH_ATTR WiFiClient::operator=(const WiFiClient& other) -{ - if (_client) - _client->unref(); - _client = other._client; - if (_client) - _client->ref(); - return *this; -} - - -int ICACHE_FLASH_ATTR WiFiClient::connect(const char* host, uint16_t port) -{ - IPAddress remote_addr; - if (WiFi.hostByName(host, remote_addr)) - { - return connect(remote_addr, port); - } - return 0; -} - -int ICACHE_FLASH_ATTR WiFiClient::connect(IPAddress ip, uint16_t port) -{ - if (_client) - stop(); - - tcp_pcb* pcb = tcp_new(); - if (!pcb) - return 0; - - ip_addr_t addr; - addr.addr = ip; - tcp_arg(pcb, this); - tcp_err(pcb, &WiFiClient::_s_err); - tcp_connect(pcb, &addr, port, reinterpret_cast(&WiFiClient::_s_connected)); - - esp_yield(); - if (_client) - return 1; - - // if tcp_error was called, pcb has already been destroyed. - // tcp_abort(pcb); - return 0; -} - -int8_t ICACHE_FLASH_ATTR WiFiClient::_connected(void* pcb, int8_t err) -{ - tcp_pcb* tpcb = reinterpret_cast(pcb); - _client = new ClientContext(tpcb, 0, 0); - _client->ref(); - esp_schedule(); - return ERR_OK; -} - -void ICACHE_FLASH_ATTR WiFiClient::_err(int8_t err) -{ - DEBUGV(":err %d\r\n", err); - esp_schedule(); -} - - -void ICACHE_FLASH_ATTR WiFiClient::setNoDelay(bool nodelay) { - if (!_client) - return; - _client->setNoDelay(nodelay); -} - -bool ICACHE_FLASH_ATTR WiFiClient::getNoDelay() { - if (!_client) - return false; - return _client->getNoDelay(); -} - -size_t ICACHE_FLASH_ATTR WiFiClient::write(uint8_t b) -{ - return write(&b, 1); -} - -size_t ICACHE_FLASH_ATTR WiFiClient::write(const uint8_t *buf, size_t size) -{ - if (!_client || !size) - { - return 0; - } - - return _client->write(reinterpret_cast(buf), size); -} - -extern "C" uint32_t esp_micros_at_task_start(); - -int ICACHE_FLASH_ATTR WiFiClient::available() -{ - static uint32_t lastPollTime = 0; - if (!_client) - return 0; - - if (lastPollTime > esp_micros_at_task_start()) - yield(); - - lastPollTime = micros(); - - int result = _client->getSize(); - return result; -} - -int ICACHE_FLASH_ATTR WiFiClient::read() -{ - if (!available()) - return -1; - - return _client->read(); -} - - -int ICACHE_FLASH_ATTR WiFiClient::read(uint8_t* buf, size_t size) -{ - return (int) _client->read(reinterpret_cast(buf), size); -} - -int ICACHE_FLASH_ATTR WiFiClient::peek() -{ - if (!available()) - return -1; - - return _client->peek(); -} - -void ICACHE_FLASH_ATTR WiFiClient::flush() -{ - if (_client) - _client->flush(); -} - -void ICACHE_FLASH_ATTR WiFiClient::stop() -{ - if (!_client) - return; - - _client->unref(); - _client = 0; -} - -uint8_t ICACHE_FLASH_ATTR WiFiClient::connected() -{ - if (!_client) - return 0; - - return _client->state() == ESTABLISHED || available(); -} - -uint8_t ICACHE_FLASH_ATTR WiFiClient::status() -{ - if (!_client) - return CLOSED; - return _client->state(); -} - -ICACHE_FLASH_ATTR WiFiClient::operator bool() -{ - return _client != 0; -} - -IPAddress WiFiClient::remoteIP() -{ - if (!_client) - return IPAddress(0U); - - return IPAddress(_client->getRemoteAddress()); -} - -uint16_t WiFiClient::remotePort() -{ - if (!_client) - return 0; - - return _client->getRemotePort(); -} - -int8_t ICACHE_FLASH_ATTR WiFiClient::_s_connected(void* arg, void* tpcb, int8_t err) -{ - return reinterpret_cast(arg)->_connected(tpcb, err); -} - -void ICACHE_FLASH_ATTR WiFiClient::_s_err(void* arg, int8_t err) -{ - reinterpret_cast(arg)->_err(err); -} - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.h deleted file mode 100644 index f4063cbb..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiClient.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - WiFiClient.h - Library for Arduino Wifi shield. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified by Ivan Grokhotkov, December 2014 - esp8266 support -*/ - -#ifndef wificlient_h -#define wificlient_h -#include "Arduino.h" -#include "Print.h" -#include "Client.h" -#include "IPAddress.h" -#include - -class ClientContext; -class WiFiServer; - -class WiFiClient : public Client { -protected: - WiFiClient(ClientContext* client); - -public: - WiFiClient(); - virtual ~WiFiClient(); - WiFiClient(const WiFiClient&); - WiFiClient& operator=(const WiFiClient&); - - uint8_t status(); - virtual int connect(IPAddress ip, uint16_t port); - virtual int connect(const char *host, uint16_t port); - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *buf, size_t size); - template - size_t write(T& source, size_t unitSize); - - virtual int available(); - virtual int read(); - virtual int read(uint8_t *buf, size_t size); - virtual int peek(); - virtual void flush(); - virtual void stop(); - virtual uint8_t connected(); - virtual operator bool(); - - IPAddress remoteIP(); - uint16_t remotePort(); - bool getNoDelay(); - void setNoDelay(bool nodelay); - - template size_t write(T &src){ - uint8_t obuf[1460]; - size_t doneLen = 0; - size_t sentLen; - int i; - - while (src.available() > 1460){ - src.read(obuf, 1460); - sentLen = write(obuf, 1460); - doneLen = doneLen + sentLen; - if(sentLen != 1460){ - return doneLen; - } - } - - uint16_t leftLen = src.available(); - src.read(obuf, leftLen); - sentLen = write(obuf, leftLen); - doneLen = doneLen + sentLen; - return doneLen; - } - - friend class WiFiServer; - - using Print::write; - -private: - - static int8_t _s_connected(void* arg, void* tpcb, int8_t err); - static void _s_err(void* arg, int8_t err); - - int8_t _connected(void* tpcb, int8_t err); - void _err(int8_t err); - - ClientContext* _client; - -}; - - -template -inline size_t WiFiClient::write(T& source, size_t unitSize) { - std::unique_ptr buffer(new uint8_t[unitSize]); - size_t size_sent = 0; - while(true) { - size_t left = source.available(); - if (!left) - break; - size_t will_send = (left < unitSize) ? left : unitSize; - source.read(buffer.get(), will_send); - size_t cb = write(buffer.get(), will_send); - size_sent += cb; - if (cb != will_send) { - break; - } - } - return size_sent; -} - -#endif diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.cpp b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.cpp deleted file mode 100644 index 69ad4ff8..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - WiFiServer.cpp - TCP/IP server for esp8266, mostly compatible - with Arduino WiFi shield library - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - - -#define LWIP_INTERNAL - -extern "C" { - #include "osapi.h" - #include "ets_sys.h" -} - -#include "debug.h" -#include "ESP8266WiFi.h" -#include "WiFiClient.h" -#include "WiFiServer.h" -#include "lwip/opt.h" -#include "lwip/tcp.h" -#include "lwip/inet.h" -#include "cbuf.h" -#include "include/ClientContext.h" - -WiFiServer::WiFiServer(uint16_t port) -{ - _port = port; - _pcb = 0; - _unclaimed = 0; - _discarded = 0; -} - -void WiFiServer::begin() -{ - err_t err; - - tcp_pcb* pcb = tcp_new(); - if (!pcb) - return; - - err = tcp_bind(pcb, INADDR_ANY, _port); - - if (err != ERR_OK) - { - tcp_close(pcb); - return; - } - - tcp_pcb* listen_pcb = tcp_listen(pcb); - if (!listen_pcb) - { - tcp_close(pcb); - return; - } - _pcb = listen_pcb; - tcp_accept(listen_pcb, &WiFiServer::_s_accept); - tcp_arg(listen_pcb, (void*) this); -} - -void WiFiServer::setNoDelay(bool nodelay){ - if(!_pcb) return; - if(nodelay) tcp_nagle_disable(_pcb); - else tcp_nagle_enable(_pcb); -} - -bool WiFiServer::getNoDelay(){ - if(!_pcb) return false; - return tcp_nagle_disabled(_pcb); -} - -extern "C" uint32_t esp_micros_at_task_start(); - -bool WiFiServer::hasClient(){ - if (_unclaimed) return true; - return false; -} - -WiFiClient WiFiServer::available(byte* status) -{ - static uint32_t lastPollTime = 0; - - if (_unclaimed) - { - WiFiClient result(_unclaimed); - _unclaimed = _unclaimed->next(); - DEBUGV("WS:av\r\n"); - return result; - } - - if (lastPollTime > esp_micros_at_task_start()) - yield(); - lastPollTime = micros(); - - return WiFiClient(); -} - -uint8_t WiFiServer::status() { - if (!_pcb) - return CLOSED; - return _pcb->state; -} - - -size_t WiFiServer::write(uint8_t b) -{ - return write(&b, 1); -} - -size_t WiFiServer::write(const uint8_t *buffer, size_t size) -{ - // write to all clients - // not implemented - return 0; -} - -template -T* slist_append_tail(T* head, T* item) -{ - if (!head) - return item; - T* last = head; - while(last->next()) - last = last->next(); - last->next(item); - return head; -} - -int8_t WiFiServer::_accept(tcp_pcb* apcb, int8_t err) -{ - DEBUGV("WS:ac\r\n"); - ClientContext* client = new ClientContext(apcb, &WiFiServer::_s_discard, this); - _unclaimed = slist_append_tail(_unclaimed, client); - tcp_accepted(_pcb); - // printf("WiFiServer::_accept\r\n"); - return ERR_OK; -} - -void WiFiServer::_discard(ClientContext* client) -{ - // _discarded = slist_append_tail(_discarded, client); - DEBUGV("WS:dis\r\n"); - // printf("WiFiServer::_discard\r\n"); -} - -int8_t WiFiServer::_s_accept(void *arg, tcp_pcb* newpcb, int8_t err) -{ - return reinterpret_cast(arg)->_accept(newpcb, err); -} - -void WiFiServer::_s_discard(void* server, ClientContext* ctx) -{ - reinterpret_cast(server)->_discard(ctx); -} - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.h deleted file mode 100644 index ef642762..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiServer.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - WiFiServer.h - Library for Arduino Wifi shield. - Copyright (c) 2011-2014 Arduino LLC. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified by Ivan Grokhotkov, December 2014 - esp8266 support -*/ - -#ifndef wifiserver_h -#define wifiserver_h - -extern "C" { - #include "include/wl_definitions.h" - - struct tcp_pcb; -} - -#include "Server.h" - -class ClientContext; -class WiFiClient; - -class WiFiServer : public Server { -private: - uint16_t _port; - tcp_pcb* _pcb; - - ClientContext* _unclaimed; - ClientContext* _discarded; - -public: - WiFiServer(uint16_t port); - WiFiClient available(uint8_t* status = NULL); - bool hasClient(); - void begin(); - void setNoDelay(bool nodelay); - bool getNoDelay(); - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *buf, size_t size); - uint8_t status(); - - using Print::write; - -protected: - int8_t _accept(tcp_pcb* newpcb, int8_t err); - void _discard(ClientContext* client); - - static int8_t _s_accept(void *arg, tcp_pcb* newpcb, int8_t err); - static void _s_discard(void* server, ClientContext* ctx); -}; - -#endif diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.cpp b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.cpp deleted file mode 100644 index 7696d747..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* - WiFiUdp.cpp - UDP client/server for esp8266, mostly compatible - with Arduino WiFi shield library - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#define LWIP_INTERNAL -#include - -extern "C" -{ - #include "include/wl_definitions.h" - #include "osapi.h" - #include "ets_sys.h" -} - -#include "debug.h" -#include "ESP8266WiFi.h" -#include "WiFiUdp.h" -#include "lwip/opt.h" -#include "lwip/udp.h" -#include "lwip/inet.h" -#include "lwip/igmp.h" -#include "lwip/mem.h" -#include "include/UdpContext.h" - -/* Constructor */ -WiFiUDP::WiFiUDP() : _ctx(0) {} - -WiFiUDP::WiFiUDP(const WiFiUDP& other) -{ - _ctx = other._ctx; - if (_ctx) - _ctx->ref(); -} - -WiFiUDP& WiFiUDP::operator=(const WiFiUDP& rhs) -{ - _ctx = rhs._ctx; - if (_ctx) - _ctx->ref(); - return *this; -} - -WiFiUDP::~WiFiUDP() -{ - if (_ctx) - _ctx->unref(); -} - -/* Start WiFiUDP socket, listening at local port */ -uint8_t WiFiUDP::begin(uint16_t port) -{ - if (_ctx) { - _ctx->unref(); - _ctx = 0; - } - - _ctx = new UdpContext; - _ctx->ref(); - ip_addr_t addr; - addr.addr = INADDR_ANY; - return (_ctx->listen(addr, port)) ? 1 : 0; -} - -uint8_t WiFiUDP::beginMulticast(IPAddress interfaceAddr, IPAddress multicast, uint16_t port) -{ - if (_ctx) { - _ctx->unref(); - _ctx = 0; - } - - ip_addr_t ifaddr; - ifaddr.addr = (uint32_t) interfaceAddr; - ip_addr_t multicast_addr; - multicast_addr.addr = (uint32_t) multicast; - - if (igmp_joingroup(&ifaddr, &multicast_addr)!= ERR_OK) { - return 0; - } - - _ctx = new UdpContext; - _ctx->ref(); - if (!_ctx->listen(*IP_ADDR_ANY, port)) { - return 0; - } - - return 1; -} - -/* return number of bytes available in the current packet, - will return zero if parsePacket hasn't been called yet */ -int WiFiUDP::available() { - if (!_ctx) - return 0; - return static_cast(_ctx->getSize()); -} - -/* Release any resources being used by this WiFiUDP instance */ -void WiFiUDP::stop() -{ - if (_ctx) - _ctx->disconnect(); - _ctx->unref(); - _ctx = 0; -} - -int WiFiUDP::beginPacket(const char *host, uint16_t port) -{ - IPAddress remote_addr; - if (WiFi.hostByName(host, remote_addr)) - { - return beginPacket(remote_addr, port); - } - return 0; -} - -int WiFiUDP::beginPacket(IPAddress ip, uint16_t port) -{ - ip_addr_t addr; - addr.addr = ip; - - if (!_ctx) { - _ctx = new UdpContext; - _ctx->ref(); - } - return (_ctx->connect(addr, port)) ? 1 : 0; -} - -int WiFiUDP::beginPacketMulticast(IPAddress multicastAddress, uint16_t port, - IPAddress interfaceAddress, int ttl) -{ - ip_addr_t mcastAddr; - mcastAddr.addr = multicastAddress; - ip_addr_t ifaceAddr; - ifaceAddr.addr = interfaceAddress; - - if (!_ctx) { - _ctx = new UdpContext; - _ctx->ref(); - } - if (!_ctx->connect(mcastAddr, port)) { - return 0; - } - _ctx->setMulticastInterface(ifaceAddr); - _ctx->setMulticastTTL(ttl); - return 1; -} - -int WiFiUDP::endPacket() -{ - if (!_ctx) - return 0; - - _ctx->send(); - return 1; -} - -size_t WiFiUDP::write(uint8_t byte) -{ - return write(&byte, 1); -} - -size_t WiFiUDP::write(const uint8_t *buffer, size_t size) -{ - if (!_ctx) - return 0; - - return _ctx->append(reinterpret_cast(buffer), size); -} - -int WiFiUDP::parsePacket() -{ - if (!_ctx) - return 0; - if (!_ctx->next()) - return 0; - return _ctx->getSize(); -} - -int WiFiUDP::read() -{ - if (!_ctx) - return -1; - - return _ctx->read(); -} - -int WiFiUDP::read(unsigned char* buffer, size_t len) -{ - if (!_ctx) - return 0; - - return _ctx->read(reinterpret_cast(buffer), len); -} - -int WiFiUDP::peek() -{ - if (!_ctx) - return 0; - - return _ctx->peek(); -} - -void WiFiUDP::flush() -{ - if (_ctx) - _ctx->flush(); -} - -IPAddress WiFiUDP::remoteIP() -{ - if (!_ctx) - return IPAddress(0U); - - return IPAddress(_ctx->getRemoteAddress()); -} - -uint16_t WiFiUDP::remotePort() -{ - if (!_ctx) - return 0; - - return _ctx->getRemotePort(); -} - -IPAddress WiFiUDP::destinationIP() -{ - IPAddress addr; - - if (!_ctx) - return addr; - - addr = _ctx->getDestAddress(); - return addr; -} - -uint16_t WiFiUDP::localPort() -{ - if (!_ctx) - return 0; - - return _ctx->getLocalPort(); -} diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.h deleted file mode 100644 index f8d76cd0..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/WiFiUdp.h +++ /dev/null @@ -1,109 +0,0 @@ -/* - WiFiUdp.h - Library for Arduino Wifi shield. - Copyright (c) 2011-2014 Arduino LLC. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified by Ivan Grokhotkov, January 2015 - esp8266 support -*/ - -#ifndef WIFIUDP_H -#define WIFIUDP_H - -#include - -#define UDP_TX_PACKET_MAX_SIZE 8192 - -class UdpContext; - -class WiFiUDP : public UDP { -private: - UdpContext* _ctx; - -public: - WiFiUDP(); // Constructor - WiFiUDP(const WiFiUDP& other); - WiFiUDP& operator=(const WiFiUDP& rhs); - ~WiFiUDP(); - - operator bool() const { return _ctx != 0; } - - // initialize, start listening on specified port. - // Returns 1 if successful, 0 if there are no sockets available to use - virtual uint8_t begin(uint16_t port); - // Finish with the UDP connetion - virtual void stop(); - // join a multicast group and listen on the given port - uint8_t beginMulticast(IPAddress interfaceAddr, IPAddress multicast, uint16_t port); - - // Sending UDP packets - - // Start building up a packet to send to the remote host specific in ip and port - // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port - virtual int beginPacket(IPAddress ip, uint16_t port); - // Start building up a packet to send to the remote host specific in host and port - // Returns 1 if successful, 0 if there was a problem resolving the hostname or port - virtual int beginPacket(const char *host, uint16_t port); - // Start building up a packet to send to the multicast address - // multicastAddress - muticast address to send to - // interfaceAddress - the local IP address of the interface that should be used - // use WiFi.localIP() or WiFi.softAPIP() depending on the interface you need - // ttl - multicast packet TTL (default is 1) - // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port - virtual int beginPacketMulticast(IPAddress multicastAddress, - uint16_t port, - IPAddress interfaceAddress, - int ttl = 1); - // Finish off this packet and send it - // Returns 1 if the packet was sent successfully, 0 if there was an error - virtual int endPacket(); - // Write a single byte into the packet - virtual size_t write(uint8_t); - // Write size bytes from buffer into the packet - virtual size_t write(const uint8_t *buffer, size_t size); - - using Print::write; - - // Start processing the next available incoming packet - // Returns the size of the packet in bytes, or 0 if no packets are available - virtual int parsePacket(); - // Number of bytes remaining in the current packet - virtual int available(); - // Read a single byte from the current packet - virtual int read(); - // Read up to len bytes from the current packet and place them into buffer - // Returns the number of bytes read, or 0 if none are available - virtual int read(unsigned char* buffer, size_t len); - // Read up to len characters from the current packet and place them into buffer - // Returns the number of characters read, or 0 if none are available - virtual int read(char* buffer, size_t len) { return read((unsigned char*)buffer, len); }; - // Return the next byte from the current packet without moving on to the next byte - virtual int peek(); - virtual void flush(); // Finish reading the current packet - - // Return the IP address of the host who sent the current incoming packet - virtual IPAddress remoteIP(); - // Return the port of the host who sent the current incoming packet - virtual uint16_t remotePort(); - // Return the destination address for incoming packets, - // useful to distinguish multicast and ordinary packets - IPAddress destinationIP(); - // Return the local port for outgoing packets - uint16_t localPort(); - -}; - -#endif //WIFIUDP_H - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/cc.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/cc.h deleted file mode 100644 index ff03b307..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/cc.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __ARCH_CC_H__ -#define __ARCH_CC_H__ - -//#include -#include "c_types.h" -#include "ets_sys.h" -#include "osapi.h" -#define EFAULT 14 - -//#define LWIP_PROVIDE_ERRNO - -#if (1) -#define BYTE_ORDER LITTLE_ENDIAN -#else -#define BYTE_ORDER BIG_ENDIAN -#endif - - -typedef unsigned char u8_t; -typedef signed char s8_t; -typedef unsigned short u16_t; -typedef signed short s16_t; -typedef unsigned long u32_t; -typedef signed long s32_t; -typedef unsigned long mem_ptr_t; - -#define S16_F "d" -#define U16_F "d" -#define X16_F "x" - -#define S32_F "d" -#define U32_F "d" -#define X32_F "x" - - - -//#define PACK_STRUCT_FIELD(x) x __attribute__((packed)) -#define PACK_STRUCT_FIELD(x) x -#define PACK_STRUCT_STRUCT __attribute__((packed)) -#define PACK_STRUCT_BEGIN -#define PACK_STRUCT_END - -//#define LWIP_DEBUG - -#ifdef LWIP_DEBUG -#define LWIP_PLATFORM_DIAG(x) os_printf x -#define LWIP_PLATFORM_ASSERT(x) ETS_ASSERT(x) -#else -#define LWIP_PLATFORM_DIAG(x) -#define LWIP_PLATFORM_ASSERT(x) -#endif - -#define SYS_ARCH_DECL_PROTECT(x) -#define SYS_ARCH_PROTECT(x) -#define SYS_ARCH_UNPROTECT(x) - -#define LWIP_PLATFORM_BYTESWAP 1 -#define LWIP_PLATFORM_HTONS(_n) ((u16_t)((((_n) & 0xff) << 8) | (((_n) >> 8) & 0xff))) -#define LWIP_PLATFORM_HTONL(_n) ((u32_t)( (((_n) & 0xff) << 24) | (((_n) & 0xff00) << 8) | (((_n) >> 8) & 0xff00) | (((_n) >> 24) & 0xff) )) - -#if LWIP_RAW -extern u8_t memp_memory_RAW_PCB_base[]; -#endif /* LWIP_RAW */ - -#if LWIP_UDP -extern u8_t memp_memory_UDP_PCB_base[]; -#endif /* LWIP_UDP */ - -#if LWIP_TCP -extern u8_t memp_memory_TCP_PCB_base[]; -extern u8_t memp_memory_TCP_PCB_LISTEN_base[]; -extern u8_t memp_memory_TCP_SEG_base[] SHMEM_ATTR; -#endif /* LWIP_TCP */ - -#if (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) /* LWIP_TIMERS */ -extern u8_t memp_memory_SYS_TIMEOUT_base[]; -#endif /* LWIP_TIMERS */ - -extern u8_t memp_memory_PBUF_base[]; -extern u8_t memp_memory_PBUF_POOL_base[]; - - - -#endif /* __ARCH_CC_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/perf.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/perf.h deleted file mode 100644 index 089facac..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/perf.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2001, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __PERF_H__ -#define __PERF_H__ - -#define PERF_START /* null definition */ -#define PERF_STOP(x) /* null definition */ - -#endif /* __PERF_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/sys_arch.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/arch/sys_arch.h deleted file mode 100644 index e69de29b..00000000 diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h deleted file mode 100644 index 79c68127..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/ClientContext.h +++ /dev/null @@ -1,307 +0,0 @@ -/* - ClientContext.h - TCP connection handling on top of lwIP - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef CLIENTCONTEXT_H -#define CLIENTCONTEXT_H - -class ClientContext; -class WiFiClient; - -typedef void (*discard_cb_t)(void*, ClientContext*); - -extern "C" void esp_yield(); -extern "C" void esp_schedule(); - -class ClientContext { - public: - ClientContext(tcp_pcb* pcb, discard_cb_t discard_cb, void* discard_cb_arg) : - _pcb(pcb), _rx_buf(0), _rx_buf_offset(0), _discard_cb(discard_cb), _discard_cb_arg(discard_cb_arg), _refcnt(0), _next(0), _send_waiting(false) { - tcp_setprio(pcb, TCP_PRIO_MIN); - tcp_arg(pcb, this); - tcp_recv(pcb, &_s_recv); - tcp_sent(pcb, &_s_sent); - tcp_err(pcb, &_s_error); - } - - err_t abort(){ - if(_pcb) { - DEBUGV(":abort\r\n"); - tcp_arg(_pcb, NULL); - tcp_sent(_pcb, NULL); - tcp_recv(_pcb, NULL); - tcp_err(_pcb, NULL); - tcp_abort(_pcb); - _pcb = 0; - } - return ERR_ABRT; - } - - err_t close(){ - err_t err = ERR_OK; - if(_pcb) { - DEBUGV(":close\r\n"); - tcp_arg(_pcb, NULL); - tcp_sent(_pcb, NULL); - tcp_recv(_pcb, NULL); - tcp_err(_pcb, NULL); - err = tcp_close(_pcb); - if(err != ERR_OK) { - DEBUGV(":tc err %d\r\n", err); - tcp_abort(_pcb); - err = ERR_ABRT; - } - _pcb = 0; - } - return err; - } - - ~ClientContext() { - } - - ClientContext* next() const { - return _next; - } - - ClientContext* next(ClientContext* new_next) { - _next = new_next; - return _next; - } - - void ref() { - ++_refcnt; - DEBUGV(":ref %d\r\n", _refcnt); - } - - void unref() { - DEBUGV(":ur %d\r\n", _refcnt); - if(--_refcnt == 0) { - flush(); - close(); - if(_discard_cb) _discard_cb(_discard_cb_arg, this); - delete this; - } - } - - void setNoDelay(bool nodelay){ - if(!_pcb) return; - if(nodelay) tcp_nagle_disable(_pcb); - else tcp_nagle_enable(_pcb); - } - - bool getNoDelay(){ - if(!_pcb) return false; - return tcp_nagle_disabled(_pcb); - } - - uint32_t getRemoteAddress() { - if(!_pcb) return 0; - - return _pcb->remote_ip.addr; - } - - uint16_t getRemotePort() { - if(!_pcb) return 0; - - return _pcb->remote_port; - } - - size_t getSize() const { - if(!_rx_buf) return 0; - - return _rx_buf->tot_len - _rx_buf_offset; - } - - char read() { - if(!_rx_buf) return 0; - - char c = reinterpret_cast(_rx_buf->payload)[_rx_buf_offset]; - _consume(1); - return c; - } - - size_t read(char* dst, size_t size) { - if(!_rx_buf) return 0; - - size_t max_size = _rx_buf->tot_len - _rx_buf_offset; - size = (size < max_size) ? size : max_size; - - DEBUGV(":rd %d, %d, %d\r\n", size, _rx_buf->tot_len, _rx_buf_offset); - size_t size_read = 0; - while(size) { - size_t buf_size = _rx_buf->len - _rx_buf_offset; - size_t copy_size = (size < buf_size) ? size : buf_size; - DEBUGV(":rdi %d, %d\r\n", buf_size, copy_size); - os_memcpy(dst, reinterpret_cast(_rx_buf->payload) + _rx_buf_offset, copy_size); - dst += copy_size; - _consume(copy_size); - size -= copy_size; - size_read += copy_size; - } - return size_read; - } - - char peek() { - if(!_rx_buf) return 0; - - return reinterpret_cast(_rx_buf->payload)[_rx_buf_offset]; - } - - void flush() { - if(!_rx_buf) { - return; - } - if(_pcb) { - tcp_recved(_pcb, (size_t) _rx_buf->tot_len); - } - pbuf_free(_rx_buf); - _rx_buf = 0; - _rx_buf_offset = 0; - } - - uint8_t state() const { - if(!_pcb) return CLOSED; - - return _pcb->state; - } - - size_t write(const char* data, size_t size) { - if(!_pcb) { - DEBUGV(":wr !_pcb\r\n"); - return 0; - } - - if(size == 0) { - return 0; - } - - size_t room = tcp_sndbuf(_pcb); - size_t will_send = (room < size) ? room : size; - err_t err = tcp_write(_pcb, data, will_send, 0); - if(err != ERR_OK) { - DEBUGV(":wr !ERR_OK\r\n"); - return 0; - } - - _size_sent = will_send; - DEBUGV(":wr\r\n"); - tcp_output( _pcb ); - _send_waiting = true; - delay(5000); // max send timeout - _send_waiting = false; - DEBUGV(":ww\r\n"); - return will_send - _size_sent; - } - - private: - - err_t _sent(tcp_pcb* pcb, uint16_t len) { - DEBUGV(":sent %d\r\n", len); - _size_sent -= len; - if(_size_sent == 0 && _send_waiting) esp_schedule(); - return ERR_OK; - } - - void _consume(size_t size) { - ptrdiff_t left = _rx_buf->len - _rx_buf_offset - size; - if(left > 0) { - _rx_buf_offset += size; - } else if(!_rx_buf->next) { - DEBUGV(":c0 %d, %d\r\n", size, _rx_buf->tot_len); - if(_pcb) tcp_recved(_pcb, _rx_buf->len); - pbuf_free(_rx_buf); - _rx_buf = 0; - _rx_buf_offset = 0; - } else { - DEBUGV(":c %d, %d, %d\r\n", size, _rx_buf->len, _rx_buf->tot_len); - auto head = _rx_buf; - _rx_buf = _rx_buf->next; - _rx_buf_offset = 0; - pbuf_ref(_rx_buf); - if(_pcb) tcp_recved(_pcb, head->len); - pbuf_free(head); - } - } - - err_t _recv(tcp_pcb* pcb, pbuf* pb, err_t err) { - - if(pb == 0) // connection closed - { - DEBUGV(":rcla\r\n"); - return abort(); - } - - if(_rx_buf) { - // there is some unread data - // chain the new pbuf to the existing one - DEBUGV(":rch %d, %d\r\n", _rx_buf->tot_len, pb->tot_len); - pbuf_cat(_rx_buf, pb); - } else { - DEBUGV(":rn %d\r\n", pb->tot_len); - _rx_buf = pb; - _rx_buf_offset = 0; - } - return ERR_OK; - } - - void _error(err_t err) { - DEBUGV(":er %d\r\n", err); - close(); - if(_size_sent && _send_waiting) { - esp_schedule(); - } - } - - err_t _poll(tcp_pcb* pcb) { - return ERR_OK; - } - - static err_t _s_recv(void *arg, struct tcp_pcb *tpcb, struct pbuf *pb, err_t err) { - return reinterpret_cast(arg)->_recv(tpcb, pb, err); - } - - static void _s_error(void *arg, err_t err) { - reinterpret_cast(arg)->_error(err); - } - - static err_t _s_poll(void *arg, struct tcp_pcb *tpcb) { - return reinterpret_cast(arg)->_poll(tpcb); - } - - static err_t _s_sent(void *arg, struct tcp_pcb *tpcb, uint16_t len) { - return reinterpret_cast(arg)->_sent(tpcb, len); - } - - private: - ClientContext* _next; - int _refcnt; - - tcp_pcb* _pcb; - - pbuf* _rx_buf; - size_t _rx_buf_offset; - - discard_cb_t _discard_cb; - void* _discard_cb_arg; - - size_t _size_sent; - bool _send_waiting; -}; - -#endif//CLIENTCONTEXT_H diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/UdpContext.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/UdpContext.h deleted file mode 100644 index c86e050e..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/UdpContext.h +++ /dev/null @@ -1,388 +0,0 @@ -/* - UdpContext.h - UDP connection handling on top of lwIP - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef UDPCONTEXT_H -#define UDPCONTEXT_H - -class UdpContext; - -extern "C" void esp_yield(); -extern "C" void esp_schedule(); - -#define GET_IP_HDR(pb) reinterpret_cast(((uint8_t*)((pb)->payload)) - UDP_HLEN - IP_HLEN); -#define GET_UDP_HDR(pb) reinterpret_cast(((uint8_t*)((pb)->payload)) - UDP_HLEN); - -class UdpContext -{ -public: - - typedef std::function rxhandler_t; - - UdpContext() - : _pcb(0) - , _rx_buf(0) - , _first_buf_taken(false) - , _rx_buf_offset(0) - , _refcnt(0) - , _tx_buf_head(0) - , _tx_buf_cur(0) - , _tx_buf_offset(0) - , _multicast_ttl(1) - , _dest_port(0) - { - _pcb = udp_new(); - _dest_addr.addr = 0; - } - - ~UdpContext() - { - udp_remove(_pcb); - _pcb = 0; - if (_tx_buf_head) - { - pbuf_free(_tx_buf_head); - _tx_buf_head = 0; - _tx_buf_cur = 0; - _tx_buf_offset = 0; - } - if (_rx_buf) - { - pbuf_free(_rx_buf); - _rx_buf = 0; - _rx_buf_offset = 0; - } - } - - void ref() - { - ++_refcnt; - } - - void unref() - { - DEBUGV(":ur %d\r\n", _refcnt); - if (--_refcnt == 0) - { - delete this; - } - } - - bool connect(ip_addr_t addr, uint16_t port) - { - _dest_addr = addr; - _dest_port = port; - return true; - } - - bool listen(ip_addr_t addr, uint16_t port) - { - udp_recv(_pcb, &_s_recv, (void *) this); - err_t err = udp_bind(_pcb, &addr, port); - return err == ERR_OK; - } - - void disconnect() - { - udp_disconnect(_pcb); - } - - void setMulticastInterface(ip_addr_t addr) - { - // newer versions of lwip have a macro to set the multicast ip - // udp_set_multicast_netif_addr(_pcb, addr); - _pcb->multicast_ip = addr; - } - - void setMulticastTTL(int ttl) - { - // newer versions of lwip have an additional field (mcast_ttl) for this purpose - // and a macro to set it instead of direct field access - // udp_set_multicast_ttl(_pcb, ttl); - _multicast_ttl = ttl; - } - - // warning: handler is called from tcp stack context - // esp_yield and non-reentrant functions which depend on it will fail - void onRx(rxhandler_t handler) { - _on_rx = handler; - } - - size_t getSize() const - { - if (!_rx_buf) - return 0; - - return _rx_buf->len - _rx_buf_offset; - } - - uint32_t getRemoteAddress() - { - if (!_rx_buf) - return 0; - - ip_hdr* iphdr = GET_IP_HDR(_rx_buf); - return iphdr->src.addr; - } - - uint16_t getRemotePort() - { - if (!_rx_buf) - return 0; - - udp_hdr* udphdr = GET_UDP_HDR(_rx_buf); - return ntohs(udphdr->src); - } - - uint32_t getDestAddress() - { - ip_hdr* iphdr = GET_IP_HDR(_rx_buf); - return iphdr->dest.addr; - } - - uint16_t getLocalPort() - { - if (!_pcb) - return 0; - - return _pcb->local_port; - } - - bool next() - { - if (!_rx_buf) - return false; - - if (!_first_buf_taken) - { - _first_buf_taken = true; - return true; - } - - auto head = _rx_buf; - _rx_buf = _rx_buf->next; - _rx_buf_offset = 0; - - if (_rx_buf) - { - pbuf_ref(_rx_buf); - } - pbuf_free(head); - return _rx_buf != 0; - } - - int read() - { - if (!_rx_buf || _rx_buf->len == _rx_buf_offset) - return -1; - - char c = reinterpret_cast(_rx_buf->payload)[_rx_buf_offset]; - _consume(1); - return c; - } - - size_t read(char* dst, size_t size) - { - if (!_rx_buf) - return 0; - - size_t max_size = _rx_buf->len - _rx_buf_offset; - size = (size < max_size) ? size : max_size; - DEBUGV(":urd %d, %d, %d\r\n", size, _rx_buf->len, _rx_buf_offset); - - os_memcpy(dst, reinterpret_cast(_rx_buf->payload) + _rx_buf_offset, size); - _consume(size); - - return size; - } - - char peek() - { - if (!_rx_buf) - return 0; - - return reinterpret_cast(_rx_buf->payload)[_rx_buf_offset]; - } - - void flush() - { - if (!_rx_buf) - return; - - _consume(_rx_buf->len - _rx_buf_offset); - } - - - size_t append(const char* data, size_t size) - { - if (!_tx_buf_head || _tx_buf_head->tot_len < _tx_buf_offset + size) - { - _reserve(_tx_buf_offset + size); - } - - size_t left_to_copy = size; - while(left_to_copy) - { - // size already used in current pbuf - size_t used_cur = _tx_buf_offset - (_tx_buf_head->tot_len - _tx_buf_cur->tot_len); - size_t free_cur = _tx_buf_cur->len - used_cur; - if (free_cur == 0) - { - _tx_buf_cur = _tx_buf_cur->next; - continue; - } - size_t will_copy = (left_to_copy < free_cur) ? left_to_copy : free_cur; - os_memcpy(reinterpret_cast(_tx_buf_cur->payload) + used_cur, data, will_copy); - _tx_buf_offset += will_copy; - left_to_copy -= will_copy; - data += will_copy; - } - return size; - } - - void send(ip_addr_t* addr = 0, uint16_t port = 0) - { - size_t orig_size = _tx_buf_head->tot_len; - - size_t data_size = _tx_buf_offset; - size_t size_adjustment = orig_size - data_size; - for (pbuf* p = _tx_buf_head; p; p = p->next) - { - p->tot_len -= size_adjustment; - if (!p->next) - { - p->len = p->tot_len; - } - } - - if (!addr) { - addr = &_dest_addr; - port = _dest_port; - } - - uint16_t old_ttl = _pcb->ttl; - if (ip_addr_ismulticast(addr)) { - _pcb->ttl = _multicast_ttl; - } - - udp_sendto(_pcb, _tx_buf_head, addr, port); - - _pcb->ttl = old_ttl; - - for (pbuf* p = _tx_buf_head; p; p = p->next) - { - p->tot_len += size_adjustment; - if (!p->next) - { - p->len = p->tot_len; - } - } - - pbuf_free(_tx_buf_head); - _tx_buf_head = 0; - _tx_buf_cur = 0; - _tx_buf_offset = 0; - } - -private: - - void _reserve(size_t size) - { - const size_t pbuf_unit_size = 512; - if (!_tx_buf_head) - { - _tx_buf_head = pbuf_alloc(PBUF_TRANSPORT, pbuf_unit_size, PBUF_RAM); - _tx_buf_cur = _tx_buf_head; - _tx_buf_offset = 0; - } - - size_t cur_size = _tx_buf_head->tot_len; - if (size < cur_size) - return; - - size_t grow_size = size - cur_size; - - while(grow_size) - { - pbuf* pb = pbuf_alloc(PBUF_TRANSPORT, pbuf_unit_size, PBUF_RAM); - pbuf_cat(_tx_buf_head, pb); - if (grow_size < pbuf_unit_size) - return; - grow_size -= pbuf_unit_size; - } - } - - void _consume(size_t size) - { - _rx_buf_offset += size; - } - - void _recv(udp_pcb *upcb, pbuf *pb, - ip_addr_t *addr, u16_t port) - { - if (_rx_buf) - { - // there is some unread data - // chain the new pbuf to the existing one - DEBUGV(":urch %d, %d\r\n", _rx_buf->tot_len, pb->tot_len); - pbuf_cat(_rx_buf, pb); - } - else - { - DEBUGV(":urn %d\r\n", pb->tot_len); - _first_buf_taken = false; - _rx_buf = pb; - _rx_buf_offset = 0; - } - if (_on_rx) { - _on_rx(); - } - } - - - static void _s_recv(void *arg, - udp_pcb *upcb, pbuf *p, - ip_addr_t *addr, u16_t port) - { - reinterpret_cast(arg)->_recv(upcb, p, addr, port); - } - -private: - int _refcnt; - udp_pcb* _pcb; - - ip_addr_t _dest_addr; - uint16_t _dest_port; - - uint16_t _multicast_ttl; - - bool _first_buf_taken; - pbuf* _rx_buf; - size_t _rx_buf_offset; - - pbuf* _tx_buf_head; - pbuf* _tx_buf_cur; - size_t _tx_buf_offset; - - rxhandler_t _on_rx; -}; - - - -#endif//CLIENTCONTEXT_H diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/lwipopts.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/lwipopts.h deleted file mode 100644 index 1678a402..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/lwipopts.h +++ /dev/null @@ -1,2037 +0,0 @@ -/** - * @file - * - * lwIP Options Configuration - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIPOPTS_H__ -#define __LWIPOPTS_H__ - - -#define EBUF_LWIP 1 -#define LWIP_ESP 1 -#define EP_OFFSET 36 -/* - ----------------------------------------------- - ---------- Platform specific locking ---------- - ----------------------------------------------- -*/ - -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#ifndef SYS_LIGHTWEIGHT_PROT -#define SYS_LIGHTWEIGHT_PROT 0 -#endif - -/** - * NO_SYS==1: Provides VERY minimal functionality. Otherwise, - * use lwIP facilities. - */ -#ifndef NO_SYS -#define NO_SYS 1 -#endif - -/** - * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1 - * Mainly for compatibility to old versions. - */ -#ifndef NO_SYS_NO_TIMERS -#define NO_SYS_NO_TIMERS 0 -#endif - -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#ifndef MEMCPY -#define MEMCPY(dst,src,len) os_memcpy(dst,src,len) -#endif - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#ifndef SMEMCPY -#define SMEMCPY(dst,src,len) os_memcpy(dst,src,len) -#endif - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#ifndef MEM_LIBC_MALLOC -#define MEM_LIBC_MALLOC 1 -#endif - -/** -* MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. -* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution -* speed and usage from interrupts! -*/ -#ifndef MEMP_MEM_MALLOC -#define MEMP_MEM_MALLOC 1 -#endif - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#ifndef MEM_ALIGNMENT -#define MEM_ALIGNMENT 4 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#ifndef MEM_SIZE -#define MEM_SIZE 16000 -#endif - -/** - * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array. - * This can be used to individually change the location of each pool. - * Default is one big array for all pools - */ -#ifndef MEMP_SEPARATE_POOLS -#define MEMP_SEPARATE_POOLS 1 -#endif - -/** - * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable - * amount of bytes before and after each memp element in every pool and fills - * it with a prominent default value. - * MEMP_OVERFLOW_CHECK == 0 no checking - * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed - * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time - * memp_malloc() or memp_free() is called (useful but slow!) - */ -#ifndef MEMP_OVERFLOW_CHECK -#define MEMP_OVERFLOW_CHECK 0 -#endif - -/** - * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make - * sure that there are no cycles in the linked lists. - */ -#ifndef MEMP_SANITY_CHECK -#define MEMP_SANITY_CHECK 1 -#endif - -/** - * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set - * of memory pools of various sizes. When mem_malloc is called, an element of - * the smallest pool that can provide the length needed is returned. - * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. - */ -#ifndef MEM_USE_POOLS -#define MEM_USE_POOLS 0 -#endif - -/** - * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next - * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more - * reliable. */ -#ifndef MEM_USE_POOLS_TRY_BIGGER_POOL -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 -#endif - -/** - * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h - * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. - */ -#ifndef MEMP_USE_CUSTOM_POOLS -#define MEMP_USE_CUSTOM_POOLS 0 -#endif - -/** - * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from - * interrupt context (or another context that doesn't allow waiting for a - * semaphore). - * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, - * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs - * with each loop so that mem_free can run. - * - * ATTENTION: As you can see from the above description, this leads to dis-/ - * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc - * can need longer. - * - * If you don't want that, at least for NO_SYS=0, you can still use the following - * functions to enqueue a deallocation call which then runs in the tcpip_thread - * context: - * - pbuf_free_callback(p); - * - mem_free_callback(m); - */ -#ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT -#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 -#endif - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ -/** - * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). - * If the application sends a lot of data out of ROM (or other static memory), - * this should be set high. - */ -#ifndef MEMP_NUM_PBUF -#define MEMP_NUM_PBUF 10 -#endif - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#ifndef MEMP_NUM_RAW_PCB -#define MEMP_NUM_RAW_PCB 4 -#endif - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#ifndef MEMP_NUM_UDP_PCB -#define MEMP_NUM_UDP_PCB 4 -#endif - -/** - * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB -#define MEMP_NUM_TCP_PCB (*((volatile uint32*)0x600011FC)) -#endif - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB_LISTEN -#define MEMP_NUM_TCP_PCB_LISTEN 2 -#endif - -/** - * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_SEG -#define MEMP_NUM_TCP_SEG 16 -#endif - -/** - * MEMP_NUM_REASSDATA: the number of simultaneously IP packets queued for - * reassembly (whole packets, not fragments!) - */ -#ifndef MEMP_NUM_REASSDATA -#define MEMP_NUM_REASSDATA 0 -#endif - -/** - * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent - * (fragments, not whole packets!). - * This is only used with IP_FRAG_USES_STATIC_BUF==0 and - * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs - * where the packet is not yet sent when netif->output returns. - */ -#ifndef MEMP_NUM_FRAG_PBUF -#define MEMP_NUM_FRAG_PBUF 0 -#endif - -/** - * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing - * packets (pbufs) that are waiting for an ARP request (to resolve - * their destination address) to finish. - * (requires the ARP_QUEUEING option) - */ -#ifndef MEMP_NUM_ARP_QUEUE -#define MEMP_NUM_ARP_QUEUE 10 -#endif - -/** - * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces - * can be members et the same time (one per netif - allsystems group -, plus one - * per netif membership). - * (requires the LWIP_IGMP option) - */ -#ifndef MEMP_NUM_IGMP_GROUP -#define MEMP_NUM_IGMP_GROUP 8 -#endif - -/** - * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. - * (requires NO_SYS==0) - */ -#ifndef MEMP_NUM_SYS_TIMEOUT -#define MEMP_NUM_SYS_TIMEOUT 6 -#endif - -/** - * MEMP_NUM_NETBUF: the number of struct netbufs. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETBUF -#define MEMP_NUM_NETBUF 0 -#endif - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETCONN -#define MEMP_NUM_NETCONN 0 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_API -#define MEMP_NUM_TCPIP_MSG_API 4 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_INPKT -#define MEMP_NUM_TCPIP_MSG_INPKT 4 -#endif - -/** - * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree. - */ -#ifndef MEMP_NUM_SNMP_NODE -#define MEMP_NUM_SNMP_NODE 0 -#endif - -/** - * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree. - * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least! - */ -#ifndef MEMP_NUM_SNMP_ROOTNODE -#define MEMP_NUM_SNMP_ROOTNODE 0 -#endif - -/** - * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to - * be changed normally) - 2 of these are used per request (1 for input, - * 1 for output) - */ -#ifndef MEMP_NUM_SNMP_VARBIND -#define MEMP_NUM_SNMP_VARBIND 0 -#endif - -/** - * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used - * (does not have to be changed normally) - 3 of these are used per request - * (1 for the value read and 2 for OIDs - input and output) - */ -#ifndef MEMP_NUM_SNMP_VALUE -#define MEMP_NUM_SNMP_VALUE 0 -#endif - -/** - * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls - * (before freeing the corresponding memory using lwip_freeaddrinfo()). - */ -#ifndef MEMP_NUM_NETDB -#define MEMP_NUM_NETDB 0 -#endif - -/** - * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list - * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. - */ -#ifndef MEMP_NUM_LOCALHOSTLIST -#define MEMP_NUM_LOCALHOSTLIST 0 -#endif - -/** - * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE - * interfaces (only used with PPPOE_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOE_INTERFACES -#define MEMP_NUM_PPPOE_INTERFACES 0 -#endif - -/** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. - */ -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 10 -#endif - -/* - --------------------------------- - ---------- ARP options ---------- - --------------------------------- -*/ -/** - * LWIP_ARP==1: Enable ARP functionality. - */ -#ifndef LWIP_ARP -#define LWIP_ARP 1 -#endif - -/** - * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. - */ -#ifndef ARP_TABLE_SIZE -#define ARP_TABLE_SIZE 10 -#endif - -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#ifndef ARP_QUEUEING -#define ARP_QUEUEING 1 -#endif - -/** - * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be - * updated with the source MAC and IP addresses supplied in the packet. - * You may want to disable this if you do not trust LAN peers to have the - * correct addresses, or as a limited approach to attempt to handle - * spoofing. If disabled, lwIP will need to make a new ARP request if - * the peer is not already in the ARP table, adding a little latency. - * The peer *is* in the ARP table if it requested our address before. - * Also notice that this slows down input processing of every IP packet! - */ -#ifndef ETHARP_TRUST_IP_MAC -#define ETHARP_TRUST_IP_MAC 1 -#endif - -/** - * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header. - * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. - * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. - * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. - */ -#ifndef ETHARP_SUPPORT_VLAN -#define ETHARP_SUPPORT_VLAN 0 -#endif - -/** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP - * might be disabled - */ -#ifndef LWIP_ETHERNET -#define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT) -#endif - -/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure - * alignment of payload after that header. Since the header is 14 bytes long, - * without this padding e.g. addresses in the IP header will not be aligned - * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. - */ -#ifndef ETH_PAD_SIZE -#define ETH_PAD_SIZE 0 -#endif - -/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table - * entries (using etharp_add_static_entry/etharp_remove_static_entry). - */ -#ifndef ETHARP_SUPPORT_STATIC_ENTRIES -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 -#endif - - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * IP_FORWARD==1: Enables the ability to forward IP packets across network - * interfaces. If you are going to run lwIP on a device with only one network - * interface, define this to 0. - */ -#ifndef IP_FORWARD -#define IP_FORWARD 0 -#endif - -/** - * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. - * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. - * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). - */ -#ifndef IP_OPTIONS_ALLOWED -#define IP_OPTIONS_ALLOWED 1 -#endif - -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#ifndef IP_REASSEMBLY -#define IP_REASSEMBLY 0 -#endif - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#ifndef IP_FRAG -#define IP_FRAG 0 -#endif - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#ifndef IP_REASS_MAXAGE -#define IP_REASS_MAXAGE 0 -#endif - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#ifndef IP_REASS_MAX_PBUFS -#define IP_REASS_MAX_PBUFS 0 -#endif - -/** - * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP - * fragmentation. Otherwise pbufs are allocated and reference the original - * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1, - * new PBUF_RAM pbufs are used for fragments). - * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs! - */ -#ifndef IP_FRAG_USES_STATIC_BUF -#define IP_FRAG_USES_STATIC_BUF 1 -#endif - -/** - * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer - * (requires IP_FRAG_USES_STATIC_BUF==1) - */ -#if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) -#define IP_FRAG_MAX_MTU 1500 -#endif - -/** - * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. - */ -#ifndef IP_DEFAULT_TTL -#define IP_DEFAULT_TTL 255 -#endif - -/** - * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast - * filter per pcb on udp and raw send operations. To enable broadcast filter - * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. - */ -#ifndef IP_SOF_BROADCAST -#define IP_SOF_BROADCAST 0 -#endif - -/** - * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast - * filter on recv operations. - */ -#ifndef IP_SOF_BROADCAST_RECV -#define IP_SOF_BROADCAST_RECV 0 -#endif - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_ICMP==1: Enable ICMP module inside the IP stack. - * Be careful, disable that make your product non-compliant to RFC1122 - */ -#ifndef LWIP_ICMP -#define LWIP_ICMP 1 -#endif - -/** - * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. - */ -#ifndef ICMP_TTL -#define ICMP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) - */ -#ifndef LWIP_BROADCAST_PING -#define LWIP_BROADCAST_PING 0 -#endif - -/** - * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) - */ -#ifndef LWIP_MULTICAST_PING -#define LWIP_MULTICAST_PING 0 -#endif - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef LWIP_RAW -#define LWIP_RAW 0 -#endif - -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef RAW_TTL -#define RAW_TTL (IP_DEFAULT_TTL) -#endif - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#ifndef LWIP_DHCP -#define LWIP_DHCP 1 -#endif - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#ifndef DHCP_DOES_ARP_CHECK -#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -/** - * LWIP_AUTOIP==1: Enable AUTOIP module. - */ -#ifndef LWIP_AUTOIP -#define LWIP_AUTOIP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on - * the same interface at the same time. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP -#define LWIP_DHCP_AUTOIP_COOP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes - * that should be sent before falling back on AUTOIP. This can be set - * as low as 1 to get an AutoIP address very quickly, but you should - * be prepared to handle a changing IP address when DHCP overrides - * AutoIP. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP_TRIES -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 -#endif - -/* - ---------------------------------- - ---------- SNMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP - * transport. - */ -#ifndef LWIP_SNMP -#define LWIP_SNMP 0 -#endif - -/** - * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will - * allow. At least one request buffer is required. - */ -#ifndef SNMP_CONCURRENT_REQUESTS -#define SNMP_CONCURRENT_REQUESTS 0 -#endif - -/** - * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap - * destination is required - */ -#ifndef SNMP_TRAP_DESTINATIONS -#define SNMP_TRAP_DESTINATIONS 0 -#endif - -/** - * SNMP_PRIVATE_MIB: - */ -#ifndef SNMP_PRIVATE_MIB -#define SNMP_PRIVATE_MIB 0 -#endif - -/** - * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not - * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). - * Unsafe requests are disabled by default! - */ -#ifndef SNMP_SAFE_REQUESTS -#define SNMP_SAFE_REQUESTS 0 -#endif - -/** - * The maximum length of strings used. This affects the size of - * MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_OCTET_STRING_LEN -#define SNMP_MAX_OCTET_STRING_LEN 127 -#endif - -/** - * The maximum depth of the SNMP tree. - * With private MIBs enabled, this depends on your MIB! - * This affects the size of MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_TREE_DEPTH -#define SNMP_MAX_TREE_DEPTH 15 -#endif - -/** - * The size of the MEMP_SNMP_VALUE elements, normally calculated from - * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH. - */ -#ifndef SNMP_MAX_VALUE_SIZE -#define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH)) -#endif - -/* - ---------------------------------- - ---------- IGMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#ifndef LWIP_IGMP -#define LWIP_IGMP 1 -#endif - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#ifndef LWIP_DNS -#define LWIP_DNS 1 -#endif - -/** DNS maximum number of entries to maintain locally. */ -#ifndef DNS_TABLE_SIZE -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#ifndef DNS_MAX_NAME_LENGTH -#define DNS_MAX_NAME_LENGTH 256 -#endif - -/** The maximum of DNS servers */ -#ifndef DNS_MAX_SERVERS -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS do a name checking between the query and the response. */ -#ifndef DNS_DOES_NAME_CHECK -#define DNS_DOES_NAME_CHECK 1 -#endif - -/** DNS message max. size. Default value is RFC compliant. */ -#ifndef DNS_MSG_SIZE -#define DNS_MSG_SIZE 512 -#endif - -/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, - * you have to define - * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}} - * (an array of structs name/address, where address is an u32_t in network - * byte order). - * - * Instead, you can also use an external function: - * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name) - * that returns the IP address or INADDR_NONE if not found. - */ -#ifndef DNS_LOCAL_HOSTLIST -#define DNS_LOCAL_HOSTLIST 0 -#endif /* DNS_LOCAL_HOSTLIST */ - -/** If this is turned on, the local host-list can be dynamically changed - * at runtime. */ -#ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/** - * LWIP_UDP==1: Turn on UDP. - */ -#ifndef LWIP_UDP -#define LWIP_UDP 1 -#endif - -/** - * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) - */ -#ifndef LWIP_UDPLITE -#define LWIP_UDPLITE 0 -#endif - -/** - * UDP_TTL: Default Time-To-Live value. - */ -#ifndef UDP_TTL -#define UDP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. - */ -#ifndef LWIP_NETBUF_RECVINFO -#define LWIP_NETBUF_RECVINFO 0 -#endif - -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ -/** - * LWIP_TCP==1: Turn on TCP. - */ -#ifndef LWIP_TCP -#define LWIP_TCP 1 -#endif - -/** - * TCP_TTL: Default Time-To-Live value. - */ -#ifndef TCP_TTL -#define TCP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * TCP_WND: The size of a TCP window. This must be at least - * (2 * TCP_MSS) for things to work well - */ -#ifndef TCP_WND -#define TCP_WND (4 * TCP_MSS) -#endif - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#ifndef TCP_MAXRTX -#define TCP_MAXRTX 5 -#endif - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#ifndef TCP_SYNMAXRTX -#define TCP_SYNMAXRTX 5 -#endif - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#ifndef TCP_QUEUE_OOSEQ -#define TCP_QUEUE_OOSEQ 0 -#endif - -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#ifndef TCP_MSS -#define TCP_MSS 1460 -#endif - -/** - * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really - * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which - * reflects the available reassembly buffer size at the remote host) and the - * largest size permitted by the IP layer" (RFC 1122) - * Setting this to 1 enables code that checks TCP_MSS against the MTU of the - * netif used for a connection and limits the MSS if it would be too big otherwise. - */ -#ifndef TCP_CALCULATE_EFF_SEND_MSS -#define TCP_CALCULATE_EFF_SEND_MSS 1 -#endif - - -/** - * TCP_SND_BUF: TCP sender buffer space (bytes). - */ -#ifndef TCP_SND_BUF -#define TCP_SND_BUF 2 * TCP_MSS -#endif - -/** - * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least - * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. - */ -#ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) -#endif - -/** - * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than - * TCP_SND_BUF. It is the amount of space which must be available in the - * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). - */ -#ifndef TCP_SNDLOWAT -#define TCP_SNDLOWAT ((TCP_SND_BUF)/2) -#endif - -/** - * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater - * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below - * this number, select returns writable (combined with TCP_SNDLOWAT). - */ -#ifndef TCP_SNDQUEUELOWAT -#define TCP_SNDQUEUELOWAT LWIP_MAX(((TCP_SND_QUEUELEN)/2), 5) -#endif - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#ifndef TCP_LISTEN_BACKLOG -#define TCP_LISTEN_BACKLOG 0 -#endif - -/** - * The maximum allowed backlog for TCP listen netconns. - * This backlog is used unless another is explicitly specified. - * 0xff is the maximum (u8_t). - */ -#ifndef TCP_DEFAULT_LISTEN_BACKLOG -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff -#endif - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time in an attempt to create shorter pbuf chains - * for transmission. The meaningful range is 0 to TCP_MSS. Some - * suggested values are: - * - * 0: Disable oversized allocation. Each tcp_write() allocates a new - pbuf (old behaviour). - * 1: Allocate size-aligned pbufs with minimal excess. Use this if your - * scatter-gather DMA requires aligned fragments. - * 128: Limit the pbuf/memory overhead to 20%. - * TCP_MSS: Try to create unfragmented TCP packets. - * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. - */ -#ifndef TCP_OVERSIZE -#define TCP_OVERSIZE TCP_MSS -#endif - -/** - * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. - */ -#ifndef LWIP_TCP_TIMESTAMPS -#define LWIP_TCP_TIMESTAMPS 0 -#endif - -/** - * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an - * explicit window update - */ -#ifndef TCP_WND_UPDATE_THRESHOLD -#define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4) -#endif - -/** - * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. - */ -#ifndef LWIP_EVENT_API -#define LWIP_EVENT_API 0 -#define LWIP_CALLBACK_API 1 -#else -#define LWIP_EVENT_API 1 -#define LWIP_CALLBACK_API 0 -#endif - - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ -/** - * PBUF_LINK_HLEN: the number of bytes that should be allocated for a - * link level header. The default is 14, the standard value for - * Ethernet. - */ -#ifndef PBUF_LINK_HLEN -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) -#endif - -/** - * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size TCP frame in one pbuf, including - * TCP_MSS, IP header, and link header. - */ -#ifndef PBUF_POOL_BUFSIZE -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) -#endif - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#ifndef LWIP_NETIF_HOSTNAME -#define LWIP_NETIF_HOSTNAME 0 -#endif - -/** - * LWIP_NETIF_API==1: Support netif api (in netifapi.c) - */ -#ifndef LWIP_NETIF_API -#define LWIP_NETIF_API 0 -#endif - -/** - * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface - * changes its up/down status (i.e., due to DHCP IP acquistion) - */ -#ifndef LWIP_NETIF_STATUS_CALLBACK -#define LWIP_NETIF_STATUS_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface - * whenever the link changes (i.e., link down) - */ -#ifndef LWIP_NETIF_LINK_CALLBACK -#define LWIP_NETIF_LINK_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table - * indices) in struct netif. TCP and UDP can make use of this to prevent - * scanning the ARP table for every sent packet. While this is faster for big - * ARP tables or many concurrent connections, it might be counterproductive - * if you have a tiny ARP table or if there never are concurrent connections. - */ -#ifndef LWIP_NETIF_HWADDRHINT -#define LWIP_NETIF_HWADDRHINT 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#ifndef LWIP_NETIF_LOOPBACK -#define LWIP_NETIF_LOOPBACK 0 -#endif - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#ifndef LWIP_LOOPBACK_MAX_PBUFS -#define LWIP_LOOPBACK_MAX_PBUFS 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in - * the system, as netifs must change how they behave depending on this setting - * for the LWIP_NETIF_LOOPBACK option to work. - * Setting this is needed to avoid reentering non-reentrant functions like - * tcp_input(). - * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a - * multithreaded environment like tcpip.c. In this case, netif->input() - * is called directly. - * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. - * The packets are put on a list and netif_poll() must be called in - * the main application loop. - */ -#ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) -#endif - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#ifndef LWIP_NETIF_TX_SINGLE_PBUF -#define LWIP_NETIF_TX_SINGLE_PBUF 1 -#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c - */ -#ifndef LWIP_HAVE_LOOPIF -#define LWIP_HAVE_LOOPIF 0 -#endif - -/* - ------------------------------------ - ---------- SLIPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c - */ -#ifndef LWIP_HAVE_SLIPIF -#define LWIP_HAVE_SLIPIF 0 -#endif - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#ifndef TCPIP_THREAD_NAME -#define TCPIP_THREAD_NAME "tcpip_thread" -#endif - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_STACKSIZE -#define TCPIP_THREAD_STACKSIZE 0 -#endif - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_PRIO -#define TCPIP_THREAD_PRIO 1 -#endif - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#ifndef TCPIP_MBOX_SIZE -#define TCPIP_MBOX_SIZE 0 -#endif - -/** - * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. - */ -#ifndef SLIPIF_THREAD_NAME -#define SLIPIF_THREAD_NAME "slipif_loop" -#endif - -/** - * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_STACKSIZE -#define SLIPIF_THREAD_STACKSIZE 0 -#endif - -/** - * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_PRIO -#define SLIPIF_THREAD_PRIO 1 -#endif - -/** - * PPP_THREAD_NAME: The name assigned to the pppInputThread. - */ -#ifndef PPP_THREAD_NAME -#define PPP_THREAD_NAME "pppInputThread" -#endif - -/** - * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_STACKSIZE -#define PPP_THREAD_STACKSIZE 0 -#endif - -/** - * PPP_THREAD_PRIO: The priority assigned to the pppInputThread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_PRIO -#define PPP_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. - */ -#ifndef DEFAULT_THREAD_NAME -#define DEFAULT_THREAD_NAME "lwIP" -#endif - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_STACKSIZE -#define DEFAULT_THREAD_STACKSIZE 0 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_PRIO -#define DEFAULT_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_RAW_RECVMBOX_SIZE -#define DEFAULT_RAW_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_UDP_RECVMBOX_SIZE -#define DEFAULT_UDP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_TCP_RECVMBOX_SIZE -#define DEFAULT_TCP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#ifndef DEFAULT_ACCEPTMBOX_SIZE -#define DEFAULT_ACCEPTMBOX_SIZE 0 -#endif - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING -#define LWIP_TCPIP_CORE_LOCKING 0 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING_INPUT -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 -#endif - -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#ifndef LWIP_NETCONN -#define LWIP_NETCONN 0 -#endif - -/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create - * timers running in tcpip_thread from another thread. - */ -#ifndef LWIP_TCPIP_TIMEOUT -#define LWIP_TCPIP_TIMEOUT 1 -#endif - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#ifndef LWIP_SOCKET -#define LWIP_SOCKET 0 -#endif - -/** - * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. - * (only used if you use sockets.c) - */ -#ifndef LWIP_COMPAT_SOCKETS -#define LWIP_COMPAT_SOCKETS 0 -#endif - -/** - * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. - * Disable this option if you use a POSIX operating system that uses the same - * names (read, write & close). (only used if you use sockets.c) - */ -#ifndef LWIP_POSIX_SOCKETS_IO_NAMES -#define LWIP_POSIX_SOCKETS_IO_NAMES 0 -#endif - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#ifndef LWIP_TCP_KEEPALIVE -#define LWIP_TCP_KEEPALIVE 1 -#endif - -/** - * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. - */ -#ifndef LWIP_SO_RCVTIMEO -#define LWIP_SO_RCVTIMEO 0 -#endif - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#ifndef LWIP_SO_RCVBUF -#define LWIP_SO_RCVBUF 0 -#endif - -/** - * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. - */ -#ifndef RECV_BUFSIZE_DEFAULT -#define RECV_BUFSIZE_DEFAULT INT_MAX -#endif - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - */ -#ifndef SO_REUSE -#define SO_REUSE 0 -#endif - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#ifndef SO_REUSE_RXTOALL -#define SO_REUSE_RXTOALL 0 -#endif - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#ifndef LWIP_STATS -#define LWIP_STATS 0 -#endif - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#ifndef LWIP_STATS_DISPLAY -#define LWIP_STATS_DISPLAY 0 -#endif - -/** - * LINK_STATS==1: Enable link stats. - */ -#ifndef LINK_STATS -#define LINK_STATS 1 -#endif - -/** - * ETHARP_STATS==1: Enable etharp stats. - */ -#ifndef ETHARP_STATS -#define ETHARP_STATS (LWIP_ARP) -#endif - -/** - * IP_STATS==1: Enable IP stats. - */ -#ifndef IP_STATS -#define IP_STATS 1 -#endif - -/** - * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is - * on if using either frag or reass. - */ -#ifndef IPFRAG_STATS -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) -#endif - -/** - * ICMP_STATS==1: Enable ICMP stats. - */ -#ifndef ICMP_STATS -#define ICMP_STATS 1 -#endif - -/** - * IGMP_STATS==1: Enable IGMP stats. - */ -#ifndef IGMP_STATS -#define IGMP_STATS (LWIP_IGMP) -#endif - -/** - * UDP_STATS==1: Enable UDP stats. Default is on if - * UDP enabled, otherwise off. - */ -#ifndef UDP_STATS -#define UDP_STATS (LWIP_UDP) -#endif - -/** - * TCP_STATS==1: Enable TCP stats. Default is on if TCP - * enabled, otherwise off. - */ -#ifndef TCP_STATS -#define TCP_STATS (LWIP_TCP) -#endif - -/** - * MEM_STATS==1: Enable mem.c stats. - */ -#ifndef MEM_STATS -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) -#endif - -/** - * MEMP_STATS==1: Enable memp.c pool stats. - */ -#ifndef MEMP_STATS -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) -#endif - -/** - * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). - */ -#ifndef SYS_STATS -#define SYS_STATS (NO_SYS == 0) -#endif - -#else -#define ETHARP_STATS 0 -#define LINK_STATS 0 -#define IP_STATS 0 -#define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define IGMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define SYS_STATS 0 -#define LWIP_STATS_DISPLAY 0 - -#endif /* LWIP_STATS */ - -/* - --------------------------------- - ---------- PPP options ---------- - --------------------------------- -*/ -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#ifndef PPP_SUPPORT -#define PPP_SUPPORT 0 -#endif - -/** - * PPPOE_SUPPORT==1: Enable PPP Over Ethernet - */ -#ifndef PPPOE_SUPPORT -#define PPPOE_SUPPORT 0 -#endif - -/** - * PPPOS_SUPPORT==1: Enable PPP Over Serial - */ -#ifndef PPPOS_SUPPORT -#define PPPOS_SUPPORT PPP_SUPPORT -#endif - -#if PPP_SUPPORT - -/** - * NUM_PPP: Max PPP sessions. - */ -#ifndef NUM_PPP -#define NUM_PPP 1 -#endif - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#ifndef PAP_SUPPORT -#define PAP_SUPPORT 0 -#endif - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#ifndef CHAP_SUPPORT -#define CHAP_SUPPORT 0 -#endif - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 0 -#endif - -/** - * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CBCP_SUPPORT -#define CBCP_SUPPORT 0 -#endif - -/** - * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CCP_SUPPORT -#define CCP_SUPPORT 0 -#endif - -/** - * VJ_SUPPORT==1: Support VJ header compression. - */ -#ifndef VJ_SUPPORT -#define VJ_SUPPORT 0 -#endif - -/** - * MD5_SUPPORT==1: Support MD5 (see also CHAP). - */ -#ifndef MD5_SUPPORT -#define MD5_SUPPORT 0 -#endif - -/* - * Timeouts - */ -#ifndef FSM_DEFTIMEOUT -#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef FSM_DEFMAXTERMREQS -#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXCONFREQS -#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXNAKLOOPS -#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ -#endif - -#ifndef UPAP_DEFTIMEOUT -#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ -#endif - -#ifndef UPAP_DEFREQTIME -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#endif - -#ifndef CHAP_DEFTIMEOUT -#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef CHAP_DEFTRANSMITS -#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ -#endif - -/* Interval in seconds between keepalive echo requests, 0 to disable. */ -#ifndef LCP_ECHOINTERVAL -#define LCP_ECHOINTERVAL 0 -#endif - -/* Number of unanswered echo requests before failure. */ -#ifndef LCP_MAXECHOFAILS -#define LCP_MAXECHOFAILS 3 -#endif - -/* Max Xmit idle time (in jiffies) before resend flag char. */ -#ifndef PPP_MAXIDLEFLAG -#define PPP_MAXIDLEFLAG 100 -#endif - -/* - * Packet sizes - * - * Note - lcp shouldn't be allowed to negotiate stuff outside these - * limits. See lcp.h in the pppd directory. - * (XXX - these constants should simply be shared by lcp.c instead - * of living in lcp.h) - */ -#define PPP_MTU 1500 /* Default MTU (size of Info field) */ -#ifndef PPP_MAXMTU -/* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */ -#define PPP_MAXMTU 1500 /* Largest MTU we allow */ -#endif -#define PPP_MINMTU 64 -#define PPP_MRU 1500 /* default MRU = max length of info field */ -#define PPP_MAXMRU 1500 /* Largest MRU we allow */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 296 /* Try for this */ -#endif -#define PPP_MINMRU 128 /* No MRUs below this */ - -#ifndef MAXNAMELEN -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ -#endif -#ifndef MAXSECRETLEN -#define MAXSECRETLEN 256 /* max length of password or secret */ -#endif - -#endif /* PPP_SUPPORT */ - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ -/** - * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. - */ -#ifndef CHECKSUM_GEN_IP -#define CHECKSUM_GEN_IP 1 -#endif - -/** - * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. - */ -#ifndef CHECKSUM_GEN_UDP -#define CHECKSUM_GEN_UDP 1 -#endif - -/** - * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. - */ -#ifndef CHECKSUM_GEN_TCP -#define CHECKSUM_GEN_TCP 1 -#endif - -/** - * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. - */ -#ifndef CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 1 -#endif - -/** - * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. - */ -#ifndef CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 1 -#endif - -/** - * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. - */ -#ifndef CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 1 -#endif - -/** - * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from - * application buffers to pbufs. - */ -#ifndef LWIP_CHECKSUM_ON_COPY -#define LWIP_CHECKSUM_ON_COPY 0 -#endif - -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - */ -#ifndef LWIP_DBG_MIN_LEVEL -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL -#endif - -/** - * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable - * debug messages of certain types. - */ -#ifndef LWIP_DBG_TYPES_ON -#define LWIP_DBG_TYPES_ON LWIP_DBG_OFF -#endif - -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#ifndef ETHARP_DEBUG -#define ETHARP_DEBUG LWIP_DBG_OFF -#endif - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#ifndef NETIF_DEBUG -#define NETIF_DEBUG LWIP_DBG_OFF -#endif - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#ifndef PBUF_DEBUG -#define PBUF_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#ifndef API_LIB_DEBUG -#define API_LIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_MSG_DEBUG: Enable debugging in api_msg.c. - */ -#ifndef API_MSG_DEBUG -#define API_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#ifndef SOCKETS_DEBUG -#define SOCKETS_DEBUG LWIP_DBG_OFF -#endif - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#ifndef ICMP_DEBUG -#define ICMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IGMP_DEBUG: Enable debugging in igmp.c. - */ -#ifndef IGMP_DEBUG -#define IGMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * INET_DEBUG: Enable debugging in inet.c. - */ -#ifndef INET_DEBUG -#define INET_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#ifndef IP_DEBUG -#define IP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. - */ -#ifndef IP_REASS_DEBUG -#define IP_REASS_DEBUG LWIP_DBG_OFF -#endif - -/** - * RAW_DEBUG: Enable debugging in raw.c. - */ -#ifndef RAW_DEBUG -#define RAW_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEM_DEBUG: Enable debugging in mem.c. - */ -#ifndef MEM_DEBUG -#define MEM_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#ifndef MEMP_DEBUG -#define MEMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SYS_DEBUG: Enable debugging in sys.c. - */ -#ifndef SYS_DEBUG -#define SYS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TIMERS_DEBUG: Enable debugging in timers.c. - */ -#ifndef TIMERS_DEBUG -#define TIMERS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_DEBUG: Enable debugging for TCP. - */ -#ifndef TCP_DEBUG -#define TCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#ifndef TCP_INPUT_DEBUG -#define TCP_INPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. - */ -#ifndef TCP_FR_DEBUG -#define TCP_FR_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit - * timeout. - */ -#ifndef TCP_RTO_DEBUG -#define TCP_RTO_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. - */ -#ifndef TCP_CWND_DEBUG -#define TCP_CWND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. - */ -#ifndef TCP_WND_DEBUG -#define TCP_WND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#ifndef TCP_OUTPUT_DEBUG -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. - */ -#ifndef TCP_RST_DEBUG -#define TCP_RST_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. - */ -#ifndef TCP_QLEN_DEBUG -#define TCP_QLEN_DEBUG LWIP_DBG_OFF -#endif - -/** - * UDP_DEBUG: Enable debugging in UDP. - */ -#ifndef UDP_DEBUG -#define UDP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#ifndef TCPIP_DEBUG -#define TCPIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#ifndef PPP_DEBUG -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SLIP_DEBUG: Enable debugging in slipif.c. - */ -#ifndef SLIP_DEBUG -#define SLIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#ifndef DHCP_DEBUG -#define DHCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * AUTOIP_DEBUG: Enable debugging in autoip.c. - */ -#ifndef AUTOIP_DEBUG -#define AUTOIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. - */ -#ifndef SNMP_MSG_DEBUG -#define SNMP_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. - */ -#ifndef SNMP_MIB_DEBUG -#define SNMP_MIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * DNS_DEBUG: Enable debugging for DNS. - */ -#ifndef DNS_DEBUG -#define DNS_DEBUG LWIP_DBG_OFF -#endif - -#endif /* __LWIP_OPT_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/wl_definitions.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/wl_definitions.h deleted file mode 100644 index 45bee676..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/include/wl_definitions.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - wl_definitions.h - Library for Arduino Wifi shield. - Copyright (c) 2011-2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -/* - * wl_definitions.h - * - * Created on: Mar 6, 2011 - * Author: dlafauci - */ - -#ifndef WL_DEFINITIONS_H_ -#define WL_DEFINITIONS_H_ - -// Maximum size of a SSID -#define WL_SSID_MAX_LENGTH 32 -// Length of passphrase. Valid lengths are 8-63. -#define WL_WPA_KEY_MAX_LENGTH 63 -// Length of key in bytes. Valid values are 5 and 13. -#define WL_WEP_KEY_MAX_LENGTH 13 -// Size of a MAC-address or BSSID -#define WL_MAC_ADDR_LENGTH 6 -// Size of a MAC-address or BSSID -#define WL_IPV4_LENGTH 4 -// Maximum size of a SSID list -#define WL_NETWORKS_LIST_MAXNUM 10 -// Maxmium number of socket -#define MAX_SOCK_NUM 4 -// Socket not available constant -#define SOCK_NOT_AVAIL 255 -// Default state value for Wifi state field -#define NA_STATE -1 -//Maximum number of attempts to establish wifi connection -#define WL_MAX_ATTEMPT_CONNECTION 10 - -typedef enum { - WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library - WL_IDLE_STATUS = 0, - WL_NO_SSID_AVAIL = 1, - WL_SCAN_COMPLETED = 2, - WL_CONNECTED = 3, - WL_CONNECT_FAILED = 4, - WL_CONNECTION_LOST = 5, - WL_DISCONNECTED = 6 -} wl_status_t; - -/* Encryption modes */ -enum wl_enc_type { /* Values map to 802.11 encryption suites... */ - ENC_TYPE_WEP = 5, - ENC_TYPE_TKIP = 2, - ENC_TYPE_CCMP = 4, - /* ... except these two, 7 and 8 are reserved in 802.11-2007 */ - ENC_TYPE_NONE = 7, - ENC_TYPE_AUTO = 8 -}; - -#if !defined(LWIP_INTERNAL) -enum wl_tcp_state { - CLOSED = 0, - LISTEN = 1, - SYN_SENT = 2, - SYN_RCVD = 3, - ESTABLISHED = 4, - FIN_WAIT_1 = 5, - FIN_WAIT_2 = 6, - CLOSE_WAIT = 7, - CLOSING = 8, - LAST_ACK = 9, - TIME_WAIT = 10 -}; -#endif - -#endif /* WL_DEFINITIONS_H_ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api.h deleted file mode 100644 index 91b9e5d2..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api.h +++ /dev/null @@ -1,284 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_API_H__ -#define __LWIP_API_H__ - -#include "lwip/opt.h" - -#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/netbuf.h" -#include "lwip/sys.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ - -/* Flags for netconn_write (u8_t) */ -#define NETCONN_NOFLAG 0x00 -#define NETCONN_NOCOPY 0x00 /* Only for source code compatibility */ -#define NETCONN_COPY 0x01 -#define NETCONN_MORE 0x02 -#define NETCONN_DONTBLOCK 0x04 - -/* Flags for struct netconn.flags (u8_t) */ -/** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores whether to wake up the original application task - if data couldn't be sent in the first try. */ -#define NETCONN_FLAG_WRITE_DELAYED 0x01 -/** Should this netconn avoid blocking? */ -#define NETCONN_FLAG_NON_BLOCKING 0x02 -/** Was the last connect action a non-blocking one? */ -#define NETCONN_FLAG_IN_NONBLOCKING_CONNECT 0x04 -/** If this is set, a TCP netconn must call netconn_recved() to update - the TCP receive window (done automatically if not set). */ -#define NETCONN_FLAG_NO_AUTO_RECVED 0x08 -/** If a nonblocking write has been rejected before, poll_tcp needs to - check if the netconn is writable again */ -#define NETCONN_FLAG_CHECK_WRITESPACE 0x10 - - -/* Helpers to process several netconn_types by the same code */ -#define NETCONNTYPE_GROUP(t) (t&0xF0) -#define NETCONNTYPE_DATAGRAM(t) (t&0xE0) - -/** Protocol family and type of the netconn */ -enum netconn_type { - NETCONN_INVALID = 0, - /* NETCONN_TCP Group */ - NETCONN_TCP = 0x10, - /* NETCONN_UDP Group */ - NETCONN_UDP = 0x20, - NETCONN_UDPLITE = 0x21, - NETCONN_UDPNOCHKSUM= 0x22, - /* NETCONN_RAW Group */ - NETCONN_RAW = 0x40 -}; - -/** Current state of the netconn. Non-TCP netconns are always - * in state NETCONN_NONE! */ -enum netconn_state { - NETCONN_NONE, - NETCONN_WRITE, - NETCONN_LISTEN, - NETCONN_CONNECT, - NETCONN_CLOSE -}; - -/** Use to inform the callback function about changes */ -enum netconn_evt { - NETCONN_EVT_RCVPLUS, - NETCONN_EVT_RCVMINUS, - NETCONN_EVT_SENDPLUS, - NETCONN_EVT_SENDMINUS, - NETCONN_EVT_ERROR -}; - -#if LWIP_IGMP -/** Used for netconn_join_leave_group() */ -enum netconn_igmp { - NETCONN_JOIN, - NETCONN_LEAVE -}; -#endif /* LWIP_IGMP */ - -/* forward-declare some structs to avoid to include their headers */ -struct ip_pcb; -struct tcp_pcb; -struct udp_pcb; -struct raw_pcb; -struct netconn; -struct api_msg_msg; - -/** A callback prototype to inform about events for a netconn */ -typedef void (* netconn_callback)(struct netconn *, enum netconn_evt, u16_t len); - -/** A netconn descriptor */ -struct netconn { - /** type of the netconn (TCP, UDP or RAW) */ - enum netconn_type type; - /** current state of the netconn */ - enum netconn_state state; - /** the lwIP internal protocol control block */ - union { - struct ip_pcb *ip; - struct tcp_pcb *tcp; - struct udp_pcb *udp; - struct raw_pcb *raw; - } pcb; - /** the last error this netconn had */ - err_t last_err; - /** sem that is used to synchroneously execute functions in the core context */ - sys_sem_t op_completed; - /** mbox where received packets are stored until they are fetched - by the netconn application thread (can grow quite big) */ - sys_mbox_t recvmbox; -#if LWIP_TCP - /** mbox where new connections are stored until processed - by the application thread */ - sys_mbox_t acceptmbox; -#endif /* LWIP_TCP */ - /** only used for socket layer */ -#if LWIP_SOCKET - int socket; -#endif /* LWIP_SOCKET */ -#if LWIP_SO_RCVTIMEO - /** timeout to wait for new data to be received - (or connections to arrive for listening netconns) */ - int recv_timeout; -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF - /** maximum amount of bytes queued in recvmbox - not used for TCP: adjust TCP_WND instead! */ - int recv_bufsize; - /** number of bytes currently in recvmbox to be received, - tested against recv_bufsize to limit bytes on recvmbox - for UDP and RAW, used for FIONREAD */ - s16_t recv_avail; -#endif /* LWIP_SO_RCVBUF */ - /** flags holding more netconn-internal state, see NETCONN_FLAG_* defines */ - u8_t flags; -#if LWIP_TCP - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores how much is already sent. */ - size_t write_offset; - /** TCP: when data passed to netconn_write doesn't fit into the send buffer, - this temporarily stores the message. - Also used during connect and close. */ - struct api_msg_msg *current_msg; -#endif /* LWIP_TCP */ - /** A callback function that is informed about events for this netconn */ - netconn_callback callback; -}; - -/** Register an Network connection event */ -#define API_EVENT(c,e,l) if (c->callback) { \ - (*c->callback)(c, e, l); \ - } - -/** Set conn->last_err to err but don't overwrite fatal errors */ -#define NETCONN_SET_SAFE_ERR(conn, err) do { \ - SYS_ARCH_DECL_PROTECT(lev); \ - SYS_ARCH_PROTECT(lev); \ - if (!ERR_IS_FATAL((conn)->last_err)) { \ - (conn)->last_err = err; \ - } \ - SYS_ARCH_UNPROTECT(lev); \ -} while(0); - -/* Network connection functions: */ -#define netconn_new(t) netconn_new_with_proto_and_callback(t, 0, NULL) -#define netconn_new_with_callback(t, c) netconn_new_with_proto_and_callback(t, 0, c) -struct -netconn *netconn_new_with_proto_and_callback(enum netconn_type t, u8_t proto, - netconn_callback callback); -err_t netconn_delete(struct netconn *conn); -/** Get the type of a netconn (as enum netconn_type). */ -#define netconn_type(conn) (conn->type) - -err_t netconn_getaddr(struct netconn *conn, ip_addr_t *addr, - u16_t *port, u8_t local); -#define netconn_peer(c,i,p) netconn_getaddr(c,i,p,0) -#define netconn_addr(c,i,p) netconn_getaddr(c,i,p,1) - -err_t netconn_bind(struct netconn *conn, ip_addr_t *addr, u16_t port); -err_t netconn_connect(struct netconn *conn, ip_addr_t *addr, u16_t port); -err_t netconn_disconnect (struct netconn *conn); -err_t netconn_listen_with_backlog(struct netconn *conn, u8_t backlog); -#define netconn_listen(conn) netconn_listen_with_backlog(conn, TCP_DEFAULT_LISTEN_BACKLOG) -err_t netconn_accept(struct netconn *conn, struct netconn **new_conn); -err_t netconn_recv(struct netconn *conn, struct netbuf **new_buf); -err_t netconn_recv_tcp_pbuf(struct netconn *conn, struct pbuf **new_buf); -void netconn_recved(struct netconn *conn, u32_t length); -err_t netconn_sendto(struct netconn *conn, struct netbuf *buf, - ip_addr_t *addr, u16_t port); -err_t netconn_send(struct netconn *conn, struct netbuf *buf); -err_t netconn_write(struct netconn *conn, const void *dataptr, size_t size, - u8_t apiflags); -err_t netconn_close(struct netconn *conn); -err_t netconn_shutdown(struct netconn *conn, u8_t shut_rx, u8_t shut_tx); - -#if LWIP_IGMP -err_t netconn_join_leave_group(struct netconn *conn, ip_addr_t *multiaddr, - ip_addr_t *netif_addr, enum netconn_igmp join_or_leave); -#endif /* LWIP_IGMP */ -#if LWIP_DNS -err_t netconn_gethostbyname(const char *name, ip_addr_t *addr); -#endif /* LWIP_DNS */ - -#define netconn_err(conn) ((conn)->last_err) -#define netconn_recv_bufsize(conn) ((conn)->recv_bufsize) - -/** Set the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_set_nonblocking(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NON_BLOCKING; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NON_BLOCKING; }} while(0) -/** Get the blocking status of netconn calls (@todo: write/send is missing) */ -#define netconn_is_nonblocking(conn) (((conn)->flags & NETCONN_FLAG_NON_BLOCKING) != 0) - -/** TCP: Set the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_set_noautorecved(conn, val) do { if(val) { \ - (conn)->flags |= NETCONN_FLAG_NO_AUTO_RECVED; \ -} else { \ - (conn)->flags &= ~ NETCONN_FLAG_NO_AUTO_RECVED; }} while(0) -/** TCP: Get the no-auto-recved status of netconn calls (see NETCONN_FLAG_NO_AUTO_RECVED) */ -#define netconn_get_noautorecved(conn) (((conn)->flags & NETCONN_FLAG_NO_AUTO_RECVED) != 0) - -#if LWIP_SO_RCVTIMEO -/** Set the receive timeout in milliseconds */ -#define netconn_set_recvtimeout(conn, timeout) ((conn)->recv_timeout = (timeout)) -/** Get the receive timeout in milliseconds */ -#define netconn_get_recvtimeout(conn) ((conn)->recv_timeout) -#endif /* LWIP_SO_RCVTIMEO */ -#if LWIP_SO_RCVBUF -/** Set the receive buffer in bytes */ -#define netconn_set_recvbufsize(conn, recvbufsize) ((conn)->recv_bufsize = (recvbufsize)) -/** Get the receive buffer in bytes */ -#define netconn_get_recvbufsize(conn) ((conn)->recv_bufsize) -#endif /* LWIP_SO_RCVBUF*/ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN */ - -#endif /* __LWIP_API_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api_msg.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api_msg.h deleted file mode 100644 index f99d8c3b..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/api_msg.h +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_API_MSG_H__ -#define __LWIP_API_MSG_H__ - -#include "lwip/opt.h" - -#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/sys.h" -#include "lwip/igmp.h" -#include "lwip/api.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* For the netconn API, these values are use as a bitmask! */ -#define NETCONN_SHUT_RD 1 -#define NETCONN_SHUT_WR 2 -#define NETCONN_SHUT_RDWR (NETCONN_SHUT_RD | NETCONN_SHUT_WR) - -/* IP addresses and port numbers are expected to be in - * the same byte order as in the corresponding pcb. - */ -/** This struct includes everything that is necessary to execute a function - for a netconn in another thread context (mainly used to process netconns - in the tcpip_thread context to be thread safe). */ -struct api_msg_msg { - /** The netconn which to process - always needed: it includes the semaphore - which is used to block the application thread until the function finished. */ - struct netconn *conn; - /** The return value of the function executed in tcpip_thread. */ - err_t err; - /** Depending on the executed function, one of these union members is used */ - union { - /** used for do_send */ - struct netbuf *b; - /** used for do_newconn */ - struct { - u8_t proto; - } n; - /** used for do_bind and do_connect */ - struct { - ip_addr_t *ipaddr; - u16_t port; - } bc; - /** used for do_getaddr */ - struct { - ip_addr_t *ipaddr; - u16_t *port; - u8_t local; - } ad; - /** used for do_write */ - struct { - const void *dataptr; - size_t len; - u8_t apiflags; - } w; - /** used for do_recv */ - struct { - u32_t len; - } r; - /** used for do_close (/shutdown) */ - struct { - u8_t shut; - } sd; -#if LWIP_IGMP - /** used for do_join_leave_group */ - struct { - ip_addr_t *multiaddr; - ip_addr_t *netif_addr; - enum netconn_igmp join_or_leave; - } jl; -#endif /* LWIP_IGMP */ -#if TCP_LISTEN_BACKLOG - struct { - u8_t backlog; - } lb; -#endif /* TCP_LISTEN_BACKLOG */ - } msg; -}; - -/** This struct contains a function to execute in another thread context and - a struct api_msg_msg that serves as an argument for this function. - This is passed to tcpip_apimsg to execute functions in tcpip_thread context. */ -struct api_msg { - /** function to execute in tcpip_thread context */ - void (* function)(struct api_msg_msg *msg); - /** arguments for this function */ - struct api_msg_msg msg; -}; - -#if LWIP_DNS -/** As do_gethostbyname requires more arguments but doesn't require a netconn, - it has its own struct (to avoid struct api_msg getting bigger than necessary). - do_gethostbyname must be called using tcpip_callback instead of tcpip_apimsg - (see netconn_gethostbyname). */ -struct dns_api_msg { - /** Hostname to query or dotted IP address string */ - const char *name; - /** Rhe resolved address is stored here */ - ip_addr_t *addr; - /** This semaphore is posted when the name is resolved, the application thread - should wait on it. */ - sys_sem_t *sem; - /** Errors are given back here */ - err_t *err; -}; -#endif /* LWIP_DNS */ - -void do_newconn ( struct api_msg_msg *msg); -void do_delconn ( struct api_msg_msg *msg); -void do_bind ( struct api_msg_msg *msg); -void do_connect ( struct api_msg_msg *msg); -void do_disconnect ( struct api_msg_msg *msg); -void do_listen ( struct api_msg_msg *msg); -void do_send ( struct api_msg_msg *msg); -void do_recv ( struct api_msg_msg *msg); -void do_write ( struct api_msg_msg *msg); -void do_getaddr ( struct api_msg_msg *msg); -void do_close ( struct api_msg_msg *msg); -void do_shutdown ( struct api_msg_msg *msg); -#if LWIP_IGMP -void do_join_leave_group( struct api_msg_msg *msg); -#endif /* LWIP_IGMP */ - -#if LWIP_DNS -void do_gethostbyname(void *arg); -#endif /* LWIP_DNS */ - -struct netconn* netconn_alloc(enum netconn_type t, netconn_callback callback); -void netconn_free(struct netconn *conn); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETCONN */ - -#endif /* __LWIP_API_MSG_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/arch.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/arch.h deleted file mode 100644 index 524af6be..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/arch.h +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ARCH_H__ -#define __LWIP_ARCH_H__ - -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif - -#include "arch/cc.h" - -/** Temporary: define format string for size_t if not defined in cc.h */ -#ifndef SZT_F -#define SZT_F U32_F -#endif /* SZT_F */ -/** Temporary upgrade helper: define format string for u8_t as hex if not - defined in cc.h */ -#ifndef X8_F -#define X8_F "02x" -#endif /* X8_F */ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef PACK_STRUCT_BEGIN -#define PACK_STRUCT_BEGIN -#endif /* PACK_STRUCT_BEGIN */ - -#ifndef PACK_STRUCT_END -#define PACK_STRUCT_END -#endif /* PACK_STRUCT_END */ - -#ifndef PACK_STRUCT_FIELD -#define PACK_STRUCT_FIELD(x) x -#endif /* PACK_STRUCT_FIELD */ - - -#ifndef LWIP_UNUSED_ARG -#define LWIP_UNUSED_ARG(x) (void)x -#endif /* LWIP_UNUSED_ARG */ - - -#ifdef LWIP_PROVIDE_ERRNO - -#define EPERM 1 /* Operation not permitted */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No child processes */ -#define EAGAIN 11 /* Try again */ -#define ENOMEM 12 /* Out of memory */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#define ENOTBLK 15 /* Block device required */ -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* File table overflow */ -#define EMFILE 24 /* Too many open files */ -#define ENOTTY 25 /* Not a typewriter */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Math argument out of domain of func */ -#define ERANGE 34 /* Math result not representable */ -#define EDEADLK 35 /* Resource deadlock would occur */ -#define ENAMETOOLONG 36 /* File name too long */ -#define ENOLCK 37 /* No record locks available */ -#define ENOSYS 38 /* Function not implemented */ -#define ENOTEMPTY 39 /* Directory not empty */ -#define ELOOP 40 /* Too many symbolic links encountered */ -#define EWOULDBLOCK EAGAIN /* Operation would block */ -#define ENOMSG 42 /* No message of desired type */ -#define EIDRM 43 /* Identifier removed */ -#define ECHRNG 44 /* Channel number out of range */ -#define EL2NSYNC 45 /* Level 2 not synchronized */ -#define EL3HLT 46 /* Level 3 halted */ -#define EL3RST 47 /* Level 3 reset */ -#define ELNRNG 48 /* Link number out of range */ -#define EUNATCH 49 /* Protocol driver not attached */ -#define ENOCSI 50 /* No CSI structure available */ -#define EL2HLT 51 /* Level 2 halted */ -#define EBADE 52 /* Invalid exchange */ -#define EBADR 53 /* Invalid request descriptor */ -#define EXFULL 54 /* Exchange full */ -#define ENOANO 55 /* No anode */ -#define EBADRQC 56 /* Invalid request code */ -#define EBADSLT 57 /* Invalid slot */ - -#define EDEADLOCK EDEADLK - -#define EBFONT 59 /* Bad font file format */ -#define ENOSTR 60 /* Device not a stream */ -#define ENODATA 61 /* No data available */ -#define ETIME 62 /* Timer expired */ -#define ENOSR 63 /* Out of streams resources */ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* Object is remote */ -#define ENOLINK 67 /* Link has been severed */ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 72 /* Multihop attempted */ -#define EDOTDOT 73 /* RFS specific error */ -#define EBADMSG 74 /* Not a data message */ -#define EOVERFLOW 75 /* Value too large for defined data type */ -#define ENOTUNIQ 76 /* Name not unique on network */ -#define EBADFD 77 /* File descriptor in bad state */ -#define EREMCHG 78 /* Remote address changed */ -#define ELIBACC 79 /* Can not access a needed shared library */ -#define ELIBBAD 80 /* Accessing a corrupted shared library */ -#define ELIBSCN 81 /* .lib section in a.out corrupted */ -#define ELIBMAX 82 /* Attempting to link in too many shared libraries */ -#define ELIBEXEC 83 /* Cannot exec a shared library directly */ -#define EILSEQ 84 /* Illegal byte sequence */ -#define ERESTART 85 /* Interrupted system call should be restarted */ -#define ESTRPIPE 86 /* Streams pipe error */ -#define EUSERS 87 /* Too many users */ -#define ENOTSOCK 88 /* Socket operation on non-socket */ -#define EDESTADDRREQ 89 /* Destination address required */ -#define EMSGSIZE 90 /* Message too long */ -#define EPROTOTYPE 91 /* Protocol wrong type for socket */ -#define ENOPROTOOPT 92 /* Protocol not available */ -#define EPROTONOSUPPORT 93 /* Protocol not supported */ -#define ESOCKTNOSUPPORT 94 /* Socket type not supported */ -#define EOPNOTSUPP 95 /* Operation not supported on transport endpoint */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define EAFNOSUPPORT 97 /* Address family not supported by protocol */ -#define EADDRINUSE 98 /* Address already in use */ -#define EADDRNOTAVAIL 99 /* Cannot assign requested address */ -#define ENETDOWN 100 /* Network is down */ -#define ENETUNREACH 101 /* Network is unreachable */ -#define ENETRESET 102 /* Network dropped connection because of reset */ -#define ECONNABORTED 103 /* Software caused connection abort */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EISCONN 106 /* Transport endpoint is already connected */ -#define ENOTCONN 107 /* Transport endpoint is not connected */ -#define ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */ -#define ETOOMANYREFS 109 /* Too many references: cannot splice */ -#define ETIMEDOUT 110 /* Connection timed out */ -#define ECONNREFUSED 111 /* Connection refused */ -#define EHOSTDOWN 112 /* Host is down */ -#define EHOSTUNREACH 113 /* No route to host */ -#define EALREADY 114 /* Operation already in progress */ -#define EINPROGRESS 115 /* Operation now in progress */ -#define ESTALE 116 /* Stale NFS file handle */ -#define EUCLEAN 117 /* Structure needs cleaning */ -#define ENOTNAM 118 /* Not a XENIX named type file */ -#define ENAVAIL 119 /* No XENIX semaphores available */ -#define EISNAM 120 /* Is a named type file */ -#define EREMOTEIO 121 /* Remote I/O error */ -#define EDQUOT 122 /* Quota exceeded */ - -#define ENOMEDIUM 123 /* No medium found */ -#define EMEDIUMTYPE 124 /* Wrong medium type */ - - -#define ENSROK 0 /* DNS server returned answer with no data */ -#define ENSRNODATA 160 /* DNS server returned answer with no data */ -#define ENSRFORMERR 161 /* DNS server claims query was misformatted */ -#define ENSRSERVFAIL 162 /* DNS server returned general failure */ -#define ENSRNOTFOUND 163 /* Domain name not found */ -#define ENSRNOTIMP 164 /* DNS server does not implement requested operation */ -#define ENSRREFUSED 165 /* DNS server refused query */ -#define ENSRBADQUERY 166 /* Misformatted DNS query */ -#define ENSRBADNAME 167 /* Misformatted domain name */ -#define ENSRBADFAMILY 168 /* Unsupported address family */ -#define ENSRBADRESP 169 /* Misformatted DNS reply */ -#define ENSRCONNREFUSED 170 /* Could not contact DNS servers */ -#define ENSRTIMEOUT 171 /* Timeout while contacting DNS servers */ -#define ENSROF 172 /* End of file */ -#define ENSRFILE 173 /* Error reading file */ -#define ENSRNOMEM 174 /* Out of memory */ -#define ENSRDESTRUCTION 175 /* Application terminated lookup */ -#define ENSRQUERYDOMAINTOOLONG 176 /* Domain name is too long */ -#define ENSRCNAMELOOP 177 /* Domain name is too long */ - -#ifndef errno -extern int errno; -#endif - -#endif /* LWIP_PROVIDE_ERRNO */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ARCH_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/autoip.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/autoip.h deleted file mode 100644 index 23c264a1..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/autoip.h +++ /dev/null @@ -1,119 +0,0 @@ -/** - * @file - * - * AutoIP Automatic LinkLocal IP Configuration - */ - -/* - * - * Copyright (c) 2007 Dominik Spies - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Dominik Spies - * - * This is a AutoIP implementation for the lwIP TCP/IP stack. It aims to conform - * with RFC 3927. - * - * - * Please coordinate changes and requests with Dominik Spies - * - */ - -#ifndef __LWIP_AUTOIP_H__ -#define __LWIP_AUTOIP_H__ - -#include "lwip/opt.h" - -#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -#include "lwip/udp.h" -#include "netif/etharp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* AutoIP Timing */ -#define AUTOIP_TMR_INTERVAL 100 -#define AUTOIP_TICKS_PER_SECOND (1000 / AUTOIP_TMR_INTERVAL) - -/* RFC 3927 Constants */ -#define PROBE_WAIT 1 /* second (initial random delay) */ -#define PROBE_MIN 1 /* second (minimum delay till repeated probe) */ -#define PROBE_MAX 2 /* seconds (maximum delay till repeated probe) */ -#define PROBE_NUM 3 /* (number of probe packets) */ -#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ -#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ -#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ -#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */ -#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */ -#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ - -/* AutoIP client states */ -#define AUTOIP_STATE_OFF 0 -#define AUTOIP_STATE_PROBING 1 -#define AUTOIP_STATE_ANNOUNCING 2 -#define AUTOIP_STATE_BOUND 3 - -struct autoip -{ - ip_addr_t llipaddr; /* the currently selected, probed, announced or used LL IP-Address */ - u8_t state; /* current AutoIP state machine state */ - u8_t sent_num; /* sent number of probes or announces, dependent on state */ - u16_t ttw; /* ticks to wait, tick is AUTOIP_TMR_INTERVAL long */ - u8_t lastconflict; /* ticks until a conflict can be solved by defending */ - u8_t tried_llipaddr; /* total number of probed/used Link Local IP-Addresses */ -}; - - -/** Init srand, has to be called before entering mainloop */ -void autoip_init(void); - -/** Set a struct autoip allocated by the application to work with */ -void autoip_set_struct(struct netif *netif, struct autoip *autoip); - -/** Start AutoIP client */ -err_t autoip_start(struct netif *netif); - -/** Stop AutoIP client */ -err_t autoip_stop(struct netif *netif); - -/** Handles every incoming ARP Packet, called by etharp_arp_input */ -void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr); - -/** Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds */ -void autoip_tmr(void); - -/** Handle a possible change in the network configuration */ -void autoip_network_changed(struct netif *netif); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_AUTOIP */ - -#endif /* __LWIP_AUTOIP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/debug.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/debug.h deleted file mode 100644 index d8359ea3..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/debug.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_DEBUG_H__ -#define __LWIP_DEBUG_H__ - -#include "lwip/arch.h" - -/** lower two bits indicate debug level - * - 0 all - * - 1 warning - * - 2 serious - * - 3 severe - */ -#define LWIP_DBG_LEVEL_ALL 0x00 -#define LWIP_DBG_LEVEL_OFF LWIP_DBG_LEVEL_ALL /* compatibility define only */ -#define LWIP_DBG_LEVEL_WARNING 0x01 /* bad checksums, dropped packets, ... */ -#define LWIP_DBG_LEVEL_SERIOUS 0x02 /* memory allocation failures, ... */ -#define LWIP_DBG_LEVEL_SEVERE 0x03 -#define LWIP_DBG_MASK_LEVEL 0x03 - -/** flag for LWIP_DEBUGF to enable that debug message */ -#define LWIP_DBG_ON 0x80U -/** flag for LWIP_DEBUGF to disable that debug message */ -#define LWIP_DBG_OFF 0x00U - -/** flag for LWIP_DEBUGF indicating a tracing message (to follow program flow) */ -#define LWIP_DBG_TRACE 0x40U -/** flag for LWIP_DEBUGF indicating a state debug message (to follow module states) */ -#define LWIP_DBG_STATE 0x20U -/** flag for LWIP_DEBUGF indicating newly added code, not thoroughly tested yet */ -#define LWIP_DBG_FRESH 0x10U -/** flag for LWIP_DEBUGF to halt after printing this debug message */ -#define LWIP_DBG_HALT 0x08U - -#ifndef LWIP_NOASSERT -#define LWIP_ASSERT(message, assertion) do { if(!(assertion)) \ - LWIP_PLATFORM_ASSERT(message); } while(0) -#else /* LWIP_NOASSERT */ -#define LWIP_ASSERT(message, assertion) -#endif /* LWIP_NOASSERT */ - -/** if "expression" isn't true, then print "message" and execute "handler" expression */ -#ifndef LWIP_ERROR -#define LWIP_ERROR(message, expression, handler) do { if (!(expression)) { \ - LWIP_PLATFORM_ASSERT(message); handler;}} while(0) -#endif /* LWIP_ERROR */ - -#ifdef LWIP_DEBUG -/** print debug message only if debug message type is enabled... - * AND is of correct type AND is at least LWIP_DBG_LEVEL - */ -#define LWIP_DEBUGF(debug, message) do { \ - if ( \ - ((debug) & LWIP_DBG_ON) && \ - ((debug) & LWIP_DBG_TYPES_ON) && \ - ((s16_t)((debug) & LWIP_DBG_MASK_LEVEL) >= LWIP_DBG_MIN_LEVEL)) { \ - LWIP_PLATFORM_DIAG(message); \ - if ((debug) & LWIP_DBG_HALT) { \ - while(1); \ - } \ - } \ - } while(0) - -#else /* LWIP_DEBUG */ -#define LWIP_DEBUGF(debug, message) -#endif /* LWIP_DEBUG */ - -#endif /* __LWIP_DEBUG_H__ */ - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/def.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/def.h deleted file mode 100644 index 9b6de6a8..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/def.h +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_DEF_H__ -#define __LWIP_DEF_H__ - -/* arch.h might define NULL already */ -#include "lwip/arch.h" -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) -#define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) - -#ifndef NULL -#define NULL ((void *)0) -#endif - -/** Get the absolute difference between 2 u32_t values (correcting overflows) - * 'a' is expected to be 'higher' (without overflow) than 'b'. */ -#define LWIP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1))) - -/* Endianess-optimized shifting of two u8_t to create one u16_t */ -#if BYTE_ORDER == LITTLE_ENDIAN -#define LWIP_MAKE_U16(a, b) ((a << 8) | b) -#else -#define LWIP_MAKE_U16(a, b) ((b << 8) | a) -#endif - -#ifndef LWIP_PLATFORM_BYTESWAP -#define LWIP_PLATFORM_BYTESWAP 0 -#endif - -#ifndef LWIP_PREFIX_BYTEORDER_FUNCS -/* workaround for naming collisions on some platforms */ - -#ifdef htons -#undef htons -#endif /* htons */ -#ifdef htonl -#undef htonl -#endif /* htonl */ -#ifdef ntohs -#undef ntohs -#endif /* ntohs */ -#ifdef ntohl -#undef ntohl -#endif /* ntohl */ - -#define htons(x) lwip_htons(x) -#define ntohs(x) lwip_ntohs(x) -#define htonl(x) lwip_htonl(x) -#define ntohl(x) lwip_ntohl(x) -#endif /* LWIP_PREFIX_BYTEORDER_FUNCS */ - -#if BYTE_ORDER == BIG_ENDIAN -#define lwip_htons(x) (x) -#define lwip_ntohs(x) (x) -#define lwip_htonl(x) (x) -#define lwip_ntohl(x) (x) -#define PP_HTONS(x) (x) -#define PP_NTOHS(x) (x) -#define PP_HTONL(x) (x) -#define PP_NTOHL(x) (x) -#else /* BYTE_ORDER != BIG_ENDIAN */ -#if LWIP_PLATFORM_BYTESWAP -#define lwip_htons(x) LWIP_PLATFORM_HTONS(x) -#define lwip_ntohs(x) LWIP_PLATFORM_HTONS(x) -#define lwip_htonl(x) LWIP_PLATFORM_HTONL(x) -#define lwip_ntohl(x) LWIP_PLATFORM_HTONL(x) -#else /* LWIP_PLATFORM_BYTESWAP */ -u16_t lwip_htons(u16_t x); -u16_t lwip_ntohs(u16_t x); -u32_t lwip_htonl(u32_t x); -u32_t lwip_ntohl(u32_t x); -#endif /* LWIP_PLATFORM_BYTESWAP */ - -/* These macros should be calculated by the preprocessor and are used - with compile-time constants only (so that there is no little-endian - overhead at runtime). */ -#define PP_HTONS(x) ((((x) & 0xff) << 8) | (((x) & 0xff00) >> 8)) -#define PP_NTOHS(x) PP_HTONS(x) -#define PP_HTONL(x) ((((x) & 0xff) << 24) | \ - (((x) & 0xff00) << 8) | \ - (((x) & 0xff0000UL) >> 8) | \ - (((x) & 0xff000000UL) >> 24)) -#define PP_NTOHL(x) PP_HTONL(x) - -#endif /* BYTE_ORDER == BIG_ENDIAN */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_DEF_H__ */ - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dhcp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dhcp.h deleted file mode 100644 index ba21068c..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dhcp.h +++ /dev/null @@ -1,243 +0,0 @@ -/** @file - */ - -#ifndef __LWIP_DHCP_H__ -#define __LWIP_DHCP_H__ - -#include "lwip/opt.h" - -#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/netif.h" -#include "lwip/udp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** period (in seconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_SECS 60 -/** period (in milliseconds) of the application calling dhcp_coarse_tmr() */ -#define DHCP_COARSE_TIMER_MSECS (DHCP_COARSE_TIMER_SECS * 1000UL) -/** period (in milliseconds) of the application calling dhcp_fine_tmr() */ -#define DHCP_FINE_TIMER_MSECS 500 - -#define DHCP_CHADDR_LEN 16U -#define DHCP_SNAME_LEN 64U -#define DHCP_FILE_LEN 128U - -struct dhcp -{ - /** transaction identifier of last sent request */ - u32_t xid; - /** our connection to the DHCP server */ - struct udp_pcb *pcb; - /** incoming msg */ - struct dhcp_msg *msg_in; - /** current DHCP state machine state */ - u8_t state; - /** retries of current request */ - u8_t tries; -#if LWIP_DHCP_AUTOIP_COOP - u8_t autoip_coop_state; -#endif - u8_t subnet_mask_given; - - struct pbuf *p_out; /* pbuf of outcoming msg */ - struct dhcp_msg *msg_out; /* outgoing msg */ - u16_t options_out_len; /* outgoing msg options length */ - u16_t request_timeout; /* #ticks with period DHCP_FINE_TIMER_SECS for request timeout */ - u16_t t1_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for renewal time */ - u16_t t2_timeout; /* #ticks with period DHCP_COARSE_TIMER_SECS for rebind time */ - ip_addr_t server_ip_addr; /* dhcp server address that offered this lease */ - ip_addr_t offered_ip_addr; - ip_addr_t offered_sn_mask; - ip_addr_t offered_gw_addr; - - u32_t offered_t0_lease; /* lease period (in seconds) */ - u32_t offered_t1_renew; /* recommended renew time (usually 50% of lease period) */ - u32_t offered_t2_rebind; /* recommended rebind time (usually 66% of lease period) */ - /* @todo: LWIP_DHCP_BOOTP_FILE configuration option? - integrate with possible TFTP-client for booting? */ -#define LWIP_DHCP_BOOTP_FILE 0 -#if LWIP_DHCP_BOOTP_FILE - ip_addr_t offered_si_addr; - char boot_file_name[DHCP_FILE_LEN]; -#endif /* LWIP_DHCP_BOOTPFILE */ -}; - -/* MUST be compiled with "pack structs" or equivalent! */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -/** minimum set of fields of any DHCP message */ -struct dhcp_msg -{ - PACK_STRUCT_FIELD(u8_t op); - PACK_STRUCT_FIELD(u8_t htype); - PACK_STRUCT_FIELD(u8_t hlen); - PACK_STRUCT_FIELD(u8_t hops); - PACK_STRUCT_FIELD(u32_t xid); - PACK_STRUCT_FIELD(u16_t secs); - PACK_STRUCT_FIELD(u16_t flags); - PACK_STRUCT_FIELD(ip_addr_p_t ciaddr); - PACK_STRUCT_FIELD(ip_addr_p_t yiaddr); - PACK_STRUCT_FIELD(ip_addr_p_t siaddr); - PACK_STRUCT_FIELD(ip_addr_p_t giaddr); - PACK_STRUCT_FIELD(u8_t chaddr[DHCP_CHADDR_LEN]); - PACK_STRUCT_FIELD(u8_t sname[DHCP_SNAME_LEN]); - PACK_STRUCT_FIELD(u8_t file[DHCP_FILE_LEN]); - PACK_STRUCT_FIELD(u32_t cookie); -#define DHCP_MIN_OPTIONS_LEN 68U -/** make sure user does not configure this too small */ -#if ((defined(DHCP_OPTIONS_LEN)) && (DHCP_OPTIONS_LEN < DHCP_MIN_OPTIONS_LEN)) -# undef DHCP_OPTIONS_LEN -#endif -/** allow this to be configured in lwipopts.h, but not too small */ -#if (!defined(DHCP_OPTIONS_LEN)) -/** set this to be sufficient for your options in outgoing DHCP msgs */ -# define DHCP_OPTIONS_LEN DHCP_MIN_OPTIONS_LEN -#endif - PACK_STRUCT_FIELD(u8_t options[DHCP_OPTIONS_LEN]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -void dhcp_set_struct(struct netif *netif, struct dhcp *dhcp); -/** Remove a struct dhcp previously set to the netif using dhcp_set_struct() */ -#define dhcp_remove_struct(netif) do { (netif)->dhcp = NULL; } while(0) -void dhcp_cleanup(struct netif *netif); -/** start DHCP configuration */ -err_t dhcp_start(struct netif *netif); -/** enforce early lease renewal (not needed normally)*/ -err_t dhcp_renew(struct netif *netif); -/** release the DHCP lease, usually called before dhcp_stop()*/ -err_t dhcp_release(struct netif *netif); -/** stop DHCP configuration */ -void dhcp_stop(struct netif *netif); -/** inform server of our manual IP address */ -void dhcp_inform(struct netif *netif); -/** Handle a possible change in the network configuration */ -void dhcp_network_changed(struct netif *netif); - -/** if enabled, check whether the offered IP address is not in use, using ARP */ -#if DHCP_DOES_ARP_CHECK -void dhcp_arp_reply(struct netif *netif, ip_addr_t *addr); -#endif - -/** to be called every minute */ -void dhcp_coarse_tmr(void); -/** to be called every half second */ -void dhcp_fine_tmr(void); - -/** DHCP message item offsets and length */ -#define DHCP_OP_OFS 0 -#define DHCP_HTYPE_OFS 1 -#define DHCP_HLEN_OFS 2 -#define DHCP_HOPS_OFS 3 -#define DHCP_XID_OFS 4 -#define DHCP_SECS_OFS 8 -#define DHCP_FLAGS_OFS 10 -#define DHCP_CIADDR_OFS 12 -#define DHCP_YIADDR_OFS 16 -#define DHCP_SIADDR_OFS 20 -#define DHCP_GIADDR_OFS 24 -#define DHCP_CHADDR_OFS 28 -#define DHCP_SNAME_OFS 44 -#define DHCP_FILE_OFS 108 -#define DHCP_MSG_LEN 236 - -#define DHCP_COOKIE_OFS DHCP_MSG_LEN -#define DHCP_OPTIONS_OFS (DHCP_MSG_LEN + 4) - -#define DHCP_CLIENT_PORT 68 -#define DHCP_SERVER_PORT 67 - -/** DHCP client states */ -#define DHCP_OFF 0 -#define DHCP_REQUESTING 1 -#define DHCP_INIT 2 -#define DHCP_REBOOTING 3 -#define DHCP_REBINDING 4 -#define DHCP_RENEWING 5 -#define DHCP_SELECTING 6 -#define DHCP_INFORMING 7 -#define DHCP_CHECKING 8 -#define DHCP_PERMANENT 9 -#define DHCP_BOUND 10 -/** not yet implemented #define DHCP_RELEASING 11 */ -#define DHCP_BACKING_OFF 12 - -/** AUTOIP cooperatation flags */ -#define DHCP_AUTOIP_COOP_STATE_OFF 0 -#define DHCP_AUTOIP_COOP_STATE_ON 1 - -#define DHCP_BOOTREQUEST 1 -#define DHCP_BOOTREPLY 2 - -/** DHCP message types */ -#define DHCP_DISCOVER 1 -#define DHCP_OFFER 2 -#define DHCP_REQUEST 3 -#define DHCP_DECLINE 4 -#define DHCP_ACK 5 -#define DHCP_NAK 6 -#define DHCP_RELEASE 7 -#define DHCP_INFORM 8 - -/** DHCP hardware type, currently only ethernet is supported */ -#define DHCP_HTYPE_ETH 1 - -#define DHCP_MAGIC_COOKIE 0x63825363UL - -/* This is a list of options for BOOTP and DHCP, see RFC 2132 for descriptions */ - -/** BootP options */ -#define DHCP_OPTION_PAD 0 -#define DHCP_OPTION_SUBNET_MASK 1 /* RFC 2132 3.3 */ -#define DHCP_OPTION_ROUTER 3 -#define DHCP_OPTION_DNS_SERVER 6 -#define DHCP_OPTION_HOSTNAME 12 -#define DHCP_OPTION_IP_TTL 23 -#define DHCP_OPTION_MTU 26 -#define DHCP_OPTION_BROADCAST 28 -#define DHCP_OPTION_TCP_TTL 37 -#define DHCP_OPTION_END 255 - -/** DHCP options */ -#define DHCP_OPTION_REQUESTED_IP 50 /* RFC 2132 9.1, requested IP address */ -#define DHCP_OPTION_LEASE_TIME 51 /* RFC 2132 9.2, time in seconds, in 4 bytes */ -#define DHCP_OPTION_OVERLOAD 52 /* RFC2132 9.3, use file and/or sname field for options */ - -#define DHCP_OPTION_MESSAGE_TYPE 53 /* RFC 2132 9.6, important for DHCP */ -#define DHCP_OPTION_MESSAGE_TYPE_LEN 1 - -#define DHCP_OPTION_SERVER_ID 54 /* RFC 2132 9.7, server IP address */ -#define DHCP_OPTION_PARAMETER_REQUEST_LIST 55 /* RFC 2132 9.8, requested option types */ - -#define DHCP_OPTION_MAX_MSG_SIZE 57 /* RFC 2132 9.10, message size accepted >= 576 */ -#define DHCP_OPTION_MAX_MSG_SIZE_LEN 2 - -#define DHCP_OPTION_T1 58 /* T1 renewal time */ -#define DHCP_OPTION_T2 59 /* T2 rebinding time */ -#define DHCP_OPTION_US 60 -#define DHCP_OPTION_CLIENT_ID 61 -#define DHCP_OPTION_TFTP_SERVERNAME 66 -#define DHCP_OPTION_BOOTFILE 67 - -/** possible combinations of overloading the file and sname fields with options */ -#define DHCP_OVERLOAD_NONE 0 -#define DHCP_OVERLOAD_FILE 1 -#define DHCP_OVERLOAD_SNAME 2 -#define DHCP_OVERLOAD_SNAME_FILE 3 - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DHCP */ - -#endif /*__LWIP_DHCP_H__*/ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dns.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dns.h deleted file mode 100644 index 6c7d9b07..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/dns.h +++ /dev/null @@ -1,124 +0,0 @@ -/** - * lwip DNS resolver header file. - - * Author: Jim Pettinato - * April 2007 - - * ported from uIP resolv.c Copyright (c) 2002-2003, Adam Dunkels. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS - * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef __LWIP_DNS_H__ -#define __LWIP_DNS_H__ - -#include "lwip/opt.h" - -#if LWIP_DNS /* don't build if not configured for use in lwipopts.h */ - -#ifdef __cplusplus -extern "C" { -#endif - -/** DNS timer period */ -#define DNS_TMR_INTERVAL 1000 - -/** DNS field TYPE used for "Resource Records" */ -#define DNS_RRTYPE_A 1 /* a host address */ -#define DNS_RRTYPE_NS 2 /* an authoritative name server */ -#define DNS_RRTYPE_MD 3 /* a mail destination (Obsolete - use MX) */ -#define DNS_RRTYPE_MF 4 /* a mail forwarder (Obsolete - use MX) */ -#define DNS_RRTYPE_CNAME 5 /* the canonical name for an alias */ -#define DNS_RRTYPE_SOA 6 /* marks the start of a zone of authority */ -#define DNS_RRTYPE_MB 7 /* a mailbox domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_MG 8 /* a mail group member (EXPERIMENTAL) */ -#define DNS_RRTYPE_MR 9 /* a mail rename domain name (EXPERIMENTAL) */ -#define DNS_RRTYPE_NULL 10 /* a null RR (EXPERIMENTAL) */ -#define DNS_RRTYPE_WKS 11 /* a well known service description */ -#define DNS_RRTYPE_PTR 12 /* a domain name pointer */ -#define DNS_RRTYPE_HINFO 13 /* host information */ -#define DNS_RRTYPE_MINFO 14 /* mailbox or mail list information */ -#define DNS_RRTYPE_MX 15 /* mail exchange */ -#define DNS_RRTYPE_TXT 16 /* text strings */ - -/** DNS field CLASS used for "Resource Records" */ -#define DNS_RRCLASS_IN 1 /* the Internet */ -#define DNS_RRCLASS_CS 2 /* the CSNET class (Obsolete - used only for examples in some obsolete RFCs) */ -#define DNS_RRCLASS_CH 3 /* the CHAOS class */ -#define DNS_RRCLASS_HS 4 /* Hesiod [Dyer 87] */ -#define DNS_RRCLASS_FLUSH 0x800 /* Flush bit */ - -/* The size used for the next line is rather a hack, but it prevents including socket.h in all files - that include memp.h, and that would possibly break portability (since socket.h defines some types - and constants possibly already define by the OS). - Calculation rule: - sizeof(struct addrinfo) + sizeof(struct sockaddr_in) + DNS_MAX_NAME_LENGTH + 1 byte zero-termination */ -#define NETDB_ELEM_SIZE (32 + 16 + DNS_MAX_NAME_LENGTH + 1) - -#if DNS_LOCAL_HOSTLIST -/** struct used for local host-list */ -struct local_hostlist_entry { - /** static hostname */ - const char *name; - /** static host address in network byteorder */ - ip_addr_t addr; - struct local_hostlist_entry *next; -}; -#if DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#ifndef DNS_LOCAL_HOSTLIST_MAX_NAMELEN -#define DNS_LOCAL_HOSTLIST_MAX_NAMELEN DNS_MAX_NAME_LENGTH -#endif -#define LOCALHOSTLIST_ELEM_SIZE ((sizeof(struct local_hostlist_entry) + DNS_LOCAL_HOSTLIST_MAX_NAMELEN + 1)) -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#endif /* DNS_LOCAL_HOSTLIST */ - -/** Callback which is invoked when a hostname is found. - * A function of this type must be implemented by the application using the DNS resolver. - * @param name pointer to the name that was looked up. - * @param ipaddr pointer to an ip_addr_t containing the IP address of the hostname, - * or NULL if the name could not be found (or on any other error). - * @param callback_arg a user-specified callback argument passed to dns_gethostbyname -*/ -typedef void (*dns_found_callback)(const char *name, ip_addr_t *ipaddr, void *callback_arg); - -void dns_init(void); -void dns_tmr(void); -void dns_setserver(u8_t numdns, ip_addr_t *dnsserver); -ip_addr_t dns_getserver(u8_t numdns); -err_t dns_gethostbyname(const char *hostname, ip_addr_t *addr, - dns_found_callback found, void *callback_arg); - -#if DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC -int dns_local_removehost(const char *hostname, const ip_addr_t *addr); -err_t dns_local_addhost(const char *hostname, const ip_addr_t *addr); -#endif /* DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS */ - -#endif /* __LWIP_DNS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/err.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/err.h deleted file mode 100644 index cb69a9f4..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/err.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ERR_H__ -#define __LWIP_ERR_H__ - -#include "lwip/opt.h" -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Define LWIP_ERR_T in cc.h if you want to use - * a different type for your platform (must be signed). */ -#ifdef LWIP_ERR_T -typedef LWIP_ERR_T err_t; -#else /* LWIP_ERR_T */ -typedef s8_t err_t; -#endif /* LWIP_ERR_T*/ - -/* Definitions for error constants. */ - -#define ERR_OK 0 /* No error, everything OK. */ -#define ERR_MEM -1 /* Out of memory error. */ -#define ERR_BUF -2 /* Buffer error. */ -#define ERR_TIMEOUT -3 /* Timeout. */ -#define ERR_RTE -4 /* Routing problem. */ -#define ERR_INPROGRESS -5 /* Operation in progress */ -#define ERR_VAL -6 /* Illegal value. */ -#define ERR_WOULDBLOCK -7 /* Operation would block. */ - -#define ERR_IS_FATAL(e) ((e) < ERR_WOULDBLOCK) - -#define ERR_ABRT -8 /* Connection aborted. */ -#define ERR_RST -9 /* Connection reset. */ -#define ERR_CLSD -10 /* Connection closed. */ -#define ERR_CONN -11 /* Not connected. */ - -#define ERR_ARG -12 /* Illegal argument. */ - -#define ERR_USE -13 /* Address in use. */ - -#define ERR_IF -14 /* Low-level netif error */ -#define ERR_ISCONN -15 /* Already connected. */ - - -#ifdef LWIP_DEBUG -extern const char *lwip_strerr(err_t err)ICACHE_FLASH_ATTR; -#else -#define lwip_strerr(x) "" -#endif /* LWIP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ERR_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/icmp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/icmp.h deleted file mode 100644 index 9bcb7bc4..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/icmp.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_ICMP_H__ -#define __LWIP_ICMP_H__ - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define ICMP_ER 0 /* echo reply */ -#define ICMP_DUR 3 /* destination unreachable */ -#define ICMP_SQ 4 /* source quench */ -#define ICMP_RD 5 /* redirect */ -#define ICMP_ECHO 8 /* echo */ -#define ICMP_TE 11 /* time exceeded */ -#define ICMP_PP 12 /* parameter problem */ -#define ICMP_TS 13 /* timestamp */ -#define ICMP_TSR 14 /* timestamp reply */ -#define ICMP_IRQ 15 /* information request */ -#define ICMP_IR 16 /* information reply */ - -enum icmp_dur_type { - ICMP_DUR_NET = 0, /* net unreachable */ - ICMP_DUR_HOST = 1, /* host unreachable */ - ICMP_DUR_PROTO = 2, /* protocol unreachable */ - ICMP_DUR_PORT = 3, /* port unreachable */ - ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */ - ICMP_DUR_SR = 5 /* source route failed */ -}; - -enum icmp_te_type { - ICMP_TE_TTL = 0, /* time to live exceeded in transit */ - ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */ -}; - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -/** This is the standard ICMP header only that the u32_t data - * is splitted to two u16_t like ICMP echo needs it. - * This header is also used for other ICMP types that do not - * use the data part. - * ¶¨ÒåICMP»ØËÍÇëÇó±¨ÎÄÊײ¿½á¹¹£¬ - * ÓÉÓÚËùÓÐICMP±¨ÎÄÊײ¿ÓкܴóÏàËÆÐÔ£¬ - * ¸Ã½á¹¹Í¬ÑùÊÊÓÃÓÚÆäËüICMP±¨ÎÄ¡£ - */ -PACK_STRUCT_BEGIN -struct icmp_echo_hdr { - PACK_STRUCT_FIELD(u8_t type); - PACK_STRUCT_FIELD(u8_t code); - PACK_STRUCT_FIELD(u16_t chksum); - PACK_STRUCT_FIELD(u16_t id); - PACK_STRUCT_FIELD(u16_t seqno); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -//¶ÁÈ¡ICMPÊײ¿ÖÐ×Ö¶Î -#define ICMPH_TYPE(hdr) ((hdr)->type) -#define ICMPH_CODE(hdr) ((hdr)->code) - -/** Combines type and code to an u16_t ÏòICMP±¨ÎÄÊײ¿×Ö¶ÎÖÐдÈëÏàÓ¦Öµ*/ -#define ICMPH_TYPE_SET(hdr, t) ((hdr)->type = (t)) -#define ICMPH_CODE_SET(hdr, c) ((hdr)->code = (c)) - - -#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ - -void icmp_input(struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t)ICACHE_FLASH_ATTR; -void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t)ICACHE_FLASH_ATTR; - -#endif /* LWIP_ICMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_ICMP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/igmp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/igmp.h deleted file mode 100644 index 8cf9a481..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/igmp.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2002 CITEL Technologies Ltd. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of CITEL Technologies Ltd nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY CITEL TECHNOLOGIES AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL CITEL TECHNOLOGIES OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is a contribution to the lwIP TCP/IP stack. - * The Swedish Institute of Computer Science and Adam Dunkels - * are specifically granted permission to redistribute this - * source code. -*/ - -#ifndef __LWIP_IGMP_H__ -#define __LWIP_IGMP_H__ - -#include "lwip/opt.h" -#include "lwip/ip_addr.h" -#include "lwip/netif.h" -#include "lwip/pbuf.h" - -#if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */ - -#ifdef __cplusplus -extern "C" { -#endif - - -/* IGMP timer */ -#define IGMP_TMR_INTERVAL 100 /* Milliseconds */ -#define IGMP_V1_DELAYING_MEMBER_TMR (1000/IGMP_TMR_INTERVAL) -#define IGMP_JOIN_DELAYING_MEMBER_TMR (500 /IGMP_TMR_INTERVAL) - -/* MAC Filter Actions, these are passed to a netif's - * igmp_mac_filter callback function. */ -#define IGMP_DEL_MAC_FILTER 0 -#define IGMP_ADD_MAC_FILTER 1 - - -/** - * igmp group structure - there is - * a list of groups for each interface - * these should really be linked from the interface, but - * if we keep them separate we will not affect the lwip original code - * too much - * - * There will be a group for the all systems group address but this - * will not run the state machine as it is used to kick off reports - * from all the other groups - */ -struct igmp_group { - /** next link */ - struct igmp_group *next; - /** interface on which the group is active */ - struct netif *netif; - /** multicast address */ - ip_addr_t group_address; - /** signifies we were the last person to report */ - u8_t last_reporter_flag; - /** current state of the group */ - u8_t group_state; - /** timer for reporting, negative is OFF */ - u16_t timer; - /** counter of simultaneous uses */ - u8_t use; -}; - -/* Prototypes */ -void igmp_init(void)ICACHE_FLASH_ATTR; -err_t igmp_start(struct netif *netif)ICACHE_FLASH_ATTR; -err_t igmp_stop(struct netif *netif)ICACHE_FLASH_ATTR; -void igmp_report_groups(struct netif *netif)ICACHE_FLASH_ATTR; -struct igmp_group *igmp_lookfor_group(struct netif *ifp, ip_addr_t *addr)ICACHE_FLASH_ATTR; -void igmp_input(struct pbuf *p, struct netif *inp, ip_addr_t *dest)ICACHE_FLASH_ATTR; -err_t igmp_joingroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR; -err_t igmp_leavegroup(ip_addr_t *ifaddr, ip_addr_t *groupaddr)ICACHE_FLASH_ATTR; -void igmp_tmr(void)ICACHE_FLASH_ATTR; -#define LWIP_RAND() rand() -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_IGMP */ - -#endif /* __LWIP_IGMP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet.h deleted file mode 100644 index 7bff49b5..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet.h +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INET_H__ -#define __LWIP_INET_H__ - -#include "lwip/opt.h" -#include "lwip/def.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** For compatibility with BSD code */ -struct in_addr { - u32_t s_addr; -}; - -/** 255.255.255.255 */ -#define INADDR_NONE IPADDR_NONE -/** 127.0.0.1 */ -#define INADDR_LOOPBACK IPADDR_LOOPBACK -/** 0.0.0.0 */ -#define INADDR_ANY IPADDR_ANY -/** 255.255.255.255 */ -#define INADDR_BROADCAST IPADDR_BROADCAST - -/* Definitions of the bits in an Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IN_CLASSA(a) IP_CLASSA(a) -#define IN_CLASSA_NET IP_CLASSA_NET -#define IN_CLASSA_NSHIFT IP_CLASSA_NSHIFT -#define IN_CLASSA_HOST IP_CLASSA_HOST -#define IN_CLASSA_MAX IP_CLASSA_MAX - -#define IN_CLASSB(b) IP_CLASSB(b) -#define IN_CLASSB_NET IP_CLASSB_NET -#define IN_CLASSB_NSHIFT IP_CLASSB_NSHIFT -#define IN_CLASSB_HOST IP_CLASSB_HOST -#define IN_CLASSB_MAX IP_CLASSB_MAX - -#define IN_CLASSC(c) IP_CLASSC(c) -#define IN_CLASSC_NET IP_CLASSC_NET -#define IN_CLASSC_NSHIFT IP_CLASSC_NSHIFT -#define IN_CLASSC_HOST IP_CLASSC_HOST -#define IN_CLASSC_MAX IP_CLASSC_MAX - -#define IN_CLASSD(d) IP_CLASSD(d) -#define IN_CLASSD_NET IP_CLASSD_NET /* These ones aren't really */ -#define IN_CLASSD_NSHIFT IP_CLASSD_NSHIFT /* net and host fields, but */ -#define IN_CLASSD_HOST IP_CLASSD_HOST /* routing needn't know. */ -#define IN_CLASSD_MAX IP_CLASSD_MAX - -#define IN_MULTICAST(a) IP_MULTICAST(a) - -#define IN_EXPERIMENTAL(a) IP_EXPERIMENTAL(a) -#define IN_BADCLASS(a) IP_BADCLASS(a) - -#define IN_LOOPBACKNET IP_LOOPBACKNET - -#define inet_addr_from_ipaddr(target_inaddr, source_ipaddr) ((target_inaddr)->s_addr = ip4_addr_get_u32(source_ipaddr)) -#define inet_addr_to_ipaddr(target_ipaddr, source_inaddr) (ip4_addr_set_u32(target_ipaddr, (source_inaddr)->s_addr)) -/* ATTENTION: the next define only works because both s_addr and ip_addr_t are an u32_t effectively! */ -#define inet_addr_to_ipaddr_p(target_ipaddr_p, source_inaddr) ((target_ipaddr_p) = (ip_addr_t*)&((source_inaddr)->s_addr)) - -/* directly map this to the lwip internal functions */ -#define inet_addr(cp) ipaddr_addr(cp) -#define inet_aton(cp, addr) ipaddr_aton(cp, (ip_addr_t*)addr) -#define inet_ntoa(addr) ipaddr_ntoa((ip_addr_t*)&(addr)) -#define inet_ntoa_r(addr, buf, buflen) ipaddr_ntoa_r((ip_addr_t*)&(addr), buf, buflen) - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INET_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet_chksum.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet_chksum.h deleted file mode 100644 index 41be6415..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/inet_chksum.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INET_CHKSUM_H__ -#define __LWIP_INET_CHKSUM_H__ - -#include "lwip/opt.h" - -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" - -/** Swap the bytes in an u16_t: much like htons() for little-endian */ -#ifndef SWAP_BYTES_IN_WORD -#if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) -/* little endian and PLATFORM_BYTESWAP defined */ -#define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) -#else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) */ -/* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ -#define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) -#endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)*/ -#endif /* SWAP_BYTES_IN_WORD */ - -/** Split an u32_t in two u16_ts and add them up */ -#ifndef FOLD_U32T -#define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) -#endif - -#if LWIP_CHECKSUM_ON_COPY -/** Function-like macro: same as MEMCPY but returns the checksum of copied data - as u16_t */ -#ifndef LWIP_CHKSUM_COPY -#define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) -#ifndef LWIP_CHKSUM_COPY_ALGORITHM -#define LWIP_CHKSUM_COPY_ALGORITHM 1 -#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ -#endif /* LWIP_CHKSUM_COPY */ -#else /* LWIP_CHECKSUM_ON_COPY */ -#define LWIP_CHKSUM_COPY_ALGORITHM 0 -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -extern "C" { -#endif - -u16_t inet_chksum(void *dataptr, u16_t len)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pbuf(struct pbuf *p)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pseudo(struct pbuf *p, - ip_addr_t *src, ip_addr_t *dest, - u8_t proto, u16_t proto_len)ICACHE_FLASH_ATTR; -u16_t inet_chksum_pseudo_partial(struct pbuf *p, - ip_addr_t *src, ip_addr_t *dest, - u8_t proto, u16_t proto_len, u16_t chksum_len)ICACHE_FLASH_ATTR; -#if LWIP_CHKSUM_COPY_ALGORITHM -u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHKSUM_COPY_ALGORITHM */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INET_H__ */ - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/init.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/init.h deleted file mode 100644 index 7a58aece..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/init.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_INIT_H__ -#define __LWIP_INIT_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** X.x.x: Major version of the stack */ -#define LWIP_VERSION_MAJOR 1U -/** x.X.x: Minor version of the stack */ -#define LWIP_VERSION_MINOR 4U -/** x.x.X: Revision of the stack */ -#define LWIP_VERSION_REVISION 0U -/** For release candidates, this is set to 1..254 - * For official releases, this is set to 255 (LWIP_RC_RELEASE) - * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ -#define LWIP_VERSION_RC 2U - -/** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ -#define LWIP_RC_RELEASE 255U -/** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ -#define LWIP_RC_DEVELOPMENT 0U - -#define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) -#define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) -#define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) - -/** Provides the version of the stack */ -#define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ - LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) - -/* Modules initialization */ -void lwip_init(void) ICACHE_FLASH_ATTR; -//void lwip_init(void); - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_INIT_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip.h deleted file mode 100644 index 1f361fa4..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip.h +++ /dev/null @@ -1,215 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_IP_H__ -#define __LWIP_IP_H__ - -#include "lwip/opt.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Currently, the function ip_output_if_opt() is only used with IGMP */ -#define IP_OPTIONS_SEND LWIP_IGMP - -#define IP_HLEN 20 - -#define IP_PROTO_ICMP 1 -#define IP_PROTO_IGMP 2 -#define IP_PROTO_UDP 17 -#define IP_PROTO_UDPLITE 136 -#define IP_PROTO_TCP 6 - -/* This is passed as the destination address to ip_output_if (not - to ip_output), meaning that an IP header already is constructed - in the pbuf. This is used when TCP retransmits. */ -#ifdef IP_HDRINCL -#undef IP_HDRINCL -#endif /* IP_HDRINCL */ -#define IP_HDRINCL NULL - -#if LWIP_NETIF_HWADDRHINT -#define IP_PCB_ADDRHINT ;u8_t addr_hint -#else -#define IP_PCB_ADDRHINT -#endif /* LWIP_NETIF_HWADDRHINT */ - -/* This is the common part of all PCB types. It needs to be at the - beginning of a PCB type definition. It is located here so that - changes to this common part are made in one location instead of - having to change all PCB structs. */ -#define IP_PCB \ - /* ip addresses in network byte order */ \ - ip_addr_t local_ip; \ - ip_addr_t remote_ip; \ - /* Socket options */ \ - u8_t so_options; \ - /* Type Of Service */ \ - u8_t tos; \ - /* Time To Live */ \ - u8_t ttl \ - /* link layer address resolution hint */ \ - IP_PCB_ADDRHINT - -struct ip_pcb { -/* Common members of all PCB types */ - IP_PCB; -}; - -/* - * Option flags per-socket. These are the same like SO_XXX. - */ -/*#define SOF_DEBUG (u8_t)0x01U Unimplemented: turn on debugging info recording */ -#define SOF_ACCEPTCONN (u8_t)0x02U /* socket has had listen() */ -#define SOF_REUSEADDR (u8_t)0x04U /* allow local address reuse */ -#define SOF_KEEPALIVE (u8_t)0x08U /* keep connections alive */ -/*#define SOF_DONTROUTE (u8_t)0x10U Unimplemented: just use interface addresses */ -#define SOF_BROADCAST (u8_t)0x20U /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ -/*#define SOF_USELOOPBACK (u8_t)0x40U Unimplemented: bypass hardware when possible */ -#define SOF_LINGER (u8_t)0x80U /* linger on close if data present */ -/*#define SOF_OOBINLINE (u16_t)0x0100U Unimplemented: leave received OOB data in line */ -/*#define SOF_REUSEPORT (u16_t)0x0200U Unimplemented: allow local address & port reuse */ - -/* These flags are inherited (e.g. from a listen-pcb to a connection-pcb): */ -#define SOF_INHERITED (SOF_REUSEADDR|SOF_KEEPALIVE|SOF_LINGER/*|SOF_DEBUG|SOF_DONTROUTE|SOF_OOBINLINE*/) - - -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_hdr { - /* version / header length / type of service */ - PACK_STRUCT_FIELD(u16_t _v_hl_tos); - /* total length */ - PACK_STRUCT_FIELD(u16_t _len); - /* identification */ - PACK_STRUCT_FIELD(u16_t _id); - /* fragment offset field */ - PACK_STRUCT_FIELD(u16_t _offset); -#define IP_RF 0x8000 /* reserved fragment flag */ -#define IP_DF 0x4000 /* dont fragment flag */ -#define IP_MF 0x2000 /* more fragments flag */ -#define IP_OFFMASK 0x1fff /* mask for fragmenting bits */ - /* time to live */ - PACK_STRUCT_FIELD(u8_t _ttl); - /* protocol*/ - PACK_STRUCT_FIELD(u8_t _proto); - /* checksum */ - PACK_STRUCT_FIELD(u16_t _chksum); - /* source and destination IP addresses */ - PACK_STRUCT_FIELD(ip_addr_p_t src); - PACK_STRUCT_FIELD(ip_addr_p_t dest); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define IPH_V(hdr) (ntohs((hdr)->_v_hl_tos) >> 12) -#define IPH_HL(hdr) ((ntohs((hdr)->_v_hl_tos) >> 8) & 0x0f) -#define IPH_TOS(hdr) (ntohs((hdr)->_v_hl_tos) & 0xff) -#define IPH_LEN(hdr) ((hdr)->_len) -#define IPH_ID(hdr) ((hdr)->_id) -#define IPH_OFFSET(hdr) ((hdr)->_offset) -#define IPH_TTL(hdr) ((hdr)->_ttl) -#define IPH_PROTO(hdr) ((hdr)->_proto) -#define IPH_CHKSUM(hdr) ((hdr)->_chksum) - -#define IPH_VHLTOS_SET(hdr, v, hl, tos) (hdr)->_v_hl_tos = (htons(((v) << 12) | ((hl) << 8) | (tos))) -#define IPH_LEN_SET(hdr, len) (hdr)->_len = (len) -#define IPH_ID_SET(hdr, id) (hdr)->_id = (id) -#define IPH_OFFSET_SET(hdr, off) (hdr)->_offset = (off) -#define IPH_TTL_SET(hdr, ttl) (hdr)->_ttl = (u8_t)(ttl) -#define IPH_PROTO_SET(hdr, proto) (hdr)->_proto = (u8_t)(proto) -#define IPH_CHKSUM_SET(hdr, chksum) (hdr)->_chksum = (chksum) - -/** The interface that provided the packet for the current callback invocation. */ -extern struct netif *current_netif; -/** Header of the input packet currently being processed. */ -extern const struct ip_hdr *current_header; -/** Source IP address of current_header */ -extern ip_addr_t current_iphdr_src; -/** Destination IP address of current_header */ -extern ip_addr_t current_iphdr_dest; - -#define ip_init() /* Compatibility define, not init needed. */ -struct netif *ip_route(ip_addr_t *dest)ICACHE_FLASH_ATTR; -struct netif *ip_router(ip_addr_t *dest, ip_addr_t *source); - -err_t ip_input(struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -err_t ip_output(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto)ICACHE_FLASH_ATTR; -err_t ip_output_if(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, - struct netif *netif)ICACHE_FLASH_ATTR; -#if LWIP_NETIF_HWADDRHINT -err_t ip_output_hinted(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, u8_t *addr_hint)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if IP_OPTIONS_SEND -err_t ip_output_if_opt(struct pbuf *p, ip_addr_t *src, ip_addr_t *dest, - u8_t ttl, u8_t tos, u8_t proto, struct netif *netif, void *ip_options, - u16_t optlen)ICACHE_FLASH_ATTR; -#endif /* IP_OPTIONS_SEND */ -/** Get the interface that received the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_netif() (current_netif) -/** Get the IP header of the current packet. - * This function must only be called from a receive callback (udp_recv, - * raw_recv, tcp_accept). It will return NULL otherwise. */ -#define ip_current_header() (current_header) -/** Source IP address of current_header */ -#define ip_current_src_addr() (¤t_iphdr_src) -/** Destination IP address of current_header */ -#define ip_current_dest_addr() (¤t_iphdr_dest) - -#if IP_DEBUG -void ip_debug_print(struct pbuf *p)ICACHE_FLASH_ATTR; -#else -#define ip_debug_print(p) -#endif /* IP_DEBUG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_H__ */ - - diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_addr.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_addr.h deleted file mode 100644 index cfc10f80..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_addr.h +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_IP_ADDR_H__ -#define __LWIP_IP_ADDR_H__ - -#include "lwip/opt.h" -#include "lwip/def.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* This is the aligned version of ip_addr_t, - used as local variable, on the stack, etc. */ -struct ip_addr { - u32_t addr; -}; - -/* This is the packed version of ip_addr_t, - used in network headers that are itself packed */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_addr_packed { - PACK_STRUCT_FIELD(u32_t addr); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/** ip_addr_t uses a struct for convenience only, so that the same defines can - * operate both on ip_addr_t as well as on ip_addr_p_t. */ -typedef struct ip_addr ip_addr_t; -typedef struct ip_addr_packed ip_addr_p_t; - -/* - * struct ipaddr2 is used in the definition of the ARP packet format in - * order to support compilers that don't have structure packing. - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct ip_addr2 { - PACK_STRUCT_FIELD(u16_t addrw[2]); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -/* Forward declaration to not include netif.h */ -struct netif; - -extern const ip_addr_t ip_addr_any; -extern const ip_addr_t ip_addr_broadcast; - -/** IP_ADDR_ can be used as a fixed IP address - * for the wildcard and the broadcast address - */ -#define IP_ADDR_ANY ((ip_addr_t *)&ip_addr_any) -#define IP_ADDR_BROADCAST ((ip_addr_t *)&ip_addr_broadcast) - -/** 255.255.255.255 */ -#define IPADDR_NONE ((u32_t)0xffffffffUL) -/** 127.0.0.1 */ -#define IPADDR_LOOPBACK ((u32_t)0x7f000001UL) -/** 0.0.0.0 */ -#define IPADDR_ANY ((u32_t)0x00000000UL) -/** 255.255.255.255 */ -#define IPADDR_BROADCAST ((u32_t)0xffffffffUL) - -/* Definitions of the bits in an Internet address integer. - - On subnets, host and network parts are found according to - the subnet mask, not these masks. */ -#define IP_CLASSA(a) ((((u32_t)(a)) & 0x80000000UL) == 0) -#define IP_CLASSA_NET 0xff000000 -#define IP_CLASSA_NSHIFT 24 -#define IP_CLASSA_HOST (0xffffffff & ~IP_CLASSA_NET) -#define IP_CLASSA_MAX 128 - -#define IP_CLASSB(a) ((((u32_t)(a)) & 0xc0000000UL) == 0x80000000UL) -#define IP_CLASSB_NET 0xffff0000 -#define IP_CLASSB_NSHIFT 16 -#define IP_CLASSB_HOST (0xffffffff & ~IP_CLASSB_NET) -#define IP_CLASSB_MAX 65536 - -#define IP_CLASSC(a) ((((u32_t)(a)) & 0xe0000000UL) == 0xc0000000UL) -#define IP_CLASSC_NET 0xffffff00 -#define IP_CLASSC_NSHIFT 8 -#define IP_CLASSC_HOST (0xffffffff & ~IP_CLASSC_NET) - -#define IP_CLASSD(a) (((u32_t)(a) & 0xf0000000UL) == 0xe0000000UL) -#define IP_CLASSD_NET 0xf0000000 /* These ones aren't really */ -#define IP_CLASSD_NSHIFT 28 /* net and host fields, but */ -#define IP_CLASSD_HOST 0x0fffffff /* routing needn't know. */ -#define IP_MULTICAST(a) IP_CLASSD(a) - -#define IP_EXPERIMENTAL(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) -#define IP_BADCLASS(a) (((u32_t)(a) & 0xf0000000UL) == 0xf0000000UL) - -#define IP_LOOPBACKNET 127 /* official! */ - - -#if BYTE_ORDER == BIG_ENDIAN -/** Set an IP address given by the four byte-parts */ -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((u32_t)((a) & 0xff) << 24) | \ - ((u32_t)((b) & 0xff) << 16) | \ - ((u32_t)((c) & 0xff) << 8) | \ - (u32_t)((d) & 0xff) -#else -/** Set an IP address given by the four byte-parts. - Little-endian version that prevents the use of htonl. */ -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((u32_t)((d) & 0xff) << 24) | \ - ((u32_t)((c) & 0xff) << 16) | \ - ((u32_t)((b) & 0xff) << 8) | \ - (u32_t)((a) & 0xff) -#endif - -/** MEMCPY-like copying of IP addresses where addresses are known to be - * 16-bit-aligned if the port is correctly configured (so a port could define - * this to copying 2 u16_t's) - no NULL-pointer-checking needed. */ -#ifndef IPADDR2_COPY -#define IPADDR2_COPY(dest, src) SMEMCPY(dest, src, sizeof(ip_addr_t)) -#endif - -/** Copy IP address - faster than ip_addr_set: no NULL check */ -#define ip_addr_copy(dest, src) ((dest).addr = (src).addr) -/** Safely copy one IP address to another (src may be NULL) */ -#define ip_addr_set(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0 : \ - (src)->addr)) -/** Set complete address to zero */ -#define ip_addr_set_zero(ipaddr) ((ipaddr)->addr = 0) -/** Set address to IPADDR_ANY (no need for htonl()) */ -#define ip_addr_set_any(ipaddr) ((ipaddr)->addr = IPADDR_ANY) -/** Set address to loopback address */ -#define ip_addr_set_loopback(ipaddr) ((ipaddr)->addr = PP_HTONL(IPADDR_LOOPBACK)) -/** Safely copy one IP address to another and change byte order - * from host- to network-order. */ -#define ip_addr_set_hton(dest, src) ((dest)->addr = \ - ((src) == NULL ? 0:\ - htonl((src)->addr))) -/** IPv4 only: set the IP address given as an u32_t */ -#define ip4_addr_set_u32(dest_ipaddr, src_u32) ((dest_ipaddr)->addr = (src_u32)) -/** IPv4 only: get the IP address as an u32_t */ -#define ip4_addr_get_u32(src_ipaddr) ((src_ipaddr)->addr) - -/** Get the network address by combining host address with netmask */ -#define ip_addr_get_network(target, host, netmask) ((target)->addr = ((host)->addr) & ((netmask)->addr)) - -/** - * Determine if two address are on the same network. - * - * @arg addr1 IP address 1 - * @arg addr2 IP address 2 - * @arg mask network identifier mask - * @return !0 if the network identifiers of both address match - */ -#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ - (mask)->addr) == \ - ((addr2)->addr & \ - (mask)->addr)) -#define ip_addr_cmp(addr1, addr2) ((addr1)->addr == (addr2)->addr) - -#define ip_addr_isany(addr1) ((addr1) == NULL || (addr1)->addr == IPADDR_ANY) - -#define ip_addr_isbroadcast(ipaddr, netif) ip4_addr_isbroadcast((ipaddr)->addr, (netif)) -u8_t ip4_addr_isbroadcast(u32_t addr, const struct netif *netif)ICACHE_FLASH_ATTR; - -#define ip_addr_netmask_valid(netmask) ip4_addr_netmask_valid((netmask)->addr) -u8_t ip4_addr_netmask_valid(u32_t netmask)ICACHE_FLASH_ATTR; - -#define ip_addr_ismulticast(addr1) (((addr1)->addr & PP_HTONL(0xf0000000UL)) == PP_HTONL(0xe0000000UL)) - -#define ip_addr_islinklocal(addr1) (((addr1)->addr & PP_HTONL(0xffff0000UL)) == PP_HTONL(0xa9fe0000UL)) - -#define ip_addr_debug_print(debug, ipaddr) \ - LWIP_DEBUGF(debug, ("%" U16_F ".%" U16_F ".%" U16_F ".%" U16_F, \ - ipaddr != NULL ? ip4_addr1_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr2_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr3_16(ipaddr) : 0, \ - ipaddr != NULL ? ip4_addr4_16(ipaddr) : 0)) - -/* Get one byte from the 4-byte address */ -#define ip4_addr1(ipaddr) (((u8_t*)(ipaddr))[0]) -#define ip4_addr2(ipaddr) (((u8_t*)(ipaddr))[1]) -#define ip4_addr3(ipaddr) (((u8_t*)(ipaddr))[2]) -#define ip4_addr4(ipaddr) (((u8_t*)(ipaddr))[3]) -/* These are cast to u16_t, with the intent that they are often arguments - * to printf using the U16_F format from cc.h. */ -#define ip4_addr1_16(ipaddr) ((u16_t)ip4_addr1(ipaddr)) -#define ip4_addr2_16(ipaddr) ((u16_t)ip4_addr2(ipaddr)) -#define ip4_addr3_16(ipaddr) ((u16_t)ip4_addr3(ipaddr)) -#define ip4_addr4_16(ipaddr) ((u16_t)ip4_addr4(ipaddr)) - -/** For backwards compatibility */ -#define ip_ntoa(ipaddr) ipaddr_ntoa(ipaddr) - -u32_t ipaddr_addr(const char *cp)ICACHE_FLASH_ATTR; -int ipaddr_aton(const char *cp, ip_addr_t *addr)ICACHE_FLASH_ATTR; -/** returns ptr to static buffer; not reentrant! */ -char *ipaddr_ntoa(const ip_addr_t *addr)ICACHE_FLASH_ATTR; -char *ipaddr_ntoa_r(const ip_addr_t *addr, char *buf, int buflen)ICACHE_FLASH_ATTR; - -#define IP2STR(ipaddr) ip4_addr1_16(ipaddr), \ - ip4_addr2_16(ipaddr), \ - ip4_addr3_16(ipaddr), \ - ip4_addr4_16(ipaddr) - -#define IPSTR "%d.%d.%d.%d" - -struct ip_info { - struct ip_addr ip; - struct ip_addr netmask; - struct ip_addr gw; -}; -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_ADDR_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_frag.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_frag.h deleted file mode 100644 index df6db5f5..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/ip_frag.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Jani Monoses - * - */ - -#ifndef __LWIP_IP_FRAG_H__ -#define __LWIP_IP_FRAG_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if IP_REASSEMBLY -/* The IP reassembly timer interval in milliseconds. */ -#define IP_TMR_INTERVAL 1000 - -/* IP reassembly helper struct. - * This is exported because memp needs to know the size. - */ -struct ip_reassdata { - struct ip_reassdata *next; - struct pbuf *p; - struct ip_hdr iphdr; - u16_t datagram_len; - u8_t flags; - u8_t timer; -}; - -void ip_reass_init(void)ICACHE_FLASH_ATTR; -void ip_reass_tmr(void)ICACHE_FLASH_ATTR; -struct pbuf * ip_reass(struct pbuf *p)ICACHE_FLASH_ATTR; -#endif /* IP_REASSEMBLY */ - -#if IP_FRAG -#if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF -/** A custom pbuf that holds a reference to another pbuf, which is freed - * when this custom pbuf is freed. This is used to create a custom PBUF_REF - * that points into the original pbuf. */ -struct pbuf_custom_ref { - /** 'base class' */ - struct pbuf_custom pc; - /** pointer to the original pbuf that is referenced */ - struct pbuf *original; -}; -#endif /* !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ - -err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest)ICACHE_FLASH_ATTR; -#endif /* IP_FRAG */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_IP_FRAG_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem.h deleted file mode 100644 index 7a4febcc..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_MEM_H__ -#define __LWIP_MEM_H__ - -#include "lwip/opt.h" -#include "mem_manager.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if MEM_LIBC_MALLOC - -#include /* for size_t */ - -typedef size_t mem_size_t; - -/* aliases for C library malloc() */ -#define mem_init() -/* in case C library malloc() needs extra protection, - * allow these defines to be overridden. - */ -#ifndef mem_free -#define mem_free vPortFree -#endif -#ifndef mem_malloc -#define mem_malloc pvPortMalloc -#endif -#ifndef mem_calloc -#define mem_calloc pvPortCalloc -#endif -#ifndef mem_realloc -#define mem_realloc pvPortRealloc -#endif -#ifndef mem_zalloc -#define mem_zalloc pvPortZalloc -#endif - -#ifndef os_malloc -#define os_malloc(s) mem_malloc((s)) -#endif -#ifndef os_realloc -#define os_realloc(p, s) mem_realloc((p), (s)) -#endif -#ifndef os_zalloc -#define os_zalloc(s) mem_zalloc((s)) -#endif -#ifndef os_free -#define os_free(p) mem_free((p)) -#endif - -/* Since there is no C library allocation function to shrink memory without - moving it, define this to nothing. */ -#ifndef mem_trim -#define mem_trim(mem, size) (mem) -#endif -#else /* MEM_LIBC_MALLOC */ - -/* MEM_SIZE would have to be aligned, but using 64000 here instead of - * 65535 leaves some room for alignment... - */ -#if MEM_SIZE > 64000l -typedef u32_t mem_size_t; -#define MEM_SIZE_F U32_F -#else -typedef u16_t mem_size_t; -#define MEM_SIZE_F U16_F -#endif /* MEM_SIZE > 64000 */ - -#if MEM_USE_POOLS -/** mem_init is not used when using pools instead of a heap */ -#define mem_init() -/** mem_trim is not used when using pools instead of a heap: - we can't free part of a pool element and don't want to copy the rest */ -#define mem_trim(mem, size) (mem) -#else /* MEM_USE_POOLS */ -/* lwIP alternative malloc */ -void mem_init(void)ICACHE_FLASH_ATTR; -void *mem_trim(void *mem, mem_size_t size)ICACHE_FLASH_ATTR; -#endif /* MEM_USE_POOLS */ -void *mem_malloc(mem_size_t size)ICACHE_FLASH_ATTR; -void *mem_calloc(mem_size_t count, mem_size_t size)ICACHE_FLASH_ATTR; -void mem_free(void *mem)ICACHE_FLASH_ATTR; -#endif /* MEM_LIBC_MALLOC */ - -/** Calculate memory size for an aligned buffer - returns the next highest - * multiple of MEM_ALIGNMENT (e.g. LWIP_MEM_ALIGN_SIZE(3) and - * LWIP_MEM_ALIGN_SIZE(4) will both yield 4 for MEM_ALIGNMENT == 4). - */ -#ifndef LWIP_MEM_ALIGN_SIZE -#define LWIP_MEM_ALIGN_SIZE(size) (((size) + MEM_ALIGNMENT - 1) & ~(MEM_ALIGNMENT-1)) -#endif - -/** Calculate safe memory size for an aligned buffer when using an unaligned - * type as storage. This includes a safety-margin on (MEM_ALIGNMENT - 1) at the - * start (e.g. if buffer is u8_t[] and actual data will be u32_t*) - */ -#ifndef LWIP_MEM_ALIGN_BUFFER -#define LWIP_MEM_ALIGN_BUFFER(size) (((size) + MEM_ALIGNMENT - 1)) -#endif - -/** Align a memory pointer to the alignment defined by MEM_ALIGNMENT - * so that ADDR % MEM_ALIGNMENT == 0 - */ -#ifndef LWIP_MEM_ALIGN -#define LWIP_MEM_ALIGN(addr) ((void *)(((mem_ptr_t)(addr) + MEM_ALIGNMENT - 1) & ~(mem_ptr_t)(MEM_ALIGNMENT-1))) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_MEM_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem_manager.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem_manager.h deleted file mode 100644 index 03559689..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/mem_manager.h +++ /dev/null @@ -1,81 +0,0 @@ -#ifndef __MEM_MANAGER_H__ -#define __MEM_MANAGER_H__ - -#include "c_types.h" - -/*------------------------±äÁ¿¶¨Òå------------------------*/ - -#define MPU_WRAPPERS_INCLUDED_FROM_API_FILE -#ifndef IOT_SIP_MODE -//#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 0x3fffc000 - (uint32)&_heap_start ) )//fix 16000 to 24000 on 14.2.26 -#else -#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 8000 ) ) -#endif -#define portBYTE_ALIGNMENT 8 -#define pdFALSE 0 -#define pdTRUE 1 - -#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE -#if portBYTE_ALIGNMENT == 8 - #define portBYTE_ALIGNMENT_MASK ( 0x0007 ) -#endif - -#if portBYTE_ALIGNMENT == 4 - #define portBYTE_ALIGNMENT_MASK ( 0x0003 ) -#endif - -#if portBYTE_ALIGNMENT == 2 - #define portBYTE_ALIGNMENT_MASK ( 0x0001 ) -#endif - -#if portBYTE_ALIGNMENT == 1 - #define portBYTE_ALIGNMENT_MASK ( 0x0000 ) -#endif - -#ifndef portBYTE_ALIGNMENT_MASK - #error "Invalid portBYTE_ALIGNMENT definition" -#endif - -#define configUSE_MALLOC_FAILED_HOOK 1 -#define portPOINTER_SIZE_TYPE unsigned int - -#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) ) - -//#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT ) - -//static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ]; -//static unsigned char *ucHeap; - -typedef struct A_BLOCK_LINK -{ - struct A_BLOCK_LINK *pxNextFreeBlock; //The next free block in the list. - size_t xBlockSize; //The size of the free block. -} xBlockLink; - -static const unsigned short heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + portBYTE_ALIGNMENT - ( sizeof( xBlockLink ) % portBYTE_ALIGNMENT ) ); - -//static const size_t xTotalHeapSize = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK ); - -//static xBlockLink xStart, *pxEnd = NULL; - -//static size_t xFreeBytesRemaining = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK ); - - -/*------------------------º¯ÊýÉùÃ÷-----------------------------------*/ - -//static void prvInsertBlockIntoFreeList( xBlockLink *pxBlockToInsert ) ;//ICACHE_FLASH_ATTR; - -//static void prvHeapInit( void ) ;//ICACHE_FLASH_ATTR; - -void vApplicationMallocFailedHook( void ) ;//ICACHE_FLASH_ATTR; - -void *pvPortMalloc( size_t xWantedSize ) ;//ICACHE_FLASH_ATTR; - -void vPortFree( void *pv ) ;//ICACHE_FLASH_ATTR; - -size_t xPortGetFreeHeapSize( void ) ;//ICACHE_FLASH_ATTR; - -void vPortInitialiseBlocks( void ) ;//ICACHE_FLASH_ATTR; -/*-----------------------------------------------------------*/ - -#endif diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp.h deleted file mode 100644 index 764dedb1..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp.h +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -#ifndef __LWIP_MEMP_H__ -#define __LWIP_MEMP_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Create the list of all memory pools managed by memp. MEMP_MAX represents a NULL pool at the end */ -typedef enum { -#define LWIP_MEMPOOL(name,num,size,desc, attr) MEMP_##name, -#include "lwip/memp_std.h" - MEMP_MAX -} memp_t; - -#if MEM_USE_POOLS -/* Use a helper type to get the start and end of the user "memory pools" for mem_malloc */ -typedef enum { - /* Get the first (via: - MEMP_POOL_HELPER_START = ((u8_t) 1*MEMP_POOL_A + 0*MEMP_POOL_B + 0*MEMP_POOL_C + 0)*/ - MEMP_POOL_HELPER_FIRST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START 1 -#define LWIP_MALLOC_MEMPOOL(num, size) * MEMP_POOL_##size + 0 -#define LWIP_MALLOC_MEMPOOL_END -#include "lwip/memp_std.h" - ) , - /* Get the last (via: - MEMP_POOL_HELPER_END = ((u8_t) 0 + MEMP_POOL_A*0 + MEMP_POOL_B*0 + MEMP_POOL_C*1) */ - MEMP_POOL_HELPER_LAST = ((u8_t) -#define LWIP_MEMPOOL(name,num,size,desc) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL(num, size) 0 + MEMP_POOL_##size * -#define LWIP_MALLOC_MEMPOOL_END 1 -#include "lwip/memp_std.h" - ) -} memp_pool_helper_t; - -/* The actual start and stop values are here (cast them over) - We use this helper type and these defines so we can avoid using const memp_t values */ -#define MEMP_POOL_FIRST ((memp_t) MEMP_POOL_HELPER_FIRST) -#define MEMP_POOL_LAST ((memp_t) MEMP_POOL_HELPER_LAST) -#endif /* MEM_USE_POOLS */ - -#if MEMP_MEM_MALLOC || MEM_USE_POOLS -extern const u16_t memp_sizes[MEMP_MAX]; -#endif /* MEMP_MEM_MALLOC || MEM_USE_POOLS */ - -#if MEMP_MEM_MALLOC - -#include "mem.h" - -#define memp_init() -#define memp_malloc(type) mem_malloc(memp_sizes[type]) -#define memp_free(type, mem) mem_free(mem) - -#else /* MEMP_MEM_MALLOC */ - -#if MEM_USE_POOLS -/** This structure is used to save the pool one element came from. */ -struct memp_malloc_helper -{ - memp_t poolnr; -}; -#endif /* MEM_USE_POOLS */ - -void memp_init(void)ICACHE_FLASH_ATTR; - -#if MEMP_OVERFLOW_CHECK -void *memp_malloc_fn(memp_t type, const char* file, const int line)ICACHE_FLASH_ATTR; -#define memp_malloc(t) memp_malloc_fn((t), __FILE__, __LINE__) -#else -void *memp_malloc(memp_t type)ICACHE_FLASH_ATTR; -#endif -void memp_free(memp_t type, void *mem)ICACHE_FLASH_ATTR; - -#endif /* MEMP_MEM_MALLOC */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_MEMP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp_std.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp_std.h deleted file mode 100644 index b20a2405..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/memp_std.h +++ /dev/null @@ -1,126 +0,0 @@ -/* - * SETUP: Make sure we define everything we will need. - * - * We have create three types of pools: - * 1) MEMPOOL - standard pools - * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c - * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct - * - * If the include'r doesn't require any special treatment of each of the types - * above, then will declare #2 & #3 to be just standard mempools. - */ -#ifndef LWIP_MALLOC_MEMPOOL -/* This treats "malloc pools" just like any other pool. - The pools are a little bigger to provide 'size' as the amount of user data. */ -#define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size, attr) -#define LWIP_MALLOC_MEMPOOL_START -#define LWIP_MALLOC_MEMPOOL_END -#endif /* LWIP_MALLOC_MEMPOOL */ - -#ifndef LWIP_PBUF_MEMPOOL -/* This treats "pbuf pools" just like any other pool. - * Allocates buffers for a pbuf struct AND a payload size */ -#define LWIP_PBUF_MEMPOOL(name, num, payload, desc, attr) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc, attr) -#endif /* LWIP_PBUF_MEMPOOL */ - - -/* - * A list of internal pools used by LWIP. - * - * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - */ -#if LWIP_RAW -LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB", DMEM_ATTR) -#endif /* LWIP_RAW */ - -#if LWIP_UDP -LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB", DMEM_ATTR) -#endif /* LWIP_UDP */ - -#if LWIP_TCP -LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB", DMEM_ATTR) -LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN", DMEM_ATTR) -LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG", DMEM_ATTR) -#endif /* LWIP_TCP */ - -#if IP_REASSEMBLY -LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA", DMEM_ATTR) -#endif /* IP_REASSEMBLY */ -#if IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF -LWIP_MEMPOOL(FRAG_PBUF, MEMP_NUM_FRAG_PBUF, sizeof(struct pbuf_custom_ref),"FRAG_PBUF", DMEM_ATTR) -#endif /* IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ - -#if LWIP_NETCONN -LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF") -LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN") -#endif /* LWIP_NETCONN */ - -#if NO_SYS==0 -LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API") -#if !LWIP_TCPIP_CORE_LOCKING_INPUT -LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT") -#endif /* !LWIP_TCPIP_CORE_LOCKING_INPUT */ -#endif /* NO_SYS==0 */ - -#if ARP_QUEUEING -LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE", DMEM_ATTR) -#endif /* ARP_QUEUEING */ - -#if LWIP_IGMP -LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP", DMEM_ATTR) -#endif /* LWIP_IGMP */ - -#if (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) /* LWIP_TIMERS */ -LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT", DMEM_ATTR) -#endif /* LWIP_TIMERS */ - -#if LWIP_SNMP -LWIP_MEMPOOL(SNMP_ROOTNODE, MEMP_NUM_SNMP_ROOTNODE, sizeof(struct mib_list_rootnode), "SNMP_ROOTNODE") -LWIP_MEMPOOL(SNMP_NODE, MEMP_NUM_SNMP_NODE, sizeof(struct mib_list_node), "SNMP_NODE") -LWIP_MEMPOOL(SNMP_VARBIND, MEMP_NUM_SNMP_VARBIND, sizeof(struct snmp_varbind), "SNMP_VARBIND") -LWIP_MEMPOOL(SNMP_VALUE, MEMP_NUM_SNMP_VALUE, SNMP_MAX_VALUE_SIZE, "SNMP_VALUE") -#endif /* LWIP_SNMP */ -#if LWIP_DNS && LWIP_SOCKET -LWIP_MEMPOOL(NETDB, MEMP_NUM_NETDB, NETDB_ELEM_SIZE, "NETDB") -#endif /* LWIP_DNS && LWIP_SOCKET */ -#if LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC -LWIP_MEMPOOL(LOCALHOSTLIST, MEMP_NUM_LOCALHOSTLIST, LOCALHOSTLIST_ELEM_SIZE, "LOCALHOSTLIST") -#endif /* LWIP_DNS && DNS_LOCAL_HOSTLIST && DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ -#if PPP_SUPPORT && PPPOE_SUPPORT -LWIP_MEMPOOL(PPPOE_IF, MEMP_NUM_PPPOE_INTERFACES, sizeof(struct pppoe_softc), "PPPOE_IF") -#endif /* PPP_SUPPORT && PPPOE_SUPPORT */ - -/* - * A list of pools of pbuf's used by LWIP. - * - * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description) - * creates a pool name MEMP_pool_name. description is used in stats.c - * This allocates enough space for the pbuf struct and a payload. - * (Example: pbuf_payload_size=0 allocates only size for the struct) - */ -LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM", DMEM_ATTR) - -/* XXX: need to align to 4 byte as memp strcut is 4-byte long. otherwise will crash */ -#define LWIP_MEM_ALIGN4_SIZE(size) (((size) + 4 - 1) & ~(4-1)) - -LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, LWIP_MEM_ALIGN4_SIZE(PBUF_POOL_BUFSIZE), "PBUF_POOL", DMEM_ATTR) - - -/* - * Allow for user-defined pools; this must be explicitly set in lwipopts.h - * since the default is to NOT look for lwippools.h - */ -#if MEMP_USE_CUSTOM_POOLS -#include "lwippools.h" -#endif /* MEMP_USE_CUSTOM_POOLS */ - -/* - * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later - * (#undef is ignored for something that is not defined) - */ -#undef LWIP_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL -#undef LWIP_MALLOC_MEMPOOL_START -#undef LWIP_MALLOC_MEMPOOL_END -#undef LWIP_PBUF_MEMPOOL diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netbuf.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netbuf.h deleted file mode 100644 index b554a579..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netbuf.h +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_NETBUF_H__ -#define __LWIP_NETBUF_H__ - -#include "lwip/opt.h" -#include "lwip/pbuf.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** This netbuf has dest-addr/port set */ -#define NETBUF_FLAG_DESTADDR 0x01 -/** This netbuf includes a checksum */ -#define NETBUF_FLAG_CHKSUM 0x02 - -struct netbuf { - struct pbuf *p, *ptr; - ip_addr_t addr; - u16_t port; -#if LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY -#if LWIP_CHECKSUM_ON_COPY - u8_t flags; -#endif /* LWIP_CHECKSUM_ON_COPY */ - u16_t toport_chksum; -#if LWIP_NETBUF_RECVINFO - ip_addr_t toaddr; -#endif /* LWIP_NETBUF_RECVINFO */ -#endif /* LWIP_NETBUF_RECVINFO || LWIP_CHECKSUM_ON_COPY */ -}; - -/* Network buffer functions: */ -struct netbuf * netbuf_new (void)ICACHE_FLASH_ATTR; -void netbuf_delete (struct netbuf *buf)ICACHE_FLASH_ATTR; -void * netbuf_alloc (struct netbuf *buf, u16_t size)ICACHE_FLASH_ATTR; -void netbuf_free (struct netbuf *buf)ICACHE_FLASH_ATTR; -err_t netbuf_ref (struct netbuf *buf, - const void *dataptr, u16_t size)ICACHE_FLASH_ATTR; -void netbuf_chain (struct netbuf *head, - struct netbuf *tail)ICACHE_FLASH_ATTR; - -err_t netbuf_data (struct netbuf *buf, - void **dataptr, u16_t *len)ICACHE_FLASH_ATTR; -s8_t netbuf_next (struct netbuf *buf)ICACHE_FLASH_ATTR; -void netbuf_first (struct netbuf *buf)ICACHE_FLASH_ATTR; - - -#define netbuf_copy_partial(buf, dataptr, len, offset) \ - pbuf_copy_partial((buf)->p, (dataptr), (len), (offset)) -#define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) -#define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) -#define netbuf_len(buf) ((buf)->p->tot_len) -#define netbuf_fromaddr(buf) (&((buf)->addr)) -#define netbuf_set_fromaddr(buf, fromaddr) ip_addr_set((&(buf)->addr), fromaddr) -#define netbuf_fromport(buf) ((buf)->port) -#if LWIP_NETBUF_RECVINFO -#define netbuf_destaddr(buf) (&((buf)->toaddr)) -#define netbuf_set_destaddr(buf, destaddr) ip_addr_set((&(buf)->addr), destaddr) -#define netbuf_destport(buf) (((buf)->flags & NETBUF_FLAG_DESTADDR) ? (buf)->toport_chksum : 0) -#endif /* LWIP_NETBUF_RECVINFO */ -#if LWIP_CHECKSUM_ON_COPY -#define netbuf_set_chksum(buf, chksum) do { (buf)->flags = NETBUF_FLAG_CHKSUM; \ - (buf)->toport_chksum = chksum; } while(0) -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_NETBUF_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netdb.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netdb.h deleted file mode 100644 index 7587e2f2..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netdb.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Simon Goldschmidt - * - */ -#ifndef __LWIP_NETDB_H__ -#define __LWIP_NETDB_H__ - -#include "lwip/opt.h" - -#if LWIP_DNS && LWIP_SOCKET - -#include /* for size_t */ - -#include "lwip/inet.h" -#include "lwip/sockets.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* some rarely used options */ -#ifndef LWIP_DNS_API_DECLARE_H_ERRNO -#define LWIP_DNS_API_DECLARE_H_ERRNO 1 -#endif - -#ifndef LWIP_DNS_API_DEFINE_ERRORS -#define LWIP_DNS_API_DEFINE_ERRORS 1 -#endif - -#ifndef LWIP_DNS_API_DECLARE_STRUCTS -#define LWIP_DNS_API_DECLARE_STRUCTS 1 -#endif - -#if LWIP_DNS_API_DEFINE_ERRORS -/** Errors used by the DNS API functions, h_errno can be one of them */ -#define EAI_NONAME 200 -#define EAI_SERVICE 201 -#define EAI_FAIL 202 -#define EAI_MEMORY 203 - -#define HOST_NOT_FOUND 210 -#define NO_DATA 211 -#define NO_RECOVERY 212 -#define TRY_AGAIN 213 -#endif /* LWIP_DNS_API_DEFINE_ERRORS */ - -#if LWIP_DNS_API_DECLARE_STRUCTS -struct hostent { - char *h_name; /* Official name of the host. */ - char **h_aliases; /* A pointer to an array of pointers to alternative host names, - terminated by a null pointer. */ - int h_addrtype; /* Address type. */ - int h_length; /* The length, in bytes, of the address. */ - char **h_addr_list; /* A pointer to an array of pointers to network addresses (in - network byte order) for the host, terminated by a null pointer. */ -#define h_addr h_addr_list[0] /* for backward compatibility */ -}; - -struct addrinfo { - int ai_flags; /* Input flags. */ - int ai_family; /* Address family of socket. */ - int ai_socktype; /* Socket type. */ - int ai_protocol; /* Protocol of socket. */ - socklen_t ai_addrlen; /* Length of socket address. */ - struct sockaddr *ai_addr; /* Socket address of socket. */ - char *ai_canonname; /* Canonical name of service location. */ - struct addrinfo *ai_next; /* Pointer to next in list. */ -}; -#endif /* LWIP_DNS_API_DECLARE_STRUCTS */ - -#if LWIP_DNS_API_DECLARE_H_ERRNO -/* application accessable error code set by the DNS API functions */ -extern int h_errno; -#endif /* LWIP_DNS_API_DECLARE_H_ERRNO*/ - -struct hostent *lwip_gethostbyname(const char *name); -int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, - size_t buflen, struct hostent **result, int *h_errnop); -void lwip_freeaddrinfo(struct addrinfo *ai); -int lwip_getaddrinfo(const char *nodename, - const char *servname, - const struct addrinfo *hints, - struct addrinfo **res); - -#if LWIP_COMPAT_SOCKETS -#define gethostbyname(name) lwip_gethostbyname(name) -#define gethostbyname_r(name, ret, buf, buflen, result, h_errnop) \ - lwip_gethostbyname_r(name, ret, buf, buflen, result, h_errnop) -#define freeaddrinfo(addrinfo) lwip_freeaddrinfo(addrinfo) -#define getaddrinfo(nodname, servname, hints, res) \ - lwip_getaddrinfo(nodname, servname, hints, res) -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_DNS && LWIP_SOCKET */ - -#endif /* __LWIP_NETDB_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netif.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netif.h deleted file mode 100644 index 8bf13752..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netif.h +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_NETIF_H__ -#define __LWIP_NETIF_H__ - -#include "lwip/opt.h" - -#define ENABLE_LOOPBACK (LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF) - -#include "lwip/err.h" - -#include "lwip/ip_addr.h" - -#include "lwip/def.h" -#include "lwip/pbuf.h" -#if LWIP_DHCP -struct dhcp; -#endif -#if LWIP_AUTOIP -struct autoip; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* Throughout this file, IP addresses are expected to be in - * the same byte order as in IP_PCB. */ - -/** must be the maximum of all used hardware address lengths - across all types of interfaces in use */ -#define NETIF_MAX_HWADDR_LEN 6U - -/** Whether the network interface is 'up'. This is - * a software flag used to control whether this network - * interface is enabled and processes traffic. - * It is set by the startup code (for static IP configuration) or - * by dhcp/autoip when an address has been assigned. - */ -#define NETIF_FLAG_UP 0x01U -/** If set, the netif has broadcast capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_BROADCAST 0x02U -/** If set, the netif is one end of a point-to-point connection. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_POINTTOPOINT 0x04U -/** If set, the interface is configured using DHCP. - * Set by the DHCP code when starting or stopping DHCP. */ -#define NETIF_FLAG_DHCP 0x08U -/** If set, the interface has an active link - * (set by the network interface driver). - * Either set by the netif driver in its init function (if the link - * is up at that time) or at a later point once the link comes up - * (if link detection is supported by the hardware). */ -#define NETIF_FLAG_LINK_UP 0x10U -/** If set, the netif is an ethernet device using ARP. - * Set by the netif driver in its init function. - * Used to check input packet types and use of DHCP. */ -#define NETIF_FLAG_ETHARP 0x20U -/** If set, the netif is an ethernet device. It might not use - * ARP or TCP/IP if it is used for PPPoE only. - */ -#define NETIF_FLAG_ETHERNET 0x40U -/** If set, the netif has IGMP capability. - * Set by the netif driver in its init function. */ -#define NETIF_FLAG_IGMP 0x80U - -/** Function prototype for netif init functions. Set up flags and output/linkoutput - * callback functions in this function. - * - * @param netif The netif to initialize - */ -typedef err_t (*netif_init_fn)(struct netif *netif); -/** Function prototype for netif->input functions. This function is saved as 'input' - * callback function in the netif struct. Call it when a packet has been received. - * - * @param p The received packet, copied into a pbuf - * @param inp The netif which received the packet - */ -typedef err_t (*netif_input_fn)(struct pbuf *p, struct netif *inp); -/** Function prototype for netif->output functions. Called by lwIP when a packet - * shall be sent. For ethernet netif, set this to 'etharp_output' and set - * 'linkoutput'. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (p->payload points to IP header) - * @param ipaddr The IP address to which the packet shall be sent - */ -typedef err_t (*netif_output_fn)(struct netif *netif, struct pbuf *p, - ip_addr_t *ipaddr); -/** Function prototype for netif->linkoutput functions. Only used for ethernet - * netifs. This function is called by ARP when a packet shall be sent. - * - * @param netif The netif which shall send a packet - * @param p The packet to send (raw ethernet packet) - */ -typedef err_t (*netif_linkoutput_fn)(struct netif *netif, struct pbuf *p); -/** Function prototype for netif status- or link-callback functions. */ -typedef void (*netif_status_callback_fn)(struct netif *netif); -/** Function prototype for netif igmp_mac_filter functions */ -typedef err_t (*netif_igmp_mac_filter_fn)(struct netif *netif, - ip_addr_t *group, u8_t action); - -/** Generic data structure used for all lwIP network interfaces. - * The following fields should be filled in by the initialization - * function for the device driver: hwaddr_len, hwaddr[], mtu, flags */ -struct netif { - /** pointer to next in linked list */ - struct netif *next; - - /** IP address configuration in network byte order */ - ip_addr_t ip_addr; - ip_addr_t netmask; - ip_addr_t gw; - - /** This function is called by the network device driver - * to pass a packet up the TCP/IP stack. ÏòIP²ãÊäÈëÊý¾Ý°ü*/ - netif_input_fn input; - /** This function is called by the IP module when it wants - * to send a packet on the interface. This function typically - * first resolves the hardware address, then sends the packet. ·¢ËÍIPÊý¾Ý°ü*/ - netif_output_fn output; - /** This function is called by the ARP module when it wants - * to send a packet on the interface. This function outputs - * the pbuf as-is on the link medium. µ×²ãÊý¾Ý°ü·¢ËÍ*/ - netif_linkoutput_fn linkoutput; -#if LWIP_NETIF_STATUS_CALLBACK - /** This function is called when the netif state is set to up or down - */ - netif_status_callback_fn status_callback; -#endif /* LWIP_NETIF_STATUS_CALLBACK */ -#if LWIP_NETIF_LINK_CALLBACK - /** This function is called when the netif link is set to up or down - */ - netif_status_callback_fn link_callback; -#endif /* LWIP_NETIF_LINK_CALLBACK */ - /** This field can be set by the device driver and could point - * to state information for the device. ×ÔÓÉÉèÖÃ×ֶΣ¬±ÈÈçÖ¸Ïòµ×²ãÉ豸Ïà¹ØÐÅÏ¢*/ - void *state; -#if LWIP_DHCP - /** the DHCP client state information for this netif */ - struct dhcp *dhcp; -#endif /* LWIP_DHCP */ -#if LWIP_AUTOIP - /** the AutoIP client state information for this netif */ - struct autoip *autoip; -#endif -#if LWIP_NETIF_HOSTNAME - /* the hostname for this netif, NULL is a valid value */ - char* hostname; -#endif /* LWIP_NETIF_HOSTNAME */ - /** maximum transfer unit (in bytes) ¸Ã½Ó¿ÚÔÊÐíµÄ×î´óÊý¾Ý°ü³¤¶È£¬¶àÊÇ1500*/ - u16_t mtu; - /** number of bytes used in hwaddr¸Ã½Ó¿ÚÎïÀíµØÖ·³¤¶È */ - u8_t hwaddr_len; - /** link level hardware address of this interface ¸Ã½Ó¿ÚÎïÀíµØÖ·*/ - u8_t hwaddr[NETIF_MAX_HWADDR_LEN]; - /** flags (see NETIF_FLAG_ above) ¸Ã½Ó¿Ú״̬¡¢ÊôÐÔ×Ö¶Î*/ - u8_t flags; - /** descriptive abbreviation ¸Ã½Ó¿ÚµÄÃû×Ö*/ - char name[2]; - /** number of this interface ¸Ã½Ó¿ÚµÄ±àºÅ*/ - u8_t num; -#if LWIP_SNMP - /** link type (from "snmp_ifType" enum from snmp.h) */ - u8_t link_type; - /** (estimate) link speed */ - u32_t link_speed; - /** timestamp at last change made (up/down) */ - u32_t ts; - /** counters */ - u32_t ifinoctets; - u32_t ifinucastpkts; - u32_t ifinnucastpkts; - u32_t ifindiscards; - u32_t ifoutoctets; - u32_t ifoutucastpkts; - u32_t ifoutnucastpkts; - u32_t ifoutdiscards; -#endif /* LWIP_SNMP */ -#if LWIP_IGMP - /** This function could be called to add or delete a entry in the multicast - filter table of the ethernet MAC.*/ - netif_igmp_mac_filter_fn igmp_mac_filter; -#endif /* LWIP_IGMP */ -#if LWIP_NETIF_HWADDRHINT - u8_t *addr_hint; -#endif /* LWIP_NETIF_HWADDRHINT */ -#if ENABLE_LOOPBACK - /* List of packets to be queued for ourselves. Ö¸Ïò·¢Ë͸ø×Ô¼ºµÄÊý¾Ý°üµÄpbuf*/ - struct pbuf *loop_first;//µÚÒ»¸ö - struct pbuf *loop_last;//×îºóÒ»¸ö -#if LWIP_LOOPBACK_MAX_PBUFS - u16_t loop_cnt_current; -#endif /* LWIP_LOOPBACK_MAX_PBUFS */ -#endif /* ENABLE_LOOPBACK */ -}; - -#if LWIP_SNMP -#define NETIF_INIT_SNMP(netif, type, speed) \ - /* use "snmp_ifType" enum from snmp.h for "type", snmp_ifType_ethernet_csmacd by example */ \ - (netif)->link_type = (type); \ - /* your link speed here (units: bits per second) */ \ - (netif)->link_speed = (speed); \ - (netif)->ts = 0; \ - (netif)->ifinoctets = 0; \ - (netif)->ifinucastpkts = 0; \ - (netif)->ifinnucastpkts = 0; \ - (netif)->ifindiscards = 0; \ - (netif)->ifoutoctets = 0; \ - (netif)->ifoutucastpkts = 0; \ - (netif)->ifoutnucastpkts = 0; \ - (netif)->ifoutdiscards = 0 -#else /* LWIP_SNMP */ -#define NETIF_INIT_SNMP(netif, type, speed) -#endif /* LWIP_SNMP */ - - -/** The list of network interfaces. */ -extern struct netif *netif_list; -/** The default network interface. */ -extern struct netif *netif_default; - -void netif_init(void)ICACHE_FLASH_ATTR; - -struct netif *netif_add(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, - ip_addr_t *gw, void *state, netif_init_fn init, netif_input_fn input)ICACHE_FLASH_ATTR; - -void -netif_set_addr(struct netif *netif, ip_addr_t *ipaddr, ip_addr_t *netmask, - ip_addr_t *gw)ICACHE_FLASH_ATTR; -void netif_remove(struct netif * netif)ICACHE_FLASH_ATTR; - -/* Returns a network interface given its name. The name is of the form - "et0", where the first two letters are the "name" field in the - netif structure, and the digit is in the num field in the same - structure. */ -struct netif *netif_find(char *name)ICACHE_FLASH_ATTR; - -void netif_set_default(struct netif *netif)ICACHE_FLASH_ATTR; - -void netif_set_ipaddr(struct netif *netif, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -void netif_set_netmask(struct netif *netif, ip_addr_t *netmask)ICACHE_FLASH_ATTR; -void netif_set_gw(struct netif *netif, ip_addr_t *gw)ICACHE_FLASH_ATTR; - -void netif_set_up(struct netif *netif)ICACHE_FLASH_ATTR; -void netif_set_down(struct netif *netif)ICACHE_FLASH_ATTR; -/** Ask if an interface is up */ -#define netif_is_up(netif) (((netif)->flags & NETIF_FLAG_UP) ? (u8_t)1 : (u8_t)0) - -#if LWIP_NETIF_STATUS_CALLBACK -void netif_set_status_callback(struct netif *netif, netif_status_callback_fn status_callback)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_STATUS_CALLBACK */ - -void netif_set_link_up(struct netif *netif)ICACHE_FLASH_ATTR; -void netif_set_link_down(struct netif *netif)ICACHE_FLASH_ATTR; -/** Ask if a link is up */ -#define netif_is_link_up(netif) (((netif)->flags & NETIF_FLAG_LINK_UP) ? (u8_t)1 : (u8_t)0) - -#if LWIP_NETIF_LINK_CALLBACK -void netif_set_link_callback(struct netif *netif, netif_status_callback_fn link_callback)ICACHE_FLASH_ATTR; -#endif /* LWIP_NETIF_LINK_CALLBACK */ - -#if LWIP_NETIF_HOSTNAME -#define netif_set_hostname(netif, name) do { if((netif) != NULL) { (netif)->hostname = name; }}while(0) -#define netif_get_hostname(netif) (((netif) != NULL) ? ((netif)->hostname) : NULL) -#endif /* LWIP_NETIF_HOSTNAME */ - -#if LWIP_IGMP -#define netif_set_igmp_mac_filter(netif, function) do { if((netif) != NULL) { (netif)->igmp_mac_filter = function; }}while(0) -#define netif_get_igmp_mac_filter(netif) (((netif) != NULL) ? ((netif)->igmp_mac_filter) : NULL) -#endif /* LWIP_IGMP */ - -#if ENABLE_LOOPBACK -err_t netif_loop_output(struct netif *netif, struct pbuf *p, ip_addr_t *dest_ip)ICACHE_FLASH_ATTR; -void netif_poll(struct netif *netif)ICACHE_FLASH_ATTR; -#if !LWIP_NETIF_LOOPBACK_MULTITHREADING -void netif_poll_all(void)ICACHE_FLASH_ATTR; -#endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ -#endif /* ENABLE_LOOPBACK */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_NETIF_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netifapi.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netifapi.h deleted file mode 100644 index 33318efa..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/netifapi.h +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - */ - -#ifndef __LWIP_NETIFAPI_H__ -#define __LWIP_NETIFAPI_H__ - -#include "lwip/opt.h" - -#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/netif.h" -#include "lwip/dhcp.h" -#include "lwip/autoip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -typedef void (*netifapi_void_fn)(struct netif *netif); -typedef err_t (*netifapi_errt_fn)(struct netif *netif); - -struct netifapi_msg_msg { -#if !LWIP_TCPIP_CORE_LOCKING - sys_sem_t sem; -#endif /* !LWIP_TCPIP_CORE_LOCKING */ - err_t err; - struct netif *netif; - union { - struct { - ip_addr_t *ipaddr; - ip_addr_t *netmask; - ip_addr_t *gw; - void *state; - netif_init_fn init; - netif_input_fn input; - } add; - struct { - netifapi_void_fn voidfunc; - netifapi_errt_fn errtfunc; - } common; - } msg; -}; - -struct netifapi_msg { - void (* function)(struct netifapi_msg_msg *msg); - struct netifapi_msg_msg msg; -}; - - -/* API for application */ -err_t netifapi_netif_add ( struct netif *netif, - ip_addr_t *ipaddr, - ip_addr_t *netmask, - ip_addr_t *gw, - void *state, - netif_init_fn init, - netif_input_fn input); - -err_t netifapi_netif_set_addr ( struct netif *netif, - ip_addr_t *ipaddr, - ip_addr_t *netmask, - ip_addr_t *gw ); - -err_t netifapi_netif_common ( struct netif *netif, - netifapi_void_fn voidfunc, - netifapi_errt_fn errtfunc); - -#define netifapi_netif_remove(n) netifapi_netif_common(n, netif_remove, NULL) -#define netifapi_netif_set_up(n) netifapi_netif_common(n, netif_set_up, NULL) -#define netifapi_netif_set_down(n) netifapi_netif_common(n, netif_set_down, NULL) -#define netifapi_netif_set_default(n) netifapi_netif_common(n, netif_set_default, NULL) -#define netifapi_dhcp_start(n) netifapi_netif_common(n, NULL, dhcp_start) -#define netifapi_dhcp_stop(n) netifapi_netif_common(n, dhcp_stop, NULL) -#define netifapi_autoip_start(n) netifapi_netif_common(n, NULL, autoip_start) -#define netifapi_autoip_stop(n) netifapi_netif_common(n, NULL, autoip_stop) - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_NETIF_API */ - -#endif /* __LWIP_NETIFAPI_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/opt.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/opt.h deleted file mode 100644 index 1a681c99..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/opt.h +++ /dev/null @@ -1,2043 +0,0 @@ -/** - * @file - * - * lwIP Options Configuration - */ - -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_OPT_H__ -#define __LWIP_OPT_H__ - -/* - * Include user defined options first. Anything not defined in these files - * will be set to standard values. Override anything you dont like! - */ -#include "include/lwipopts.h" -#include "lwip/debug.h" - -/* - ----------------------------------------------- - ---------- Platform specific locking ---------- - ----------------------------------------------- -*/ - -/** - * SYS_LIGHTWEIGHT_PROT==1: if you want inter-task protection for certain - * critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#ifndef SYS_LIGHTWEIGHT_PROT -#define SYS_LIGHTWEIGHT_PROT 0 -#endif - -/** - * NO_SYS==1: Provides VERY minimal functionality. Otherwise, - * use lwIP facilities. - */ -#ifndef NO_SYS -#define NO_SYS 1 -#endif - -/** - * NO_SYS_NO_TIMERS==1: Drop support for sys_timeout when NO_SYS==1 - * Mainly for compatibility to old versions. - */ -#ifndef NO_SYS_NO_TIMERS -#define NO_SYS_NO_TIMERS 1 -#endif - -/** - * MEMCPY: override this if you have a faster implementation at hand than the - * one included in your C library - */ -#ifndef MEMCPY -#define MEMCPY(dst,src,len) memcpy(dst,src,len) -#endif - -/** - * SMEMCPY: override this with care! Some compilers (e.g. gcc) can inline a - * call to memcpy() if the length is known at compile time and is small. - */ -#ifndef SMEMCPY -#define SMEMCPY(dst,src,len) memcpy(dst,src,len) -#endif - -/* - ------------------------------------ - ---------- Memory options ---------- - ------------------------------------ -*/ -/** - * MEM_LIBC_MALLOC==1: Use malloc/free/realloc provided by your C-library - * instead of the lwip internal allocator. Can save code size if you - * already use it. - */ -#ifndef MEM_LIBC_MALLOC -#define MEM_LIBC_MALLOC 0 -#endif - -/** -* MEMP_MEM_MALLOC==1: Use mem_malloc/mem_free instead of the lwip pool allocator. -* Especially useful with MEM_LIBC_MALLOC but handle with care regarding execution -* speed and usage from interrupts! -*/ -#ifndef MEMP_MEM_MALLOC -#define MEMP_MEM_MALLOC 0 -#endif - -/** - * MEM_ALIGNMENT: should be set to the alignment of the CPU - * 4 byte alignment -> #define MEM_ALIGNMENT 4 - * 2 byte alignment -> #define MEM_ALIGNMENT 2 - */ -#ifndef MEM_ALIGNMENT -#define MEM_ALIGNMENT 1 -#endif - -/** - * MEM_SIZE: the size of the heap memory. If the application will send - * a lot of data that needs to be copied, this should be set high. - */ -#ifndef MEM_SIZE -#define MEM_SIZE 1600 -#endif - -/** - * MEMP_SEPARATE_POOLS: if defined to 1, each pool is placed in its own array. - * This can be used to individually change the location of each pool. - * Default is one big array for all pools - */ -#ifndef MEMP_SEPARATE_POOLS -#define MEMP_SEPARATE_POOLS 0 -#endif - -/** - * MEMP_OVERFLOW_CHECK: memp overflow protection reserves a configurable - * amount of bytes before and after each memp element in every pool and fills - * it with a prominent default value. - * MEMP_OVERFLOW_CHECK == 0 no checking - * MEMP_OVERFLOW_CHECK == 1 checks each element when it is freed - * MEMP_OVERFLOW_CHECK >= 2 checks each element in every pool every time - * memp_malloc() or memp_free() is called (useful but slow!) - */ -#ifndef MEMP_OVERFLOW_CHECK -#define MEMP_OVERFLOW_CHECK 0 -#endif - -/** - * MEMP_SANITY_CHECK==1: run a sanity check after each memp_free() to make - * sure that there are no cycles in the linked lists. - */ -#ifndef MEMP_SANITY_CHECK -#define MEMP_SANITY_CHECK 0 -#endif - -/** - * MEM_USE_POOLS==1: Use an alternative to malloc() by allocating from a set - * of memory pools of various sizes. When mem_malloc is called, an element of - * the smallest pool that can provide the length needed is returned. - * To use this, MEMP_USE_CUSTOM_POOLS also has to be enabled. - */ -#ifndef MEM_USE_POOLS -#define MEM_USE_POOLS 0 -#endif - -/** - * MEM_USE_POOLS_TRY_BIGGER_POOL==1: if one malloc-pool is empty, try the next - * bigger pool - WARNING: THIS MIGHT WASTE MEMORY but it can make a system more - * reliable. */ -#ifndef MEM_USE_POOLS_TRY_BIGGER_POOL -#define MEM_USE_POOLS_TRY_BIGGER_POOL 0 -#endif - -/** - * MEMP_USE_CUSTOM_POOLS==1: whether to include a user file lwippools.h - * that defines additional pools beyond the "standard" ones required - * by lwIP. If you set this to 1, you must have lwippools.h in your - * inlude path somewhere. - */ -#ifndef MEMP_USE_CUSTOM_POOLS -#define MEMP_USE_CUSTOM_POOLS 0 -#endif - -/** - * Set this to 1 if you want to free PBUF_RAM pbufs (or call mem_free()) from - * interrupt context (or another context that doesn't allow waiting for a - * semaphore). - * If set to 1, mem_malloc will be protected by a semaphore and SYS_ARCH_PROTECT, - * while mem_free will only use SYS_ARCH_PROTECT. mem_malloc SYS_ARCH_UNPROTECTs - * with each loop so that mem_free can run. - * - * ATTENTION: As you can see from the above description, this leads to dis-/ - * enabling interrupts often, which can be slow! Also, on low memory, mem_malloc - * can need longer. - * - * If you don't want that, at least for NO_SYS=0, you can still use the following - * functions to enqueue a deallocation call which then runs in the tcpip_thread - * context: - * - pbuf_free_callback(p); - * - mem_free_callback(m); - */ -#ifndef LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT -#define LWIP_ALLOW_MEM_FREE_FROM_OTHER_CONTEXT 0 -#endif - -/* - ------------------------------------------------ - ---------- Internal Memory Pool Sizes ---------- - ------------------------------------------------ -*/ -/** - * MEMP_NUM_PBUF: the number of memp struct pbufs (used for PBUF_ROM and PBUF_REF). - * If the application sends a lot of data out of ROM (or other static memory), - * this should be set high. - */ -#ifndef MEMP_NUM_PBUF -#define MEMP_NUM_PBUF 16 -#endif - -/** - * MEMP_NUM_RAW_PCB: Number of raw connection PCBs - * (requires the LWIP_RAW option) - */ -#ifndef MEMP_NUM_RAW_PCB -#define MEMP_NUM_RAW_PCB 4 -#endif - -/** - * MEMP_NUM_UDP_PCB: the number of UDP protocol control blocks. One - * per active UDP "connection". - * (requires the LWIP_UDP option) - */ -#ifndef MEMP_NUM_UDP_PCB -#define MEMP_NUM_UDP_PCB 4 -#endif - -/** - * MEMP_NUM_TCP_PCB: the number of simulatenously active TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB -#define MEMP_NUM_TCP_PCB 5 -#endif - -/** - * MEMP_NUM_TCP_PCB_LISTEN: the number of listening TCP connections. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_PCB_LISTEN -#define MEMP_NUM_TCP_PCB_LISTEN 8 -#endif - -/** - * MEMP_NUM_TCP_SEG: the number of simultaneously queued TCP segments. - * (requires the LWIP_TCP option) - */ -#ifndef MEMP_NUM_TCP_SEG -#define MEMP_NUM_TCP_SEG 16 -#endif - -/** - * MEMP_NUM_REASSDATA: the number of IP packets simultaneously queued for - * reassembly (whole packets, not fragments!) - */ -#ifndef MEMP_NUM_REASSDATA -#define MEMP_NUM_REASSDATA 5 -#endif - -/** - * MEMP_NUM_FRAG_PBUF: the number of IP fragments simultaneously sent - * (fragments, not whole packets!). - * This is only used with IP_FRAG_USES_STATIC_BUF==0 and - * LWIP_NETIF_TX_SINGLE_PBUF==0 and only has to be > 1 with DMA-enabled MACs - * where the packet is not yet sent when netif->output returns. - */ -#ifndef MEMP_NUM_FRAG_PBUF -#define MEMP_NUM_FRAG_PBUF 15 -#endif - -/** - * MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing - * packets (pbufs) that are waiting for an ARP request (to resolve - * their destination address) to finish. - * (requires the ARP_QUEUEING option) - */ -#ifndef MEMP_NUM_ARP_QUEUE -#define MEMP_NUM_ARP_QUEUE 30 -#endif - -/** - * MEMP_NUM_IGMP_GROUP: The number of multicast groups whose network interfaces - * can be members et the same time (one per netif - allsystems group -, plus one - * per netif membership). - * (requires the LWIP_IGMP option) - */ -#ifndef MEMP_NUM_IGMP_GROUP -#define MEMP_NUM_IGMP_GROUP 8 -#endif - -/** - * MEMP_NUM_SYS_TIMEOUT: the number of simulateously active timeouts. - * (requires NO_SYS==0) - */ -#ifndef MEMP_NUM_SYS_TIMEOUT -#define MEMP_NUM_SYS_TIMEOUT 3 -#endif - -/** - * MEMP_NUM_NETBUF: the number of struct netbufs. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETBUF -#define MEMP_NUM_NETBUF 2 -#endif - -/** - * MEMP_NUM_NETCONN: the number of struct netconns. - * (only needed if you use the sequential API, like api_lib.c) - */ -#ifndef MEMP_NUM_NETCONN -#define MEMP_NUM_NETCONN 4 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_API: the number of struct tcpip_msg, which are used - * for callback/timeout API communication. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_API -#define MEMP_NUM_TCPIP_MSG_API 8 -#endif - -/** - * MEMP_NUM_TCPIP_MSG_INPKT: the number of struct tcpip_msg, which are used - * for incoming packets. - * (only needed if you use tcpip.c) - */ -#ifndef MEMP_NUM_TCPIP_MSG_INPKT -#define MEMP_NUM_TCPIP_MSG_INPKT 8 -#endif - -/** - * MEMP_NUM_SNMP_NODE: the number of leafs in the SNMP tree. - */ -#ifndef MEMP_NUM_SNMP_NODE -#define MEMP_NUM_SNMP_NODE 50 -#endif - -/** - * MEMP_NUM_SNMP_ROOTNODE: the number of branches in the SNMP tree. - * Every branch has one leaf (MEMP_NUM_SNMP_NODE) at least! - */ -#ifndef MEMP_NUM_SNMP_ROOTNODE -#define MEMP_NUM_SNMP_ROOTNODE 30 -#endif - -/** - * MEMP_NUM_SNMP_VARBIND: the number of concurrent requests (does not have to - * be changed normally) - 2 of these are used per request (1 for input, - * 1 for output) - */ -#ifndef MEMP_NUM_SNMP_VARBIND -#define MEMP_NUM_SNMP_VARBIND 2 -#endif - -/** - * MEMP_NUM_SNMP_VALUE: the number of OID or values concurrently used - * (does not have to be changed normally) - 3 of these are used per request - * (1 for the value read and 2 for OIDs - input and output) - */ -#ifndef MEMP_NUM_SNMP_VALUE -#define MEMP_NUM_SNMP_VALUE 3 -#endif - -/** - * MEMP_NUM_NETDB: the number of concurrently running lwip_addrinfo() calls - * (before freeing the corresponding memory using lwip_freeaddrinfo()). - */ -#ifndef MEMP_NUM_NETDB -#define MEMP_NUM_NETDB 1 -#endif - -/** - * MEMP_NUM_LOCALHOSTLIST: the number of host entries in the local host list - * if DNS_LOCAL_HOSTLIST_IS_DYNAMIC==1. - */ -#ifndef MEMP_NUM_LOCALHOSTLIST -#define MEMP_NUM_LOCALHOSTLIST 1 -#endif - -/** - * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE - * interfaces (only used with PPPOE_SUPPORT==1) - */ -#ifndef MEMP_NUM_PPPOE_INTERFACES -#define MEMP_NUM_PPPOE_INTERFACES 1 -#endif - -/** - * PBUF_POOL_SIZE: the number of buffers in the pbuf pool. - */ -#ifndef PBUF_POOL_SIZE -#define PBUF_POOL_SIZE 16 -#endif - -/* - --------------------------------- - ---------- ARP options ---------- - --------------------------------- -*/ -/** - * LWIP_ARP==1: Enable ARP functionality. - */ -#ifndef LWIP_ARP -#define LWIP_ARP 1 -#endif - -/** - * ARP_TABLE_SIZE: Number of active MAC-IP address pairs cached. - */ -#ifndef ARP_TABLE_SIZE -#define ARP_TABLE_SIZE 10 -#endif - -/** - * ARP_QUEUEING==1: Multiple outgoing packets are queued during hardware address - * resolution. By default, only the most recent packet is queued per IP address. - * This is sufficient for most protocols and mainly reduces TCP connection - * startup time. Set this to 1 if you know your application sends more than one - * packet in a row to an IP address that is not in the ARP cache. - */ -#ifndef ARP_QUEUEING -#define ARP_QUEUEING 0 -#endif - -/** - * ETHARP_TRUST_IP_MAC==1: Incoming IP packets cause the ARP table to be - * updated with the source MAC and IP addresses supplied in the packet. - * You may want to disable this if you do not trust LAN peers to have the - * correct addresses, or as a limited approach to attempt to handle - * spoofing. If disabled, lwIP will need to make a new ARP request if - * the peer is not already in the ARP table, adding a little latency. - * The peer *is* in the ARP table if it requested our address before. - * Also notice that this slows down input processing of every IP packet! - */ -#ifndef ETHARP_TRUST_IP_MAC -#define ETHARP_TRUST_IP_MAC 0 -#endif - -/** - * ETHARP_SUPPORT_VLAN==1: support receiving ethernet packets with VLAN header. - * Additionally, you can define ETHARP_VLAN_CHECK to an u16_t VLAN ID to check. - * If ETHARP_VLAN_CHECK is defined, only VLAN-traffic for this VLAN is accepted. - * If ETHARP_VLAN_CHECK is not defined, all traffic is accepted. - */ -#ifndef ETHARP_SUPPORT_VLAN -#define ETHARP_SUPPORT_VLAN 0 -#endif - -/** LWIP_ETHERNET==1: enable ethernet support for PPPoE even though ARP - * might be disabled - */ -#ifndef LWIP_ETHERNET -#define LWIP_ETHERNET (LWIP_ARP || PPPOE_SUPPORT) -#endif - -/** ETH_PAD_SIZE: number of bytes added before the ethernet header to ensure - * alignment of payload after that header. Since the header is 14 bytes long, - * without this padding e.g. addresses in the IP header will not be aligned - * on a 32-bit boundary, so setting this to 2 can speed up 32-bit-platforms. - */ -#ifndef ETH_PAD_SIZE -#define ETH_PAD_SIZE 0 -#endif - -/** ETHARP_SUPPORT_STATIC_ENTRIES==1: enable code to support static ARP table - * entries (using etharp_add_static_entry/etharp_remove_static_entry). - */ -#ifndef ETHARP_SUPPORT_STATIC_ENTRIES -#define ETHARP_SUPPORT_STATIC_ENTRIES 0 -#endif - - -/* - -------------------------------- - ---------- IP options ---------- - -------------------------------- -*/ -/** - * IP_FORWARD==1: Enables the ability to forward IP packets across network - * interfaces. If you are going to run lwIP on a device with only one network - * interface, define this to 0. - */ -#ifndef IP_FORWARD -#define IP_FORWARD 0 -#endif - -/** - * IP_OPTIONS_ALLOWED: Defines the behavior for IP options. - * IP_OPTIONS_ALLOWED==0: All packets with IP options are dropped. - * IP_OPTIONS_ALLOWED==1: IP options are allowed (but not parsed). - */ -#ifndef IP_OPTIONS_ALLOWED -#define IP_OPTIONS_ALLOWED 1 -#endif - -/** - * IP_REASSEMBLY==1: Reassemble incoming fragmented IP packets. Note that - * this option does not affect outgoing packet sizes, which can be controlled - * via IP_FRAG. - */ -#ifndef IP_REASSEMBLY -#define IP_REASSEMBLY 0 -#endif - -/** - * IP_FRAG==1: Fragment outgoing IP packets if their size exceeds MTU. Note - * that this option does not affect incoming packet sizes, which can be - * controlled via IP_REASSEMBLY. - */ -#ifndef IP_FRAG -#define IP_FRAG 1 -#endif - -/** - * IP_REASS_MAXAGE: Maximum time (in multiples of IP_TMR_INTERVAL - so seconds, normally) - * a fragmented IP packet waits for all fragments to arrive. If not all fragments arrived - * in this time, the whole packet is discarded. - */ -#ifndef IP_REASS_MAXAGE -#define IP_REASS_MAXAGE 3 -#endif - -/** - * IP_REASS_MAX_PBUFS: Total maximum amount of pbufs waiting to be reassembled. - * Since the received pbufs are enqueued, be sure to configure - * PBUF_POOL_SIZE > IP_REASS_MAX_PBUFS so that the stack is still able to receive - * packets even if the maximum amount of fragments is enqueued for reassembly! - */ -#ifndef IP_REASS_MAX_PBUFS -#define IP_REASS_MAX_PBUFS 10 -#endif - -/** - * IP_FRAG_USES_STATIC_BUF==1: Use a static MTU-sized buffer for IP - * fragmentation. Otherwise pbufs are allocated and reference the original - * packet data to be fragmented (or with LWIP_NETIF_TX_SINGLE_PBUF==1, - * new PBUF_RAM pbufs are used for fragments). - * ATTENTION: IP_FRAG_USES_STATIC_BUF==1 may not be used for DMA-enabled MACs! - */ -#ifndef IP_FRAG_USES_STATIC_BUF -#define IP_FRAG_USES_STATIC_BUF 0 -#endif - -/** - * IP_FRAG_MAX_MTU: Assumed max MTU on any interface for IP frag buffer - * (requires IP_FRAG_USES_STATIC_BUF==1) - */ -#if IP_FRAG_USES_STATIC_BUF && !defined(IP_FRAG_MAX_MTU) -#define IP_FRAG_MAX_MTU 1500 -#endif - -/** - * IP_DEFAULT_TTL: Default value for Time-To-Live used by transport layers. - */ -#ifndef IP_DEFAULT_TTL -#define IP_DEFAULT_TTL 255 -#endif - -/** - * IP_SOF_BROADCAST=1: Use the SOF_BROADCAST field to enable broadcast - * filter per pcb on udp and raw send operations. To enable broadcast filter - * on recv operations, you also have to set IP_SOF_BROADCAST_RECV=1. - */ -#ifndef IP_SOF_BROADCAST -#define IP_SOF_BROADCAST 0 -#endif - -/** - * IP_SOF_BROADCAST_RECV (requires IP_SOF_BROADCAST=1) enable the broadcast - * filter on recv operations. - */ -#ifndef IP_SOF_BROADCAST_RECV -#define IP_SOF_BROADCAST_RECV 0 -#endif - -/* - ---------------------------------- - ---------- ICMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_ICMP==1: Enable ICMP module inside the IP stack. - * Be careful, disable that make your product non-compliant to RFC1122 - */ -#ifndef LWIP_ICMP -#define LWIP_ICMP 1 -#endif - -/** - * ICMP_TTL: Default value for Time-To-Live used by ICMP packets. - */ -#ifndef ICMP_TTL -#define ICMP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_BROADCAST_PING==1: respond to broadcast pings (default is unicast only) - */ -#ifndef LWIP_BROADCAST_PING -#define LWIP_BROADCAST_PING 0 -#endif - -/** - * LWIP_MULTICAST_PING==1: respond to multicast pings (default is unicast only) - */ -#ifndef LWIP_MULTICAST_PING -#define LWIP_MULTICAST_PING 0 -#endif - -/* - --------------------------------- - ---------- RAW options ---------- - --------------------------------- -*/ -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef LWIP_RAW -#define LWIP_RAW 1 -#endif - -/** - * LWIP_RAW==1: Enable application layer to hook into the IP layer itself. - */ -#ifndef RAW_TTL -#define RAW_TTL (IP_DEFAULT_TTL) -#endif - -/* - ---------------------------------- - ---------- DHCP options ---------- - ---------------------------------- -*/ -/** - * LWIP_DHCP==1: Enable DHCP module. - */ -#ifndef LWIP_DHCP -#define LWIP_DHCP 0 -#endif - -/** - * DHCP_DOES_ARP_CHECK==1: Do an ARP check on the offered address. - */ -#ifndef DHCP_DOES_ARP_CHECK -#define DHCP_DOES_ARP_CHECK ((LWIP_DHCP) && (LWIP_ARP)) -#endif - -/* - ------------------------------------ - ---------- AUTOIP options ---------- - ------------------------------------ -*/ -/** - * LWIP_AUTOIP==1: Enable AUTOIP module. - */ -#ifndef LWIP_AUTOIP -#define LWIP_AUTOIP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP==1: Allow DHCP and AUTOIP to be both enabled on - * the same interface at the same time. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP -#define LWIP_DHCP_AUTOIP_COOP 0 -#endif - -/** - * LWIP_DHCP_AUTOIP_COOP_TRIES: Set to the number of DHCP DISCOVER probes - * that should be sent before falling back on AUTOIP. This can be set - * as low as 1 to get an AutoIP address very quickly, but you should - * be prepared to handle a changing IP address when DHCP overrides - * AutoIP. - */ -#ifndef LWIP_DHCP_AUTOIP_COOP_TRIES -#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 -#endif - -/* - ---------------------------------- - ---------- SNMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_SNMP==1: Turn on SNMP module. UDP must be available for SNMP - * transport. - */ -#ifndef LWIP_SNMP -#define LWIP_SNMP 0 -#endif - -/** - * SNMP_CONCURRENT_REQUESTS: Number of concurrent requests the module will - * allow. At least one request buffer is required. - * Does not have to be changed unless external MIBs answer request asynchronously - */ -#ifndef SNMP_CONCURRENT_REQUESTS -#define SNMP_CONCURRENT_REQUESTS 1 -#endif - -/** - * SNMP_TRAP_DESTINATIONS: Number of trap destinations. At least one trap - * destination is required - */ -#ifndef SNMP_TRAP_DESTINATIONS -#define SNMP_TRAP_DESTINATIONS 1 -#endif - -/** - * SNMP_PRIVATE_MIB: - * When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. - */ -#ifndef SNMP_PRIVATE_MIB -#define SNMP_PRIVATE_MIB 0 -#endif - -/** - * Only allow SNMP write actions that are 'safe' (e.g. disabeling netifs is not - * a safe action and disabled when SNMP_SAFE_REQUESTS = 1). - * Unsafe requests are disabled by default! - */ -#ifndef SNMP_SAFE_REQUESTS -#define SNMP_SAFE_REQUESTS 1 -#endif - -/** - * The maximum length of strings used. This affects the size of - * MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_OCTET_STRING_LEN -#define SNMP_MAX_OCTET_STRING_LEN 127 -#endif - -/** - * The maximum depth of the SNMP tree. - * With private MIBs enabled, this depends on your MIB! - * This affects the size of MEMP_SNMP_VALUE elements. - */ -#ifndef SNMP_MAX_TREE_DEPTH -#define SNMP_MAX_TREE_DEPTH 15 -#endif - -/** - * The size of the MEMP_SNMP_VALUE elements, normally calculated from - * SNMP_MAX_OCTET_STRING_LEN and SNMP_MAX_TREE_DEPTH. - */ -#ifndef SNMP_MAX_VALUE_SIZE -#define SNMP_MAX_VALUE_SIZE LWIP_MAX((SNMP_MAX_OCTET_STRING_LEN)+1, sizeof(s32_t)*(SNMP_MAX_TREE_DEPTH)) -#endif - -/* - ---------------------------------- - ---------- IGMP options ---------- - ---------------------------------- -*/ -/** - * LWIP_IGMP==1: Turn on IGMP module. - */ -#ifndef LWIP_IGMP -#define LWIP_IGMP 0 -#endif - -/* - ---------------------------------- - ---------- DNS options ----------- - ---------------------------------- -*/ -/** - * LWIP_DNS==1: Turn on DNS module. UDP must be available for DNS - * transport. - */ -#ifndef LWIP_DNS -#define LWIP_DNS 0 -#endif - -/** DNS maximum number of entries to maintain locally. */ -#ifndef DNS_TABLE_SIZE -#define DNS_TABLE_SIZE 4 -#endif - -/** DNS maximum host name length supported in the name table. */ -#ifndef DNS_MAX_NAME_LENGTH -#define DNS_MAX_NAME_LENGTH 256 -#endif - -/** The maximum of DNS servers */ -#ifndef DNS_MAX_SERVERS -#define DNS_MAX_SERVERS 2 -#endif - -/** DNS do a name checking between the query and the response. */ -#ifndef DNS_DOES_NAME_CHECK -#define DNS_DOES_NAME_CHECK 1 -#endif - -/** DNS message max. size. Default value is RFC compliant. */ -#ifndef DNS_MSG_SIZE -#define DNS_MSG_SIZE 512 -#endif - -/** DNS_LOCAL_HOSTLIST: Implements a local host-to-address list. If enabled, - * you have to define - * #define DNS_LOCAL_HOSTLIST_INIT {{"host1", 0x123}, {"host2", 0x234}} - * (an array of structs name/address, where address is an u32_t in network - * byte order). - * - * Instead, you can also use an external function: - * #define DNS_LOOKUP_LOCAL_EXTERN(x) extern u32_t my_lookup_function(const char *name) - * that returns the IP address or INADDR_NONE if not found. - */ -#ifndef DNS_LOCAL_HOSTLIST -#define DNS_LOCAL_HOSTLIST 0 -#endif /* DNS_LOCAL_HOSTLIST */ - -/** If this is turned on, the local host-list can be dynamically changed - * at runtime. */ -#ifndef DNS_LOCAL_HOSTLIST_IS_DYNAMIC -#define DNS_LOCAL_HOSTLIST_IS_DYNAMIC 0 -#endif /* DNS_LOCAL_HOSTLIST_IS_DYNAMIC */ - -/* - --------------------------------- - ---------- UDP options ---------- - --------------------------------- -*/ -/** - * LWIP_UDP==1: Turn on UDP. - */ -#ifndef LWIP_UDP -#define LWIP_UDP 1 -#endif - -/** - * LWIP_UDPLITE==1: Turn on UDP-Lite. (Requires LWIP_UDP) - */ -#ifndef LWIP_UDPLITE -#define LWIP_UDPLITE 0 -#endif - -/** - * UDP_TTL: Default Time-To-Live value. - */ -#ifndef UDP_TTL -#define UDP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * LWIP_NETBUF_RECVINFO==1: append destination addr and port to every netbuf. - */ -#ifndef LWIP_NETBUF_RECVINFO -#define LWIP_NETBUF_RECVINFO 0 -#endif - -/* - --------------------------------- - ---------- TCP options ---------- - --------------------------------- -*/ -/** - * LWIP_TCP==1: Turn on TCP. - */ -#ifndef LWIP_TCP -#define LWIP_TCP 1 -#endif - -/** - * TCP_TTL: Default Time-To-Live value. - */ -#ifndef TCP_TTL -#define TCP_TTL (IP_DEFAULT_TTL) -#endif - -/** - * TCP_WND: The size of a TCP window. This must be at least - * (2 * TCP_MSS) for things to work well - */ -#ifndef TCP_WND -#define TCP_WND (4 * TCP_MSS) -#endif - -/** - * TCP_MAXRTX: Maximum number of retransmissions of data segments. - */ -#ifndef TCP_MAXRTX -#define TCP_MAXRTX 12 -#endif - -/** - * TCP_SYNMAXRTX: Maximum number of retransmissions of SYN segments. - */ -#ifndef TCP_SYNMAXRTX -#define TCP_SYNMAXRTX 6 -#endif - -/** - * TCP_QUEUE_OOSEQ==1: TCP will queue segments that arrive out of order. - * Define to 0 if your device is low on memory. - */ -#ifndef TCP_QUEUE_OOSEQ -#define TCP_QUEUE_OOSEQ (LWIP_TCP) -#endif - -/** - * TCP_MSS: TCP Maximum segment size. (default is 536, a conservative default, - * you might want to increase this.) - * For the receive side, this MSS is advertised to the remote side - * when opening a connection. For the transmit size, this MSS sets - * an upper limit on the MSS advertised by the remote host. - */ -#ifndef TCP_MSS -#define TCP_MSS 536 -#endif - -/** - * TCP_CALCULATE_EFF_SEND_MSS: "The maximum size of a segment that TCP really - * sends, the 'effective send MSS,' MUST be the smaller of the send MSS (which - * reflects the available reassembly buffer size at the remote host) and the - * largest size permitted by the IP layer" (RFC 1122) - * Setting this to 1 enables code that checks TCP_MSS against the MTU of the - * netif used for a connection and limits the MSS if it would be too big otherwise. - */ -#ifndef TCP_CALCULATE_EFF_SEND_MSS -#define TCP_CALCULATE_EFF_SEND_MSS 1 -#endif - - -/** - * TCP_SND_BUF: TCP sender buffer space (bytes). - */ -#ifndef TCP_SND_BUF -#define TCP_SND_BUF 256 -#endif - -/** - * TCP_SND_QUEUELEN: TCP sender buffer space (pbufs). This must be at least - * as much as (2 * TCP_SND_BUF/TCP_MSS) for things to work. - */ -#ifndef TCP_SND_QUEUELEN -#define TCP_SND_QUEUELEN ((4 * (TCP_SND_BUF) + (TCP_MSS - 1))/(TCP_MSS)) -#endif - -/** - * TCP_SNDLOWAT: TCP writable space (bytes). This must be less than - * TCP_SND_BUF. It is the amount of space which must be available in the - * TCP snd_buf for select to return writable (combined with TCP_SNDQUEUELOWAT). - */ -#ifndef TCP_SNDLOWAT -#define TCP_SNDLOWAT ((TCP_SND_BUF)/2) -#endif - -/** - * TCP_SNDQUEUELOWAT: TCP writable bufs (pbuf count). This must be grater - * than TCP_SND_QUEUELEN. If the number of pbufs queued on a pcb drops below - * this number, select returns writable (combined with TCP_SNDLOWAT). - */ -#ifndef TCP_SNDQUEUELOWAT -#define TCP_SNDQUEUELOWAT ((TCP_SND_QUEUELEN)/2) -#endif - -/** - * TCP_LISTEN_BACKLOG: Enable the backlog option for tcp listen pcb. - */ -#ifndef TCP_LISTEN_BACKLOG -#define TCP_LISTEN_BACKLOG 0 -#endif - -/** - * The maximum allowed backlog for TCP listen netconns. - * This backlog is used unless another is explicitly specified. - * 0xff is the maximum (u8_t). - */ -#ifndef TCP_DEFAULT_LISTEN_BACKLOG -#define TCP_DEFAULT_LISTEN_BACKLOG 0xff -#endif - -/** - * TCP_OVERSIZE: The maximum number of bytes that tcp_write may - * allocate ahead of time in an attempt to create shorter pbuf chains - * for transmission. The meaningful range is 0 to TCP_MSS. Some - * suggested values are: - * - * 0: Disable oversized allocation. Each tcp_write() allocates a new - pbuf (old behaviour). - * 1: Allocate size-aligned pbufs with minimal excess. Use this if your - * scatter-gather DMA requires aligned fragments. - * 128: Limit the pbuf/memory overhead to 20%. - * TCP_MSS: Try to create unfragmented TCP packets. - * TCP_MSS/4: Try to create 4 fragments or less per TCP packet. - */ -#ifndef TCP_OVERSIZE -#define TCP_OVERSIZE TCP_MSS -#endif - -/** - * LWIP_TCP_TIMESTAMPS==1: support the TCP timestamp option. - */ -#ifndef LWIP_TCP_TIMESTAMPS -#define LWIP_TCP_TIMESTAMPS 0 -#endif - -/** - * TCP_WND_UPDATE_THRESHOLD: difference in window to trigger an - * explicit window update - */ -#ifndef TCP_WND_UPDATE_THRESHOLD -#define TCP_WND_UPDATE_THRESHOLD (TCP_WND / 4) -#endif - -/** - * LWIP_EVENT_API and LWIP_CALLBACK_API: Only one of these should be set to 1. - * LWIP_EVENT_API==1: The user defines lwip_tcp_event() to receive all - * events (accept, sent, etc) that happen in the system. - * LWIP_CALLBACK_API==1: The PCB callback function is called directly - * for the event. - */ -//#ifndef LWIP_EVENT_API -//#define LWIP_EVENT_API 0 -//#define LWIP_CALLBACK_API 1 -//#else -//#define LWIP_EVENT_API 1 -//#define LWIP_CALLBACK_API 0 -//#endif - - -/* - ---------------------------------- - ---------- Pbuf options ---------- - ---------------------------------- -*/ -/** - * PBUF_LINK_HLEN: the number of bytes that should be allocated for a - * link level header. The default is 14, the standard value for - * Ethernet. - */ -#ifndef PBUF_LINK_HLEN -#define PBUF_LINK_HLEN (14 + ETH_PAD_SIZE) -#endif - -/** - * PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. The default is - * designed to accomodate single full size TCP frame in one pbuf, including - * TCP_MSS, IP header, and link header. - */ -#ifndef PBUF_POOL_BUFSIZE -#define PBUF_POOL_BUFSIZE LWIP_MEM_ALIGN_SIZE(TCP_MSS+40+PBUF_LINK_HLEN) -#endif - -/* - ------------------------------------------------ - ---------- Network Interfaces options ---------- - ------------------------------------------------ -*/ -/** - * LWIP_NETIF_HOSTNAME==1: use DHCP_OPTION_HOSTNAME with netif's hostname - * field. - */ -#ifndef LWIP_NETIF_HOSTNAME -#define LWIP_NETIF_HOSTNAME 0 -#endif - -/** - * LWIP_NETIF_API==1: Support netif api (in netifapi.c) - */ -#ifndef LWIP_NETIF_API -#define LWIP_NETIF_API 0 -#endif - -/** - * LWIP_NETIF_STATUS_CALLBACK==1: Support a callback function whenever an interface - * changes its up/down status (i.e., due to DHCP IP acquistion) - */ -#ifndef LWIP_NETIF_STATUS_CALLBACK -#define LWIP_NETIF_STATUS_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_LINK_CALLBACK==1: Support a callback function from an interface - * whenever the link changes (i.e., link down) - */ -#ifndef LWIP_NETIF_LINK_CALLBACK -#define LWIP_NETIF_LINK_CALLBACK 0 -#endif - -/** - * LWIP_NETIF_HWADDRHINT==1: Cache link-layer-address hints (e.g. table - * indices) in struct netif. TCP and UDP can make use of this to prevent - * scanning the ARP table for every sent packet. While this is faster for big - * ARP tables or many concurrent connections, it might be counterproductive - * if you have a tiny ARP table or if there never are concurrent connections. - */ -#ifndef LWIP_NETIF_HWADDRHINT -#define LWIP_NETIF_HWADDRHINT 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP - * address equal to the netif IP address, looping them back up the stack. - */ -#ifndef LWIP_NETIF_LOOPBACK -#define LWIP_NETIF_LOOPBACK 1 -#endif - -/** - * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback - * sending for each netif (0 = disabled) - */ -#ifndef LWIP_LOOPBACK_MAX_PBUFS -#define LWIP_LOOPBACK_MAX_PBUFS 0 -#endif - -/** - * LWIP_NETIF_LOOPBACK_MULTITHREADING: Indicates whether threading is enabled in - * the system, as netifs must change how they behave depending on this setting - * for the LWIP_NETIF_LOOPBACK option to work. - * Setting this is needed to avoid reentering non-reentrant functions like - * tcp_input(). - * LWIP_NETIF_LOOPBACK_MULTITHREADING==1: Indicates that the user is using a - * multithreaded environment like tcpip.c. In this case, netif->input() - * is called directly. - * LWIP_NETIF_LOOPBACK_MULTITHREADING==0: Indicates a polling (or NO_SYS) setup. - * The packets are put on a list and netif_poll() must be called in - * the main application loop. - */ -#ifndef LWIP_NETIF_LOOPBACK_MULTITHREADING -#define LWIP_NETIF_LOOPBACK_MULTITHREADING (!NO_SYS) -#endif - -/** - * LWIP_NETIF_TX_SINGLE_PBUF: if this is set to 1, lwIP tries to put all data - * to be sent into one single pbuf. This is for compatibility with DMA-enabled - * MACs that do not support scatter-gather. - * Beware that this might involve CPU-memcpy before transmitting that would not - * be needed without this flag! Use this only if you need to! - * - * @todo: TCP and IP-frag do not work with this, yet: - */ -#ifndef LWIP_NETIF_TX_SINGLE_PBUF -#define LWIP_NETIF_TX_SINGLE_PBUF 0 -#endif /* LWIP_NETIF_TX_SINGLE_PBUF */ - -/* - ------------------------------------ - ---------- LOOPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_LOOPIF==1: Support loop interface (127.0.0.1) and loopif.c - */ -#ifndef LWIP_HAVE_LOOPIF -#define LWIP_HAVE_LOOPIF 1 -#endif - -/* - ------------------------------------ - ---------- SLIPIF options ---------- - ------------------------------------ -*/ -/** - * LWIP_HAVE_SLIPIF==1: Support slip interface and slipif.c - */ -#ifndef LWIP_HAVE_SLIPIF -#define LWIP_HAVE_SLIPIF 0 -#endif - -/* - ------------------------------------ - ---------- Thread options ---------- - ------------------------------------ -*/ -/** - * TCPIP_THREAD_NAME: The name assigned to the main tcpip thread. - */ -#ifndef TCPIP_THREAD_NAME -#define TCPIP_THREAD_NAME "tcpip_thread" -#endif - -/** - * TCPIP_THREAD_STACKSIZE: The stack size used by the main tcpip thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_STACKSIZE -#define TCPIP_THREAD_STACKSIZE 0 -#endif - -/** - * TCPIP_THREAD_PRIO: The priority assigned to the main tcpip thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef TCPIP_THREAD_PRIO -#define TCPIP_THREAD_PRIO 1 -#endif - -/** - * TCPIP_MBOX_SIZE: The mailbox size for the tcpip thread messages - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when tcpip_init is called. - */ -#ifndef TCPIP_MBOX_SIZE -#define TCPIP_MBOX_SIZE 0 -#endif - -/** - * SLIPIF_THREAD_NAME: The name assigned to the slipif_loop thread. - */ -#ifndef SLIPIF_THREAD_NAME -#define SLIPIF_THREAD_NAME "slipif_loop" -#endif - -/** - * SLIP_THREAD_STACKSIZE: The stack size used by the slipif_loop thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_STACKSIZE -#define SLIPIF_THREAD_STACKSIZE 0 -#endif - -/** - * SLIPIF_THREAD_PRIO: The priority assigned to the slipif_loop thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef SLIPIF_THREAD_PRIO -#define SLIPIF_THREAD_PRIO 1 -#endif - -/** - * PPP_THREAD_NAME: The name assigned to the pppInputThread. - */ -#ifndef PPP_THREAD_NAME -#define PPP_THREAD_NAME "pppInputThread" -#endif - -/** - * PPP_THREAD_STACKSIZE: The stack size used by the pppInputThread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_STACKSIZE -#define PPP_THREAD_STACKSIZE 0 -#endif - -/** - * PPP_THREAD_PRIO: The priority assigned to the pppInputThread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef PPP_THREAD_PRIO -#define PPP_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_THREAD_NAME: The name assigned to any other lwIP thread. - */ -#ifndef DEFAULT_THREAD_NAME -#define DEFAULT_THREAD_NAME "lwIP" -#endif - -/** - * DEFAULT_THREAD_STACKSIZE: The stack size used by any other lwIP thread. - * The stack size value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_STACKSIZE -#define DEFAULT_THREAD_STACKSIZE 0 -#endif - -/** - * DEFAULT_THREAD_PRIO: The priority assigned to any other lwIP thread. - * The priority value itself is platform-dependent, but is passed to - * sys_thread_new() when the thread is created. - */ -#ifndef DEFAULT_THREAD_PRIO -#define DEFAULT_THREAD_PRIO 1 -#endif - -/** - * DEFAULT_RAW_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_RAW. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_RAW_RECVMBOX_SIZE -#define DEFAULT_RAW_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_UDP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_UDP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_UDP_RECVMBOX_SIZE -#define DEFAULT_UDP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_TCP_RECVMBOX_SIZE: The mailbox size for the incoming packets on a - * NETCONN_TCP. The queue size value itself is platform-dependent, but is passed - * to sys_mbox_new() when the recvmbox is created. - */ -#ifndef DEFAULT_TCP_RECVMBOX_SIZE -#define DEFAULT_TCP_RECVMBOX_SIZE 0 -#endif - -/** - * DEFAULT_ACCEPTMBOX_SIZE: The mailbox size for the incoming connections. - * The queue size value itself is platform-dependent, but is passed to - * sys_mbox_new() when the acceptmbox is created. - */ -#ifndef DEFAULT_ACCEPTMBOX_SIZE -#define DEFAULT_ACCEPTMBOX_SIZE 0 -#endif - -/* - ---------------------------------------------- - ---------- Sequential layer options ---------- - ---------------------------------------------- -*/ -/** - * LWIP_TCPIP_CORE_LOCKING: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING -#define LWIP_TCPIP_CORE_LOCKING 0 -#endif - -/** - * LWIP_TCPIP_CORE_LOCKING_INPUT: (EXPERIMENTAL!) - * Don't use it if you're not an active lwIP project member - */ -#ifndef LWIP_TCPIP_CORE_LOCKING_INPUT -#define LWIP_TCPIP_CORE_LOCKING_INPUT 0 -#endif - -/** - * LWIP_NETCONN==1: Enable Netconn API (require to use api_lib.c) - */ -#ifndef LWIP_NETCONN -#define LWIP_NETCONN 0 -#endif - -/** LWIP_TCPIP_TIMEOUT==1: Enable tcpip_timeout/tcpip_untimeout tod create - * timers running in tcpip_thread from another thread. - */ -#ifndef LWIP_TCPIP_TIMEOUT -#define LWIP_TCPIP_TIMEOUT 1 -#endif - -/* - ------------------------------------ - ---------- Socket options ---------- - ------------------------------------ -*/ -/** - * LWIP_SOCKET==1: Enable Socket API (require to use sockets.c) - */ -#ifndef LWIP_SOCKET -#define LWIP_SOCKET 0 -#endif - -/** - * LWIP_COMPAT_SOCKETS==1: Enable BSD-style sockets functions names. - * (only used if you use sockets.c) - */ -#ifndef LWIP_COMPAT_SOCKETS -#define LWIP_COMPAT_SOCKETS 1 -#endif - -/** - * LWIP_POSIX_SOCKETS_IO_NAMES==1: Enable POSIX-style sockets functions names. - * Disable this option if you use a POSIX operating system that uses the same - * names (read, write & close). (only used if you use sockets.c) - */ -#ifndef LWIP_POSIX_SOCKETS_IO_NAMES -#define LWIP_POSIX_SOCKETS_IO_NAMES 1 -#endif - -/** - * LWIP_TCP_KEEPALIVE==1: Enable TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT - * options processing. Note that TCP_KEEPIDLE and TCP_KEEPINTVL have to be set - * in seconds. (does not require sockets.c, and will affect tcp.c) - */ -#ifndef LWIP_TCP_KEEPALIVE -#define LWIP_TCP_KEEPALIVE 0 -#endif - -/** - * LWIP_SO_RCVTIMEO==1: Enable SO_RCVTIMEO processing. - */ -#ifndef LWIP_SO_RCVTIMEO -#define LWIP_SO_RCVTIMEO 0 -#endif - -/** - * LWIP_SO_RCVBUF==1: Enable SO_RCVBUF processing. - */ -#ifndef LWIP_SO_RCVBUF -#define LWIP_SO_RCVBUF 0 -#endif - -/** - * If LWIP_SO_RCVBUF is used, this is the default value for recv_bufsize. - */ -#ifndef RECV_BUFSIZE_DEFAULT -#define RECV_BUFSIZE_DEFAULT INT_MAX -#endif - -/** - * SO_REUSE==1: Enable SO_REUSEADDR option. - */ -#ifndef SO_REUSE -#define SO_REUSE 0 -#endif - -/** - * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets - * to all local matches if SO_REUSEADDR is turned on. - * WARNING: Adds a memcpy for every packet if passing to more than one pcb! - */ -#ifndef SO_REUSE_RXTOALL -#define SO_REUSE_RXTOALL 0 -#endif - -/* - ---------------------------------------- - ---------- Statistics options ---------- - ---------------------------------------- -*/ -/** - * LWIP_STATS==1: Enable statistics collection in lwip_stats. - */ -#ifndef LWIP_STATS -#define LWIP_STATS 1 -#endif - -#if LWIP_STATS - -/** - * LWIP_STATS_DISPLAY==1: Compile in the statistics output functions. - */ -#ifndef LWIP_STATS_DISPLAY -#define LWIP_STATS_DISPLAY 0 -#endif - -/** - * LINK_STATS==1: Enable link stats. - */ -#ifndef LINK_STATS -#define LINK_STATS 1 -#endif - -/** - * ETHARP_STATS==1: Enable etharp stats. - */ -#ifndef ETHARP_STATS -#define ETHARP_STATS (LWIP_ARP) -#endif - -/** - * IP_STATS==1: Enable IP stats. - */ -#ifndef IP_STATS -#define IP_STATS 1 -#endif - -/** - * IPFRAG_STATS==1: Enable IP fragmentation stats. Default is - * on if using either frag or reass. - */ -#ifndef IPFRAG_STATS -#define IPFRAG_STATS (IP_REASSEMBLY || IP_FRAG) -#endif - -/** - * ICMP_STATS==1: Enable ICMP stats. - */ -#ifndef ICMP_STATS -#define ICMP_STATS 1 -#endif - -/** - * IGMP_STATS==1: Enable IGMP stats. - */ -#ifndef IGMP_STATS -#define IGMP_STATS (LWIP_IGMP) -#endif - -/** - * UDP_STATS==1: Enable UDP stats. Default is on if - * UDP enabled, otherwise off. - */ -#ifndef UDP_STATS -#define UDP_STATS (LWIP_UDP) -#endif - -/** - * TCP_STATS==1: Enable TCP stats. Default is on if TCP - * enabled, otherwise off. - */ -#ifndef TCP_STATS -#define TCP_STATS (LWIP_TCP) -#endif - -/** - * MEM_STATS==1: Enable mem.c stats. - */ -#ifndef MEM_STATS -#define MEM_STATS ((MEM_LIBC_MALLOC == 0) && (MEM_USE_POOLS == 0)) -#endif - -/** - * MEMP_STATS==1: Enable memp.c pool stats. - */ -#ifndef MEMP_STATS -#define MEMP_STATS (MEMP_MEM_MALLOC == 0) -#endif - -/** - * SYS_STATS==1: Enable system stats (sem and mbox counts, etc). - */ -#ifndef SYS_STATS -#define SYS_STATS (NO_SYS == 0) -#endif - -#else - -#define LINK_STATS 0 -#define IP_STATS 0 -#define IPFRAG_STATS 0 -#define ICMP_STATS 0 -#define IGMP_STATS 0 -#define UDP_STATS 0 -#define TCP_STATS 0 -#define MEM_STATS 0 -#define MEMP_STATS 0 -#define SYS_STATS 0 -#define LWIP_STATS_DISPLAY 0 - -#endif /* LWIP_STATS */ - -/* - --------------------------------- - ---------- PPP options ---------- - --------------------------------- -*/ -/** - * PPP_SUPPORT==1: Enable PPP. - */ -#ifndef PPP_SUPPORT -#define PPP_SUPPORT 0 -#endif - -/** - * PPPOE_SUPPORT==1: Enable PPP Over Ethernet - */ -#ifndef PPPOE_SUPPORT -#define PPPOE_SUPPORT 0 -#endif - -/** - * PPPOS_SUPPORT==1: Enable PPP Over Serial - */ -#ifndef PPPOS_SUPPORT -#define PPPOS_SUPPORT PPP_SUPPORT -#endif - -#if PPP_SUPPORT - -/** - * NUM_PPP: Max PPP sessions. - */ -#ifndef NUM_PPP -#define NUM_PPP 1 -#endif - -/** - * PAP_SUPPORT==1: Support PAP. - */ -#ifndef PAP_SUPPORT -#define PAP_SUPPORT 0 -#endif - -/** - * CHAP_SUPPORT==1: Support CHAP. - */ -#ifndef CHAP_SUPPORT -#define CHAP_SUPPORT 0 -#endif - -/** - * MSCHAP_SUPPORT==1: Support MSCHAP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef MSCHAP_SUPPORT -#define MSCHAP_SUPPORT 0 -#endif - -/** - * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CBCP_SUPPORT -#define CBCP_SUPPORT 0 -#endif - -/** - * CCP_SUPPORT==1: Support CCP. CURRENTLY NOT SUPPORTED! DO NOT SET! - */ -#ifndef CCP_SUPPORT -#define CCP_SUPPORT 0 -#endif - -/** - * VJ_SUPPORT==1: Support VJ header compression. - */ -#ifndef VJ_SUPPORT -#define VJ_SUPPORT 0 -#endif - -/** - * MD5_SUPPORT==1: Support MD5 (see also CHAP). - */ -#ifndef MD5_SUPPORT -#define MD5_SUPPORT 0 -#endif - -/* - * Timeouts - */ -#ifndef FSM_DEFTIMEOUT -#define FSM_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef FSM_DEFMAXTERMREQS -#define FSM_DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXCONFREQS -#define FSM_DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ -#endif - -#ifndef FSM_DEFMAXNAKLOOPS -#define FSM_DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ -#endif - -#ifndef UPAP_DEFTIMEOUT -#define UPAP_DEFTIMEOUT 6 /* Timeout (seconds) for retransmitting req */ -#endif - -#ifndef UPAP_DEFREQTIME -#define UPAP_DEFREQTIME 30 /* Time to wait for auth-req from peer */ -#endif - -#ifndef CHAP_DEFTIMEOUT -#define CHAP_DEFTIMEOUT 6 /* Timeout time in seconds */ -#endif - -#ifndef CHAP_DEFTRANSMITS -#define CHAP_DEFTRANSMITS 10 /* max # times to send challenge */ -#endif - -/* Interval in seconds between keepalive echo requests, 0 to disable. */ -#ifndef LCP_ECHOINTERVAL -#define LCP_ECHOINTERVAL 0 -#endif - -/* Number of unanswered echo requests before failure. */ -#ifndef LCP_MAXECHOFAILS -#define LCP_MAXECHOFAILS 3 -#endif - -/* Max Xmit idle time (in jiffies) before resend flag char. */ -#ifndef PPP_MAXIDLEFLAG -#define PPP_MAXIDLEFLAG 100 -#endif - -/* - * Packet sizes - * - * Note - lcp shouldn't be allowed to negotiate stuff outside these - * limits. See lcp.h in the pppd directory. - * (XXX - these constants should simply be shared by lcp.c instead - * of living in lcp.h) - */ -#define PPP_MTU 1500 /* Default MTU (size of Info field) */ -#ifndef PPP_MAXMTU -/* #define PPP_MAXMTU 65535 - (PPP_HDRLEN + PPP_FCSLEN) */ -#define PPP_MAXMTU 1500 /* Largest MTU we allow */ -#endif -#define PPP_MINMTU 64 -#define PPP_MRU 1500 /* default MRU = max length of info field */ -#define PPP_MAXMRU 1500 /* Largest MRU we allow */ -#ifndef PPP_DEFMRU -#define PPP_DEFMRU 296 /* Try for this */ -#endif -#define PPP_MINMRU 128 /* No MRUs below this */ - -#ifndef MAXNAMELEN -#define MAXNAMELEN 256 /* max length of hostname or name for auth */ -#endif -#ifndef MAXSECRETLEN -#define MAXSECRETLEN 256 /* max length of password or secret */ -#endif - -#endif /* PPP_SUPPORT */ - -/* - -------------------------------------- - ---------- Checksum options ---------- - -------------------------------------- -*/ -/** - * CHECKSUM_GEN_IP==1: Generate checksums in software for outgoing IP packets. - */ -#ifndef CHECKSUM_GEN_IP -#define CHECKSUM_GEN_IP 1 -#endif - -/** - * CHECKSUM_GEN_UDP==1: Generate checksums in software for outgoing UDP packets. - */ -#ifndef CHECKSUM_GEN_UDP -#define CHECKSUM_GEN_UDP 1 -#endif - -/** - * CHECKSUM_GEN_TCP==1: Generate checksums in software for outgoing TCP packets. - */ -#ifndef CHECKSUM_GEN_TCP -#define CHECKSUM_GEN_TCP 1 -#endif - -/** - * CHECKSUM_CHECK_IP==1: Check checksums in software for incoming IP packets. - */ -#ifndef CHECKSUM_CHECK_IP -#define CHECKSUM_CHECK_IP 1 -#endif - -/** - * CHECKSUM_CHECK_UDP==1: Check checksums in software for incoming UDP packets. - */ -#ifndef CHECKSUM_CHECK_UDP -#define CHECKSUM_CHECK_UDP 1 -#endif - -/** - * CHECKSUM_CHECK_TCP==1: Check checksums in software for incoming TCP packets. - */ -#ifndef CHECKSUM_CHECK_TCP -#define CHECKSUM_CHECK_TCP 1 -#endif - -/** - * LWIP_CHECKSUM_ON_COPY==1: Calculate checksum when copying data from - * application buffers to pbufs. - */ -#ifndef LWIP_CHECKSUM_ON_COPY -#define LWIP_CHECKSUM_ON_COPY 0 -#endif - -/* - --------------------------------------- - ---------- Debugging options ---------- - --------------------------------------- -*/ -/** - * LWIP_DBG_MIN_LEVEL: After masking, the value of the debug is - * compared against this value. If it is smaller, then debugging - * messages are written. - */ -#ifndef LWIP_DBG_MIN_LEVEL -#define LWIP_DBG_MIN_LEVEL LWIP_DBG_LEVEL_ALL -#endif - -/** - * LWIP_DBG_TYPES_ON: A mask that can be used to globally enable/disable - * debug messages of certain types. - */ -#ifndef LWIP_DBG_TYPES_ON -#define LWIP_DBG_TYPES_ON LWIP_DBG_ON -#endif - -/** - * ETHARP_DEBUG: Enable debugging in etharp.c. - */ -#ifndef ETHARP_DEBUG -#define ETHARP_DEBUG LWIP_DBG_OFF -#endif - -/** - * NETIF_DEBUG: Enable debugging in netif.c. - */ -#ifndef NETIF_DEBUG -#define NETIF_DEBUG LWIP_DBG_OFF -#endif - -/** - * PBUF_DEBUG: Enable debugging in pbuf.c. - */ -#ifndef PBUF_DEBUG -#define PBUF_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_LIB_DEBUG: Enable debugging in api_lib.c. - */ -#ifndef API_LIB_DEBUG -#define API_LIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * API_MSG_DEBUG: Enable debugging in api_msg.c. - */ -#ifndef API_MSG_DEBUG -#define API_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SOCKETS_DEBUG: Enable debugging in sockets.c. - */ -#ifndef SOCKETS_DEBUG -#define SOCKETS_DEBUG LWIP_DBG_OFF -#endif - -/** - * ICMP_DEBUG: Enable debugging in icmp.c. - */ -#ifndef ICMP_DEBUG -#define ICMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IGMP_DEBUG: Enable debugging in igmp.c. - */ -#ifndef IGMP_DEBUG -#define IGMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * INET_DEBUG: Enable debugging in inet.c. - */ -#ifndef INET_DEBUG -#define INET_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_DEBUG: Enable debugging for IP. - */ -#ifndef IP_DEBUG -#define IP_DEBUG LWIP_DBG_OFF -#endif - -/** - * IP_REASS_DEBUG: Enable debugging in ip_frag.c for both frag & reass. - */ -#ifndef IP_REASS_DEBUG -#define IP_REASS_DEBUG LWIP_DBG_OFF -#endif - -/** - * RAW_DEBUG: Enable debugging in raw.c. - */ -#ifndef RAW_DEBUG -#define RAW_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEM_DEBUG: Enable debugging in mem.c. - */ -#ifndef MEM_DEBUG -#define MEM_DEBUG LWIP_DBG_OFF -#endif - -/** - * MEMP_DEBUG: Enable debugging in memp.c. - */ -#ifndef MEMP_DEBUG -#define MEMP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SYS_DEBUG: Enable debugging in sys.c. - */ -#ifndef SYS_DEBUG -#define SYS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TIMERS_DEBUG: Enable debugging in timers.c. - */ -#ifndef TIMERS_DEBUG -#define TIMERS_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_DEBUG: Enable debugging for TCP. - */ -#ifndef TCP_DEBUG -#define TCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_INPUT_DEBUG: Enable debugging in tcp_in.c for incoming debug. - */ -#ifndef TCP_INPUT_DEBUG -#define TCP_INPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_FR_DEBUG: Enable debugging in tcp_in.c for fast retransmit. - */ -#ifndef TCP_FR_DEBUG -#define TCP_FR_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RTO_DEBUG: Enable debugging in TCP for retransmit - * timeout. - */ -#ifndef TCP_RTO_DEBUG -#define TCP_RTO_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_CWND_DEBUG: Enable debugging for TCP congestion window. - */ -#ifndef TCP_CWND_DEBUG -#define TCP_CWND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_WND_DEBUG: Enable debugging in tcp_in.c for window updating. - */ -#ifndef TCP_WND_DEBUG -#define TCP_WND_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_OUTPUT_DEBUG: Enable debugging in tcp_out.c output functions. - */ -#ifndef TCP_OUTPUT_DEBUG -#define TCP_OUTPUT_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_RST_DEBUG: Enable debugging for TCP with the RST message. - */ -#ifndef TCP_RST_DEBUG -#define TCP_RST_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCP_QLEN_DEBUG: Enable debugging for TCP queue lengths. - */ -#ifndef TCP_QLEN_DEBUG -#define TCP_QLEN_DEBUG LWIP_DBG_OFF -#endif - -/** - * UDP_DEBUG: Enable debugging in UDP. - */ -#ifndef UDP_DEBUG -#define UDP_DEBUG LWIP_DBG_OFF -#endif - -/** - * TCPIP_DEBUG: Enable debugging in tcpip.c. - */ -#ifndef TCPIP_DEBUG -#define TCPIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * PPP_DEBUG: Enable debugging for PPP. - */ -#ifndef PPP_DEBUG -#define PPP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SLIP_DEBUG: Enable debugging in slipif.c. - */ -#ifndef SLIP_DEBUG -#define SLIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * DHCP_DEBUG: Enable debugging in dhcp.c. - */ -#ifndef DHCP_DEBUG -#define DHCP_DEBUG LWIP_DBG_OFF -#endif - -/** - * AUTOIP_DEBUG: Enable debugging in autoip.c. - */ -#ifndef AUTOIP_DEBUG -#define AUTOIP_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MSG_DEBUG: Enable debugging for SNMP messages. - */ -#ifndef SNMP_MSG_DEBUG -#define SNMP_MSG_DEBUG LWIP_DBG_OFF -#endif - -/** - * SNMP_MIB_DEBUG: Enable debugging for SNMP MIBs. - */ -#ifndef SNMP_MIB_DEBUG -#define SNMP_MIB_DEBUG LWIP_DBG_OFF -#endif - -/** - * DNS_DEBUG: Enable debugging for DNS. - */ -#ifndef DNS_DEBUG -#define DNS_DEBUG LWIP_DBG_OFF -#endif - -#endif /* __LWIP_OPT_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/pbuf.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/pbuf.h deleted file mode 100644 index 3d24db4d..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/pbuf.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - -#ifndef __LWIP_PBUF_H__ -#define __LWIP_PBUF_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Currently, the pbuf_custom code is only needed for one specific configuration - * of IP_FRAG */ -#define LWIP_SUPPORT_CUSTOM_PBUF (IP_FRAG && !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF) - -#define PBUF_TRANSPORT_HLEN 20 -#define PBUF_IP_HLEN 20 - -typedef enum { - PBUF_TRANSPORT, - PBUF_IP, - PBUF_LINK, - PBUF_RAW -} pbuf_layer; - -typedef enum { - PBUF_RAM, /* pbuf data is stored in RAM */ - PBUF_ROM, /* pbuf data is stored in ROM */ - PBUF_REF, /* pbuf comes from the pbuf pool */ - PBUF_POOL, /* pbuf payload refers to RAM */ -#ifdef EBUF_LWIP - PBUF_ESF_RX /* pbuf payload is from WLAN */ -#endif /* ESF_LWIP */ -} pbuf_type; - - -/** indicates this packet's data should be immediately passed to the application */ -#define PBUF_FLAG_PUSH 0x01U -/** indicates this is a custom pbuf: pbuf_free and pbuf_header handle such a - a pbuf differently */ -#define PBUF_FLAG_IS_CUSTOM 0x02U -/** indicates this pbuf is UDP multicast to be looped back */ -#define PBUF_FLAG_MCASTLOOP 0x04U - -struct pbuf { - /** next pbuf in singly linked pbuf chain */ - struct pbuf *next; - - /** pointer to the actual data in the buffer */ - void *payload; - - /** - * total length of this buffer and all next buffers in chain - * belonging to the same packet. - * - * For non-queue packet chains this is the invariant: - * p->tot_len == p->len + (p->next? p->next->tot_len: 0) - */ - u16_t tot_len; - - /** length of this buffer */ - u16_t len; - - /** pbuf_type as u8_t instead of enum to save space */ - u8_t /*pbuf_type*/ type; - - /** misc flags */ - u8_t flags; - - /** - * the reference count always equals the number of pointers - * that refer to this pbuf. This can be pointers from an application, - * the stack itself, or pbuf->next pointers from a chain. - */ - u16_t ref; - - /* add a pointer for esf_buf */ - void * eb; -}; - -#if LWIP_SUPPORT_CUSTOM_PBUF -/** Prototype for a function to free a custom pbuf */ -typedef void (*pbuf_free_custom_fn)(struct pbuf *p); - -/** A custom pbuf: like a pbuf, but following a function pointer to free it. */ -struct pbuf_custom { - /** The actual pbuf */ - struct pbuf pbuf; - /** This function is called when pbuf_free deallocates this pbuf(_custom) */ - pbuf_free_custom_fn custom_free_function; -}; -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ - -/* Initializes the pbuf module. This call is empty for now, but may not be in future. */ -#define pbuf_init() - -struct pbuf *pbuf_alloc(pbuf_layer l, u16_t length, pbuf_type type)ICACHE_FLASH_ATTR; -#if LWIP_SUPPORT_CUSTOM_PBUF -struct pbuf *pbuf_alloced_custom(pbuf_layer l, u16_t length, pbuf_type type, - struct pbuf_custom *p, void *payload_mem, - u16_t payload_mem_len)ICACHE_FLASH_ATTR; -#endif /* LWIP_SUPPORT_CUSTOM_PBUF */ -void pbuf_realloc(struct pbuf *p, u16_t size)ICACHE_FLASH_ATTR; -u8_t pbuf_header(struct pbuf *p, s16_t header_size)ICACHE_FLASH_ATTR; -void pbuf_ref(struct pbuf *p)ICACHE_FLASH_ATTR; -u8_t pbuf_free(struct pbuf *p)ICACHE_FLASH_ATTR; -u8_t pbuf_clen(struct pbuf *p)ICACHE_FLASH_ATTR; -void pbuf_cat(struct pbuf *head, struct pbuf *tail)ICACHE_FLASH_ATTR; -void pbuf_chain(struct pbuf *head, struct pbuf *tail)ICACHE_FLASH_ATTR; -struct pbuf *pbuf_dechain(struct pbuf *p)ICACHE_FLASH_ATTR; -err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)ICACHE_FLASH_ATTR; -u16_t pbuf_copy_partial(struct pbuf *p, void *dataptr, u16_t len, u16_t offset)ICACHE_FLASH_ATTR; -err_t pbuf_take(struct pbuf *buf, const void *dataptr, u16_t len)ICACHE_FLASH_ATTR; -struct pbuf *pbuf_coalesce(struct pbuf *p, pbuf_layer layer)ICACHE_FLASH_ATTR; -#if LWIP_CHECKSUM_ON_COPY -err_t pbuf_fill_chksum(struct pbuf *p, u16_t start_offset, const void *dataptr, - u16_t len, u16_t *chksum)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHECKSUM_ON_COPY */ - -u8_t pbuf_get_at(struct pbuf* p, u16_t offset)ICACHE_FLASH_ATTR; -u16_t pbuf_memcmp(struct pbuf* p, u16_t offset, const void* s2, u16_t n)ICACHE_FLASH_ATTR; -u16_t pbuf_memfind(struct pbuf* p, const void* mem, u16_t mem_len, u16_t start_offset)ICACHE_FLASH_ATTR; -u16_t pbuf_strstr(struct pbuf* p, const char* substr)ICACHE_FLASH_ATTR; - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_PBUF_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/raw.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/raw.h deleted file mode 100644 index c9c40871..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/raw.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_RAW_H__ -#define __LWIP_RAW_H__ - -#include "lwip/opt.h" - -#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/def.h" -#include "lwip/ip.h" -#include "lwip/ip_addr.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct raw_pcb; - -/** Function prototype for raw pcb receive callback functions. - * @param arg user supplied argument (raw_pcb.recv_arg) - * @param pcb the raw_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @return 1 if the packet was 'eaten' (aka. deleted), - * 0 if the packet lives on - * If returning 1, the callback is responsible for freeing the pbuf - * if it's not used any more. - */ -typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, - ip_addr_t *addr); - -struct raw_pcb { - /* Common members of all PCB types */ - IP_PCB; - - struct raw_pcb *next; - - u8_t protocol; - - /** receive callback function */ - raw_recv_fn recv; - /* user-supplied argument for the recv callback */ - void *recv_arg; -}; - -/* The following functions is the application layer interface to the - RAW code. */ -struct raw_pcb * raw_new (u8_t proto)ICACHE_FLASH_ATTR; -void raw_remove (struct raw_pcb *pcb)ICACHE_FLASH_ATTR; -err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; - -void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg)ICACHE_FLASH_ATTR; -err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr)ICACHE_FLASH_ATTR; -err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); - -/* The following functions are the lower layer interface to RAW. */ -u8_t raw_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -#define raw_init() /* Compatibility define, not init needed. */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_RAW */ - -#endif /* __LWIP_RAW_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sio.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sio.h deleted file mode 100644 index 228c8577..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sio.h +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - */ - -/* - * This is the interface to the platform specific serial IO module - * It needs to be implemented by those platforms which need SLIP or PPP - */ - -#ifndef __SIO_H__ -#define __SIO_H__ - -#include "lwip/arch.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* If you want to define sio_fd_t elsewhere or differently, - define this in your cc.h file. */ -#ifndef __sio_fd_t_defined -typedef void * sio_fd_t; -#endif - -/* The following functions can be defined to something else in your cc.h file - or be implemented in your custom sio.c file. */ - -#ifndef sio_open -/** - * Opens a serial device for communication. - * - * @param devnum device number - * @return handle to serial device if successful, NULL otherwise - */ -sio_fd_t sio_open(u8_t devnum)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_send -/** - * Sends a single character to the serial device. - * - * @param c character to send - * @param fd serial device handle - * - * @note This function will block until the character can be sent. - */ -void sio_send(u8_t c, sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_recv -/** - * Receives a single character from the serial device. - * - * @param fd serial device handle - * - * @note This function will block until a character is received. - */ -u8_t sio_recv(sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_read -/** - * Reads from the serial device. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - may be 0 if aborted by sio_read_abort - * - * @note This function will block until data can be received. The blocking - * can be cancelled by calling sio_read_abort(). - */ -u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_tryread -/** - * Tries to read from the serial device. Same as sio_read but returns - * immediately if no data is available and never blocks. - * - * @param fd serial device handle - * @param data pointer to data buffer for receiving - * @param len maximum length (in bytes) of data to receive - * @return number of bytes actually received - */ -u32_t sio_tryread(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_write -/** - * Writes to the serial device. - * - * @param fd serial device handle - * @param data pointer to data to send - * @param len length (in bytes) of data to send - * @return number of bytes actually sent - * - * @note This function will block until all data can be sent. - */ -u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len)ICACHE_FLASH_ATTR; -#endif - -#ifndef sio_read_abort -/** - * Aborts a blocking sio_read() call. - * - * @param fd serial device handle - */ -void sio_read_abort(sio_fd_t fd)ICACHE_FLASH_ATTR; -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __SIO_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp.h deleted file mode 100644 index 2ed043dd..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp.h +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Copyright (c) 2001, 2002 Leon Woestenberg - * Copyright (c) 2001, 2002 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Leon Woestenberg - * - */ -#ifndef __LWIP_SNMP_H__ -#define __LWIP_SNMP_H__ - -#include "lwip/opt.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#include "lwip/ip_addr.h" - -struct udp_pcb; -struct netif; - -/** - * @see RFC1213, "MIB-II, 6. Definitions" - */ -enum snmp_ifType { - snmp_ifType_other=1, /* none of the following */ - snmp_ifType_regular1822, - snmp_ifType_hdh1822, - snmp_ifType_ddn_x25, - snmp_ifType_rfc877_x25, - snmp_ifType_ethernet_csmacd, - snmp_ifType_iso88023_csmacd, - snmp_ifType_iso88024_tokenBus, - snmp_ifType_iso88025_tokenRing, - snmp_ifType_iso88026_man, - snmp_ifType_starLan, - snmp_ifType_proteon_10Mbit, - snmp_ifType_proteon_80Mbit, - snmp_ifType_hyperchannel, - snmp_ifType_fddi, - snmp_ifType_lapb, - snmp_ifType_sdlc, - snmp_ifType_ds1, /* T-1 */ - snmp_ifType_e1, /* european equiv. of T-1 */ - snmp_ifType_basicISDN, - snmp_ifType_primaryISDN, /* proprietary serial */ - snmp_ifType_propPointToPointSerial, - snmp_ifType_ppp, - snmp_ifType_softwareLoopback, - snmp_ifType_eon, /* CLNP over IP [11] */ - snmp_ifType_ethernet_3Mbit, - snmp_ifType_nsip, /* XNS over IP */ - snmp_ifType_slip, /* generic SLIP */ - snmp_ifType_ultra, /* ULTRA technologies */ - snmp_ifType_ds3, /* T-3 */ - snmp_ifType_sip, /* SMDS */ - snmp_ifType_frame_relay -}; - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -/** SNMP "sysuptime" Interval */ -#define SNMP_SYSUPTIME_INTERVAL 10 - -/** fixed maximum length for object identifier type */ -#define LWIP_SNMP_OBJ_ID_LEN 32 - -/** internal object identifier representation */ -struct snmp_obj_id -{ - u8_t len; - s32_t id[LWIP_SNMP_OBJ_ID_LEN]; -}; - -/* system */ -void snmp_set_sysdesr(u8_t* str, u8_t* len); -void snmp_set_sysobjid(struct snmp_obj_id *oid); -void snmp_get_sysobjid_ptr(struct snmp_obj_id **oid); -void snmp_inc_sysuptime(void); -void snmp_add_sysuptime(u32_t value); -void snmp_get_sysuptime(u32_t *value); -void snmp_set_syscontact(u8_t *ocstr, u8_t *ocstrlen); -void snmp_set_sysname(u8_t *ocstr, u8_t *ocstrlen); -void snmp_set_syslocation(u8_t *ocstr, u8_t *ocstrlen); - -/* network interface */ -void snmp_add_ifinoctets(struct netif *ni, u32_t value); -void snmp_inc_ifinucastpkts(struct netif *ni); -void snmp_inc_ifinnucastpkts(struct netif *ni); -void snmp_inc_ifindiscards(struct netif *ni); -void snmp_add_ifoutoctets(struct netif *ni, u32_t value); -void snmp_inc_ifoutucastpkts(struct netif *ni); -void snmp_inc_ifoutnucastpkts(struct netif *ni); -void snmp_inc_ifoutdiscards(struct netif *ni); -void snmp_inc_iflist(void); -void snmp_dec_iflist(void); - -/* ARP (for atTable and ipNetToMediaTable) */ -void snmp_insert_arpidx_tree(struct netif *ni, ip_addr_t *ip); -void snmp_delete_arpidx_tree(struct netif *ni, ip_addr_t *ip); - -/* IP */ -void snmp_inc_ipinreceives(void); -void snmp_inc_ipinhdrerrors(void); -void snmp_inc_ipinaddrerrors(void); -void snmp_inc_ipforwdatagrams(void); -void snmp_inc_ipinunknownprotos(void); -void snmp_inc_ipindiscards(void); -void snmp_inc_ipindelivers(void); -void snmp_inc_ipoutrequests(void); -void snmp_inc_ipoutdiscards(void); -void snmp_inc_ipoutnoroutes(void); -void snmp_inc_ipreasmreqds(void); -void snmp_inc_ipreasmoks(void); -void snmp_inc_ipreasmfails(void); -void snmp_inc_ipfragoks(void); -void snmp_inc_ipfragfails(void); -void snmp_inc_ipfragcreates(void); -void snmp_inc_iproutingdiscards(void); -void snmp_insert_ipaddridx_tree(struct netif *ni); -void snmp_delete_ipaddridx_tree(struct netif *ni); -void snmp_insert_iprteidx_tree(u8_t dflt, struct netif *ni); -void snmp_delete_iprteidx_tree(u8_t dflt, struct netif *ni); - -/* ICMP */ -void snmp_inc_icmpinmsgs(void); -void snmp_inc_icmpinerrors(void); -void snmp_inc_icmpindestunreachs(void); -void snmp_inc_icmpintimeexcds(void); -void snmp_inc_icmpinparmprobs(void); -void snmp_inc_icmpinsrcquenchs(void); -void snmp_inc_icmpinredirects(void); -void snmp_inc_icmpinechos(void); -void snmp_inc_icmpinechoreps(void); -void snmp_inc_icmpintimestamps(void); -void snmp_inc_icmpintimestampreps(void); -void snmp_inc_icmpinaddrmasks(void); -void snmp_inc_icmpinaddrmaskreps(void); -void snmp_inc_icmpoutmsgs(void); -void snmp_inc_icmpouterrors(void); -void snmp_inc_icmpoutdestunreachs(void); -void snmp_inc_icmpouttimeexcds(void); -void snmp_inc_icmpoutparmprobs(void); -void snmp_inc_icmpoutsrcquenchs(void); -void snmp_inc_icmpoutredirects(void); -void snmp_inc_icmpoutechos(void); -void snmp_inc_icmpoutechoreps(void); -void snmp_inc_icmpouttimestamps(void); -void snmp_inc_icmpouttimestampreps(void); -void snmp_inc_icmpoutaddrmasks(void); -void snmp_inc_icmpoutaddrmaskreps(void); - -/* TCP */ -void snmp_inc_tcpactiveopens(void); -void snmp_inc_tcppassiveopens(void); -void snmp_inc_tcpattemptfails(void); -void snmp_inc_tcpestabresets(void); -void snmp_inc_tcpinsegs(void); -void snmp_inc_tcpoutsegs(void); -void snmp_inc_tcpretranssegs(void); -void snmp_inc_tcpinerrs(void); -void snmp_inc_tcpoutrsts(void); - -/* UDP */ -void snmp_inc_udpindatagrams(void); -void snmp_inc_udpnoports(void); -void snmp_inc_udpinerrors(void); -void snmp_inc_udpoutdatagrams(void); -void snmp_insert_udpidx_tree(struct udp_pcb *pcb); -void snmp_delete_udpidx_tree(struct udp_pcb *pcb); - -/* SNMP */ -void snmp_inc_snmpinpkts(void); -void snmp_inc_snmpoutpkts(void); -void snmp_inc_snmpinbadversions(void); -void snmp_inc_snmpinbadcommunitynames(void); -void snmp_inc_snmpinbadcommunityuses(void); -void snmp_inc_snmpinasnparseerrs(void); -void snmp_inc_snmpintoobigs(void); -void snmp_inc_snmpinnosuchnames(void); -void snmp_inc_snmpinbadvalues(void); -void snmp_inc_snmpinreadonlys(void); -void snmp_inc_snmpingenerrs(void); -void snmp_add_snmpintotalreqvars(u8_t value); -void snmp_add_snmpintotalsetvars(u8_t value); -void snmp_inc_snmpingetrequests(void); -void snmp_inc_snmpingetnexts(void); -void snmp_inc_snmpinsetrequests(void); -void snmp_inc_snmpingetresponses(void); -void snmp_inc_snmpintraps(void); -void snmp_inc_snmpouttoobigs(void); -void snmp_inc_snmpoutnosuchnames(void); -void snmp_inc_snmpoutbadvalues(void); -void snmp_inc_snmpoutgenerrs(void); -void snmp_inc_snmpoutgetrequests(void); -void snmp_inc_snmpoutgetnexts(void); -void snmp_inc_snmpoutsetrequests(void); -void snmp_inc_snmpoutgetresponses(void); -void snmp_inc_snmpouttraps(void); -void snmp_get_snmpgrpid_ptr(struct snmp_obj_id **oid); -void snmp_set_snmpenableauthentraps(u8_t *value); -void snmp_get_snmpenableauthentraps(u8_t *value); - -/* LWIP_SNMP support not available */ -/* define everything to be empty */ -#else - -/* system */ -#define snmp_set_sysdesr(str, len) -#define snmp_set_sysobjid(oid); -#define snmp_get_sysobjid_ptr(oid) -#define snmp_inc_sysuptime() -#define snmp_add_sysuptime(value) -#define snmp_get_sysuptime(value) -#define snmp_set_syscontact(ocstr, ocstrlen); -#define snmp_set_sysname(ocstr, ocstrlen); -#define snmp_set_syslocation(ocstr, ocstrlen); - -/* network interface */ -#define snmp_add_ifinoctets(ni,value) -#define snmp_inc_ifinucastpkts(ni) -#define snmp_inc_ifinnucastpkts(ni) -#define snmp_inc_ifindiscards(ni) -#define snmp_add_ifoutoctets(ni,value) -#define snmp_inc_ifoutucastpkts(ni) -#define snmp_inc_ifoutnucastpkts(ni) -#define snmp_inc_ifoutdiscards(ni) -#define snmp_inc_iflist() -#define snmp_dec_iflist() - -/* ARP */ -#define snmp_insert_arpidx_tree(ni,ip) -#define snmp_delete_arpidx_tree(ni,ip) - -/* IP */ -#define snmp_inc_ipinreceives() -#define snmp_inc_ipinhdrerrors() -#define snmp_inc_ipinaddrerrors() -#define snmp_inc_ipforwdatagrams() -#define snmp_inc_ipinunknownprotos() -#define snmp_inc_ipindiscards() -#define snmp_inc_ipindelivers() -#define snmp_inc_ipoutrequests() -#define snmp_inc_ipoutdiscards() -#define snmp_inc_ipoutnoroutes() -#define snmp_inc_ipreasmreqds() -#define snmp_inc_ipreasmoks() -#define snmp_inc_ipreasmfails() -#define snmp_inc_ipfragoks() -#define snmp_inc_ipfragfails() -#define snmp_inc_ipfragcreates() -#define snmp_inc_iproutingdiscards() -#define snmp_insert_ipaddridx_tree(ni) -#define snmp_delete_ipaddridx_tree(ni) -#define snmp_insert_iprteidx_tree(dflt, ni) -#define snmp_delete_iprteidx_tree(dflt, ni) - -/* ICMP */ -#define snmp_inc_icmpinmsgs() -#define snmp_inc_icmpinerrors() -#define snmp_inc_icmpindestunreachs() -#define snmp_inc_icmpintimeexcds() -#define snmp_inc_icmpinparmprobs() -#define snmp_inc_icmpinsrcquenchs() -#define snmp_inc_icmpinredirects() -#define snmp_inc_icmpinechos() -#define snmp_inc_icmpinechoreps() -#define snmp_inc_icmpintimestamps() -#define snmp_inc_icmpintimestampreps() -#define snmp_inc_icmpinaddrmasks() -#define snmp_inc_icmpinaddrmaskreps() -#define snmp_inc_icmpoutmsgs() -#define snmp_inc_icmpouterrors() -#define snmp_inc_icmpoutdestunreachs() -#define snmp_inc_icmpouttimeexcds() -#define snmp_inc_icmpoutparmprobs() -#define snmp_inc_icmpoutsrcquenchs() -#define snmp_inc_icmpoutredirects() -#define snmp_inc_icmpoutechos() -#define snmp_inc_icmpoutechoreps() -#define snmp_inc_icmpouttimestamps() -#define snmp_inc_icmpouttimestampreps() -#define snmp_inc_icmpoutaddrmasks() -#define snmp_inc_icmpoutaddrmaskreps() -/* TCP */ -#define snmp_inc_tcpactiveopens() -#define snmp_inc_tcppassiveopens() -#define snmp_inc_tcpattemptfails() -#define snmp_inc_tcpestabresets() -#define snmp_inc_tcpinsegs() -#define snmp_inc_tcpoutsegs() -#define snmp_inc_tcpretranssegs() -#define snmp_inc_tcpinerrs() -#define snmp_inc_tcpoutrsts() - -/* UDP */ -#define snmp_inc_udpindatagrams() -#define snmp_inc_udpnoports() -#define snmp_inc_udpinerrors() -#define snmp_inc_udpoutdatagrams() -#define snmp_insert_udpidx_tree(pcb) -#define snmp_delete_udpidx_tree(pcb) - -/* SNMP */ -#define snmp_inc_snmpinpkts() -#define snmp_inc_snmpoutpkts() -#define snmp_inc_snmpinbadversions() -#define snmp_inc_snmpinbadcommunitynames() -#define snmp_inc_snmpinbadcommunityuses() -#define snmp_inc_snmpinasnparseerrs() -#define snmp_inc_snmpintoobigs() -#define snmp_inc_snmpinnosuchnames() -#define snmp_inc_snmpinbadvalues() -#define snmp_inc_snmpinreadonlys() -#define snmp_inc_snmpingenerrs() -#define snmp_add_snmpintotalreqvars(value) -#define snmp_add_snmpintotalsetvars(value) -#define snmp_inc_snmpingetrequests() -#define snmp_inc_snmpingetnexts() -#define snmp_inc_snmpinsetrequests() -#define snmp_inc_snmpingetresponses() -#define snmp_inc_snmpintraps() -#define snmp_inc_snmpouttoobigs() -#define snmp_inc_snmpoutnosuchnames() -#define snmp_inc_snmpoutbadvalues() -#define snmp_inc_snmpoutgenerrs() -#define snmp_inc_snmpoutgetrequests() -#define snmp_inc_snmpoutgetnexts() -#define snmp_inc_snmpoutsetrequests() -#define snmp_inc_snmpoutgetresponses() -#define snmp_inc_snmpouttraps() -#define snmp_get_snmpgrpid_ptr(oid) -#define snmp_set_snmpenableauthentraps(value) -#define snmp_get_snmpenableauthentraps(value) - -#endif /* LWIP_SNMP */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_SNMP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_asn1.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_asn1.h deleted file mode 100644 index 605fa3f1..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_asn1.h +++ /dev/null @@ -1,101 +0,0 @@ -/** - * @file - * Abstract Syntax Notation One (ISO 8824, 8825) codec. - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_ASN1_H__ -#define __LWIP_SNMP_ASN1_H__ - -#include "lwip/opt.h" -#include "lwip/err.h" -#include "lwip/pbuf.h" -#include "lwip/snmp.h" - -#if LWIP_SNMP - -#ifdef __cplusplus -extern "C" { -#endif - -#define SNMP_ASN1_UNIV (0) /* (!0x80 | !0x40) */ -#define SNMP_ASN1_APPLIC (0x40) /* (!0x80 | 0x40) */ -#define SNMP_ASN1_CONTXT (0x80) /* ( 0x80 | !0x40) */ - -#define SNMP_ASN1_CONSTR (0x20) /* ( 0x20) */ -#define SNMP_ASN1_PRIMIT (0) /* (!0x20) */ - -/* universal tags */ -#define SNMP_ASN1_INTEG 2 -#define SNMP_ASN1_OC_STR 4 -#define SNMP_ASN1_NUL 5 -#define SNMP_ASN1_OBJ_ID 6 -#define SNMP_ASN1_SEQ 16 - -/* application specific (SNMP) tags */ -#define SNMP_ASN1_IPADDR 0 /* octet string size(4) */ -#define SNMP_ASN1_COUNTER 1 /* u32_t */ -#define SNMP_ASN1_GAUGE 2 /* u32_t */ -#define SNMP_ASN1_TIMETICKS 3 /* u32_t */ -#define SNMP_ASN1_OPAQUE 4 /* octet string */ - -/* context specific (SNMP) tags */ -#define SNMP_ASN1_PDU_GET_REQ 0 -#define SNMP_ASN1_PDU_GET_NEXT_REQ 1 -#define SNMP_ASN1_PDU_GET_RESP 2 -#define SNMP_ASN1_PDU_SET_REQ 3 -#define SNMP_ASN1_PDU_TRAP 4 - -err_t snmp_asn1_dec_type(struct pbuf *p, u16_t ofs, u8_t *type); -err_t snmp_asn1_dec_length(struct pbuf *p, u16_t ofs, u8_t *octets_used, u16_t *length); -err_t snmp_asn1_dec_u32t(struct pbuf *p, u16_t ofs, u16_t len, u32_t *value); -err_t snmp_asn1_dec_s32t(struct pbuf *p, u16_t ofs, u16_t len, s32_t *value); -err_t snmp_asn1_dec_oid(struct pbuf *p, u16_t ofs, u16_t len, struct snmp_obj_id *oid); -err_t snmp_asn1_dec_raw(struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_t *raw); - -void snmp_asn1_enc_length_cnt(u16_t length, u8_t *octets_needed); -void snmp_asn1_enc_u32t_cnt(u32_t value, u16_t *octets_needed); -void snmp_asn1_enc_s32t_cnt(s32_t value, u16_t *octets_needed); -void snmp_asn1_enc_oid_cnt(u8_t ident_len, s32_t *ident, u16_t *octets_needed); -err_t snmp_asn1_enc_type(struct pbuf *p, u16_t ofs, u8_t type); -err_t snmp_asn1_enc_length(struct pbuf *p, u16_t ofs, u16_t length); -err_t snmp_asn1_enc_u32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, u32_t value); -err_t snmp_asn1_enc_s32t(struct pbuf *p, u16_t ofs, u16_t octets_needed, s32_t value); -err_t snmp_asn1_enc_oid(struct pbuf *p, u16_t ofs, u8_t ident_len, s32_t *ident); -err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u16_t raw_len, u8_t *raw); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_ASN1_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_msg.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_msg.h deleted file mode 100644 index 1183e3a9..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_msg.h +++ /dev/null @@ -1,315 +0,0 @@ -/** - * @file - * SNMP Agent message handling structures. - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_MSG_H__ -#define __LWIP_SNMP_MSG_H__ - -#include "lwip/opt.h" -#include "lwip/snmp.h" -#include "lwip/snmp_structs.h" -#include "lwip/ip_addr.h" -#include "lwip/err.h" - -#if LWIP_SNMP - -#if SNMP_PRIVATE_MIB -/* When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. */ -#include "private_mib.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* The listen port of the SNMP agent. Clients have to make their requests to - this port. Most standard clients won't work if you change this! */ -#ifndef SNMP_IN_PORT -#define SNMP_IN_PORT 161 -#endif -/* The remote port the SNMP agent sends traps to. Most standard trap sinks won't - work if you change this! */ -#ifndef SNMP_TRAP_PORT -#define SNMP_TRAP_PORT 162 -#endif - -#define SNMP_ES_NOERROR 0 -#define SNMP_ES_TOOBIG 1 -#define SNMP_ES_NOSUCHNAME 2 -#define SNMP_ES_BADVALUE 3 -#define SNMP_ES_READONLY 4 -#define SNMP_ES_GENERROR 5 - -#define SNMP_GENTRAP_COLDSTART 0 -#define SNMP_GENTRAP_WARMSTART 1 -#define SNMP_GENTRAP_AUTHFAIL 4 -#define SNMP_GENTRAP_ENTERPRISESPC 6 - -struct snmp_varbind -{ - /* next pointer, NULL for last in list */ - struct snmp_varbind *next; - /* previous pointer, NULL for first in list */ - struct snmp_varbind *prev; - - /* object identifier length (in s32_t) */ - u8_t ident_len; - /* object identifier array */ - s32_t *ident; - - /* object value ASN1 type */ - u8_t value_type; - /* object value length (in u8_t) */ - u8_t value_len; - /* object value */ - void *value; - - /* encoding varbind seq length length */ - u8_t seqlenlen; - /* encoding object identifier length length */ - u8_t olenlen; - /* encoding object value length length */ - u8_t vlenlen; - /* encoding varbind seq length */ - u16_t seqlen; - /* encoding object identifier length */ - u16_t olen; - /* encoding object value length */ - u16_t vlen; -}; - -struct snmp_varbind_root -{ - struct snmp_varbind *head; - struct snmp_varbind *tail; - /* number of variable bindings in list */ - u8_t count; - /* encoding varbind-list seq length length */ - u8_t seqlenlen; - /* encoding varbind-list seq length */ - u16_t seqlen; -}; - -/** output response message header length fields */ -struct snmp_resp_header_lengths -{ - /* encoding error-index length length */ - u8_t erridxlenlen; - /* encoding error-status length length */ - u8_t errstatlenlen; - /* encoding request id length length */ - u8_t ridlenlen; - /* encoding pdu length length */ - u8_t pdulenlen; - /* encoding community length length */ - u8_t comlenlen; - /* encoding version length length */ - u8_t verlenlen; - /* encoding sequence length length */ - u8_t seqlenlen; - - /* encoding error-index length */ - u16_t erridxlen; - /* encoding error-status length */ - u16_t errstatlen; - /* encoding request id length */ - u16_t ridlen; - /* encoding pdu length */ - u16_t pdulen; - /* encoding community length */ - u16_t comlen; - /* encoding version length */ - u16_t verlen; - /* encoding sequence length */ - u16_t seqlen; -}; - -/** output response message header length fields */ -struct snmp_trap_header_lengths -{ - /* encoding timestamp length length */ - u8_t tslenlen; - /* encoding specific-trap length length */ - u8_t strplenlen; - /* encoding generic-trap length length */ - u8_t gtrplenlen; - /* encoding agent-addr length length */ - u8_t aaddrlenlen; - /* encoding enterprise-id length length */ - u8_t eidlenlen; - /* encoding pdu length length */ - u8_t pdulenlen; - /* encoding community length length */ - u8_t comlenlen; - /* encoding version length length */ - u8_t verlenlen; - /* encoding sequence length length */ - u8_t seqlenlen; - - /* encoding timestamp length */ - u16_t tslen; - /* encoding specific-trap length */ - u16_t strplen; - /* encoding generic-trap length */ - u16_t gtrplen; - /* encoding agent-addr length */ - u16_t aaddrlen; - /* encoding enterprise-id length */ - u16_t eidlen; - /* encoding pdu length */ - u16_t pdulen; - /* encoding community length */ - u16_t comlen; - /* encoding version length */ - u16_t verlen; - /* encoding sequence length */ - u16_t seqlen; -}; - -/* Accepting new SNMP messages. */ -#define SNMP_MSG_EMPTY 0 -/* Search for matching object for variable binding. */ -#define SNMP_MSG_SEARCH_OBJ 1 -/* Perform SNMP operation on in-memory object. - Pass-through states, for symmetry only. */ -#define SNMP_MSG_INTERNAL_GET_OBJDEF 2 -#define SNMP_MSG_INTERNAL_GET_VALUE 3 -#define SNMP_MSG_INTERNAL_SET_TEST 4 -#define SNMP_MSG_INTERNAL_GET_OBJDEF_S 5 -#define SNMP_MSG_INTERNAL_SET_VALUE 6 -/* Perform SNMP operation on object located externally. - In theory this could be used for building a proxy agent. - Practical use is for an enterprise spc. app. gateway. */ -#define SNMP_MSG_EXTERNAL_GET_OBJDEF 7 -#define SNMP_MSG_EXTERNAL_GET_VALUE 8 -#define SNMP_MSG_EXTERNAL_SET_TEST 9 -#define SNMP_MSG_EXTERNAL_GET_OBJDEF_S 10 -#define SNMP_MSG_EXTERNAL_SET_VALUE 11 - -#define SNMP_COMMUNITY_STR_LEN 64 -struct snmp_msg_pstat -{ - /* lwIP local port (161) binding */ - struct udp_pcb *pcb; - /* source IP address */ - ip_addr_t sip; - /* source UDP port */ - u16_t sp; - /* request type */ - u8_t rt; - /* request ID */ - s32_t rid; - /* error status */ - s32_t error_status; - /* error index */ - s32_t error_index; - /* community name (zero terminated) */ - u8_t community[SNMP_COMMUNITY_STR_LEN + 1]; - /* community string length (exclusive zero term) */ - u8_t com_strlen; - /* one out of MSG_EMPTY, MSG_DEMUX, MSG_INTERNAL, MSG_EXTERNAL_x */ - u8_t state; - /* saved arguments for MSG_EXTERNAL_x */ - struct mib_external_node *ext_mib_node; - struct snmp_name_ptr ext_name_ptr; - struct obj_def ext_object_def; - struct snmp_obj_id ext_oid; - /* index into input variable binding list */ - u8_t vb_idx; - /* ptr into input variable binding list */ - struct snmp_varbind *vb_ptr; - /* list of variable bindings from input */ - struct snmp_varbind_root invb; - /* list of variable bindings to output */ - struct snmp_varbind_root outvb; - /* output response lengths used in ASN encoding */ - struct snmp_resp_header_lengths rhl; -}; - -struct snmp_msg_trap -{ - /* lwIP local port (161) binding */ - struct udp_pcb *pcb; - /* destination IP address in network order */ - ip_addr_t dip; - - /* source enterprise ID (sysObjectID) */ - struct snmp_obj_id *enterprise; - /* source IP address, raw network order format */ - u8_t sip_raw[4]; - /* generic trap code */ - u32_t gen_trap; - /* specific trap code */ - u32_t spc_trap; - /* timestamp */ - u32_t ts; - /* list of variable bindings to output */ - struct snmp_varbind_root outvb; - /* output trap lengths used in ASN encoding */ - struct snmp_trap_header_lengths thl; -}; - -/** Agent Version constant, 0 = v1 oddity */ -extern const s32_t snmp_version; -/** Agent default "public" community string */ -extern const char snmp_publiccommunity[7]; - -extern struct snmp_msg_trap trap_msg; - -/** Agent setup, start listening to port 161. */ -void snmp_init(void); -void snmp_trap_dst_enable(u8_t dst_idx, u8_t enable); -void snmp_trap_dst_ip_set(u8_t dst_idx, ip_addr_t *dst); - -/** Varbind-list functions. */ -struct snmp_varbind* snmp_varbind_alloc(struct snmp_obj_id *oid, u8_t type, u8_t len); -void snmp_varbind_free(struct snmp_varbind *vb); -void snmp_varbind_list_free(struct snmp_varbind_root *root); -void snmp_varbind_tail_add(struct snmp_varbind_root *root, struct snmp_varbind *vb); -struct snmp_varbind* snmp_varbind_tail_remove(struct snmp_varbind_root *root); - -/** Handle an internal (recv) or external (private response) event. */ -void snmp_msg_event(u8_t request_id); -err_t snmp_send_response(struct snmp_msg_pstat *m_stat); -err_t snmp_send_trap(s8_t generic_trap, struct snmp_obj_id *eoid, s32_t specific_trap); -void snmp_coldstart_trap(void); -void snmp_authfail_trap(void); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_MSG_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_structs.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_structs.h deleted file mode 100644 index 0d3b46a9..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/snmp_structs.h +++ /dev/null @@ -1,268 +0,0 @@ -/** - * @file - * Generic MIB tree structures. - * - * @todo namespace prefixes - */ - -/* - * Copyright (c) 2006 Axon Digital Design B.V., The Netherlands. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * Author: Christiaan Simons - */ - -#ifndef __LWIP_SNMP_STRUCTS_H__ -#define __LWIP_SNMP_STRUCTS_H__ - -#include "lwip/opt.h" - -#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/snmp.h" - -#if SNMP_PRIVATE_MIB -/* When using a private MIB, you have to create a file 'private_mib.h' that contains - * a 'struct mib_array_node mib_private' which contains your MIB. */ -#include "private_mib.h" -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/* MIB object instance */ -#define MIB_OBJECT_NONE 0 -#define MIB_OBJECT_SCALAR 1 -#define MIB_OBJECT_TAB 2 - -/* MIB access types */ -#define MIB_ACCESS_READ 1 -#define MIB_ACCESS_WRITE 2 - -/* MIB object access */ -#define MIB_OBJECT_READ_ONLY MIB_ACCESS_READ -#define MIB_OBJECT_READ_WRITE (MIB_ACCESS_READ | MIB_ACCESS_WRITE) -#define MIB_OBJECT_WRITE_ONLY MIB_ACCESS_WRITE -#define MIB_OBJECT_NOT_ACCESSIBLE 0 - -/** object definition returned by (get_object_def)() */ -struct obj_def -{ - /* MIB_OBJECT_NONE (0), MIB_OBJECT_SCALAR (1), MIB_OBJECT_TAB (2) */ - u8_t instance; - /* 0 read-only, 1 read-write, 2 write-only, 3 not-accessible */ - u8_t access; - /* ASN type for this object */ - u8_t asn_type; - /* value length (host length) */ - u16_t v_len; - /* length of instance part of supplied object identifier */ - u8_t id_inst_len; - /* instance part of supplied object identifier */ - s32_t *id_inst_ptr; -}; - -struct snmp_name_ptr -{ - u8_t ident_len; - s32_t *ident; -}; - -/** MIB const scalar (.0) node */ -#define MIB_NODE_SC 0x01 -/** MIB const array node */ -#define MIB_NODE_AR 0x02 -/** MIB array node (mem_malloced from RAM) */ -#define MIB_NODE_RA 0x03 -/** MIB list root node (mem_malloced from RAM) */ -#define MIB_NODE_LR 0x04 -/** MIB node for external objects */ -#define MIB_NODE_EX 0x05 - -/** node "base class" layout, the mandatory fields for a node */ -struct mib_node -{ - /** returns struct obj_def for the given object identifier */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - /** returns object value for the given object identifier, - @note the caller must allocate at least len bytes for the value */ - void (*get_value)(struct obj_def *od, u16_t len, void *value); - /** tests length and/or range BEFORE setting */ - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - /** sets object value, only to be called when set_test() */ - void (*set_value)(struct obj_def *od, u16_t len, void *value); - /** One out of MIB_NODE_AR, MIB_NODE_LR or MIB_NODE_EX */ - u8_t node_type; - /* array or max list length */ - u16_t maxlength; -}; - -/** derived node for scalars .0 index */ -typedef struct mib_node mib_scalar_node; - -/** derived node, points to a fixed size const array - of sub-identifiers plus a 'child' pointer */ -struct mib_array_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - const s32_t *objid; - struct mib_node* const *nptr; -}; - -/** derived node, points to a fixed size mem_malloced array - of sub-identifiers plus a 'child' pointer */ -struct mib_ram_array_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* aditional struct members */ - s32_t *objid; - struct mib_node **nptr; -}; - -struct mib_list_node -{ - struct mib_list_node *prev; - struct mib_list_node *next; - s32_t objid; - struct mib_node *nptr; -}; - -/** derived node, points to a doubly linked list - of sub-identifiers plus a 'child' pointer */ -struct mib_list_rootnode -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - struct mib_list_node *head; - struct mib_list_node *tail; - /* counts list nodes in list */ - u16_t count; -}; - -/** derived node, has access functions for mib object in external memory or device - using 'tree_level' and 'idx', with a range 0 .. (level_length() - 1) */ -struct mib_external_node -{ - /* inherited "base class" members */ - void (*get_object_def)(u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value)(struct obj_def *od, u16_t len, void *value); - u8_t (*set_test)(struct obj_def *od, u16_t len, void *value); - void (*set_value)(struct obj_def *od, u16_t len, void *value); - - u8_t node_type; - u16_t maxlength; - - /* additional struct members */ - /** points to an external (in memory) record of some sort of addressing - information, passed to and interpreted by the funtions below */ - void* addr_inf; - /** tree levels under this node */ - u8_t tree_levels; - /** number of objects at this level */ - u16_t (*level_length)(void* addr_inf, u8_t level); - /** compares object sub identifier with external id - return zero when equal, nonzero when unequal */ - s32_t (*ident_cmp)(void* addr_inf, u8_t level, u16_t idx, s32_t sub_id); - void (*get_objid)(void* addr_inf, u8_t level, u16_t idx, s32_t *sub_id); - - /** async Questions */ - void (*get_object_def_q)(void* addr_inf, u8_t rid, u8_t ident_len, s32_t *ident); - void (*get_value_q)(u8_t rid, struct obj_def *od); - void (*set_test_q)(u8_t rid, struct obj_def *od); - void (*set_value_q)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Answers */ - void (*get_object_def_a)(u8_t rid, u8_t ident_len, s32_t *ident, struct obj_def *od); - void (*get_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - u8_t (*set_test_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - void (*set_value_a)(u8_t rid, struct obj_def *od, u16_t len, void *value); - /** async Panic Close (agent returns error reply, - e.g. used for external transaction cleanup) */ - void (*get_object_def_pc)(u8_t rid, u8_t ident_len, s32_t *ident); - void (*get_value_pc)(u8_t rid, struct obj_def *od); - void (*set_test_pc)(u8_t rid, struct obj_def *od); - void (*set_value_pc)(u8_t rid, struct obj_def *od); -}; - -/** export MIB tree from mib2.c */ -extern const struct mib_array_node internet; - -/** dummy function pointers for non-leaf MIB nodes from mib2.c */ -void noleafs_get_object_def(u8_t ident_len, s32_t *ident, struct obj_def *od); -void noleafs_get_value(struct obj_def *od, u16_t len, void *value); -u8_t noleafs_set_test(struct obj_def *od, u16_t len, void *value); -void noleafs_set_value(struct obj_def *od, u16_t len, void *value); - -void snmp_oidtoip(s32_t *ident, ip_addr_t *ip); -void snmp_iptooid(ip_addr_t *ip, s32_t *ident); -void snmp_ifindextonetif(s32_t ifindex, struct netif **netif); -void snmp_netiftoifindex(struct netif *netif, s32_t *ifidx); - -struct mib_list_node* snmp_mib_ln_alloc(s32_t id); -void snmp_mib_ln_free(struct mib_list_node *ln); -struct mib_list_rootnode* snmp_mib_lrn_alloc(void); -void snmp_mib_lrn_free(struct mib_list_rootnode *lrn); - -s8_t snmp_mib_node_insert(struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **insn); -s8_t snmp_mib_node_find(struct mib_list_rootnode *rn, s32_t objid, struct mib_list_node **fn); -struct mib_list_rootnode *snmp_mib_node_delete(struct mib_list_rootnode *rn, struct mib_list_node *n); - -struct mib_node* snmp_search_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_name_ptr *np); -struct mib_node* snmp_expand_tree(struct mib_node *node, u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret); -u8_t snmp_iso_prefix_tst(u8_t ident_len, s32_t *ident); -u8_t snmp_iso_prefix_expand(u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret); - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SNMP */ - -#endif /* __LWIP_SNMP_STRUCTS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sockets.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sockets.h deleted file mode 100644 index 3c8fed24..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sockets.h +++ /dev/null @@ -1,376 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ - - -#ifndef __LWIP_SOCKETS_H__ -#define __LWIP_SOCKETS_H__ - -#include "lwip/opt.h" - -#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */ - -#include /* for size_t */ - -#include "lwip/ip_addr.h" -#include "lwip/inet.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* members are in network byte order */ -struct sockaddr_in { - u8_t sin_len; - u8_t sin_family; - u16_t sin_port; - struct in_addr sin_addr; - char sin_zero[8]; -}; - -struct sockaddr { - u8_t sa_len; - u8_t sa_family; - char sa_data[14]; -}; - -#ifndef socklen_t -# define socklen_t u32_t -#endif - -/* Socket protocol types (TCP/UDP/RAW) */ -#define SOCK_STREAM 1 -#define SOCK_DGRAM 2 -#define SOCK_RAW 3 - -/* - * Option flags per-socket. These must match the SOF_ flags in ip.h (checked in init.c) - */ -#define SO_DEBUG 0x0001 /* Unimplemented: turn on debugging info recording */ -#define SO_ACCEPTCONN 0x0002 /* socket has had listen() */ -#define SO_REUSEADDR 0x0004 /* Allow local address reuse */ -#define SO_KEEPALIVE 0x0008 /* keep connections alive */ -#define SO_DONTROUTE 0x0010 /* Unimplemented: just use interface addresses */ -#define SO_BROADCAST 0x0020 /* permit to send and to receive broadcast messages (see IP_SOF_BROADCAST option) */ -#define SO_USELOOPBACK 0x0040 /* Unimplemented: bypass hardware when possible */ -#define SO_LINGER 0x0080 /* linger on close if data present */ -#define SO_OOBINLINE 0x0100 /* Unimplemented: leave received OOB data in line */ -#define SO_REUSEPORT 0x0200 /* Unimplemented: allow local address & port reuse */ - -#define SO_DONTLINGER ((int)(~SO_LINGER)) - -/* - * Additional options, not kept in so_options. - */ -#define SO_SNDBUF 0x1001 /* Unimplemented: send buffer size */ -#define SO_RCVBUF 0x1002 /* receive buffer size */ -#define SO_SNDLOWAT 0x1003 /* Unimplemented: send low-water mark */ -#define SO_RCVLOWAT 0x1004 /* Unimplemented: receive low-water mark */ -#define SO_SNDTIMEO 0x1005 /* Unimplemented: send timeout */ -#define SO_RCVTIMEO 0x1006 /* receive timeout */ -#define SO_ERROR 0x1007 /* get error status and clear */ -#define SO_TYPE 0x1008 /* get socket type */ -#define SO_CONTIMEO 0x1009 /* Unimplemented: connect timeout */ -#define SO_NO_CHECK 0x100a /* don't create UDP checksum */ - - -/* - * Structure used for manipulating linger option. - */ -struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time */ -}; - -/* - * Level number for (get/set)sockopt() to apply to socket itself. - */ -#define SOL_SOCKET 0xfff /* options for socket level */ - - -#define AF_UNSPEC 0 -#define AF_INET 2 -#define PF_INET AF_INET -#define PF_UNSPEC AF_UNSPEC - -#define IPPROTO_IP 0 -#define IPPROTO_TCP 6 -#define IPPROTO_UDP 17 -#define IPPROTO_UDPLITE 136 - -/* Flags we can use with send and recv. */ -#define MSG_PEEK 0x01 /* Peeks at an incoming message */ -#define MSG_WAITALL 0x02 /* Unimplemented: Requests that the function block until the full amount of data requested can be returned */ -#define MSG_OOB 0x04 /* Unimplemented: Requests out-of-band data. The significance and semantics of out-of-band data are protocol-specific */ -#define MSG_DONTWAIT 0x08 /* Nonblocking i/o for this operation only */ -#define MSG_MORE 0x10 /* Sender will send more */ - - -/* - * Options for level IPPROTO_IP - */ -#define IP_TOS 1 -#define IP_TTL 2 - -#if LWIP_TCP -/* - * Options for level IPPROTO_TCP - */ -#define TCP_NODELAY 0x01 /* don't delay send to coalesce packets */ -#define TCP_KEEPALIVE 0x02 /* send KEEPALIVE probes when idle for pcb->keep_idle milliseconds */ -#define TCP_KEEPIDLE 0x03 /* set pcb->keep_idle - Same as TCP_KEEPALIVE, but use seconds for get/setsockopt */ -#define TCP_KEEPINTVL 0x04 /* set pcb->keep_intvl - Use seconds for get/setsockopt */ -#define TCP_KEEPCNT 0x05 /* set pcb->keep_cnt - Use number of probes sent for get/setsockopt */ -#endif /* LWIP_TCP */ - -#if LWIP_UDP && LWIP_UDPLITE -/* - * Options for level IPPROTO_UDPLITE - */ -#define UDPLITE_SEND_CSCOV 0x01 /* sender checksum coverage */ -#define UDPLITE_RECV_CSCOV 0x02 /* minimal receiver checksum coverage */ -#endif /* LWIP_UDP && LWIP_UDPLITE*/ - - -#if LWIP_IGMP -/* - * Options and types for UDP multicast traffic handling - */ -#define IP_ADD_MEMBERSHIP 3 -#define IP_DROP_MEMBERSHIP 4 -#define IP_MULTICAST_TTL 5 -#define IP_MULTICAST_IF 6 -#define IP_MULTICAST_LOOP 7 - -typedef struct ip_mreq { - struct in_addr imr_multiaddr; /* IP multicast address of group */ - struct in_addr imr_interface; /* local IP address of interface */ -} ip_mreq; -#endif /* LWIP_IGMP */ - -/* - * The Type of Service provides an indication of the abstract - * parameters of the quality of service desired. These parameters are - * to be used to guide the selection of the actual service parameters - * when transmitting a datagram through a particular network. Several - * networks offer service precedence, which somehow treats high - * precedence traffic as more important than other traffic (generally - * by accepting only traffic above a certain precedence at time of high - * load). The major choice is a three way tradeoff between low-delay, - * high-reliability, and high-throughput. - * The use of the Delay, Throughput, and Reliability indications may - * increase the cost (in some sense) of the service. In many networks - * better performance for one of these parameters is coupled with worse - * performance on another. Except for very unusual cases at most two - * of these three indications should be set. - */ -#define IPTOS_TOS_MASK 0x1E -#define IPTOS_TOS(tos) ((tos) & IPTOS_TOS_MASK) -#define IPTOS_LOWDELAY 0x10 -#define IPTOS_THROUGHPUT 0x08 -#define IPTOS_RELIABILITY 0x04 -#define IPTOS_LOWCOST 0x02 -#define IPTOS_MINCOST IPTOS_LOWCOST - -/* - * The Network Control precedence designation is intended to be used - * within a network only. The actual use and control of that - * designation is up to each network. The Internetwork Control - * designation is intended for use by gateway control originators only. - * If the actual use of these precedence designations is of concern to - * a particular network, it is the responsibility of that network to - * control the access to, and use of, those precedence designations. - */ -#define IPTOS_PREC_MASK 0xe0 -#define IPTOS_PREC(tos) ((tos) & IPTOS_PREC_MASK) -#define IPTOS_PREC_NETCONTROL 0xe0 -#define IPTOS_PREC_INTERNETCONTROL 0xc0 -#define IPTOS_PREC_CRITIC_ECP 0xa0 -#define IPTOS_PREC_FLASHOVERRIDE 0x80 -#define IPTOS_PREC_FLASH 0x60 -#define IPTOS_PREC_IMMEDIATE 0x40 -#define IPTOS_PREC_PRIORITY 0x20 -#define IPTOS_PREC_ROUTINE 0x00 - - -/* - * Commands for ioctlsocket(), taken from the BSD file fcntl.h. - * lwip_ioctl only supports FIONREAD and FIONBIO, for now - * - * Ioctl's have the command encoded in the lower word, - * and the size of any in or out parameters in the upper - * word. The high 2 bits of the upper word are used - * to encode the in/out status of the parameter; for now - * we restrict parameters to at most 128 bytes. - */ -#if !defined(FIONREAD) || !defined(FIONBIO) -#define IOCPARM_MASK 0x7fU /* parameters must be < 128 bytes */ -#define IOC_VOID 0x20000000UL /* no parameters */ -#define IOC_OUT 0x40000000UL /* copy out parameters */ -#define IOC_IN 0x80000000UL /* copy in parameters */ -#define IOC_INOUT (IOC_IN|IOC_OUT) - /* 0x20000000 distinguishes new & - old ioctl's */ -#define _IO(x,y) (IOC_VOID|((x)<<8)|(y)) - -#define _IOR(x,y,t) (IOC_OUT|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) - -#define _IOW(x,y,t) (IOC_IN|(((long)sizeof(t)&IOCPARM_MASK)<<16)|((x)<<8)|(y)) -#endif /* !defined(FIONREAD) || !defined(FIONBIO) */ - -#ifndef FIONREAD -#define FIONREAD _IOR('f', 127, unsigned long) /* get # bytes to read */ -#endif -#ifndef FIONBIO -#define FIONBIO _IOW('f', 126, unsigned long) /* set/clear non-blocking i/o */ -#endif - -/* Socket I/O Controls: unimplemented */ -#ifndef SIOCSHIWAT -#define SIOCSHIWAT _IOW('s', 0, unsigned long) /* set high watermark */ -#define SIOCGHIWAT _IOR('s', 1, unsigned long) /* get high watermark */ -#define SIOCSLOWAT _IOW('s', 2, unsigned long) /* set low watermark */ -#define SIOCGLOWAT _IOR('s', 3, unsigned long) /* get low watermark */ -#define SIOCATMARK _IOR('s', 7, unsigned long) /* at oob mark? */ -#endif - -/* commands for fnctl */ -#ifndef F_GETFL -#define F_GETFL 3 -#endif -#ifndef F_SETFL -#define F_SETFL 4 -#endif - -/* File status flags and file access modes for fnctl, - these are bits in an int. */ -#ifndef O_NONBLOCK -#define O_NONBLOCK 1 /* nonblocking I/O */ -#endif -#ifndef O_NDELAY -#define O_NDELAY 1 /* same as O_NONBLOCK, for compatibility */ -#endif - -#ifndef SHUT_RD - #define SHUT_RD 0 - #define SHUT_WR 1 - #define SHUT_RDWR 2 -#endif - -/* FD_SET used for lwip_select */ -#ifndef FD_SET - #undef FD_SETSIZE - /* Make FD_SETSIZE match NUM_SOCKETS in socket.c */ - #define FD_SETSIZE MEMP_NUM_NETCONN - #define FD_SET(n, p) ((p)->fd_bits[(n)/8] |= (1 << ((n) & 7))) - #define FD_CLR(n, p) ((p)->fd_bits[(n)/8] &= ~(1 << ((n) & 7))) - #define FD_ISSET(n,p) ((p)->fd_bits[(n)/8] & (1 << ((n) & 7))) - #define FD_ZERO(p) memset((void*)(p),0,sizeof(*(p))) - - typedef struct fd_set { - unsigned char fd_bits [(FD_SETSIZE+7)/8]; - } fd_set; - -#endif /* FD_SET */ - -/** LWIP_TIMEVAL_PRIVATE: if you want to use the struct timeval provided - * by your system, set this to 0 and include in cc.h */ -#ifndef LWIP_TIMEVAL_PRIVATE -#define LWIP_TIMEVAL_PRIVATE 1 -#endif - -#if LWIP_TIMEVAL_PRIVATE -struct timeval { - long tv_sec; /* seconds */ - long tv_usec; /* and microseconds */ -}; -#endif /* LWIP_TIMEVAL_PRIVATE */ - -void lwip_socket_init(void); - -int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_shutdown(int s, int how); -int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); -int lwip_close(int s); -int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_listen(int s, int backlog); -int lwip_recv(int s, void *mem, size_t len, int flags); -int lwip_read(int s, void *mem, size_t len); -int lwip_recvfrom(int s, void *mem, size_t len, int flags, - struct sockaddr *from, socklen_t *fromlen); -int lwip_send(int s, const void *dataptr, size_t size, int flags); -int lwip_sendto(int s, const void *dataptr, size_t size, int flags, - const struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_write(int s, const void *dataptr, size_t size); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, - struct timeval *timeout); -int lwip_ioctl(int s, long cmd, void *argp); -int lwip_fcntl(int s, int cmd, int val); - -#if LWIP_COMPAT_SOCKETS -#define accept(a,b,c) lwip_accept(a,b,c) -#define bind(a,b,c) lwip_bind(a,b,c) -#define shutdown(a,b) lwip_shutdown(a,b) -#define closesocket(s) lwip_close(s) -#define connect(a,b,c) lwip_connect(a,b,c) -#define getsockname(a,b,c) lwip_getsockname(a,b,c) -#define getpeername(a,b,c) lwip_getpeername(a,b,c) -#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e) -#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e) -#define listen(a,b) lwip_listen(a,b) -#define recv(a,b,c,d) lwip_recv(a,b,c,d) -#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f) -#define send(a,b,c,d) lwip_send(a,b,c,d) -#define sendto(a,b,c,d,e,f) lwip_sendto(a,b,c,d,e,f) -#define socket(a,b,c) lwip_socket(a,b,c) -#define select(a,b,c,d,e) lwip_select(a,b,c,d,e) -#define ioctlsocket(a,b,c) lwip_ioctl(a,b,c) - -#if LWIP_POSIX_SOCKETS_IO_NAMES -#define read(a,b,c) lwip_read(a,b,c) -#define write(a,b,c) lwip_write(a,b,c) -#define close(s) lwip_close(s) -#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */ - -#endif /* LWIP_COMPAT_SOCKETS */ - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_SOCKET */ - -#endif /* __LWIP_SOCKETS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/stats.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/stats.h deleted file mode 100644 index 43883217..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/stats.h +++ /dev/null @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_STATS_H__ -#define __LWIP_STATS_H__ - -#include "lwip/opt.h" - -#include "lwip/mem.h" -#include "lwip/memp.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if LWIP_STATS - -#ifndef LWIP_STATS_LARGE -#define LWIP_STATS_LARGE 0 -#endif - -#if LWIP_STATS_LARGE -#define STAT_COUNTER u32_t -#define STAT_COUNTER_F U32_F -#else -#define STAT_COUNTER u16_t -#define STAT_COUNTER_F U16_F -#endif - -struct stats_proto { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER fw; /* Forwarded packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER rterr; /* Routing error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER opterr; /* Error in options. */ - STAT_COUNTER err; /* Misc error. */ - STAT_COUNTER cachehit; -}; - -struct stats_igmp { - STAT_COUNTER xmit; /* Transmitted packets. */ - STAT_COUNTER recv; /* Received packets. */ - STAT_COUNTER drop; /* Dropped packets. */ - STAT_COUNTER chkerr; /* Checksum error. */ - STAT_COUNTER lenerr; /* Invalid length error. */ - STAT_COUNTER memerr; /* Out of memory error. */ - STAT_COUNTER proterr; /* Protocol error. */ - STAT_COUNTER rx_v1; /* Received v1 frames. */ - STAT_COUNTER rx_group; /* Received group-specific queries. */ - STAT_COUNTER rx_general; /* Received general queries. */ - STAT_COUNTER rx_report; /* Received reports. */ - STAT_COUNTER tx_join; /* Sent joins. */ - STAT_COUNTER tx_leave; /* Sent leaves. */ - STAT_COUNTER tx_report; /* Sent reports. */ -}; - -struct stats_mem { -#ifdef LWIP_DEBUG - const char *name; -#endif /* LWIP_DEBUG */ - mem_size_t avail; - mem_size_t used; - mem_size_t max; - STAT_COUNTER err; - STAT_COUNTER illegal; -}; - -struct stats_syselem { - STAT_COUNTER used; - STAT_COUNTER max; - STAT_COUNTER err; -}; - -struct stats_sys { - struct stats_syselem sem; - struct stats_syselem mutex; - struct stats_syselem mbox; -}; - -struct stats_ { -#if LINK_STATS - struct stats_proto link; -#endif -#if ETHARP_STATS - struct stats_proto etharp; -#endif -#if IPFRAG_STATS - struct stats_proto ip_frag; -#endif -#if IP_STATS - struct stats_proto ip; -#endif -#if ICMP_STATS - struct stats_proto icmp; -#endif -#if IGMP_STATS - struct stats_igmp igmp; -#endif -#if UDP_STATS - struct stats_proto udp; -#endif -#if TCP_STATS - struct stats_proto tcp; -#endif -#if MEM_STATS - struct stats_mem mem; -#endif -#if MEMP_STATS - struct stats_mem memp[MEMP_MAX]; -#endif -#if SYS_STATS - struct stats_sys sys; -#endif -}; - -extern struct stats_ lwip_stats; - -void stats_init(void)ICACHE_FLASH_ATTR; - -#define STATS_INC(x) ++lwip_stats.x -#define STATS_DEC(x) --lwip_stats.x -#define STATS_INC_USED(x, y) do { lwip_stats.x.used += y; \ - if (lwip_stats.x.max < lwip_stats.x.used) { \ - lwip_stats.x.max = lwip_stats.x.used; \ - } \ - } while(0) -#else /* LWIP_STATS */ -#define stats_init() -#define STATS_INC(x) -#define STATS_DEC(x) -#define STATS_INC_USED(x) -#endif /* LWIP_STATS */ - -#if TCP_STATS -#define TCP_STATS_INC(x) STATS_INC(x) -#define TCP_STATS_DISPLAY() stats_display_proto(&lwip_stats.tcp, "TCP") -#else -#define TCP_STATS_INC(x) -#define TCP_STATS_DISPLAY() -#endif - -#if UDP_STATS -#define UDP_STATS_INC(x) STATS_INC(x) -#define UDP_STATS_DISPLAY() stats_display_proto(&lwip_stats.udp, "UDP") -#else -#define UDP_STATS_INC(x) -#define UDP_STATS_DISPLAY() -#endif - -#if ICMP_STATS -#define ICMP_STATS_INC(x) STATS_INC(x) -#define ICMP_STATS_DISPLAY() stats_display_proto(&lwip_stats.icmp, "ICMP") -#else -#define ICMP_STATS_INC(x) -#define ICMP_STATS_DISPLAY() -#endif - -#if IGMP_STATS -#define IGMP_STATS_INC(x) STATS_INC(x) -#define IGMP_STATS_DISPLAY() stats_display_igmp(&lwip_stats.igmp) -#else -#define IGMP_STATS_INC(x) -#define IGMP_STATS_DISPLAY() -#endif - -#if IP_STATS -#define IP_STATS_INC(x) STATS_INC(x) -#define IP_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip, "IP") -#else -#define IP_STATS_INC(x) -#define IP_STATS_DISPLAY() -#endif - -#if IPFRAG_STATS -#define IPFRAG_STATS_INC(x) STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() stats_display_proto(&lwip_stats.ip_frag, "IP_FRAG") -#else -#define IPFRAG_STATS_INC(x) -#define IPFRAG_STATS_DISPLAY() -#endif - -#if ETHARP_STATS -#define ETHARP_STATS_INC(x) STATS_INC(x) -#define ETHARP_STATS_DISPLAY() stats_display_proto(&lwip_stats.etharp, "ETHARP") -#else -#define ETHARP_STATS_INC(x) -#define ETHARP_STATS_DISPLAY() -#endif - -#if LINK_STATS -#define LINK_STATS_INC(x) STATS_INC(x) -#define LINK_STATS_DISPLAY() stats_display_proto(&lwip_stats.link, "LINK") -#else -#define LINK_STATS_INC(x) -#define LINK_STATS_DISPLAY() -#endif - -#if MEM_STATS -#define MEM_STATS_AVAIL(x, y) lwip_stats.mem.x = y -#define MEM_STATS_INC(x) STATS_INC(mem.x) -#define MEM_STATS_INC_USED(x, y) STATS_INC_USED(mem, y) -#define MEM_STATS_DEC_USED(x, y) lwip_stats.mem.x -= y -#define MEM_STATS_DISPLAY() stats_display_mem(&lwip_stats.mem, "HEAP") -#else -#define MEM_STATS_AVAIL(x, y) -#define MEM_STATS_INC(x) -#define MEM_STATS_INC_USED(x, y) -#define MEM_STATS_DEC_USED(x, y) -#define MEM_STATS_DISPLAY() -#endif - -#if MEMP_STATS -#define MEMP_STATS_AVAIL(x, i, y) lwip_stats.memp[i].x = y -#define MEMP_STATS_INC(x, i) STATS_INC(memp[i].x) -#define MEMP_STATS_DEC(x, i) STATS_DEC(memp[i].x) -#define MEMP_STATS_INC_USED(x, i) STATS_INC_USED(memp[i], 1) -#define MEMP_STATS_DISPLAY(i) stats_display_memp(&lwip_stats.memp[i], i) -#else -#define MEMP_STATS_AVAIL(x, i, y) -#define MEMP_STATS_INC(x, i) -#define MEMP_STATS_DEC(x, i) -#define MEMP_STATS_INC_USED(x, i) -#define MEMP_STATS_DISPLAY(i) -#endif - -#if SYS_STATS -#define SYS_STATS_INC(x) STATS_INC(sys.x) -#define SYS_STATS_DEC(x) STATS_DEC(sys.x) -#define SYS_STATS_INC_USED(x) STATS_INC_USED(sys.x, 1) -#define SYS_STATS_DISPLAY() stats_display_sys(&lwip_stats.sys) -#else -#define SYS_STATS_INC(x) -#define SYS_STATS_DEC(x) -#define SYS_STATS_INC_USED(x) -#define SYS_STATS_DISPLAY() -#endif - -/* Display of statistics */ -#if LWIP_STATS_DISPLAY -void stats_display(void)ICACHE_FLASH_ATTR; -void stats_display_proto(struct stats_proto *proto, char *name)ICACHE_FLASH_ATTR; -void stats_display_igmp(struct stats_igmp *igmp)ICACHE_FLASH_ATTR; -void stats_display_mem(struct stats_mem *mem, char *name)ICACHE_FLASH_ATTR; -void stats_display_memp(struct stats_mem *mem, int index)ICACHE_FLASH_ATTR; -void stats_display_sys(struct stats_sys *sys)ICACHE_FLASH_ATTR; -#else /* LWIP_STATS_DISPLAY */ -#define stats_display() -#define stats_display_proto(proto, name) -#define stats_display_igmp(igmp) -#define stats_display_mem(mem, name) -#define stats_display_memp(mem, index) -#define stats_display_sys(sys) -#endif /* LWIP_STATS_DISPLAY */ - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_STATS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sys.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sys.h deleted file mode 100644 index 31a9dea7..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/sys.h +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_SYS_H__ -#define __LWIP_SYS_H__ - -#include "lwip/opt.h" - -#include "eagle_soc.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#if NO_SYS - -/* For a totally minimal and standalone system, we provide null - definitions of the sys_ functions. */ -typedef u8_t sys_sem_t; -typedef u8_t sys_mutex_t; -typedef u8_t sys_mbox_t; - -#define sys_sem_new(s, c) ERR_OK -#define sys_sem_signal(s) -#define sys_sem_wait(s) -#define sys_arch_sem_wait(s,t) -#define sys_sem_free(s) -#define sys_mutex_new(mu) ERR_OK -#define sys_mutex_lock(mu) -#define sys_mutex_unlock(mu) -#define sys_mutex_free(mu) -#define sys_mbox_new(m, s) ERR_OK -#define sys_mbox_fetch(m,d) -#define sys_mbox_tryfetch(m,d) -#define sys_mbox_post(m,d) -#define sys_mbox_trypost(m,d) -#define sys_mbox_free(m) - -#define sys_thread_new(n,t,a,s,p) - -#define sys_msleep(t) - -#else /* NO_SYS */ - -/** Return code for timeouts from sys_arch_mbox_fetch and sys_arch_sem_wait */ -#define SYS_ARCH_TIMEOUT 0xffffffffUL - -/** sys_mbox_tryfetch() returns SYS_MBOX_EMPTY if appropriate. - * For now we use the same magic value, but we allow this to change in future. - */ -#define SYS_MBOX_EMPTY SYS_ARCH_TIMEOUT - -#include "lwip/err.h" -#include "arch/sys_arch.h" - -/** Function prototype for thread functions */ -typedef void (*lwip_thread_fn)(void *arg); - -/* Function prototypes for functions to be implemented by platform ports - (in sys_arch.c) */ - -/* Mutex functions: */ - -/** Define LWIP_COMPAT_MUTEX if the port has no mutexes and binary semaphores - should be used instead */ -#if LWIP_COMPAT_MUTEX -/* for old ports that don't have mutexes: define them to binary semaphores */ -#define sys_mutex_t sys_sem_t -#define sys_mutex_new(mutex) sys_sem_new(mutex, 1) -#define sys_mutex_lock(mutex) sys_sem_wait(mutex) -#define sys_mutex_unlock(mutex) sys_sem_signal(mutex) -#define sys_mutex_free(mutex) sys_sem_free(mutex) -#define sys_mutex_valid(mutex) sys_sem_valid(mutex) -#define sys_mutex_set_invalid(mutex) sys_sem_set_invalid(mutex) - -#else /* LWIP_COMPAT_MUTEX */ - -/** Create a new mutex - * @param mutex pointer to the mutex to create - * @return a new mutex */ -err_t sys_mutex_new(sys_mutex_t *mutex); -/** Lock a mutex - * @param mutex the mutex to lock */ -void sys_mutex_lock(sys_mutex_t *mutex); -/** Unlock a mutex - * @param mutex the mutex to unlock */ -void sys_mutex_unlock(sys_mutex_t *mutex); -/** Delete a semaphore - * @param mutex the mutex to delete */ -void sys_mutex_free(sys_mutex_t *mutex); -#ifndef sys_mutex_valid -/** Check if a mutex is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_mutex_valid(sys_mutex_t *mutex); -#endif -#ifndef sys_mutex_set_invalid -/** Set a mutex invalid so that sys_mutex_valid returns 0 */ -void sys_mutex_set_invalid(sys_mutex_t *mutex); -#endif -#endif /* LWIP_COMPAT_MUTEX */ - -/* Semaphore functions: */ - -/** Create a new semaphore - * @param sem pointer to the semaphore to create - * @param count initial count of the semaphore - * @return ERR_OK if successful, another err_t otherwise */ -err_t sys_sem_new(sys_sem_t *sem, u8_t count); -/** Signals a semaphore - * @param sem the semaphore to signal */ -void sys_sem_signal(sys_sem_t *sem); -/** Wait for a semaphore for the specified timeout - * @param sem the semaphore to wait for - * @param timeout timeout in milliseconds to wait (0 = wait forever) - * @return time (in milliseconds) waited for the semaphore - * or SYS_ARCH_TIMEOUT on timeout */ -u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout); -/** Delete a semaphore - * @param sem semaphore to delete */ -void sys_sem_free(sys_sem_t *sem); -/** Wait for a semaphore - forever/no timeout */ -#define sys_sem_wait(sem) sys_arch_sem_wait(sem, 0) -#ifndef sys_sem_valid -/** Check if a sempahore is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_sem_valid(sys_sem_t *sem); -#endif -#ifndef sys_sem_set_invalid -/** Set a semaphore invalid so that sys_sem_valid returns 0 */ -void sys_sem_set_invalid(sys_sem_t *sem); -#endif - -/* Time functions. */ -#ifndef sys_msleep -void sys_msleep(u32_t ms); /* only has a (close to) 1 jiffy resolution. */ -#endif - -/* Mailbox functions. */ - -/** Create a new mbox of specified size - * @param mbox pointer to the mbox to create - * @param size (miminum) number of messages in this mbox - * @return ERR_OK if successful, another err_t otherwise */ -err_t sys_mbox_new(sys_mbox_t *mbox, int size); -/** Post a message to an mbox - may not fail - * -> blocks if full, only used from tasks not from ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) */ -void sys_mbox_post(sys_mbox_t *mbox, void *msg); -/** Try to post a message to an mbox - may fail if full or ISR - * @param mbox mbox to posts the message - * @param msg message to post (ATTENTION: can be NULL) */ -err_t sys_mbox_trypost(sys_mbox_t *mbox, void *msg); -/** Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message - * @return time (in milliseconds) waited for a message, may be 0 if not waited - or SYS_ARCH_TIMEOUT on timeout - * The returned time has to be accurate to prevent timer jitter! */ -u32_t sys_arch_mbox_fetch(sys_mbox_t *mbox, void **msg, u32_t timeout); -/* Allow port to override with a macro, e.g. special timout for sys_arch_mbox_fetch() */ -#ifndef sys_arch_mbox_tryfetch -/** Wait for a new message to arrive in the mbox - * @param mbox mbox to get a message from - * @param msg pointer where the message is stored - * @param timeout maximum time (in milliseconds) to wait for a message - * @return 0 (milliseconds) if a message has been received - * or SYS_MBOX_EMPTY if the mailbox is empty */ -u32_t sys_arch_mbox_tryfetch(sys_mbox_t *mbox, void **msg); -#endif -/** For now, we map straight to sys_arch implementation. */ -#define sys_mbox_tryfetch(mbox, msg) sys_arch_mbox_tryfetch(mbox, msg) -/** Delete an mbox - * @param mbox mbox to delete */ -void sys_mbox_free(sys_mbox_t *mbox); -#define sys_mbox_fetch(mbox, msg) sys_arch_mbox_fetch(mbox, msg, 0) -#ifndef sys_mbox_valid -/** Check if an mbox is valid/allocated: return 1 for valid, 0 for invalid */ -int sys_mbox_valid(sys_mbox_t *mbox); -#endif -#ifndef sys_mbox_set_invalid -/** Set an mbox invalid so that sys_mbox_valid returns 0 */ -void sys_mbox_set_invalid(sys_mbox_t *mbox); -#endif - -/** The only thread function: - * Creates a new thread - * @param name human-readable name for the thread (used for debugging purposes) - * @param thread thread-function - * @param arg parameter passed to 'thread' - * @param stacksize stack size in bytes for the new thread (may be ignored by ports) - * @param prio priority of the new thread (may be ignored by ports) */ -sys_thread_t sys_thread_new(const char *name, lwip_thread_fn thread, void *arg, int stacksize, int prio); - -#endif /* NO_SYS */ - -/* sys_init() must be called before anthing else. */ -void sys_init(void)ICACHE_FLASH_ATTR; - -#ifndef sys_jiffies -/** Ticks/jiffies since power up. */ -u32_t sys_jiffies(void)ICACHE_FLASH_ATTR; -#endif - -/** Returns the current time in milliseconds, - * may be the same as sys_jiffies or at least based on it. */ -static inline u32_t sys_now(void) ICACHE_FLASH_ATTR; -static inline u32_t sys_now(void) -{ - return NOW()/(TIMER_CLK_FREQ/1000); -} - -/* Critical Region Protection */ -/* These functions must be implemented in the sys_arch.c file. - In some implementations they can provide a more light-weight protection - mechanism than using semaphores. Otherwise semaphores can be used for - implementation */ -#ifndef SYS_ARCH_PROTECT -/** SYS_LIGHTWEIGHT_PROT - * define SYS_LIGHTWEIGHT_PROT in lwipopts.h if you want inter-task protection - * for certain critical regions during buffer allocation, deallocation and memory - * allocation and deallocation. - */ -#if SYS_LIGHTWEIGHT_PROT - -/** SYS_ARCH_DECL_PROTECT - * declare a protection variable. This macro will default to defining a variable of - * type sys_prot_t. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h. - */ -#define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev -/** SYS_ARCH_PROTECT - * Perform a "fast" protect. This could be implemented by - * disabling interrupts for an embedded system or by using a semaphore or - * mutex. The implementation should allow calling SYS_ARCH_PROTECT when - * already protected. The old protection level is returned in the variable - * "lev". This macro will default to calling the sys_arch_protect() function - * which should be implemented in sys_arch.c. If a particular port needs a - * different implementation, then this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_PROTECT(lev) lev = sys_arch_protect() -/** SYS_ARCH_UNPROTECT - * Perform a "fast" set of the protection level to "lev". This could be - * implemented by setting the interrupt level to "lev" within the MACRO or by - * using a semaphore or mutex. This macro will default to calling the - * sys_arch_unprotect() function which should be implemented in - * sys_arch.c. If a particular port needs a different implementation, then - * this macro may be defined in sys_arch.h - */ -#define SYS_ARCH_UNPROTECT(lev) sys_arch_unprotect(lev) -sys_prot_t sys_arch_protect(void)ICACHE_FLASH_ATTR; -void sys_arch_unprotect(sys_prot_t pval)ICACHE_FLASH_ATTR; - -#else - -#define SYS_ARCH_DECL_PROTECT(lev) -#define SYS_ARCH_PROTECT(lev) lev = os_intr_lock() //fix by ives at 2014.3.24 -#define SYS_ARCH_UNPROTECT(lev) lev = os_intr_unlock() - -#endif /* SYS_LIGHTWEIGHT_PROT */ - -#endif /* SYS_ARCH_PROTECT */ - -/* - * Macros to set/get and increase/decrease variables in a thread-safe way. - * Use these for accessing variable that are used from more than one thread. - */ - -#ifndef SYS_ARCH_INC -#define SYS_ARCH_INC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var += val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_INC */ - -#ifndef SYS_ARCH_DEC -#define SYS_ARCH_DEC(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var -= val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_DEC */ - -#ifndef SYS_ARCH_GET -#define SYS_ARCH_GET(var, ret) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - ret = var; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_GET */ - -#ifndef SYS_ARCH_SET -#define SYS_ARCH_SET(var, val) do { \ - SYS_ARCH_DECL_PROTECT(old_level); \ - SYS_ARCH_PROTECT(old_level); \ - var = val; \ - SYS_ARCH_UNPROTECT(old_level); \ - } while(0) -#endif /* SYS_ARCH_SET */ - - -#ifdef __cplusplus -} -#endif - -#endif /* __LWIP_SYS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp.h deleted file mode 100644 index 909ff9b7..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp.h +++ /dev/null @@ -1,377 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCP_H__ -#define __LWIP_TCP_H__ - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/sys.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -struct tcp_pcb; - -/** Function prototype for tcp accept callback functions. Called when a new - * connection can be accepted on a listening pcb. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param newpcb The new connection pcb - * @param err An error code if there has been an error accepting. - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_accept_fn)(void *arg, struct tcp_pcb *newpcb, err_t err); - -/** Function prototype for tcp receive callback functions. Called when data has - * been received. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which received data - * @param p The received data (or NULL when the connection has been closed!) - * @param err An error code if there has been an error receiving - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_recv_fn)(void *arg, struct tcp_pcb *tpcb, - struct pbuf *p, err_t err); - -/** Function prototype for tcp sent callback functions. Called when sent data has - * been acknowledged by the remote side. Use it to free corresponding resources. - * This also means that the pcb has now space available to send new data. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb for which data has been acknowledged - * @param len The amount of bytes acknowledged - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_sent_fn)(void *arg, struct tcp_pcb *tpcb, - u16_t len); - -/** Function prototype for tcp poll callback functions. Called periodically as - * specified by @see tcp_poll. - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb tcp pcb - * @return ERR_OK: try to send some data by calling tcp_output - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - */ -typedef err_t (*tcp_poll_fn)(void *arg, struct tcp_pcb *tpcb); - -/** Function prototype for tcp error callback functions. Called when the pcb - * receives a RST or is unexpectedly closed for any other reason. - * - * @note The corresponding pcb is already freed when this callback is called! - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param err Error code to indicate why the pcb has been closed - * ERR_ABRT: aborted through tcp_abort or by a TCP timer - * ERR_RST: the connection was reset by the remote host - */ -typedef void (*tcp_err_fn)(void *arg, err_t err); - -/** Function prototype for tcp connected callback functions. Called when a pcb - * is connected to the remote side after initiating a connection attempt by - * calling tcp_connect(). - * - * @param arg Additional argument to pass to the callback function (@see tcp_arg()) - * @param tpcb The connection pcb which is connected - * @param err An unused error code, always ERR_OK currently ;-) TODO! - * Only return ERR_ABRT if you have called tcp_abort from within the - * callback function! - * - * @note When a connection attempt fails, the error callback is currently called! - */ -typedef err_t (*tcp_connected_fn)(void *arg, struct tcp_pcb *tpcb, err_t err); - -enum tcp_state { - CLOSED = 0, - LISTEN = 1, - SYN_SENT = 2, - SYN_RCVD = 3, - ESTABLISHED = 4, - FIN_WAIT_1 = 5, - FIN_WAIT_2 = 6, - CLOSE_WAIT = 7, - CLOSING = 8, - LAST_ACK = 9, - TIME_WAIT = 10 -}; - -#if LWIP_CALLBACK_API - /* Function to call when a listener has been connected. - * @param arg user-supplied argument (tcp_pcb.callback_arg) - * @param pcb a new tcp_pcb that now is connected - * @param err an error argument (TODO: that is current always ERR_OK?) - * @return ERR_OK: accept the new connection, - * any other err_t abortsthe new connection - */ -#define DEF_ACCEPT_CALLBACK tcp_accept_fn accept; -#else /* LWIP_CALLBACK_API */ -#define DEF_ACCEPT_CALLBACK -#endif /* LWIP_CALLBACK_API */ - -/** - * members common to struct tcp_pcb and struct tcp_listen_pcb - */ -#define TCP_PCB_COMMON(type) \ - type *next; /* for the linked list */ \ - enum tcp_state state; /* TCP state */ \ - u8_t prio; \ - void *callback_arg; \ - /* the accept callback for listen- and normal pcbs, if LWIP_CALLBACK_API */ \ - DEF_ACCEPT_CALLBACK \ - /* ports are in host byte order */ \ - u16_t local_port - - -/* the TCP protocol control block */ -struct tcp_pcb { -/** common PCB members */ - IP_PCB; -/** protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb); - - /* ports are in host byte order */ - u16_t remote_port; - - u8_t flags; -#define TF_ACK_DELAY ((u8_t)0x01U) /* Delayed ACK. */ -#define TF_ACK_NOW ((u8_t)0x02U) /* Immediate ACK. */ -#define TF_INFR ((u8_t)0x04U) /* In fast recovery. */ -#define TF_TIMESTAMP ((u8_t)0x08U) /* Timestamp option enabled */ -#define TF_RXCLOSED ((u8_t)0x10U) /* rx closed by tcp_shutdown */ -#define TF_FIN ((u8_t)0x20U) /* Connection was closed locally (FIN segment enqueued). */ -#define TF_NODELAY ((u8_t)0x40U) /* Disable Nagle algorithm */ -#define TF_NAGLEMEMERR ((u8_t)0x80U) /* nagle enabled, memerr, try to output to prevent delayed ACK to happen */ - - /* the rest of the fields are in host byte order - as we have to do some math with them */ - /* receiver variables */ - u32_t rcv_nxt; /* next seqno expected */ - u16_t rcv_wnd; /* receiver window available */ - u16_t rcv_ann_wnd; /* receiver window to announce */ - u32_t rcv_ann_right_edge; /* announced right edge of window */ - - /* Timers */ - u32_t tmr; - u8_t polltmr, pollinterval; - - /* Retransmission timer. */ - s16_t rtime; - - u16_t mss; /* maximum segment size */ - - /* RTT (round trip time) estimation variables */ - u32_t rttest; /* RTT estimate in 500ms ticks */ - u32_t rtseq; /* sequence number being timed */ - s16_t sa, sv; /* @todo document this */ - - s16_t rto; /* retransmission time-out */ - u8_t nrtx; /* number of retransmissions */ - - /* fast retransmit/recovery */ - u32_t lastack; /* Highest acknowledged seqno. */ - u8_t dupacks; - - /* congestion avoidance/control variables */ - u16_t cwnd; - u16_t ssthresh; - - /* sender variables */ - u32_t snd_nxt; /* next new seqno to be sent */ - u16_t snd_wnd; /* sender window */ - u32_t snd_wl1, snd_wl2; /* Sequence and acknowledgement numbers of last - window update. */ - u32_t snd_lbb; /* Sequence number of next byte to be buffered. */ - - u16_t acked; - - u16_t snd_buf; /* Available buffer space for sending (in bytes). */ -#define TCP_SNDQUEUELEN_OVERFLOW (0xffff-3) - u16_t snd_queuelen; /* Available buffer space for sending (in tcp_segs). */ - -#if TCP_OVERSIZE - /* Extra bytes available at the end of the last pbuf in unsent. */ - u16_t unsent_oversize; -#endif /* TCP_OVERSIZE */ - - /* These are ordered by sequence number: */ - struct tcp_seg *unsent; /* Unsent (queued) segments. */ - struct tcp_seg *unacked; /* Sent but unacknowledged segments. */ -#if TCP_QUEUE_OOSEQ - struct tcp_seg *ooseq; /* Received out of sequence segments. */ -#endif /* TCP_QUEUE_OOSEQ */ - - struct pbuf *refused_data; /* Data previously received but not yet taken by upper layer */ - -#if LWIP_CALLBACK_API - /* Function to be called when more send buffer space is available. */ - tcp_sent_fn sent; - /* Function to be called when (in-sequence) data has arrived. */ - tcp_recv_fn recv; - /* Function to be called when a connection has been set up. */ - tcp_connected_fn connected; - /* Function which is called periodically. */ - tcp_poll_fn poll; - /* Function to be called whenever a fatal error occurs. */ - tcp_err_fn errf; -#endif /* LWIP_CALLBACK_API */ - -#if LWIP_TCP_TIMESTAMPS - u32_t ts_lastacksent; - u32_t ts_recent; -#endif /* LWIP_TCP_TIMESTAMPS */ - - /* idle time before KEEPALIVE is sent */ - u32_t keep_idle; -#if LWIP_TCP_KEEPALIVE - u32_t keep_intvl; - u32_t keep_cnt; -#endif /* LWIP_TCP_KEEPALIVE */ - - /* Persist timer counter */ - u32_t persist_cnt; - /* Persist timer back-off */ - u8_t persist_backoff; - - /* KEEPALIVE counter */ - u8_t keep_cnt_sent; -}; - -struct tcp_pcb_listen { -/* Common members of all PCB types */ - IP_PCB; -/* Protocol specific PCB members */ - TCP_PCB_COMMON(struct tcp_pcb_listen); - -#if TCP_LISTEN_BACKLOG - u8_t backlog; - u8_t accepts_pending; -#endif /* TCP_LISTEN_BACKLOG */ -}; - -#if LWIP_EVENT_API - -enum lwip_event { - LWIP_EVENT_ACCEPT, - LWIP_EVENT_SENT, - LWIP_EVENT_RECV, - LWIP_EVENT_CONNECTED, - LWIP_EVENT_POLL, - LWIP_EVENT_ERR -}; - -err_t lwip_tcp_event(void *arg, struct tcp_pcb *pcb, - enum lwip_event, - struct pbuf *p, - u16_t size, - err_t err); - -#endif /* LWIP_EVENT_API */ - -/* Application program's interface: */ -struct tcp_pcb * tcp_new (void)ICACHE_FLASH_ATTR; - -void tcp_arg (struct tcp_pcb *pcb, void *arg) ICACHE_FLASH_ATTR; -void tcp_accept (struct tcp_pcb *pcb, tcp_accept_fn accept) ICACHE_FLASH_ATTR; -void tcp_recv (struct tcp_pcb *pcb, tcp_recv_fn recv) ICACHE_FLASH_ATTR; -void tcp_sent (struct tcp_pcb *pcb, tcp_sent_fn sent)ICACHE_FLASH_ATTR; -void tcp_poll (struct tcp_pcb *pcb, tcp_poll_fn poll, u8_t interval)ICACHE_FLASH_ATTR; -void tcp_err (struct tcp_pcb *pcb, tcp_err_fn err)ICACHE_FLASH_ATTR; - -#define tcp_mss(pcb) (((pcb)->flags & TF_TIMESTAMP) ? ((pcb)->mss - 12) : (pcb)->mss) -#define tcp_sndbuf(pcb) ((pcb)->snd_buf) -#define tcp_sndqueuelen(pcb) ((pcb)->snd_queuelen) -#define tcp_nagle_disable(pcb) ((pcb)->flags |= TF_NODELAY) -#define tcp_nagle_enable(pcb) ((pcb)->flags &= ~TF_NODELAY) -#define tcp_nagle_disabled(pcb) (((pcb)->flags & TF_NODELAY) != 0) - -#if TCP_LISTEN_BACKLOG -#define tcp_accepted(pcb) do { \ - LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", pcb->state == LISTEN); \ - (((struct tcp_pcb_listen *)(pcb))->accepts_pending--); } while(0) -#else /* TCP_LISTEN_BACKLOG */ -#define tcp_accepted(pcb) LWIP_ASSERT("pcb->state == LISTEN (called for wrong pcb?)", \ - pcb->state == LISTEN) -#endif /* TCP_LISTEN_BACKLOG */ - -void tcp_recved (struct tcp_pcb *pcb, u16_t len)ICACHE_FLASH_ATTR; -err_t tcp_bind (struct tcp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -err_t tcp_connect (struct tcp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port, tcp_connected_fn connected)ICACHE_FLASH_ATTR; - -struct tcp_pcb * tcp_listen_with_backlog(struct tcp_pcb *pcb, u8_t backlog)ICACHE_FLASH_ATTR; -#define tcp_listen(pcb) tcp_listen_with_backlog(pcb, TCP_DEFAULT_LISTEN_BACKLOG) - -void tcp_abort (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_close (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_shutdown(struct tcp_pcb *pcb, int shut_rx, int shut_tx)ICACHE_FLASH_ATTR; - -/* Flags for "apiflags" parameter in tcp_write */ -#define TCP_WRITE_FLAG_COPY 0x01 -#define TCP_WRITE_FLAG_MORE 0x02 - -err_t tcp_write (struct tcp_pcb *pcb, const void *dataptr, u16_t len, - u8_t apiflags)ICACHE_FLASH_ATTR; - -void tcp_setprio (struct tcp_pcb *pcb, u8_t prio)ICACHE_FLASH_ATTR; - -#define TCP_PRIO_MIN 1 -#define TCP_PRIO_NORMAL 64 -#define TCP_PRIO_MAX 127 - -extern err_t tcp_output(struct tcp_pcb *pcb); - - -const char* tcp_debug_state_str(enum tcp_state s)ICACHE_FLASH_ATTR; - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* __LWIP_TCP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp_impl.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp_impl.h deleted file mode 100644 index f906c0d1..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcp_impl.h +++ /dev/null @@ -1,472 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCP_IMPL_H__ -#define __LWIP_TCP_IMPL_H__ - -#include "lwip/opt.h" - -#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/tcp.h" -#include "lwip/sys.h" -#include "lwip/mem.h" -#include "lwip/pbuf.h" -#include "lwip/ip.h" -#include "lwip/icmp.h" -#include "lwip/err.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/* Functions for interfacing with TCP: */ - -/* Lower layer interface to TCP: */ -#define tcp_init() /* Compatibility define, no init needed. */ -void tcp_tmr (void)ICACHE_FLASH_ATTR; /* Must be called every - TCP_TMR_INTERVAL - ms. (Typically 250 ms). */ -/* It is also possible to call these two functions at the right - intervals (instead of calling tcp_tmr()). */ -void tcp_slowtmr (void)ICACHE_FLASH_ATTR; -void tcp_fasttmr (void)ICACHE_FLASH_ATTR; - - -/* Only used by IP to pass a TCP segment to TCP: */ -void tcp_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; -/* Used within the TCP code only: */ -struct tcp_pcb * tcp_alloc (u8_t prio)ICACHE_FLASH_ATTR; -void tcp_abandon (struct tcp_pcb *pcb, int reset)ICACHE_FLASH_ATTR; -err_t tcp_send_empty_ack(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit_rto (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_rexmit_fast (struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -u32_t tcp_update_rcv_ann_wnd(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -/** - * This is the Nagle algorithm: try to combine user data to send as few TCP - * segments as possible. Only send if - * - no previously transmitted data on the connection remains unacknowledged or - * - the TF_NODELAY flag is set (nagle algorithm turned off for this pcb) or - * - the only unsent segment is at least pcb->mss bytes long (or there is more - * than one unsent segment - with lwIP, this can happen although unsent->len < mss) - * - or if we are in fast-retransmit (TF_INFR) - */ -#define tcp_do_output_nagle(tpcb) ((((tpcb)->unacked == NULL) || \ - ((tpcb)->flags & (TF_NODELAY | TF_INFR)) || \ - (((tpcb)->unsent != NULL) && (((tpcb)->unsent->next != NULL) || \ - ((tpcb)->unsent->len >= (tpcb)->mss))) \ - ) ? 1 : 0) -#define tcp_output_nagle(tpcb) (tcp_do_output_nagle(tpcb) ? tcp_output(tpcb) : ERR_OK) - - -#define TCP_SEQ_LT(a,b) ((s32_t)((a)-(b)) < 0) -#define TCP_SEQ_LEQ(a,b) ((s32_t)((a)-(b)) <= 0) -#define TCP_SEQ_GT(a,b) ((s32_t)((a)-(b)) > 0) -#define TCP_SEQ_GEQ(a,b) ((s32_t)((a)-(b)) >= 0) -/* is b<=a<=c? */ -#if 0 /* see bug #10548 */ -#define TCP_SEQ_BETWEEN(a,b,c) ((c)-(b) >= (a)-(b)) -#endif -#define TCP_SEQ_BETWEEN(a,b,c) (TCP_SEQ_GEQ(a,b) && TCP_SEQ_LEQ(a,c)) -#define TCP_FIN 0x01U -#define TCP_SYN 0x02U -#define TCP_RST 0x04U -#define TCP_PSH 0x08U -#define TCP_ACK 0x10U -#define TCP_URG 0x20U -#define TCP_ECE 0x40U -#define TCP_CWR 0x80U - -#define TCP_FLAGS 0x3fU - -/* Length of the TCP header, excluding options. */ -#define TCP_HLEN 20 - -#ifndef TCP_TMR_INTERVAL -#define TCP_TMR_INTERVAL 250 /* The TCP timer interval in milliseconds. */ -#endif /* TCP_TMR_INTERVAL */ - -#ifndef TCP_FAST_INTERVAL -#define TCP_FAST_INTERVAL TCP_TMR_INTERVAL /* the fine grained timeout in milliseconds */ -#endif /* TCP_FAST_INTERVAL */ - -#ifndef TCP_SLOW_INTERVAL -#define TCP_SLOW_INTERVAL (2*TCP_TMR_INTERVAL) /* the coarse grained timeout in milliseconds */ -#endif /* TCP_SLOW_INTERVAL */ - -#define TCP_FIN_WAIT_TIMEOUT 20000 /* milliseconds */ -#define TCP_SYN_RCVD_TIMEOUT 20000 /* milliseconds */ - -#define TCP_OOSEQ_TIMEOUT 6U /* x RTO */ - -#ifndef TCP_MSL -#define TCP_MSL 60000UL /* The maximum segment lifetime in milliseconds */ -#endif - -/* Keepalive values, compliant with RFC 1122. Don't change this unless you know what you're doing */ -#ifndef TCP_KEEPIDLE_DEFAULT -#define TCP_KEEPIDLE_DEFAULT 3000UL /* Default KEEPALIVE timer in milliseconds */ -#endif - -#ifndef TCP_KEEPINTVL_DEFAULT -#define TCP_KEEPINTVL_DEFAULT 1000UL /* Default Time between KEEPALIVE probes in milliseconds */ -#endif - -#ifndef TCP_KEEPCNT_DEFAULT -#define TCP_KEEPCNT_DEFAULT 3U /* Default Counter for KEEPALIVE probes */ -#endif - -#define TCP_MAXIDLE TCP_KEEPCNT_DEFAULT * TCP_KEEPINTVL_DEFAULT /* Maximum KEEPALIVE probe time */ - -/* Fields are (of course) in network byte order. - * Some fields are converted to host byte order in tcp_input(). - */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct tcp_hdr { - PACK_STRUCT_FIELD(u16_t src); //Ô´¶Ë¿Ú - PACK_STRUCT_FIELD(u16_t dest); //Ä¿µÄ¶Ë¿Ú - PACK_STRUCT_FIELD(u32_t seqno); //ÐòºÅ - PACK_STRUCT_FIELD(u32_t ackno); //Ó¦´ðÐòºÅ - PACK_STRUCT_FIELD(u16_t _hdrlen_rsvd_flags);//Êײ¿³¤¶È+±£Áôλ+±ê־λ - PACK_STRUCT_FIELD(u16_t wnd); //´°¿Ú´óС - PACK_STRUCT_FIELD(u16_t chksum); //УÑéºÍ - PACK_STRUCT_FIELD(u16_t urgp); //½ô¼±Ö¸Õë -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define TCPH_OFFSET(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 8) -#define TCPH_HDRLEN(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) >> 12) -#define TCPH_FLAGS(phdr) (ntohs((phdr)->_hdrlen_rsvd_flags) & TCP_FLAGS) - -#define TCPH_OFFSET_SET(phdr, offset) (phdr)->_hdrlen_rsvd_flags = htons(((offset) << 8) | TCPH_FLAGS(phdr)) -#define TCPH_HDRLEN_SET(phdr, len) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | TCPH_FLAGS(phdr)) -#define TCPH_FLAGS_SET(phdr, flags) (phdr)->_hdrlen_rsvd_flags = (((phdr)->_hdrlen_rsvd_flags & PP_HTONS((u16_t)(~(u16_t)(TCP_FLAGS)))) | htons(flags)) -#define TCPH_HDRLEN_FLAGS_SET(phdr, len, flags) (phdr)->_hdrlen_rsvd_flags = htons(((len) << 12) | (flags)) - -#define TCPH_SET_FLAG(phdr, flags ) (phdr)->_hdrlen_rsvd_flags = ((phdr)->_hdrlen_rsvd_flags | htons(flags)) -#define TCPH_UNSET_FLAG(phdr, flags) (phdr)->_hdrlen_rsvd_flags = htons(ntohs((phdr)->_hdrlen_rsvd_flags) | (TCPH_FLAGS(phdr) & ~(flags)) ) - -#define TCP_TCPLEN(seg) ((seg)->len + ((TCPH_FLAGS((seg)->tcphdr) & (TCP_FIN | TCP_SYN)) != 0)) - -/** Flags used on input processing, not on pcb->flags -*/ -#define TF_RESET (u8_t)0x08U /* Connection was reset. */ -#define TF_CLOSED (u8_t)0x10U /* Connection was sucessfully closed. */ -#define TF_GOT_FIN (u8_t)0x20U /* Connection was closed by the remote end. */ - - -#if LWIP_EVENT_API - -#define TCP_EVENT_ACCEPT(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_ACCEPT, NULL, 0, err) -#define TCP_EVENT_SENT(pcb,space,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_SENT, NULL, space, ERR_OK) -#define TCP_EVENT_RECV(pcb,p,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, (p), 0, (err)) -#define TCP_EVENT_CLOSED(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_RECV, NULL, 0, ERR_OK) -#define TCP_EVENT_CONNECTED(pcb,err,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_CONNECTED, NULL, 0, (err)) -#define TCP_EVENT_POLL(pcb,ret) ret = lwip_tcp_event((pcb)->callback_arg, (pcb),\ - LWIP_EVENT_POLL, NULL, 0, ERR_OK) -#define TCP_EVENT_ERR(errf,arg,err) lwip_tcp_event((arg), NULL, \ - LWIP_EVENT_ERR, NULL, 0, (err)) - -#else /* LWIP_EVENT_API */ - -#define TCP_EVENT_ACCEPT(pcb,err,ret) \ - do { \ - if((pcb)->accept != NULL) \ - (ret) = (pcb)->accept((pcb)->callback_arg,(pcb),(err)); \ - else (ret) = ERR_ARG; \ - } while (0) - -#define TCP_EVENT_SENT(pcb,space,ret) \ - do { \ - if((pcb)->sent != NULL) \ - (ret) = (pcb)->sent((pcb)->callback_arg,(pcb),(space)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_RECV(pcb,p,err,ret) \ - do { \ - if((pcb)->recv != NULL) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),(p),(err));\ - } else { \ - (ret) = tcp_recv_null(NULL, (pcb), (p), (err)); \ - } \ - } while (0) - -#define TCP_EVENT_CLOSED(pcb,ret) \ - do { \ - if(((pcb)->recv != NULL)) { \ - (ret) = (pcb)->recv((pcb)->callback_arg,(pcb),NULL,ERR_OK);\ - } else { \ - (ret) = ERR_OK; \ - } \ - } while (0) - -#define TCP_EVENT_CONNECTED(pcb,err,ret) \ - do { \ - if((pcb)->connected != NULL) \ - (ret) = (pcb)->connected((pcb)->callback_arg,(pcb),(err)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_POLL(pcb,ret) \ - do { \ - if((pcb)->poll != NULL) \ - (ret) = (pcb)->poll((pcb)->callback_arg,(pcb)); \ - else (ret) = ERR_OK; \ - } while (0) - -#define TCP_EVENT_ERR(errf,arg,err) \ - do { \ - if((errf) != NULL) \ - (errf)((arg),(err)); \ - } while (0) - -#endif /* LWIP_EVENT_API */ - -/** Enabled extra-check for TCP_OVERSIZE if LWIP_DEBUG is enabled */ -#if TCP_OVERSIZE && defined(LWIP_DEBUG) -#define TCP_OVERSIZE_DBGCHECK 1 -#else -#define TCP_OVERSIZE_DBGCHECK 0 -#endif - -/** Don't generate checksum on copy if CHECKSUM_GEN_TCP is disabled */ -#define TCP_CHECKSUM_ON_COPY (LWIP_CHECKSUM_ON_COPY && CHECKSUM_GEN_TCP) - -/* This structure represents a TCP segment on the unsent, unacked and ooseq queues */ -struct tcp_seg { - struct tcp_seg *next; /* used when putting segements on a queue */ - struct pbuf *p; /* buffer containing data + TCP header */ - void *dataptr; /* pointer to the TCP data in the pbuf */ - u16_t len; /* the TCP length of this segment */ -#if TCP_OVERSIZE_DBGCHECK - u16_t oversize_left; /* Extra bytes available at the end of the last - pbuf in unsent (used for asserting vs. - tcp_pcb.unsent_oversized only) */ -#endif /* TCP_OVERSIZE_DBGCHECK */ -#if TCP_CHECKSUM_ON_COPY - u16_t chksum; - u8_t chksum_swapped; -#endif /* TCP_CHECKSUM_ON_COPY */ - u8_t flags; -#define TF_SEG_OPTS_MSS (u8_t)0x01U /* Include MSS option. */ -#define TF_SEG_OPTS_TS (u8_t)0x02U /* Include timestamp option. */ -#define TF_SEG_DATA_CHECKSUMMED (u8_t)0x04U /* ALL data (not the header) is - checksummed into 'chksum' */ - struct tcp_hdr *tcphdr; /* the TCP header */ -}; - -#define LWIP_TCP_OPT_LENGTH(flags) \ - (flags & TF_SEG_OPTS_MSS ? 4 : 0) + \ - (flags & TF_SEG_OPTS_TS ? 12 : 0) - -/** This returns a TCP header option for MSS in an u32_t */ -#define TCP_BUILD_MSS_OPTION(x) (x) = PP_HTONL(((u32_t)2 << 24) | \ - ((u32_t)4 << 16) | \ - (((u32_t)TCP_MSS / 256) << 8) | \ - (TCP_MSS & 255)) - -/* Global variables: */ -extern struct tcp_pcb *tcp_input_pcb; -extern u32_t tcp_ticks; - -/* The TCP PCB lists. */ -union tcp_listen_pcbs_t { /* List of all TCP PCBs in LISTEN state. */ - struct tcp_pcb_listen *listen_pcbs; - struct tcp_pcb *pcbs; -}; -extern struct tcp_pcb *tcp_bound_pcbs; -extern union tcp_listen_pcbs_t tcp_listen_pcbs; -extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a - state in which they accept or send - data. */ -extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */ - -extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */ - -/* Axioms about the above lists: - 1) Every TCP PCB that is not CLOSED is in one of the lists. - 2) A PCB is only in one of the lists. - 3) All PCBs in the tcp_listen_pcbs list is in LISTEN state. - 4) All PCBs in the tcp_tw_pcbs list is in TIME-WAIT state. -*/ -/* Define two macros, TCP_REG and TCP_RMV that registers a TCP PCB - with a PCB list or removes a PCB from a list, respectively. */ -#ifndef TCP_DEBUG_PCB_LISTS -#define TCP_DEBUG_PCB_LISTS 0 -#endif -#if TCP_DEBUG_PCB_LISTS -#define TCP_REG(pcbs, npcb) do {\ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \ - for(tcp_tmp_pcb = *(pcbs); \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - LWIP_ASSERT("TCP_REG: already registered\n", tcp_tmp_pcb != (npcb)); \ - } \ - LWIP_ASSERT("TCP_REG: pcb->state != CLOSED", ((pcbs) == &tcp_bound_pcbs) || ((npcb)->state != CLOSED)); \ - (npcb)->next = *(pcbs); \ - LWIP_ASSERT("TCP_REG: npcb->next != npcb", (npcb)->next != (npcb)); \ - *(pcbs) = (npcb); \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - tcp_timer_needed(); \ - } while(0) -#define TCP_RMV(pcbs, npcb) do { \ - LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \ - if(*(pcbs) == (npcb)) { \ - *(pcbs) = (*pcbs)->next; \ - } else for(tcp_tmp_pcb = *(pcbs); tcp_tmp_pcb != NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - (npcb)->next = NULL; \ - LWIP_ASSERT("TCP_RMV: tcp_pcbs sane", tcp_pcbs_sane()); \ - LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removed %p from %p\n", (npcb), *(pcbs))); \ - } while(0) - -#else /* LWIP_DEBUG */ - -#define TCP_REG(pcbs, npcb) \ - do { \ - (npcb)->next = *pcbs; \ - *(pcbs) = (npcb); \ - tcp_timer_needed(); \ - } while (0) - -#define TCP_RMV(pcbs, npcb) \ - do { \ - if(*(pcbs) == (npcb)) { \ - (*(pcbs)) = (*pcbs)->next; \ - } \ - else { \ - for(tcp_tmp_pcb = *pcbs; \ - tcp_tmp_pcb != NULL; \ - tcp_tmp_pcb = tcp_tmp_pcb->next) { \ - if(tcp_tmp_pcb->next == (npcb)) { \ - tcp_tmp_pcb->next = (npcb)->next; \ - break; \ - } \ - } \ - } \ - (npcb)->next = NULL; \ - } while(0) - -#endif /* LWIP_DEBUG */ - - -/* Internal functions: */ -struct tcp_pcb *tcp_pcb_copy(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_pcb_purge(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -void tcp_segs_free(struct tcp_seg *seg)ICACHE_FLASH_ATTR; -void tcp_seg_free(struct tcp_seg *seg)ICACHE_FLASH_ATTR; -struct tcp_seg *tcp_seg_copy(struct tcp_seg *seg)ICACHE_FLASH_ATTR; - -#define tcp_ack(pcb) \ - do { \ - if((pcb)->flags & TF_ACK_DELAY) { \ - (pcb)->flags &= ~TF_ACK_DELAY; \ - (pcb)->flags |= TF_ACK_NOW; \ - } \ - else { \ - (pcb)->flags |= TF_ACK_DELAY; \ - } \ - } while (0) - -#define tcp_ack_now(pcb) \ - do { \ - (pcb)->flags |= TF_ACK_NOW; \ - } while (0) - -err_t tcp_send_fin(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t tcp_enqueue_flags(struct tcp_pcb *pcb, u8_t flags)ICACHE_FLASH_ATTR; - -void tcp_rexmit_seg(struct tcp_pcb *pcb, struct tcp_seg *seg)ICACHE_FLASH_ATTR; - -void tcp_rst(u32_t seqno, u32_t ackno, - ip_addr_t *local_ip, ip_addr_t *remote_ip, - u16_t local_port, u16_t remote_port)ICACHE_FLASH_ATTR; - -u32_t tcp_next_iss(void)ICACHE_FLASH_ATTR; - -void tcp_keepalive(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; -void tcp_zero_window_probe(struct tcp_pcb *pcb)ICACHE_FLASH_ATTR; - -#if TCP_CALCULATE_EFF_SEND_MSS -u16_t tcp_eff_send_mss(u16_t sendmss, ip_addr_t *addr)ICACHE_FLASH_ATTR; -#endif /* TCP_CALCULATE_EFF_SEND_MSS */ - -#if LWIP_CALLBACK_API -err_t tcp_recv_null(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t err)ICACHE_FLASH_ATTR; -#endif /* LWIP_CALLBACK_API */ - -#if TCP_DEBUG || TCP_INPUT_DEBUG || TCP_OUTPUT_DEBUG -void tcp_debug_print(struct tcp_hdr *tcphdr)ICACHE_FLASH_ATTR; -void tcp_debug_print_flags(u8_t flags)ICACHE_FLASH_ATTR; -void tcp_debug_print_state(enum tcp_state s)ICACHE_FLASH_ATTR; -void tcp_debug_print_pcbs(void)ICACHE_FLASH_ATTR; -s16_t tcp_pcbs_sane(void)ICACHE_FLASH_ATTR; -#else -# define tcp_debug_print(tcphdr) -# define tcp_debug_print_flags(flags) -# define tcp_debug_print_state(s) -# define tcp_debug_print_pcbs() -# define tcp_pcbs_sane() 1 -#endif /* TCP_DEBUG */ - -/** External function (implemented in timers.c), called when TCP detects - * that a timer is needed (i.e. active- or time-wait-pcb found). */ -void tcp_timer_needed(void)ICACHE_FLASH_ATTR; - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TCP */ - -#endif /* __LWIP_TCP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcpip.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcpip.h deleted file mode 100644 index 995ba8ad..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/tcpip.h +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_TCPIP_H__ -#define __LWIP_TCPIP_H__ - -#include "lwip/opt.h" - -#if !NO_SYS /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/api_msg.h" -#include "lwip/netifapi.h" -#include "lwip/pbuf.h" -#include "lwip/api.h" -#include "lwip/sys.h" -#include "lwip/timers.h" -#include "lwip/netif.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** Define this to something that triggers a watchdog. This is called from - * tcpip_thread after processing a message. */ -#ifndef LWIP_TCPIP_THREAD_ALIVE -#define LWIP_TCPIP_THREAD_ALIVE() -#endif - -#if LWIP_TCPIP_CORE_LOCKING -/** The global semaphore to lock the stack. */ -extern sys_mutex_t lock_tcpip_core; -#define LOCK_TCPIP_CORE() sys_mutex_lock(&lock_tcpip_core) -#define UNLOCK_TCPIP_CORE() sys_mutex_unlock(&lock_tcpip_core) -#define TCPIP_APIMSG(m) tcpip_apimsg_lock(m) -#define TCPIP_APIMSG_ACK(m) -#define TCPIP_NETIFAPI(m) tcpip_netifapi_lock(m) -#define TCPIP_NETIFAPI_ACK(m) -#else /* LWIP_TCPIP_CORE_LOCKING */ -#define LOCK_TCPIP_CORE() -#define UNLOCK_TCPIP_CORE() -#define TCPIP_APIMSG(m) tcpip_apimsg(m) -#define TCPIP_APIMSG_ACK(m) sys_sem_signal(&m->conn->op_completed) -#define TCPIP_NETIFAPI(m) tcpip_netifapi(m) -#define TCPIP_NETIFAPI_ACK(m) sys_sem_signal(&m->sem) -#endif /* LWIP_TCPIP_CORE_LOCKING */ - -/** Function prototype for the init_done function passed to tcpip_init */ -typedef void (*tcpip_init_done_fn)(void *arg); -/** Function prototype for functions passed to tcpip_callback() */ -typedef void (*tcpip_callback_fn)(void *ctx); - -void tcpip_init(tcpip_init_done_fn tcpip_init_done, void *arg); - -#if LWIP_NETCONN -err_t tcpip_apimsg(struct api_msg *apimsg); -#if LWIP_TCPIP_CORE_LOCKING -err_t tcpip_apimsg_lock(struct api_msg *apimsg); -#endif /* LWIP_TCPIP_CORE_LOCKING */ -#endif /* LWIP_NETCONN */ - -err_t tcpip_input(struct pbuf *p, struct netif *inp); - -#if LWIP_NETIF_API -err_t tcpip_netifapi(struct netifapi_msg *netifapimsg); -#if LWIP_TCPIP_CORE_LOCKING -err_t tcpip_netifapi_lock(struct netifapi_msg *netifapimsg); -#endif /* LWIP_TCPIP_CORE_LOCKING */ -#endif /* LWIP_NETIF_API */ - -err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8_t block); -#define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) - -/* free pbufs or heap memory from another context without blocking */ -err_t pbuf_free_callback(struct pbuf *p); -err_t mem_free_callback(void *m); - -#if LWIP_TCPIP_TIMEOUT -err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg); -err_t tcpip_untimeout(sys_timeout_handler h, void *arg); -#endif /* LWIP_TCPIP_TIMEOUT */ - -enum tcpip_msg_type { -#if LWIP_NETCONN - TCPIP_MSG_API, -#endif /* LWIP_NETCONN */ - TCPIP_MSG_INPKT, -#if LWIP_NETIF_API - TCPIP_MSG_NETIFAPI, -#endif /* LWIP_NETIF_API */ -#if LWIP_TCPIP_TIMEOUT - TCPIP_MSG_TIMEOUT, - TCPIP_MSG_UNTIMEOUT, -#endif /* LWIP_TCPIP_TIMEOUT */ - TCPIP_MSG_CALLBACK -}; - -struct tcpip_msg { - enum tcpip_msg_type type; - sys_sem_t *sem; - union { -#if LWIP_NETCONN - struct api_msg *apimsg; -#endif /* LWIP_NETCONN */ -#if LWIP_NETIF_API - struct netifapi_msg *netifapimsg; -#endif /* LWIP_NETIF_API */ - struct { - struct pbuf *p; - struct netif *netif; - } inp; - struct { - tcpip_callback_fn function; - void *ctx; - } cb; -#if LWIP_TCPIP_TIMEOUT - struct { - u32_t msecs; - sys_timeout_handler h; - void *arg; - } tmo; -#endif /* LWIP_TCPIP_TIMEOUT */ - } msg; -}; - -#ifdef __cplusplus -} -#endif - -#endif /* !NO_SYS */ - -#endif /* __LWIP_TCPIP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/timers.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/timers.h deleted file mode 100644 index e9db02a2..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/timers.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * Simon Goldschmidt - * - */ -#ifndef __LWIP_TIMERS_H__ -#define __LWIP_TIMERS_H__ - -#include "lwip/opt.h" - -/* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */ -#define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) - -#if LWIP_TIMERS - -#include "lwip/err.h" -#include "lwip/sys.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef LWIP_DEBUG_TIMERNAMES -#ifdef LWIP_DEBUG -#define LWIP_DEBUG_TIMERNAMES SYS_DEBUG -#else /* LWIP_DEBUG */ -#define LWIP_DEBUG_TIMERNAMES 0 -#endif /* LWIP_DEBUG*/ -#endif - -/** Function prototype for a timeout callback function. Register such a function - * using sys_timeout(). - * - * @param arg Additional argument to pass to the function - set up by sys_timeout() - */ -typedef void (* sys_timeout_handler)(void *arg); - -struct sys_timeo { - struct sys_timeo *next; - u32_t time; - sys_timeout_handler h; - void *arg; -#if LWIP_DEBUG_TIMERNAMES - const char* handler_name; -#endif /* LWIP_DEBUG_TIMERNAMES */ -}; - -void sys_timeouts_init(void)ICACHE_FLASH_ATTR; - -#if LWIP_DEBUG_TIMERNAMES -void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name)ICACHE_FLASH_ATTR; -#define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) -#else /* LWIP_DEBUG_TIMERNAMES */ -void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg)ICACHE_FLASH_ATTR; -#endif /* LWIP_DEBUG_TIMERNAMES */ - -void sys_untimeout(sys_timeout_handler handler, void *arg)ICACHE_FLASH_ATTR; -#if NO_SYS -void sys_check_timeouts(void)ICACHE_FLASH_ATTR; -void sys_restart_timeouts(void)ICACHE_FLASH_ATTR; -#else /* NO_SYS */ -void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); -#endif /* NO_SYS */ - - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_TIMERS */ -#endif /* __LWIP_TIMERS_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/udp.h b/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/udp.h deleted file mode 100644 index cb53d33e..00000000 --- a/sparkfun/esp8266/libraries/ESP8266WiFi/src/lwip/udp.h +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) 2001-2004 Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED - * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT - * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT - * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING - * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - * - * This file is part of the lwIP TCP/IP stack. - * - * Author: Adam Dunkels - * - */ -#ifndef __LWIP_UDP_H__ -#define __LWIP_UDP_H__ - -#include "lwip/opt.h" - -#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */ - -#include "lwip/pbuf.h" -#include "lwip/netif.h" -#include "lwip/ip_addr.h" -#include "lwip/ip.h" - -#ifdef __cplusplus -extern "C" { -#endif - -#define UDP_HLEN 8 - -/* Fields are (of course) in network byte order. */ -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/bpstruct.h" -#endif -PACK_STRUCT_BEGIN -struct udp_hdr { - PACK_STRUCT_FIELD(u16_t src); - PACK_STRUCT_FIELD(u16_t dest); /* src/dest UDP ports */ - PACK_STRUCT_FIELD(u16_t len); - PACK_STRUCT_FIELD(u16_t chksum); -} PACK_STRUCT_STRUCT; -PACK_STRUCT_END -#ifdef PACK_STRUCT_USE_INCLUDES -# include "arch/epstruct.h" -#endif - -#define UDP_FLAGS_NOCHKSUM 0x01U -#define UDP_FLAGS_UDPLITE 0x02U -#define UDP_FLAGS_CONNECTED 0x04U -#define UDP_FLAGS_MULTICAST_LOOP 0x08U - -struct udp_pcb; - -/** Function prototype for udp pcb receive callback functions - * addr and port are in same byte order as in the pcb - * The callback is responsible for freeing the pbuf - * if it's not used any more. - * - * ATTENTION: Be aware that 'addr' points into the pbuf 'p' so freeing this pbuf - * makes 'addr' invalid, too. - * - * @param arg user supplied argument (udp_pcb.recv_arg) - * @param pcb the udp_pcb which received data - * @param p the packet buffer that was received - * @param addr the remote IP address from which the packet was received - * @param port the remote port from which the packet was received - */ -typedef void (*udp_recv_fn)(void *arg, struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *addr, u16_t port); - - -struct udp_pcb { -/* Common members of all PCB types */ - IP_PCB; - -/* Protocol specific PCB members */ - - struct udp_pcb *next; - - u8_t flags; - /** ports are in host byte order */ - u16_t local_port, remote_port; - -#if LWIP_IGMP - /** outgoing network interface for multicast packets */ - ip_addr_t multicast_ip; -#endif /* LWIP_IGMP */ - -#if LWIP_UDPLITE - /** used for UDP_LITE only */ - u16_t chksum_len_rx, chksum_len_tx; -#endif /* LWIP_UDPLITE */ - - /** receive callback function */ - udp_recv_fn recv; - /** user-supplied argument for the recv callback */ - void *recv_arg; -}; -/* udp_pcbs export for exernal reference (e.g. SNMP agent) */ -extern struct udp_pcb *udp_pcbs; - -/* The following functions is the application layer interface to the - UDP code. */ -struct udp_pcb * udp_new (void)ICACHE_FLASH_ATTR; -void udp_remove (struct udp_pcb *pcb)ICACHE_FLASH_ATTR; -err_t udp_bind (struct udp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -err_t udp_connect (struct udp_pcb *pcb, ip_addr_t *ipaddr, - u16_t port)ICACHE_FLASH_ATTR; -void udp_disconnect (struct udp_pcb *pcb)ICACHE_FLASH_ATTR; -void udp_recv (struct udp_pcb *pcb, udp_recv_fn recv, - void *recv_arg)ICACHE_FLASH_ATTR; -err_t udp_sendto_if (struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif)ICACHE_FLASH_ATTR; -err_t udp_sendto (struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port)ICACHE_FLASH_ATTR; -err_t udp_send (struct udp_pcb *pcb, struct pbuf *p)ICACHE_FLASH_ATTR; - -#if LWIP_CHECKSUM_ON_COPY -err_t udp_sendto_if_chksum(struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - struct netif *netif, u8_t have_chksum, - u16_t chksum)ICACHE_FLASH_ATTR; -err_t udp_sendto_chksum(struct udp_pcb *pcb, struct pbuf *p, - ip_addr_t *dst_ip, u16_t dst_port, - u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR; -err_t udp_send_chksum(struct udp_pcb *pcb, struct pbuf *p, - u8_t have_chksum, u16_t chksum)ICACHE_FLASH_ATTR; -#endif /* LWIP_CHECKSUM_ON_COPY */ - -#define udp_flags(pcb) ((pcb)->flags) -#define udp_setflags(pcb, f) ((pcb)->flags = (f)) - -/* The following functions are the lower layer interface to UDP. */ -void udp_input (struct pbuf *p, struct netif *inp)ICACHE_FLASH_ATTR; - -#define udp_init() /* Compatibility define, not init needed. */ - -#if UDP_DEBUG -void udp_debug_print(struct udp_hdr *udphdr)ICACHE_FLASH_ATTR; -#else -#define udp_debug_print(udphdr) -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* LWIP_UDP */ - -#endif /* __LWIP_UDP_H__ */ diff --git a/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.cpp b/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.cpp deleted file mode 100644 index 5721c527..00000000 --- a/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.cpp +++ /dev/null @@ -1,256 +0,0 @@ -/* - -ESP8266 Multicast DNS (port of CC3000 Multicast DNS library) -Version 1.1 -Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) -ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) - -License (MIT license): - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -// Important RFC's for reference: -// - DNS request and response: http://www.ietf.org/rfc/rfc1035.txt -// - Multicast DNS: http://www.ietf.org/rfc/rfc6762.txt - -#define LWIP_INTERNAL -#include "ESP8266mDNS.h" -#include - -extern "C" -{ - #include "osapi.h" - #include "ets_sys.h" -} - -#include "debug.h" - -#include "WiFiUdp.h" -#include "lwip/opt.h" -#include "lwip/udp.h" -#include "lwip/inet.h" -#include "lwip/igmp.h" -#include "lwip/mem.h" -#include "include/UdpContext.h" - - - - -// #define MDNS_DEBUG - -#define HEADER_SIZE 12 -#define QDCOUNT_OFFSET 4 -#define A_RECORD_SIZE 14 -#define NSEC_RECORD_SIZE 20 -#define TTL_OFFSET 4 -#define IP_OFFSET 10 - -static const IPAddress MDNS_MULTICAST_ADDR(224, 0, 0, 251); -static const int MDNS_MULTICAST_TTL = 1; -static const int MDNS_PORT = 5353; - - -MDNSResponder::MDNSResponder() - : _expected(NULL) - , _expectedLen(0) - , _response(NULL) - , _responseLen(0) - , _index(0) - , _conn(0) -{ } - -MDNSResponder::~MDNSResponder() { - if (_expected) { - delete[] _expected; - } - if (_response) { - delete[] _response; - } -} - -bool MDNSResponder::begin(const char* domain, IPAddress addr, uint32_t ttlSeconds) -{ - _localAddr = addr; - // Construct DNS request/response fully qualified domain name of form: - // , , 5, "local" - size_t n = strlen(domain); - if (n > 255) { - // Can only handle domains that are 255 chars in length. - return false; - } - _expectedLen = 12 + n; - if (_expected) { - delete[] _expected; - } - _expected = new uint8_t[_expectedLen]; - _expected[0] = (uint8_t)n; - - // Copy in domain characters as lowercase - for (int i = 0; i < n; ++i) { - _expected[1+i] = tolower(domain[i]); - } - - // Values for: - // - 5 (length) - // - "local" - // - 0x00 (end of domain) - // - 0x00 0x01 (A record query) - // - 0x00 0x01 (Class IN) - const uint8_t local[] = { 0x05, 0x6C, 0x6F, 0x63, 0x61, 0x6C, 0x00, 0x00, 0x01, 0x00, 0x01 }; - memcpy(&_expected[1+n], local, 11); - - // Construct DNS query response - // TODO: Move these to flash or just construct in code. - const uint8_t respHeader[] = { 0x00, 0x00, // ID = 0 - 0x84, 0x00, // Flags = response + authoritative answer - 0x00, 0x00, // Question count = 0 - 0x00, 0x01, // Answer count = 1 - 0x00, 0x00, // Name server records = 0 - 0x00, 0x01 // Additional records = 1 - }; - // Generate positive response for IPV4 address - const uint8_t aRecord[] = { 0x00, 0x01, // Type = 1, A record/IPV4 address - 0x80, 0x01, // Class = Internet, with cache flush bit - 0x00, 0x00, 0x00, 0x00, // TTL in seconds, to be filled in later - 0x00, 0x04, // Length of record - 0x00, 0x00, 0x00, 0x00 // IP address, to be filled in later - }; - // Generate negative response for IPV6 address (CC3000 doesn't support IPV6) - const uint8_t nsecRecord[] = { 0xC0, 0x0C, // Name offset - 0x00, 0x2F, // Type = 47, NSEC (overloaded by MDNS) - 0x80, 0x01, // Class = Internet, with cache flush bit - 0x00, 0x00, 0x00, 0x00, // TTL in seconds, to be filled in later - 0x00, 0x08, // Length of record - 0xC0, 0x0C, // Next domain = offset to FQDN - 0x00, // Block number = 0 - 0x04, // Length of bitmap = 4 bytes - 0x40, 0x00, 0x00, 0x00 // Bitmap value = Only first bit (A record/IPV4) is set - }; - - // Allocate memory for response. - int queryFQDNLen = _expectedLen - 4; - _responseLen = HEADER_SIZE + queryFQDNLen + A_RECORD_SIZE + NSEC_RECORD_SIZE; - if (_response) { - delete[] _response; - } - _response = new uint8_t[_responseLen]; - - // Copy data into response. - memcpy(_response, respHeader, HEADER_SIZE); - memcpy(_response + HEADER_SIZE, _expected, queryFQDNLen); - uint8_t* records = _response + HEADER_SIZE + queryFQDNLen; - memcpy(records, aRecord, A_RECORD_SIZE); - memcpy(records + A_RECORD_SIZE, nsecRecord, NSEC_RECORD_SIZE); - - // Add TTL to records. - uint8_t ttl[4] = { (uint8_t)(ttlSeconds >> 24), (uint8_t)(ttlSeconds >> 16), (uint8_t)(ttlSeconds >> 8), (uint8_t)ttlSeconds }; - memcpy(records + TTL_OFFSET, ttl, 4); - memcpy(records + A_RECORD_SIZE + 2 + TTL_OFFSET, ttl, 4); - - // Add IP address to response - - uint32_t ipAddress = (uint32_t) addr; - - records[IP_OFFSET + 3] = (uint8_t)(ipAddress >> 24); - records[IP_OFFSET + 2] = (uint8_t)(ipAddress >> 16); - records[IP_OFFSET + 1] = (uint8_t)(ipAddress >> 8); - records[IP_OFFSET + 0] = (uint8_t) ipAddress; - - // Open the MDNS socket if it isn't already open. - if (!_conn) { - ip_addr_t ifaddr; - ifaddr.addr = (uint32_t) addr; - ip_addr_t multicast_addr; - multicast_addr.addr = (uint32_t) MDNS_MULTICAST_ADDR; - - if (igmp_joingroup(&ifaddr, &multicast_addr)!= ERR_OK) { - return false; - } - - _conn = new UdpContext; - _conn->ref(); - - if (!_conn->listen(*IP_ADDR_ANY, MDNS_PORT)) { - return false; - } - _conn->setMulticastInterface(ifaddr); - _conn->setMulticastTTL(MDNS_MULTICAST_TTL); - _conn->onRx(std::bind(&MDNSResponder::update, this)); - _conn->connect(multicast_addr, MDNS_PORT); - } - return true; -} - -void MDNSResponder::update() { - if (!_conn->next()) { - return; - } - - // Read available data. - int n = _conn->getSize(); - - _index = 0; - -#ifdef MDNS_DEBUG - Serial.println("{"); -#endif - // Look for domain name in request and respond with canned response if found. - for (int i = 0; i < n; ++i) { - uint8_t ch = tolower(_conn->read()); - -#ifdef MDNS_DEBUG - String str(ch, 16); - Serial.print("0x"); - Serial.print(str); - Serial.print(", "); -#endif - // Check character matches expected. - if (ch == _expected[_index]) - { - _index++; - // Check if domain name was found and send a response. - if (_index == _expectedLen) { - // Send response to multicast address. -#ifdef MDNS_DEBUG - Serial.print("responding, i="); - Serial.println(i); -#endif - ip_addr_t multicast_addr; - multicast_addr.addr = (uint32_t) MDNS_MULTICAST_ADDR; - - _conn->append(reinterpret_cast(_response), _responseLen); - _conn->send(); - - _index = 0; - } - } - else if (ch == _expected[0]) { - // Found a character that doesn't match, but does match the start of the domain. - _index = 1; - } - else { - // Found a character that doesn't match the expected character or start of domain. - _index = 0; - } - } -#ifdef MDNS_DEBUG - Serial.println("}"); -#endif -} diff --git a/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.h b/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.h deleted file mode 100644 index 9a1fc56d..00000000 --- a/sparkfun/esp8266/libraries/ESP8266mDNS/ESP8266mDNS.h +++ /dev/null @@ -1,74 +0,0 @@ -/* -ESP8266 Multicast DNS (port of CC3000 Multicast DNS library) -Version 1.1 -Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) -ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) - -This is a simple implementation of multicast DNS query support for an Arduino -running on ESP8266 chip. Only support for resolving address queries is currently -implemented. - -Requirements: -- ESP8266WiFi library - -Usage: -- Include the ESP8266 Multicast DNS library in the sketch. -- Create an instance of the MDNSResponder class. -- Call the begin method in the sketch's setup and provide a domain name (without - the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the - Adafruit CC3000 class instance. Optionally provide a time to live (in seconds) - for the DNS record--the default is 1 hour. -- Call the update method in each iteration of the sketch's loop function. - -License (MIT license): - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION 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 ESP8266MDNS_H -#define ESP8266MDNS_H - -#include "ESP8266WiFi.h" -#include "WiFiUdp.h" - - -class UdpContext; - -class MDNSResponder { -public: - MDNSResponder(); - ~MDNSResponder(); - bool begin(const char* domain, IPAddress addr, uint32_t ttlSeconds = 3600); - void update(); - -private: - // Expected query values - uint8_t* _expected; - int _expectedLen; - // Current parsing state - int _index; - // Response data - uint8_t* _response; - int _responseLen; - // Socket for MDNS communication - UdpContext* _conn; - // local IP Address - IPAddress _localAddr; -}; - -#endif //ESP8266MDNS_H diff --git a/sparkfun/esp8266/libraries/ESP8266mDNS/README.md b/sparkfun/esp8266/libraries/ESP8266mDNS/README.md deleted file mode 100644 index f438ae8d..00000000 --- a/sparkfun/esp8266/libraries/ESP8266mDNS/README.md +++ /dev/null @@ -1,52 +0,0 @@ -ESP8266 Multicast DNS -==================== - -A port of CC3000 Multicast DNS library (version 1.1) - -This is a simple implementation of multicast DNS query support for an Arduino -running on ESP8266 chip. Only support for resolving address queries is currently -implemented. - -Requirements ------------- -- ESP8266WiFi library -- MDNS support in your operating system/client machines: - - For Mac OSX support is built in through Bonjour already. - - For Linux, install [Avahi](http://avahi.org/). - - For Windows, install [Bonjour](http://www.apple.com/support/bonjour/). - -Usage ------ -1. Download this repository as a zip (button on the right) and follow [these instructions to install into Arduino](http://arduino.cc/en/Guide/Libraries). -2. Include the ESP8266mDNS library in the sketch. -3. Create an instance of the MDNSResponder class. -4. Call the begin method in the sketch's setup and provide a domain name (without - the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the - IP address to advertise. Optionally provide a time to live (in seconds) - for the DNS record--the default is 1 hour. -5. Call the update method in each iteration of the sketch's loop function. - -See the included MDNS + HTTP server sketch for a full example. - -License -------- -Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) -ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino b/sparkfun/esp8266/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino deleted file mode 100644 index 08ed4b4e..00000000 --- a/sparkfun/esp8266/libraries/ESP8266mDNS/examples/mDNS_Web_Server/mDNS_Web_Server.ino +++ /dev/null @@ -1,120 +0,0 @@ -/* - ESP8266 mDNS responder sample - - This is an example of an HTTP server that is accessible - via http://esp8266.local URL thanks to mDNS responder. - - Instructions: - - Update WiFi SSID and password as necessary. - - Flash the sketch to the ESP8266 board - - Install host software: - - For Linux, install Avahi (http://avahi.org/). - - For Windows, install Bonjour (http://www.apple.com/support/bonjour/). - - For Mac OSX and iOS support is built in through Bonjour already. - - Point your browser to http://esp8266.local, you should see a response. - - */ - - -#include -#include -#include - -const char* ssid = "............"; -const char* password = ".............."; - -// multicast DNS responder -MDNSResponder mdns; - -// TCP server at port 80 will respond to HTTP requests -WiFiServer server(80); - -void setup(void) -{ - Serial.begin(115200); - - // Connect to WiFi network - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - // Set up mDNS responder: - // - first argument is the domain name, in this example - // the fully-qualified domain name is "esp8266.local" - // - second argument is the IP address to advertise - // we send our IP address on the WiFi network - if (!mdns.begin("esp8266", WiFi.localIP())) { - Serial.println("Error setting up MDNS responder!"); - while(1) { - delay(1000); - } - } - Serial.println("mDNS responder started"); - - // Start TCP (HTTP) server - server.begin(); - Serial.println("TCP server started"); -} - -void loop(void) -{ - // Check if a client has connected - WiFiClient client = server.available(); - if (!client) { - return; - } - Serial.println(""); - Serial.println("New client"); - - // Wait for data from client to become available - while(client.connected() && !client.available()){ - delay(1); - } - - // Read the first line of HTTP request - String req = client.readStringUntil('\r'); - - // First line of HTTP request looks like "GET /path HTTP/1.1" - // Retrieve the "/path" part by finding the spaces - int addr_start = req.indexOf(' '); - int addr_end = req.indexOf(' ', addr_start + 1); - if (addr_start == -1 || addr_end == -1) { - Serial.print("Invalid request: "); - Serial.println(req); - return; - } - req = req.substring(addr_start + 1, addr_end); - Serial.print("Request: "); - Serial.println(req); - client.flush(); - - String s; - if (req == "/") - { - IPAddress ip = WiFi.localIP(); - String ipStr = String(ip[0]) + '.' + String(ip[1]) + '.' + String(ip[2]) + '.' + String(ip[3]); - s = "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n\r\nHello from ESP8266 at "; - s += ipStr; - s += "\r\n\r\n"; - Serial.println("Sending 200"); - } - else - { - s = "HTTP/1.1 404 Not Found\r\n\r\n"; - Serial.println("Sending 404"); - } - client.print(s); - - Serial.println("Done with client"); -} - diff --git a/sparkfun/esp8266/libraries/ESP8266mDNS/keywords.txt b/sparkfun/esp8266/libraries/ESP8266mDNS/keywords.txt deleted file mode 100644 index 64dff910..00000000 --- a/sparkfun/esp8266/libraries/ESP8266mDNS/keywords.txt +++ /dev/null @@ -1,21 +0,0 @@ -####################################### -# Syntax Coloring Map For Ultrasound -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -MDNSResponder KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -update KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/sparkfun/esp8266/libraries/SPI/SPI.cpp b/sparkfun/esp8266/libraries/SPI/SPI.cpp deleted file mode 100644 index 7d52528e..00000000 --- a/sparkfun/esp8266/libraries/SPI/SPI.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/* - SPI.cpp - SPI library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -#include "SPI.h" -#include "HardwareSerial.h" - -typedef union { - uint32_t regValue; - struct { - unsigned regL :6; - unsigned regH :6; - unsigned regN :6; - unsigned regPre :13; - unsigned regEQU :1; - }; -} spiClk_t; - -SPIClass SPI; - -SPIClass::SPIClass() { - useHwCs = false; -} - -void SPIClass::begin() { - pinMode(SCK, SPECIAL); ///< GPIO14 - pinMode(MISO, SPECIAL); ///< GPIO12 - pinMode(MOSI, SPECIAL); ///< GPIO13 - - SPI1C = 0; - setFrequency(1000000); ///< 1MHz - SPI1U = SPIUMOSI | SPIUDUPLEX | SPIUSSE; - SPI1U1 = (7 << SPILMOSI) | (7 << SPILMISO); - SPI1C1 = 0; -} - -void SPIClass::end() { - pinMode(SCK, INPUT); - pinMode(MISO, INPUT); - pinMode(MOSI, INPUT); - if(useHwCs) { - pinMode(SS, INPUT); - } -} - -void SPIClass::setHwCs(bool use) { - if(use) { - pinMode(SS, SPECIAL); ///< GPIO15 - SPI1U |= (SPIUCSSETUP | SPIUCSHOLD); - } else { - if(useHwCs) { - pinMode(SS, INPUT); - SPI1U &= ~(SPIUCSSETUP | SPIUCSHOLD); - } - } - useHwCs = use; -} - -void SPIClass::beginTransaction(SPISettings settings) { - while(SPI1CMD & SPIBUSY) {} - setFrequency(settings._clock); - setBitOrder(settings._bitOrder); - setDataMode(settings._dataMode); -} - -void SPIClass::endTransaction() { -} - -void SPIClass::setDataMode(uint8_t dataMode) { - - /** - SPI_MODE0 0x00 - CPOL: 0 CPHA: 0 - SPI_MODE1 0x01 - CPOL: 0 CPHA: 1 - SPI_MODE2 0x10 - CPOL: 1 CPHA: 0 - SPI_MODE3 0x11 - CPOL: 1 CPHA: 1 - */ - - bool CPOL = (dataMode & 0x10); ///< CPOL (Clock Polarity) - bool CPHA = (dataMode & 0x01); ///< CPHA (Clock Phase) - - if(CPHA) { - SPI1U |= (SPIUSME); - } else { - SPI1U &= ~(SPIUSME); - } - - if(CPOL) { - //todo How set CPOL??? - } - -} - -void SPIClass::setBitOrder(uint8_t bitOrder) { - if(bitOrder == MSBFIRST) { - SPI1C &= ~(SPICWBO | SPICRBO); - } else { - SPI1C |= (SPICWBO | SPICRBO); - } -} - -/** - * calculate the Frequency based on the register value - * @param reg - * @return - */ -static uint32_t ClkRegToFreq(spiClk_t * reg) { - return (SPI_MAX_SPEED / ((reg->regPre + 1) * (reg->regN + 1))); -} - -void SPIClass::setFrequency(uint32_t freq) { - static uint32_t lastSetFrequency = 0; - static uint32_t lastSetRegister = 0; - - if(freq >= SPI_MAX_SPEED) { - setClockDivider(0x80000000); - return; - } - - if(lastSetFrequency == freq && lastSetRegister == SPI1CLK) { - // do nothing (speed optimization) - return; - } - - const spiClk_t minFreqReg = { 0x7FFFF000 }; - uint32_t minFreq = ClkRegToFreq((spiClk_t*) &minFreqReg); - if(freq < minFreq) { - // use minimum possible clock - setClockDivider(minFreqReg.regValue); - lastSetRegister = SPI1CLK; - lastSetFrequency = freq; - return; - } - - uint8_t calN = 1; - - spiClk_t bestReg = { 0 }; - int32_t bestFreq = 0; - - // find the best match - while(calN <= 0x3F) { // 0x3F max for N - - spiClk_t reg = { 0 }; - int32_t calFreq; - int32_t calPre; - int8_t calPreVari = -2; - - reg.regN = calN; - - while(calPreVari++ <= 1) { // test different variants for Pre (we calculate in int so we miss the decimals, testing is the easyest and fastest way) - calPre = (((SPI_MAX_SPEED / (reg.regN + 1)) / freq) - 1) + calPreVari; - if(calPre > 0x1FFF) { - reg.regPre = 0x1FFF; // 8191 - } else if(calPre <= 0) { - reg.regPre = 0; - } else { - reg.regPre = calPre; - } - - reg.regL = ((reg.regN + 1) / 2); - // reg.regH = (reg.regN - reg.regL); - - // test calculation - calFreq = ClkRegToFreq(®); - //os_printf("-----[0x%08X][%d]\t EQU: %d\t Pre: %d\t N: %d\t H: %d\t L: %d = %d\n", reg.regValue, freq, reg.regEQU, reg.regPre, reg.regN, reg.regH, reg.regL, calFreq); - - if(calFreq == (int32_t) freq) { - // accurate match use it! - memcpy(&bestReg, ®, sizeof(bestReg)); - break; - } else if(calFreq < (int32_t) freq) { - // never go over the requested frequency - if(abs(freq - calFreq) < abs(freq - bestFreq)) { - bestFreq = calFreq; - memcpy(&bestReg, ®, sizeof(bestReg)); - } - } - } - if(calFreq == (int32_t) freq) { - // accurate match use it! - break; - } - calN++; - } - - // os_printf("[0x%08X][%d]\t EQU: %d\t Pre: %d\t N: %d\t H: %d\t L: %d\t - Real Frequency: %d\n", bestReg.regValue, freq, bestReg.regEQU, bestReg.regPre, bestReg.regN, bestReg.regH, bestReg.regL, ClkRegToFreq(&bestReg)); - - setClockDivider(bestReg.regValue); - lastSetRegister = SPI1CLK; - lastSetFrequency = freq; - -} - -void SPIClass::setClockDivider(uint32_t clockDiv) { - if(clockDiv == 0x80000000) { - GPMUX |= (1 << 9); // Set bit 9 if sysclock required - } else { - GPMUX &= ~(1 << 9); - } - SPI1CLK = clockDiv; -} - -inline void SPIClass::setDataBits(uint16_t bits) { - const uint32_t mask = ~((SPIMMOSI << SPILMOSI) | (SPIMMISO << SPILMISO)); - bits--; - SPI1U1 = ((SPI1U1 & mask) | ((bits << SPILMOSI) | (bits << SPILMISO))); -} - -uint8_t SPIClass::transfer(uint8_t data) { - while(SPI1CMD & SPIBUSY) {} - // reset to 8Bit mode - setDataBits(8); - SPI1W0 = data; - SPI1CMD |= SPIBUSY; - while(SPI1CMD & SPIBUSY) {} - return (uint8_t) (SPI1W0 & 0xff); -} - -uint16_t SPIClass::transfer16(uint16_t data) { - union { - uint16_t val; - struct { - uint8_t lsb; - uint8_t msb; - }; - } in, out; - in.val = data; - - if((SPI1C & (SPICWBO | SPICRBO))) { - //MSBFIRST - out.msb = transfer(in.msb); - out.lsb = transfer(in.lsb); - } else { - //LSBFIRST - out.lsb = transfer(in.lsb); - out.msb = transfer(in.msb); - } - return out.val; -} - -void SPIClass::write(uint8_t data) { - while(SPI1CMD & SPIBUSY) {} - // reset to 8Bit mode - setDataBits(8); - SPI1W0 = data; - SPI1CMD |= SPIBUSY; - while(SPI1CMD & SPIBUSY) {} -} - -void SPIClass::write16(uint16_t data) { - write16(data, !(SPI1C & (SPICWBO | SPICRBO))); -} - -void SPIClass::write16(uint16_t data, bool msb) { - while(SPI1CMD & SPIBUSY) {} - // Set to 16Bits transfer - setDataBits(16); - if(msb) { - // MSBFIRST Byte first - SPI1W0 = (data >> 8) | (data << 8); - SPI1CMD |= SPIBUSY; - } else { - // LSBFIRST Byte first - SPI1W0 = data; - SPI1CMD |= SPIBUSY; - } - while(SPI1CMD & SPIBUSY) {} -} - -void SPIClass::write32(uint32_t data) { - write32(data, !(SPI1C & (SPICWBO | SPICRBO))); -} - -void SPIClass::write32(uint32_t data, bool msb) { - while(SPI1CMD & SPIBUSY) {} - // Set to 32Bits transfer - setDataBits(32); - if(msb) { - union { - uint32_t l; - uint8_t b[4]; - } data_; - data_.l = data; - // MSBFIRST Byte first - SPI1W0 = (data_.b[3] | (data_.b[2] << 8) | (data_.b[1] << 16) | (data_.b[0] << 24)); - SPI1CMD |= SPIBUSY; - } else { - // LSBFIRST Byte first - SPI1W0 = data; - SPI1CMD |= SPIBUSY; - } - while(SPI1CMD & SPIBUSY) {} -} - -/** - * Note: - * data need to be aligned to 32Bit - * or you get an Fatal exception (9) - * @param data uint8_t * - * @param size uint32_t - */ -void SPIClass::writeBytes(uint8_t * data, uint32_t size) { - while(size) { - if(size > 64) { - writeBytes_(data, 64); - size -= 64; - data += 64; - } else { - writeBytes_(data, size); - size = 0; - } - } -} - -void SPIClass::writeBytes_(uint8_t * data, uint8_t size) { - while(SPI1CMD & SPIBUSY) {} - // Set Bits to transfer - setDataBits(size * 8); - - volatile uint32_t * fifoPtr = &SPI1W0; - uint32_t * dataPtr = (uint32_t*) data; - uint8_t dataSize = ((size + 3) / 4); - - while(dataSize--) { - *fifoPtr = *dataPtr; - dataPtr++; - fifoPtr++; - } - - SPI1CMD |= SPIBUSY; - while(SPI1CMD & SPIBUSY) {} -} - - -/** - * Note: - * data need to be aligned to 32Bit - * or you get an Fatal exception (9) - * @param data uint8_t * - * @param size uint8_t max for size is 64Byte - * @param repeat uint32_t - */ -void SPIClass::writePattern(uint8_t * data, uint8_t size, uint32_t repeat) { - if(size > 64) return; //max Hardware FIFO - - uint32_t byte = (size * repeat); - uint8_t r = (64 / size); - - while(byte) { - if(byte > 64) { - writePattern_(data, size, r); - byte -= 64; - } else { - writePattern_(data, size, (byte / size)); - byte = 0; - } - } -} - -void SPIClass::writePattern_(uint8_t * data, uint8_t size, uint8_t repeat) { - uint8_t bytes = (size * repeat); - uint8_t buffer[64]; - uint8_t * bufferPtr = &buffer[0]; - uint8_t * dataPtr; - uint8_t dataSize = bytes; - for(uint8_t i = 0; i < repeat; i++) { - dataSize = size; - dataPtr = data; - while(dataSize--) { - *bufferPtr = *dataPtr; - dataPtr++; - bufferPtr++; - } - } - - writeBytes(&buffer[0], bytes); -} - -/** - * Note: - * in and out need to be aligned to 32Bit - * or you get an Fatal exception (9) - * @param out uint8_t * - * @param in uint8_t * - * @param size uint32_t - */ -void SPIClass::transferBytes(uint8_t * out, uint8_t * in, uint32_t size) { - while(size) { - if(size > 64) { - transferBytes_(out, in, 64); - size -= 64; - if(out) out += 64; - if(in) in += 64; - } else { - transferBytes_(out, in, size); - size = 0; - } - } -} - -void SPIClass::transferBytes_(uint8_t * out, uint8_t * in, uint8_t size) { - while(SPI1CMD & SPIBUSY) {} - // Set in/out Bits to transfer - - setDataBits(size * 8); - - volatile uint32_t * fifoPtr = &SPI1W0; - uint8_t dataSize = ((size + 3) / 4); - - if(out) { - uint32_t * dataPtr = (uint32_t*) out; - while(dataSize--) { - *fifoPtr = *dataPtr; - dataPtr++; - fifoPtr++; - } - } else { - // no out data only read fill with dummy data! - while(dataSize--) { - *fifoPtr = 0xFFFFFFFF; - fifoPtr++; - } - } - - SPI1CMD |= SPIBUSY; - while(SPI1CMD & SPIBUSY) {} - - if(in) { - volatile uint8_t * fifoPtr8 = (volatile uint8_t *) &SPI1W0; - dataSize = size; - while(dataSize--) { - *in = *fifoPtr8; - in++; - fifoPtr8++; - } - } -} - diff --git a/sparkfun/esp8266/libraries/SPI/SPI.h b/sparkfun/esp8266/libraries/SPI/SPI.h deleted file mode 100644 index 68d2a3dc..00000000 --- a/sparkfun/esp8266/libraries/SPI/SPI.h +++ /dev/null @@ -1,96 +0,0 @@ -/* - SPI.h - SPI library for esp8266 - - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ -#ifndef _SPI_H_INCLUDED -#define _SPI_H_INCLUDED - -#include -#include - -#define SPI_HAS_TRANSACTION - -// This defines are not representing the real Divider of the ESP8266 -// the Defines match to an AVR Arduino on 16MHz for better compatibility -#if F_CPU == 80000000L -#define SPI_CLOCK_DIV2 0x00101001 //8 MHz -#define SPI_CLOCK_DIV4 0x00241001 //4 MHz -#define SPI_CLOCK_DIV8 0x004c1001 //2 MHz -#define SPI_CLOCK_DIV16 0x009c1001 //1 MHz -#define SPI_CLOCK_DIV32 0x013c1001 //500 KHz -#define SPI_CLOCK_DIV64 0x027c1001 //250 KHz -#define SPI_CLOCK_DIV128 0x04fc1001 //125 KHz -#else -#define SPI_CLOCK_DIV2 0x00241001 //8 MHz -#define SPI_CLOCK_DIV4 0x004c1001 //4 MHz -#define SPI_CLOCK_DIV8 0x009c1001 //2 MHz -#define SPI_CLOCK_DIV16 0x013c1001 //1 MHz -#define SPI_CLOCK_DIV32 0x027c1001 //500 KHz -#define SPI_CLOCK_DIV64 0x04fc1001 //250 KHz -#endif - -#define SPI_MAX_SPEED (80000000L) - -const uint8_t SPI_MODE0 = 0x00; ///< CPOL: 0 CPHA: 0 -const uint8_t SPI_MODE1 = 0x01; ///< CPOL: 0 CPHA: 1 -const uint8_t SPI_MODE2 = 0x10; ///< CPOL: 1 CPHA: 0 -const uint8_t SPI_MODE3 = 0x11; ///< CPOL: 1 CPHA: 1 - -class SPISettings { -public: - SPISettings() :_clock(1000000), _bitOrder(LSBFIRST), _dataMode(SPI_MODE0){} - SPISettings(uint32_t clock, uint8_t bitOrder, uint8_t dataMode) :_clock(clock), _bitOrder(bitOrder), _dataMode(dataMode){} - uint32_t _clock; - uint8_t _bitOrder; - uint8_t _dataMode; -}; - -class SPIClass { -public: - SPIClass(); - void begin(); - void end(); - void setHwCs(bool use); - void setBitOrder(uint8_t bitOrder); - void setDataMode(uint8_t dataMode); - void setFrequency(uint32_t freq); - void setClockDivider(uint32_t clockDiv); - void beginTransaction(SPISettings settings); - uint8_t transfer(uint8_t data); - uint16_t transfer16(uint16_t data); - void write(uint8_t data); - void write16(uint16_t data); - void write16(uint16_t data, bool msb); - void write32(uint32_t data); - void write32(uint32_t data, bool msb); - void writeBytes(uint8_t * data, uint32_t size); - void writePattern(uint8_t * data, uint8_t size, uint32_t repeat); - void transferBytes(uint8_t * out, uint8_t * in, uint32_t size); - void endTransaction(void); -private: - bool useHwCs; - void writeBytes_(uint8_t * data, uint8_t size); - void writePattern_(uint8_t * data, uint8_t size, uint8_t repeat); - void transferBytes_(uint8_t * out, uint8_t * in, uint8_t size); - inline void setDataBits(uint16_t bits); -}; - -extern SPIClass SPI; - -#endif diff --git a/sparkfun/esp8266/libraries/SPI/keywords.txt b/sparkfun/esp8266/libraries/SPI/keywords.txt deleted file mode 100644 index fa761658..00000000 --- a/sparkfun/esp8266/libraries/SPI/keywords.txt +++ /dev/null @@ -1,36 +0,0 @@ -####################################### -# Syntax Coloring Map SPI -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -SPI KEYWORD1 - -####################################### -# Methods and Functions (KEYWORD2) -####################################### -begin KEYWORD2 -end KEYWORD2 -transfer KEYWORD2 -setBitOrder KEYWORD2 -setDataMode KEYWORD2 -setClockDivider KEYWORD2 - - -####################################### -# Constants (LITERAL1) -####################################### -SPI_CLOCK_DIV4 LITERAL1 -SPI_CLOCK_DIV16 LITERAL1 -SPI_CLOCK_DIV64 LITERAL1 -SPI_CLOCK_DIV128 LITERAL1 -SPI_CLOCK_DIV2 LITERAL1 -SPI_CLOCK_DIV8 LITERAL1 -SPI_CLOCK_DIV32 LITERAL1 -SPI_CLOCK_DIV64 LITERAL1 -SPI_MODE0 LITERAL1 -SPI_MODE1 LITERAL1 -SPI_MODE2 LITERAL1 -SPI_MODE3 LITERAL1 \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/SPI/library.properties b/sparkfun/esp8266/libraries/SPI/library.properties deleted file mode 100644 index bbe0ddb8..00000000 --- a/sparkfun/esp8266/libraries/SPI/library.properties +++ /dev/null @@ -1,8 +0,0 @@ -name=SPI -version=1.0 -author=Arduino -maintainer=Arduino -sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. For all Arduino boards, BUT Arduino DUE. -paragraph= -url=http://arduino.cc/en/Reference/SPI -architectures=esp8266 diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/License.txt b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/License.txt deleted file mode 100644 index baf484b4..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/License.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013 Seeed Technology Inc. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/README.md b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/README.md deleted file mode 100644 index 16bdadd0..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/README.md +++ /dev/null @@ -1,38 +0,0 @@ -TFT_Touch_Shield_V2 ---------------------------------------------------------- - -[![TFT_Touch_Shield_V2](http://www.seeedstudio.com/depot/images/product/2.8touch%20shieldv2.jpg)](http://www.seeedstudio.com/depot/28-tft-touch-shield-v20-p-1286.html?cPath=34_36) - -This is a multifunctional Arduino/Seeeduino/Arduino Mega compatible resistive touch screen. It can be used as display device or sketch pad.Compared with the previous version, 2.8’’TFT Touch Shield V1.0 , we replaced the screen driver with a more professional chip, ILI9341 driver, providing different pin-saving SPI communication without sacrificing the data transmitting speed. Due to the communication method change, programs developed for the original version need modifications before being transplanted to the new version. With a SD card module integrated also on this shield, this shield reserves great room for other expansions to your project. - - -**Features** - -- Big screen for easy and comfortable experience -- Backlight controllable via programming -- 65535 rich colors display -- SPI pin-saving communication method -- Full screen touch active range - - - -
-For more information, please refer to [wiki page](http://www.seeedstudio.com/wiki/2.8%27%27_TFT_Touch_Shield_v2.0). - - ----- - - -This software is written by loovee [luweicong@seeedstudio.com](luweicong@seeedstudio.com "luweicong@seeedstudio.com") for seeed studio
-and is licensed under [The MIT License](http://opensource.org/licenses/mit-license.php). Check License.txt for more information.
- -Contributing to this software is warmly welcomed. You can do this basically by
-[forking](https://help.github.com/articles/fork-a-repo), committing modifications and then [pulling requests](https://help.github.com/articles/using-pull-requests) (follow the links above
-for operating guide). Adding change log and your contact into file header is encouraged.
-Thanks for your contribution. - -Seeed Studio is an open hardware facilitation company based in Shenzhen, China.
-Benefiting from local manufacture power and convenient global logistic system,
-we integrate resources to serve new era of innovation. Seeed also works with
-global distributors and partners to push open hardware movement.
- diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/TFTv2.cpp b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/TFTv2.cpp deleted file mode 100644 index a8ba79f8..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/TFTv2.cpp +++ /dev/null @@ -1,573 +0,0 @@ -/* - 2012 Copyright (c) Seeed Technology Inc. - - Authors: Albert.Miao & Loovee, - Visweswara R (with initializtion code from TFT vendor) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc.,51 Franklin St,Fifth Floor, Boston, MA 02110-1301 USA - -*/ - -#include -#include - - -void TFT::TFTinit (void) -{ - pinMode(2, OUTPUT); - pinMode(4, OUTPUT); - pinMode(15, OUTPUT); - SPI.begin(); - SPI.setClockDivider(2); - - TFT_CS_HIGH; - TFT_DC_HIGH; - INT8U i=0, TFTDriver=0; - for(i=0;i<3;i++) - { - TFTDriver = readID(); - } - delay(500); - sendCMD(0x01); - delay(200); - - sendCMD(0xCF); - WRITE_DATA(0x00); - WRITE_DATA(0x8B); - WRITE_DATA(0X30); - - sendCMD(0xED); - WRITE_DATA(0x67); - WRITE_DATA(0x03); - WRITE_DATA(0X12); - WRITE_DATA(0X81); - - sendCMD(0xE8); - WRITE_DATA(0x85); - WRITE_DATA(0x10); - WRITE_DATA(0x7A); - - sendCMD(0xCB); - WRITE_DATA(0x39); - WRITE_DATA(0x2C); - WRITE_DATA(0x00); - WRITE_DATA(0x34); - WRITE_DATA(0x02); - - sendCMD(0xF7); - WRITE_DATA(0x20); - - sendCMD(0xEA); - WRITE_DATA(0x00); - WRITE_DATA(0x00); - - sendCMD(0xC0); /* Power control */ - WRITE_DATA(0x1B); /* VRH[5:0] */ - - sendCMD(0xC1); /* Power control */ - WRITE_DATA(0x10); /* SAP[2:0];BT[3:0] */ - - sendCMD(0xC5); /* VCM control */ - WRITE_DATA(0x3F); - WRITE_DATA(0x3C); - - sendCMD(0xC7); /* VCM control2 */ - WRITE_DATA(0XB7); - - sendCMD(0x36); /* Memory Access Control */ - WRITE_DATA(0x08); - - sendCMD(0x3A); - WRITE_DATA(0x55); - - sendCMD(0xB1); - WRITE_DATA(0x00); - WRITE_DATA(0x1B); - - sendCMD(0xB6); /* Display Function Control */ - WRITE_DATA(0x0A); - WRITE_DATA(0xA2); - - - sendCMD(0xF2); /* 3Gamma Function Disable */ - WRITE_DATA(0x00); - - sendCMD(0x26); /* Gamma curve selected */ - WRITE_DATA(0x01); - - sendCMD(0xE0); /* Set Gamma */ - WRITE_DATA(0x0F); - WRITE_DATA(0x2A); - WRITE_DATA(0x28); - WRITE_DATA(0x08); - WRITE_DATA(0x0E); - WRITE_DATA(0x08); - WRITE_DATA(0x54); - WRITE_DATA(0XA9); - WRITE_DATA(0x43); - WRITE_DATA(0x0A); - WRITE_DATA(0x0F); - WRITE_DATA(0x00); - WRITE_DATA(0x00); - WRITE_DATA(0x00); - WRITE_DATA(0x00); - - sendCMD(0XE1); /* Set Gamma */ - WRITE_DATA(0x00); - WRITE_DATA(0x15); - WRITE_DATA(0x17); - WRITE_DATA(0x07); - WRITE_DATA(0x11); - WRITE_DATA(0x06); - WRITE_DATA(0x2B); - WRITE_DATA(0x56); - WRITE_DATA(0x3C); - WRITE_DATA(0x05); - WRITE_DATA(0x10); - WRITE_DATA(0x0F); - WRITE_DATA(0x3F); - WRITE_DATA(0x3F); - WRITE_DATA(0x0F); - - sendCMD(0x11); /* Exit Sleep */ - delay(120); - sendCMD(0x29); /* Display on */ - fillScreen(); -} - -INT8U TFT::readID(void) -{ - INT8U i=0; - INT8U data[3] ; - INT8U ID[3] = {0x00, 0x93, 0x41}; - INT8U ToF=1; - for(i=0;i<3;i++) - { - data[i]=Read_Register(0xd3,i+1); - if(data[i] != ID[i]) - { - ToF=0; - } - } - if(!ToF) /* data!=ID */ - { - Serial.print("Read TFT ID failed, ID should be 0x09341, but read ID = 0x"); - for(i=0;i<3;i++) - { - Serial.print(data[i],HEX); - } - Serial.println(); - } - return ToF; -} - -void TFT::setCol(INT16U StartCol,INT16U EndCol) -{ - sendCMD(0x2A); /* Column Command address */ - sendData(StartCol); - sendData(EndCol); -} - -void TFT::setPage(INT16U StartPage,INT16U EndPage) -{ - sendCMD(0x2B); /* Column Command address */ - sendData(StartPage); - sendData(EndPage); -} - -void TFT::fillScreen(INT16U XL, INT16U XR, INT16U YU, INT16U YD, INT16U color) -{ - unsigned long XY=0; - unsigned long i=0; - - if(XL > XR) - { - XL = XL^XR; - XR = XL^XR; - XL = XL^XR; - } - if(YU > YD) - { - YU = YU^YD; - YD = YU^YD; - YU = YU^YD; - } - XL = constrain(XL, MIN_X,MAX_X); - XR = constrain(XR, MIN_X,MAX_X); - YU = constrain(YU, MIN_Y,MAX_Y); - YD = constrain(YD, MIN_Y,MAX_Y); - - XY = (XR-XL+1); - XY = XY*(YD-YU+1); - - Tft.setCol(XL,XR); - Tft.setPage(YU, YD); - Tft.sendCMD(0x2c); - - TFT_DC_HIGH; - TFT_CS_LOW; - - INT8U Hcolor = color>>8; - INT8U Lcolor = color&0xff; - for(i=0; i < XY; i++) - { - SPI.transfer(Hcolor); - SPI.transfer(Lcolor); - } - - TFT_CS_HIGH; -} - -void TFT::fillScreen(void) -{ - Tft.setCol(0, 239); - Tft.setPage(0, 319); - Tft.sendCMD(0x2c); /* start to write to display ram */ - - TFT_DC_HIGH; - TFT_CS_LOW; - for(INT16U i=0; i<38400; i++) - { - SPI.transfer(0); - SPI.transfer(0); - SPI.transfer(0); - SPI.transfer(0); - } - TFT_CS_HIGH; -} - - -void TFT::setXY(INT16U poX, INT16U poY) -{ - setCol(poX, poX); - setPage(poY, poY); - sendCMD(0x2c); -} - -void TFT::setPixel(INT16U poX, INT16U poY,INT16U color) -{ - - sendCMD(0x2A); /* Column Command address */ - sendData(poX); - sendData(poX); - - sendCMD(0x2B); /* Column Command address */ - sendData(poY); - sendData(poY); - - sendCMD(0x2c); - - sendData(color); -} - -void TFT::drawChar( INT8U ascii, INT16U poX, INT16U poY,INT16U size, INT16U fgcolor) -{ - if((ascii>=32)&&(ascii<=127)) - { - ; - } - else - { - ascii = '?'-32; - } - for (int i =0; i>f)&0x01) - { - fillRectangle(poX+i*size, poY+f*size, size, size, fgcolor); - } - } - - } -} - -void TFT::drawString(char *string,INT16U poX, INT16U poY, INT16U size,INT16U fgcolor) -{ - while(*string) - { - drawChar(*string, poX, poY, size, fgcolor); - *string++; - - if(poX < MAX_X) - { - poX += FONT_SPACE*size; /* Move cursor right */ - } - } -} - -//fillRectangle(poX+i*size, poY+f*size, size, size, fgcolor); -void TFT::fillRectangle(INT16U poX, INT16U poY, INT16U length, INT16U width, INT16U color) -{ - fillScreen(poX, poX+length, poY, poY+width, color); -} - -void TFT::drawHorizontalLine( INT16U poX, INT16U poY, -INT16U length,INT16U color) -{ - setCol(poX,poX + length); - setPage(poY,poY); - sendCMD(0x2c); - for(int i=0; i= dy) { /* e_xy+e_x > 0 */ - if (x0 == x1) break; - err += dy; x0 += sx; - } - if (e2 <= dx) { /* e_xy+e_y < 0 */ - if (y0 == y1) break; - err += dx; y0 += sy; - } - } -} - -void TFT::drawVerticalLine( INT16U poX, INT16U poY, INT16U length,INT16U color) -{ - setCol(poX,poX); - setPage(poY,poY+length); - sendCMD(0x2c); - for(int i=0; i x) err += ++x*2+1; - } while (x <= 0); -} - -void TFT::fillCircle(int poX, int poY, int r,INT16U color) -{ - int x = -r, y = 0, err = 2-2*r, e2; - do { - - drawVerticalLine(poX-x, poY-y, 2*y, color); - drawVerticalLine(poX+x, poY-y, 2*y, color); - - e2 = err; - if (e2 <= y) { - err += ++y*2+1; - if (-x == y && e2 <= x) e2 = 0; - } - if (e2 > x) err += ++x*2+1; - } while (x <= 0); - -} - -void TFT::drawTraingle( int poX1, int poY1, int poX2, int poY2, int poX3, int poY3, INT16U color) -{ - drawLine(poX1, poY1, poX2, poY2,color); - drawLine(poX1, poY1, poX3, poY3,color); - drawLine(poX2, poY2, poX3, poY3,color); -} - -INT8U TFT::drawNumber(long long_num,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor) -{ - INT8U char_buffer[10] = ""; - INT8U i = 0; - INT8U f = 0; - - if (long_num < 0) - { - f=1; - drawChar('-',poX, poY, size, fgcolor); - long_num = -long_num; - if(poX < MAX_X) - { - poX += FONT_SPACE*size; /* Move cursor right */ - } - } - else if (long_num == 0) - { - f=1; - drawChar('0',poX, poY, size, fgcolor); - return f; - if(poX < MAX_X) - { - poX += FONT_SPACE*size; /* Move cursor right */ - } - } - - - while (long_num > 0) - { - char_buffer[i++] = long_num % 10; - long_num /= 10; - } - - f = f+i; - for(; i > 0; i--) - { - drawChar('0'+ char_buffer[i - 1],poX, poY, size, fgcolor); - if(poX < MAX_X) - { - poX+=FONT_SPACE*size; /* Move cursor right */ - } - } - return f; -} - -INT8U TFT::drawFloat(float floatNumber,INT8U decimal,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor) -{ - INT16U temp=0; - float decy=0.0; - float rounding = 0.5; - INT8U f=0; - if(floatNumber<0.0) - { - drawChar('-',poX, poY, size, fgcolor); - floatNumber = -floatNumber; - if(poX < MAX_X) - { - poX+=FONT_SPACE*size; /* Move cursor right */ - } - f =1; - } - for (INT8U i=0; i0) - { - drawChar('.',poX, poY, size, fgcolor); - if(poX < MAX_X) - { - poX+=FONT_SPACE*size; /* Move cursor right */ - } - f +=1; - } - decy = floatNumber-temp; /* decimal part, 4 */ - for(INT8U i=0;i0) - { - drawChar('.',poX, poY, size, fgcolor); - if(poX < MAX_X) - { - poX += FONT_SPACE*size; /* Move cursor right */ - } - f +=1; - } - decy = floatNumber-temp; /* decimal part, */ - for(INT8U i=0;i= 100 -#define SEEEDUINO -#include -#else -#include -#endif -#include -#include - -//Basic Colors -#define RED 0xf800 -#define GREEN 0x07e0 -#define BLUE 0x001f -#define BLACK 0x0000 -#define YELLOW 0xffe0 -#define WHITE 0xffff - -//Other Colors -#define CYAN 0x07ff -#define BRIGHT_RED 0xf810 -#define GRAY1 0x8410 -#define GRAY2 0x4208 - -//TFT resolution 240*320 -#define MIN_X 0 -#define MIN_Y 0 -#define MAX_X 239 -#define MAX_Y 319 - -#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) - -#define TFT_CS_LOW {DDRE |= 0x08;PORTE &=~ 0x08;} -#define TFT_CS_HIGH {DDRE |= 0x08;PORTE |= 0x08;} -#define TFT_DC_LOW {DDRH |= 0x08;PORTH &=~ 0x08;} -#define TFT_DC_HIGH {DDRH |= 0x08;PORTH |= 0x08;} -#define TFT_BL_OFF {DDRH |= 0x10;PORTH &=~ 0x10;} -#define TFT_BL_ON {DDRH |= 0x10;PORTH |= 0x10;} - -#define YP A2 // must be an analog pin, use "An" notation! -#define XM A1 // must be an analog pin, use "An" notation! -#define YM 54 // can be a digital pin, this is A0 -#define XP 57 // can be a digital pin, this is A3 - -#elif defined(__AVR_ATmega32U4__) - -#define TFT_CS_LOW {DDRC |= 0x40;PORTC &=~ 0x40;} -#define TFT_CS_HIGH {DDRC |= 0x40;PORTC |= 0x40;} -#define TFT_DC_LOW {DDRD |= 0x80;PORTD &=~ 0x80;} -#define TFT_DC_HIGH {DDRD |= 0x80;PORTD |= 0x80;} -#define TFT_BL_OFF {DDRE |= 0x40;PORTE &=~ 0x40;} -#define TFT_BL_ON {DDRE |= 0x40;PORTE |= 0x40;} - -#define YP A2 // must be an analog pin, use "An" notation! -#define XM A1 // must be an analog pin, use "An" notation! -#define YM 18 // can be a digital pin, this is A0 -#define XP 21 // can be a digital pin, this is A3 - -#else -#define TFT_CS_LOW digitalWrite(15, 0); -#define TFT_CS_HIGH digitalWrite(15, 1); -#define TFT_DC_LOW digitalWrite(2, 0); -#define TFT_DC_HIGH digitalWrite(2, 1); -#define TFT_BL_OFF digitalWrite(4, 0); -#define TFT_BL_ON digitalWrite(4, 1); - -#define YP A2 // must be an analog pin, use "An" notation! -#define XM A1 // must be an analog pin, use "An" notation! -#define YM 14 // can be a digital pin, this is A0 -#define XP 17 // can be a digital pin, this is A3 - -#endif - -#define TS_MINX 116*2 -#define TS_MAXX 890*2 -#define TS_MINY 83*2 -#define TS_MAXY 913*2 - -#ifndef INT8U -#define INT8U unsigned char -#endif -#ifndef INT16U -#define INT16U unsigned int -#endif - -#define FONT_SPACE 6 -#define FONT_X 8 -#define FONT_Y 8 - - -extern INT8U simpleFont[][8]; - -class TFT -{ - -private: - - - -public: - - inline void sendCMD(INT8U index) - { - TFT_DC_LOW; - TFT_CS_LOW; - SPI.transfer(index); - TFT_CS_HIGH; - } - - inline void WRITE_DATA(INT8U data) - { - TFT_DC_HIGH; - TFT_CS_LOW; - SPI.transfer(data); - TFT_CS_HIGH; - } - - inline void sendData(INT16U data) - { - INT8U data1 = data>>8; - INT8U data2 = data&0xff; - TFT_DC_HIGH; - TFT_CS_LOW; - SPI.transfer(data1); - SPI.transfer(data2); - TFT_CS_HIGH; - } - - void WRITE_Package(INT16U *data, INT8U howmany) - { - INT16U data1 = 0; - INT8U data2 = 0; - - TFT_DC_HIGH; - TFT_CS_LOW; - INT8U count=0; - for(count=0;count>8; - data2 = data[count]&0xff; - SPI.transfer(data1); - SPI.transfer(data2); - } - TFT_CS_HIGH; - } - - INT8U Read_Register(INT8U Addr, INT8U xParameter) - { - INT8U data=0; - sendCMD(0xd9); /* ext command */ - WRITE_DATA(0x10+xParameter); /* 0x11 is the first Parameter */ - TFT_DC_LOW; - TFT_CS_LOW; - SPI.transfer(Addr); - TFT_DC_HIGH; - data = SPI.transfer(0); - TFT_CS_HIGH; - return data; - } - - - void TFTinit (void); - void setCol(INT16U StartCol,INT16U EndCol); - void setPage(INT16U StartPage,INT16U EndPage); - void setXY(INT16U poX, INT16U poY); - void setPixel(INT16U poX, INT16U poY,INT16U color); - - void fillScreen(INT16U XL,INT16U XR,INT16U YU,INT16U YD,INT16U color); - void fillScreen(void); - INT8U readID(void); - - void drawChar(INT8U ascii,INT16U poX, INT16U poY,INT16U size, INT16U fgcolor); - void drawString(char *string,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - void fillRectangle(INT16U poX, INT16U poY, INT16U length, INT16U width, INT16U color); - - void drawLine(INT16U x0,INT16U y0,INT16U x1,INT16U y1,INT16U color); - void drawVerticalLine(INT16U poX, INT16U poY,INT16U length,INT16U color); - void drawHorizontalLine(INT16U poX, INT16U poY,INT16U length,INT16U color); - void drawRectangle(INT16U poX, INT16U poY, INT16U length,INT16U width,INT16U color); - - void drawCircle(int poX, int poY, int r,INT16U color); - void fillCircle(int poX, int poY, int r,INT16U color); - - void drawTraingle(int poX1, int poY1, int poX2, int poY2, int poX3, int poY3, INT16U color); - - INT8U drawNumber(long long_num,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - INT8U drawFloat(float floatNumber,INT8U decimal,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - INT8U drawFloat(float floatNumber,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - -}; - -extern TFT Tft; - -#endif - -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino deleted file mode 100644 index 7059b8ff..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawCircle/drawCircle.ino +++ /dev/null @@ -1,32 +0,0 @@ -/* Demo of draw circle's APP - drawCircle(int poX, int poY, int r,INT16U color); - fillCircle(int poX, int poY, int r,INT16U color); -*/ - -#include -#include -#include - -void setup() -{ - TFT_BL_ON; //turn on the background light - - Tft.TFTinit(); //init TFT library - - Tft.drawCircle(100, 100, 30,YELLOW); //center: (100, 100), r = 30 ,color : YELLOW - - Tft.drawCircle(100, 200, 40,CYAN); // center: (100, 200), r = 10 ,color : CYAN - - Tft.fillCircle(200, 100, 30,RED); //center: (200, 100), r = 30 ,color : RED - - Tft.fillCircle(200, 200, 30,BLUE); //center: (200, 200), r = 30 ,color : BLUE -} - -void loop() -{ - -} - -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino deleted file mode 100644 index cda83dd5..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawLines/drawLines.ino +++ /dev/null @@ -1,31 +0,0 @@ -/* Demo of draw line's APP - drawLine(unsigned int x0,unsigned int y0,unsigned int x1,unsigned int y1,unsigned int color); - drawVerticalLine(unsigned int poX, unsigned int poY,unsigned int length,unsigned int color); - drawHorizontalLine(unsigned int poX, unsigned int poY,unsigned int length,unsigned int color); -*/ - -#include -#include -#include -void setup() -{ - TFT_BL_ON; // turn on the background light - Tft.TFTinit(); //init TFT library - - Tft.drawLine(0,0,239,319,RED); //start: (0, 0) end: (239, 319), color : RED - - Tft.drawVerticalLine(60,100,100,GREEN); // Draw a vertical line - // start: (60, 100) length: 100 color: green - - Tft.drawHorizontalLine(30,60,150,BLUE); //Draw a horizontal line - //start: (30, 60), high: 150, color: blue -} - -void loop() -{ - -} - -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino deleted file mode 100644 index 039f98e3..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawNumber/drawNumber.ino +++ /dev/null @@ -1,40 +0,0 @@ -/* draw number's APP - drawNumber(long long_num,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - drawFloat(float floatNumber,INT8U decimal,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); - drawFloat(float floatNumber,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); -*/ - -#include -#include -#include - -void setup() -{ - TFT_BL_ON; // turn on the background light - - Tft.TFTinit(); // init TFT library - - Tft.drawNumber(1024, 0, 0, 1, RED); // draw a integer: 1024, Location: (0, 0), size: 1, color: RED - - Tft.drawNumber(1024, 0, 20, 2, BLUE); // draw a integer: 1024, Location: (0, 20), size: 2, color: BLUE - - Tft.drawNumber(1024, 0, 50, 3, GREEN); // draw a integer: 1024, Location: (0, 50), size: 3, color: GREEN - - Tft.drawNumber(1024, 0, 90, 4, BLUE); // draw a integer: 1024, Location: (0, 90), size:4, color: BLUE - - Tft.drawFloat(1.2345, 0, 150, 4, YELLOW); // draw a float number: 1.2345, Location: (0, 150), size: 4, color: YELLOW - - Tft.drawFloat(1.2345, 2, 0, 200, 4, BLUE); // draw a float number: 1.2345: Location: (0, 200), size: 4, decimal: 2, color: BLUE - - Tft.drawFloat(1.2345, 4, 0, 250, 4, RED); // draw a float number: 1.2345 Location: (0, 250), size: 4, decimal: 4, color: RED - -} - -void loop() -{ - -} - -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino deleted file mode 100644 index b3fca1bc..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/drawRectangle/drawRectangle.ino +++ /dev/null @@ -1,26 +0,0 @@ -/* Draw Boxes - Demonstrate drawRectangle and fillRectangle - fillScreen(INT16U XL,INT16U XR,INT16U YU,INT16U YD,INT16U color); - fillRectangle(INT16U poX, INT16U poY, INT16U length, INT16U width, INT16U color); - drawRectangle(INT16U poX, INT16U poY, INT16U length,INT16U width,INT16U color); -*/ -#include -#include -#include - -void setup() -{ - TFT_BL_ON; // turn on the background light - Tft.TFTinit(); // init TFT library - - Tft.fillScreen(80, 160, 50, 150,RED); - Tft.fillRectangle(30, 120, 100,65,YELLOW); - Tft.drawRectangle(100, 170, 120,60,BLUE); -} - -void loop() -{ - -} -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino deleted file mode 100644 index 53316449..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/paint/paint.ino +++ /dev/null @@ -1,55 +0,0 @@ -// Paint application - Demonstate both TFT and Touch Screen -#include -#include -#include -#include - -int ColorPaletteHigh = 30; -int color = WHITE; //Paint brush color -unsigned int colors[8] = {BLACK, RED, GREEN, BLUE, CYAN, YELLOW, WHITE, GRAY1}; - -// For better pressure precision, we need to know the resistance -// between X+ and X- Use any multimeter to read it -// The 2.8" TFT Touch shield has 300 ohms across the X plate - -TouchScreen ts = TouchScreen(XP, YP, XM, YM); //init TouchScreen port pins - -void setup() -{ - Tft.TFTinit(); //init TFT library - Serial.begin(115200); - //Draw the pallet - for(int i = 0; i<8; i++) - { - Tft.fillRectangle(i*30, 0, 30, ColorPaletteHigh, colors[i]); - } -} - -void loop() -{ - // a point object holds x y and z coordinates. - Point p = ts.getPoint(); - - //map the ADC value read to into pixel co-ordinates - - p.x = map(p.x, TS_MINX, TS_MAXX, 0, 240); - p.y = map(p.y, TS_MINY, TS_MAXY, 0, 320); - - // we have some minimum pressure we consider 'valid' - // pressure of 0 means no pressing! - - if (p.z > __PRESURE) { - // Detect paint brush color change - if(p.y < ColorPaletteHigh+2) - { - color = colors[p.x/30]; - } - else - { - Tft.fillCircle(p.x,p.y,2,color); - } - } -} -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino deleted file mode 100644 index c1c41ddf..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/shapes/shapes.ino +++ /dev/null @@ -1,23 +0,0 @@ -// Draw Boxes - Demonstrate drawRectangle and fillRectangle - -#include -#include -#include - -void setup() -{ - TFT_BL_ON; // turn on the background light - Tft.TFTinit(); // init TFT library -} - -void loop() -{ - for(int r=0;r<115;r=r+2) //set r : 0--115 - { - Tft.drawCircle(119,160,r,random(0xFFFF)); //draw circle, center:(119, 160), color: random - } - delay(10); -} -/********************************************************************************************************* - END FILE -*********************************************************************************************************/ \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/text/text.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/text/text.ino deleted file mode 100644 index bb635752..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/text/text.ino +++ /dev/null @@ -1,35 +0,0 @@ -/* draw text's APP - drawChar(INT8U ascii,INT16U poX, INT16U poY,INT16U size, INT16U fgcolor); - drawString(char *string,INT16U poX, INT16U poY,INT16U size,INT16U fgcolor); -*/ - -#include -#include -#include - -void setup() -{ - TFT_BL_ON; // turn on the background light - Tft.TFTinit(); // init TFT library - - Tft.drawChar('S',0,0,1,RED); // draw char: 'S', (0, 0), size: 1, color: RED - - Tft.drawChar('E',10,10,2,BLUE); // draw char: 'E', (10, 10), size: 2, color: BLUE - - Tft.drawChar('E',20,40,3,GREEN); // draw char: 'E', (20, 40), size: 3, color: GREEN - - Tft.drawChar('E',30,80,4,YELLOW); // draw char: 'E', (30, 80), size: 4, color: YELLOW - - Tft.drawChar('D',40,120,4,YELLOW); // draw char: 'D', (40, 120), size: 4, color: YELLOW - - Tft.drawString("Hello",0,180,3,CYAN); // draw string: "hello", (0, 180), size: 3, color: CYAN - - Tft.drawString("World!!",60,220,4,WHITE); // draw string: "world!!", (80, 230), size: 4, color: WHITE - - -} - -void loop() -{ - -} diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/flower.BMP b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/flower.BMP deleted file mode 100644 index 791c5ad5..00000000 Binary files a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/flower.BMP and /dev/null differ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/hibiscus.bmp b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/hibiscus.bmp deleted file mode 100644 index 1691f257..00000000 Binary files a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/hibiscus.bmp and /dev/null differ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/test.bmp b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/test.bmp deleted file mode 100644 index 4f44e455..00000000 Binary files a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/test.bmp and /dev/null differ diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino deleted file mode 100644 index a25aa96c..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp/tftbmp.ino +++ /dev/null @@ -1,235 +0,0 @@ -/* - TFT Touch Shield 2.0 examples - tftbmp - - loovee - 2013-1-21 - - this demo can show specified bmp file in root Directory of SD card - please ensure that your image file is 320x240 size. - - change __Gnfile_num and __Gsbmp_files to display your image -*/ - -#include -#include -#include - -#include "TFTv2.h" - -#define MAX_BMP 10 // bmp file num -#define FILENAME_LEN 20 // max file name length - - -const int PIN_SD_CS = 4; // pin of sd card - -const int __Gnbmp_height = 320; // bmp hight -const int __Gnbmp_width = 240; // bmp width - -unsigned char __Gnbmp_image_offset = 0; // offset - - -int __Gnfile_num = 3; // num of file - -char __Gsbmp_files[3][FILENAME_LEN] = // add file name here -{ -"flower.BMP", -"hibiscus.bmp", -"test.bmp", -}; - - -File bmpFile; - - -void setup() -{ - - Serial.begin(9600); - - pinMode(PIN_SD_CS,OUTPUT); - digitalWrite(PIN_SD_CS,HIGH); - - Tft.TFTinit(); - - Sd2Card card; - card.init(SPI_FULL_SPEED, PIN_SD_CS); - - if(!SD.begin(PIN_SD_CS)) - { - Serial.println("failed!"); - while(1); // init fail, die here - } - - Serial.println("SD OK!"); - - TFT_BL_ON; -} - -void loop() -{ - for(unsigned char i=0; i<__Gnfile_num; i++) - { - bmpFile = SD.open(__Gsbmp_files[i]); - if (! bmpFile) - { - Serial.println("didnt find image"); - while (1); - } - - if(! bmpReadHeader(bmpFile)) - { - Serial.println("bad bmp"); - return; - } - - bmpdraw(bmpFile, 0, 0); - bmpFile.close(); - - delay(1000); - } - -} - -/*********************************************/ -// This procedure reads a bitmap and draws it to the screen -// its sped up by reading many pixels worth of data at a time -// instead of just one pixel at a time. increading the buffer takes -// more RAM but makes the drawing a little faster. 20 pixels' worth -// is probably a good place - -#define BUFFPIXEL 60 // must be a divisor of 240 -#define BUFFPIXEL_X3 180 // BUFFPIXELx3 - -void bmpdraw(File f, int x, int y) -{ - bmpFile.seek(__Gnbmp_image_offset); - - uint32_t time = millis(); - - uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer - - for (int i=0; i< __Gnbmp_height; i++) - { - - for(int j=0; j<(240/BUFFPIXEL); j++) - { - bmpFile.read(sdbuffer, BUFFPIXEL_X3); - uint8_t buffidx = 0; - int offset_x = j*BUFFPIXEL; - - unsigned int __color[BUFFPIXEL]; - - for(int k=0; k>3; // read - __color[k] = __color[k]<<6 | (sdbuffer[buffidx+1]>>2); // green - __color[k] = __color[k]<<5 | (sdbuffer[buffidx+0]>>3); // blue - - buffidx += 3; - } - - Tft.setCol(offset_x, offset_x+BUFFPIXEL); - Tft.setPage(i, i); - Tft.sendCMD(0x2c); - - TFT_DC_HIGH; - TFT_CS_LOW; - - for(int m=0; m < BUFFPIXEL; m++) - { - SPI.transfer(__color[m]>>8); - SPI.transfer(__color[m]); - } - - TFT_CS_HIGH; - } - - } - - Serial.print(millis() - time, DEC); - Serial.println(" ms"); -} - -boolean bmpReadHeader(File f) -{ - // read header - uint32_t tmp; - uint8_t bmpDepth; - - if (read16(f) != 0x4D42) { - // magic bytes missing - return false; - } - - // read file size - tmp = read32(f); - Serial.print("size 0x"); - Serial.println(tmp, HEX); - - // read and ignore creator bytes - read32(f); - - __Gnbmp_image_offset = read32(f); - Serial.print("offset "); - Serial.println(__Gnbmp_image_offset, DEC); - - // read DIB header - tmp = read32(f); - Serial.print("header size "); - Serial.println(tmp, DEC); - - - int bmp_width = read32(f); - int bmp_height = read32(f); - - if(bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) // if image is not 320x240, return false - { - return false; - } - - if (read16(f) != 1) - return false; - - bmpDepth = read16(f); - Serial.print("bitdepth "); - Serial.println(bmpDepth, DEC); - - if (read32(f) != 0) { - // compression not supported! - return false; - } - - Serial.print("compression "); - Serial.println(tmp, DEC); - - return true; -} - -/*********************************************/ -// These read data from the SD card file and convert them to big endian -// (the data is stored in little endian format!) - -// LITTLE ENDIAN! -uint16_t read16(File f) -{ - uint16_t d; - uint8_t b; - b = f.read(); - d = f.read(); - d <<= 8; - d |= b; - return d; -} - -// LITTLE ENDIAN! -uint32_t read32(File f) -{ - uint32_t d; - uint16_t b; - - b = read16(f); - d = read16(f); - d <<= 16; - d |= b; - return d; -} diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino deleted file mode 100644 index 2707dad3..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/examples/tftbmp2/tftbmp2.ino +++ /dev/null @@ -1,348 +0,0 @@ -/* - TFT Touch Shield 2.0 examples - tftbmp2 - - loovee - 2013-1-21 - - this demo can show all bmp file in root Directory of SD card - please ensure that your image file is 320x240 size. - - MAX_BMP can config the max file to display - FILENAME_LEN can config the max length of file name - -*/ - -#include -#include -#include - -#include "TFTv2.h" - -#define MAX_BMP 10 // bmp file num -#define FILENAME_LEN 20 // max file name length - -const int PIN_SD_CS = 4; // pin of sd card - -const long __Gnbmp_height = 320; // bmp hight -const long __Gnbmp_width = 240; // bmp width - -long __Gnbmp_image_offset = 0;; - -int __Gnfile_num = 0; // num of file -char __Gsbmp_files[MAX_BMP][FILENAME_LEN]; // file name - -File bmpFile; - -// if bmp file return 1, else return 0 -bool checkBMP(char *_name, char r_name[]) -{ - int len = 0; - - if(NULL == _name)return false; - - while(*_name) - { - r_name[len++] = *(_name++); - if(len>FILENAME_LEN)return false; - } - - r_name[len] = '\0'; - - if(len < 5)return false; - - // if xxx.bmp or xxx.BMP - if( r_name[len-4] == '.' \ - && (r_name[len-3] == 'b' || (r_name[len-3] == 'B')) \ - && (r_name[len-2] == 'm' || (r_name[len-2] == 'M')) \ - && (r_name[len-1] == 'p' || (r_name[len-1] == 'P')) ) - { - return true; - } - - return false; - -} - -// search root to find bmp file -void searchDirectory() -{ - File root = SD.open("/"); // root - while(true) - { - File entry = root.openNextFile(); - - if (! entry) - { - break; - } - - if(!entry.isDirectory()) - { - char *ptmp = entry.name(); - - char __Name[20]; - - if(checkBMP(ptmp, __Name)) - { - Serial.println(__Name); - - strcpy(__Gsbmp_files[__Gnfile_num++], __Name); - } - } - entry.close(); - } - - Serial.print("get "); - Serial.print(__Gnfile_num); - Serial.println(" file: "); - - for(int i=0; i<__Gnfile_num; i++) - { - Serial.println(__Gsbmp_files[i]); - } -} - - -void setup() -{ - - Serial.begin(115200); - - pinMode(PIN_SD_CS,OUTPUT); - digitalWrite(PIN_SD_CS,HIGH); - - Tft.TFTinit(); - - Sd2Card card; - card.init(SPI_FULL_SPEED, PIN_SD_CS); - - if(!SD.begin(PIN_SD_CS)) - { - Serial.println("failed!"); - while(1); // init fail, die here - } - - Serial.println("SD OK!"); - - searchDirectory(); - - TFT_BL_ON; -} - -void loop() -{ -/* - static int dirCtrl = 0; - for(unsigned char i=0; i<__Gnfile_num; i++) - { - bmpFile = SD.open(__Gsbmp_files[i]); - if (! bmpFile) - { - Serial.println("didnt find image"); - while (1); - } - - if(! bmpReadHeader(bmpFile)) - { - Serial.println("bad bmp"); - return; - } - - dirCtrl = 1-dirCtrl; - bmpdraw(bmpFile, 0, 0, dirCtrl); - bmpFile.close(); - - delay(1000); - } -*/ - - - bmpFile = SD.open("pfvm_1.bmp"); - - if (! bmpFile) - { - Serial.println("didnt find image"); - while (1); - } - - if(! bmpReadHeader(bmpFile)) - { - Serial.println("bad bmp"); - return; - } - - bmpdraw(bmpFile, 0, 0, 1); - bmpFile.close(); - - while(1); -} - -/*********************************************/ -// This procedure reads a bitmap and draws it to the screen -// its sped up by reading many pixels worth of data at a time -// instead of just one pixel at a time. increading the buffer takes -// more RAM but makes the drawing a little faster. 20 pixels' worth -// is probably a good place - -#define BUFFPIXEL 60 // must be a divisor of 240 -#define BUFFPIXEL_X3 180 // BUFFPIXELx3 - - -#define UP_DOWN 1 -#define DOWN_UP 0 - -// dir - 1: up to down -// dir - 2: down to up -void bmpdraw(File f, int x, int y, int dir) -{ - - if(bmpFile.seek(__Gnbmp_image_offset)) - { - Serial.print("pos = "); - Serial.println(bmpFile.position()); - } - - uint32_t time = millis(); - - uint8_t sdbuffer[BUFFPIXEL_X3]; // 3 * pixels to buffer - - for (int i=0; i< __Gnbmp_height; i++) - { - if(dir) - { - bmpFile.seek(__Gnbmp_image_offset+(__Gnbmp_height-1-i)*240*3); - } - - for(int j=0; j<(240/BUFFPIXEL); j++) - { - - bmpFile.read(sdbuffer, BUFFPIXEL_X3); - uint8_t buffidx = 0; - int offset_x = j*BUFFPIXEL; - - unsigned int __color[BUFFPIXEL]; - - for(int k=0; k>3; // read - __color[k] = __color[k]<<6 | (sdbuffer[buffidx+1]>>2); // green - __color[k] = __color[k]<<5 | (sdbuffer[buffidx+0]>>3); // blue - - buffidx += 3; - } - - Tft.setCol(offset_x, offset_x+BUFFPIXEL); - - if(dir) - { - Tft.setPage(i, i); - } - else - { - Tft.setPage(__Gnbmp_height-i-1, __Gnbmp_height-i-1); - } - - Tft.sendCMD(0x2c); - - TFT_DC_HIGH; - TFT_CS_LOW; - - for(int m=0; m < BUFFPIXEL; m++) - { - SPI.transfer(__color[m]>>8); - SPI.transfer(__color[m]); - - delay(10); - } - - TFT_CS_HIGH; - } - - } - - Serial.print(millis() - time, DEC); - Serial.println(" ms"); -} - -boolean bmpReadHeader(File f) -{ - // read header - uint32_t tmp; - uint8_t bmpDepth; - - if (read16(f) != 0x4D42) { - // magic bytes missing - return false; - } - - // read file size - tmp = read32(f); - Serial.print("size 0x"); - Serial.println(tmp, HEX); - - // read and ignore creator bytes - read32(f); - - __Gnbmp_image_offset = read32(f); - Serial.print("offset "); - Serial.println(__Gnbmp_image_offset, DEC); - - // read DIB header - tmp = read32(f); - Serial.print("header size "); - Serial.println(tmp, DEC); - - int bmp_width = read32(f); - int bmp_height = read32(f); - - if(bmp_width != __Gnbmp_width || bmp_height != __Gnbmp_height) // if image is not 320x240, return false - { - return false; - } - - if (read16(f) != 1) - return false; - - bmpDepth = read16(f); - Serial.print("bitdepth "); - Serial.println(bmpDepth, DEC); - - if (read32(f) != 0) { - // compression not supported! - return false; - } - - Serial.print("compression "); - Serial.println(tmp, DEC); - - return true; -} - -/*********************************************/ -// These read data from the SD card file and convert them to big endian -// (the data is stored in little endian format!) - -// LITTLE ENDIAN! -uint16_t read16(File f) -{ - uint16_t d; - uint8_t b; - b = f.read(); - d = f.read(); - d <<= 8; - d |= b; - return d; -} - -// LITTLE ENDIAN! -uint32_t read32(File f) -{ - uint32_t d; - uint16_t b; - - b = read16(f); - d = read16(f); - d <<= 16; - d |= b; - return d; -} diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/font.c b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/font.c deleted file mode 100644 index 3a67494a..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/font.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - 2012 Copyright (c) Seeed Technology Inc. -*/ - -#include - -const unsigned char simpleFont[][8] PROGMEM= -{ - {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x00,0x5F,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x00,0x07,0x00,0x07,0x00,0x00,0x00}, - {0x00,0x14,0x7F,0x14,0x7F,0x14,0x00,0x00}, - {0x00,0x24,0x2A,0x7F,0x2A,0x12,0x00,0x00}, - {0x00,0x23,0x13,0x08,0x64,0x62,0x00,0x00}, - {0x00,0x36,0x49,0x55,0x22,0x50,0x00,0x00}, - {0x00,0x00,0x05,0x03,0x00,0x00,0x00,0x00}, - {0x00,0x1C,0x22,0x41,0x00,0x00,0x00,0x00}, - {0x00,0x41,0x22,0x1C,0x00,0x00,0x00,0x00}, - {0x00,0x08,0x2A,0x1C,0x2A,0x08,0x00,0x00}, - {0x00,0x08,0x08,0x3E,0x08,0x08,0x00,0x00}, - {0x00,0xA0,0x60,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x08,0x08,0x08,0x08,0x08,0x00,0x00}, - {0x00,0x60,0x60,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x20,0x10,0x08,0x04,0x02,0x00,0x00}, - {0x00,0x3E,0x51,0x49,0x45,0x3E,0x00,0x00}, - {0x00,0x00,0x42,0x7F,0x40,0x00,0x00,0x00}, - {0x00,0x62,0x51,0x49,0x49,0x46,0x00,0x00}, - {0x00,0x22,0x41,0x49,0x49,0x36,0x00,0x00}, - {0x00,0x18,0x14,0x12,0x7F,0x10,0x00,0x00}, - {0x00,0x27,0x45,0x45,0x45,0x39,0x00,0x00}, - {0x00,0x3C,0x4A,0x49,0x49,0x30,0x00,0x00}, - {0x00,0x01,0x71,0x09,0x05,0x03,0x00,0x00}, - {0x00,0x36,0x49,0x49,0x49,0x36,0x00,0x00}, - {0x00,0x06,0x49,0x49,0x29,0x1E,0x00,0x00}, - {0x00,0x00,0x36,0x36,0x00,0x00,0x00,0x00}, - {0x00,0x00,0xAC,0x6C,0x00,0x00,0x00,0x00}, - {0x00,0x08,0x14,0x22,0x41,0x00,0x00,0x00}, - {0x00,0x14,0x14,0x14,0x14,0x14,0x00,0x00}, - {0x00,0x41,0x22,0x14,0x08,0x00,0x00,0x00}, - {0x00,0x02,0x01,0x51,0x09,0x06,0x00,0x00}, - {0x00,0x32,0x49,0x79,0x41,0x3E,0x00,0x00}, - {0x00,0x7E,0x09,0x09,0x09,0x7E,0x00,0x00}, - {0x00,0x7F,0x49,0x49,0x49,0x36,0x00,0x00}, - {0x00,0x3E,0x41,0x41,0x41,0x22,0x00,0x00}, - {0x00,0x7F,0x41,0x41,0x22,0x1C,0x00,0x00}, - {0x00,0x7F,0x49,0x49,0x49,0x41,0x00,0x00}, - {0x00,0x7F,0x09,0x09,0x09,0x01,0x00,0x00}, - {0x00,0x3E,0x41,0x41,0x51,0x72,0x00,0x00}, - {0x00,0x7F,0x08,0x08,0x08,0x7F,0x00,0x00}, - {0x00,0x41,0x7F,0x41,0x00,0x00,0x00,0x00}, - {0x00,0x20,0x40,0x41,0x3F,0x01,0x00,0x00}, - {0x00,0x7F,0x08,0x14,0x22,0x41,0x00,0x00}, - {0x00,0x7F,0x40,0x40,0x40,0x40,0x00,0x00}, - {0x00,0x7F,0x02,0x0C,0x02,0x7F,0x00,0x00}, - {0x00,0x7F,0x04,0x08,0x10,0x7F,0x00,0x00}, - {0x00,0x3E,0x41,0x41,0x41,0x3E,0x00,0x00}, - {0x00,0x7F,0x09,0x09,0x09,0x06,0x00,0x00}, - {0x00,0x3E,0x41,0x51,0x21,0x5E,0x00,0x00}, - {0x00,0x7F,0x09,0x19,0x29,0x46,0x00,0x00}, - {0x00,0x26,0x49,0x49,0x49,0x32,0x00,0x00}, - {0x00,0x01,0x01,0x7F,0x01,0x01,0x00,0x00}, - {0x00,0x3F,0x40,0x40,0x40,0x3F,0x00,0x00}, - {0x00,0x1F,0x20,0x40,0x20,0x1F,0x00,0x00}, - {0x00,0x3F,0x40,0x38,0x40,0x3F,0x00,0x00}, - {0x00,0x63,0x14,0x08,0x14,0x63,0x00,0x00}, - {0x00,0x03,0x04,0x78,0x04,0x03,0x00,0x00}, - {0x00,0x61,0x51,0x49,0x45,0x43,0x00,0x00}, - {0x00,0x7F,0x41,0x41,0x00,0x00,0x00,0x00}, - {0x00,0x02,0x04,0x08,0x10,0x20,0x00,0x00}, - {0x00,0x41,0x41,0x7F,0x00,0x00,0x00,0x00}, - {0x00,0x04,0x02,0x01,0x02,0x04,0x00,0x00}, - {0x00,0x80,0x80,0x80,0x80,0x80,0x00,0x00}, - {0x00,0x01,0x02,0x04,0x00,0x00,0x00,0x00}, - {0x00,0x20,0x54,0x54,0x54,0x78,0x00,0x00}, - {0x00,0x7F,0x48,0x44,0x44,0x38,0x00,0x00}, - {0x00,0x38,0x44,0x44,0x28,0x00,0x00,0x00}, - {0x00,0x38,0x44,0x44,0x48,0x7F,0x00,0x00}, - {0x00,0x38,0x54,0x54,0x54,0x18,0x00,0x00}, - {0x00,0x08,0x7E,0x09,0x02,0x00,0x00,0x00}, - {0x00,0x18,0xA4,0xA4,0xA4,0x7C,0x00,0x00}, - {0x00,0x7F,0x08,0x04,0x04,0x78,0x00,0x00}, - {0x00,0x00,0x7D,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x80,0x84,0x7D,0x00,0x00,0x00,0x00}, - {0x00,0x7F,0x10,0x28,0x44,0x00,0x00,0x00}, - {0x00,0x41,0x7F,0x40,0x00,0x00,0x00,0x00}, - {0x00,0x7C,0x04,0x18,0x04,0x78,0x00,0x00}, - {0x00,0x7C,0x08,0x04,0x7C,0x00,0x00,0x00}, - {0x00,0x38,0x44,0x44,0x38,0x00,0x00,0x00}, - {0x00,0xFC,0x24,0x24,0x18,0x00,0x00,0x00}, - {0x00,0x18,0x24,0x24,0xFC,0x00,0x00,0x00}, - {0x00,0x00,0x7C,0x08,0x04,0x00,0x00,0x00}, - {0x00,0x48,0x54,0x54,0x24,0x00,0x00,0x00}, - {0x00,0x04,0x7F,0x44,0x00,0x00,0x00,0x00}, - {0x00,0x3C,0x40,0x40,0x7C,0x00,0x00,0x00}, - {0x00,0x1C,0x20,0x40,0x20,0x1C,0x00,0x00}, - {0x00,0x3C,0x40,0x30,0x40,0x3C,0x00,0x00}, - {0x00,0x44,0x28,0x10,0x28,0x44,0x00,0x00}, - {0x00,0x1C,0xA0,0xA0,0x7C,0x00,0x00,0x00}, - {0x00,0x44,0x64,0x54,0x4C,0x44,0x00,0x00}, - {0x00,0x08,0x36,0x41,0x00,0x00,0x00,0x00}, - {0x00,0x00,0x7F,0x00,0x00,0x00,0x00,0x00}, - {0x00,0x41,0x36,0x08,0x00,0x00,0x00,0x00}, - {0x00,0x02,0x01,0x01,0x02,0x01,0x00,0x00}, - {0x00,0x02,0x05,0x05,0x02,0x00,0x00,0x00} -}; - - diff --git a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/keywords.txt b/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/keywords.txt deleted file mode 100644 index a3f47ae9..00000000 --- a/sparkfun/esp8266/libraries/TFT_Touch_Shield_V2/keywords.txt +++ /dev/null @@ -1,61 +0,0 @@ -####################################### -# Syntax Coloring Map For SeeedTft2.0 -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### -Tft KEYWORD1 -TFTv2 KEYWORD1 -####################################### -# Methods and Functions (KEYWORD2) -####################################### -TFTinit KEYWORD2 -setCol KEYWORD2 -setPage KEYWORD2 -setXY KEYWORD2 -setPixel KEYWORD2 -sendCMD KEYWORD2 -WRITE_Package KEYWORD2 -WRITE_DATA KEYWORD2 -sendData KEYWORD2 -Read_Register KEYWORD2 -fillScreen KEYWORD2 -drawChar KEYWORD2 -drawString KEYWORD2 -fillRectangle KEYWORD2 -drawLine KEYWORD2 -drawVerticalLine KEYWORD2 -drawHorizontalLine KEYWORD2 -drawRectangle KEYWORD2 -drawCircle KEYWORD2 -fillCircle KEYWORD2 -drawTraingle KEYWORD2 -drawNumber KEYWORD2 -drawFloat KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### -RED LITERAL1 -GREEN LITERAL1 -BLUE LITERAL1 -BLACK LITERAL1 -YELLOW LITERAL1 -WHITE LITERAL1 -CYAN LITERAL1 -BRIGHT_RED LITERAL1 -GRAY1 LITERAL1 -GRAY2 LITERAL1 -MIN_X LITERAL1 -MIN_Y LITERAL1 -MAX_X LITERAL1 -MAX_Y LITERAL1 -TFT_BL_ON LITERAL1 -TFT_BL_OFF LITERAL1 -TFT_CS_LOW LITERAL1 -TFT_CS_HIGH LITERAL1 -TFT_DC_LOW LITERAL1 -TFT_DC_HIGH LITERAL1 -RED LITERAL1 -RED LITERAL1 \ No newline at end of file diff --git a/sparkfun/esp8266/libraries/Ticker/Ticker.cpp b/sparkfun/esp8266/libraries/Ticker/Ticker.cpp deleted file mode 100644 index b348798c..00000000 --- a/sparkfun/esp8266/libraries/Ticker/Ticker.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - Ticker.cpp - esp8266 library that calls functions periodically - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include -#include - -extern "C" { -#include "c_types.h" -#include "eagle_soc.h" -#include "ets_sys.h" -#include "osapi.h" -} - -const int ONCE = 0; -const int REPEAT = 1; - -#include "Ticker.h" - -Ticker::Ticker() -: _timer(0) -{ -} - -Ticker::~Ticker() -{ - detach(); -} - -void Ticker::_attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg) -{ - if (_timer) - { - os_timer_disarm(_timer); - } - else - { - _timer = new ETSTimer; - } - - os_timer_setfn(_timer, reinterpret_cast(callback), reinterpret_cast(arg)); - os_timer_arm(_timer, milliseconds, (repeat)?REPEAT:ONCE); -} - -void Ticker::detach() -{ - if (!_timer) - return; - - os_timer_disarm(_timer); - delete _timer; - _timer = 0; -} diff --git a/sparkfun/esp8266/libraries/Ticker/Ticker.h b/sparkfun/esp8266/libraries/Ticker/Ticker.h deleted file mode 100644 index ea3f59f1..00000000 --- a/sparkfun/esp8266/libraries/Ticker/Ticker.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - Ticker.h - esp8266 library that calls functions periodically - - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef TICKER_H -#define TICKER_H - -#include -#include - -extern "C" { - typedef struct _ETSTIMER_ ETSTimer; -} - -class Ticker -{ -public: - Ticker(); - ~Ticker(); - typedef void (*callback_t)(void); - typedef void (*callback_with_arg_t)(void*); - - void attach(float seconds, callback_t callback) - { - _attach_ms(seconds * 1000, true, reinterpret_cast(callback), 0); - } - - void attach_ms(uint32_t milliseconds, callback_t callback) - { - _attach_ms(milliseconds, true, reinterpret_cast(callback), 0); - } - - template - void attach(float seconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach() callback argument size must be <= 4 bytes"); - // C-cast serves two purposes: - // static_cast for smaller integer types, - // reinterpret_cast + const_cast for pointer types - uint32_t arg32 = (uint32_t)arg; - _attach_ms(seconds * 1000, true, reinterpret_cast(callback), arg32); - } - - template - void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach_ms() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)arg; - _attach_ms(milliseconds, true, reinterpret_cast(callback), arg32); - } - - void once(float seconds, callback_t callback) - { - _attach_ms(seconds * 1000, false, reinterpret_cast(callback), 0); - } - - void once_ms(uint32_t milliseconds, callback_t callback) - { - _attach_ms(milliseconds, false, reinterpret_cast(callback), 0); - } - - template - void once(float seconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)(arg); - _attach_ms(seconds * 1000, false, reinterpret_cast(callback), arg32); - } - - template - void once_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) - { - static_assert(sizeof(TArg) <= sizeof(uint32_t), "attach_ms() callback argument size must be <= 4 bytes"); - uint32_t arg32 = (uint32_t)(arg); - _attach_ms(milliseconds, false, reinterpret_cast(callback), arg32); - } - - void detach(); - -protected: - void _attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t callback, uint32_t arg); - - -protected: - ETSTimer* _timer; -}; - - -#endif//TICKER_H diff --git a/sparkfun/esp8266/libraries/Ticker/examples/TickerBasic/TickerBasic.ino b/sparkfun/esp8266/libraries/Ticker/examples/TickerBasic/TickerBasic.ino deleted file mode 100644 index 772b5b74..00000000 --- a/sparkfun/esp8266/libraries/Ticker/examples/TickerBasic/TickerBasic.ino +++ /dev/null @@ -1,49 +0,0 @@ -/* - Basic Ticker usage - - Ticker is an object that will call a given function with a certain period. - Each Ticker calls one function. You can have as many Tickers as you like, - memory being the only limitation. - - A function may be attached to a ticker and detached from the ticker. - There are two variants of the attach function: attach and attach_ms. - The first one takes period in seconds, the second one in milliseconds. - - An LED connected to GPIO1 will be blinking. Use a built-in LED on ESP-01 - or connect an external one to TXD on other boards. -*/ - -#include - -Ticker flipper; - -int count = 0; - -void flip() -{ - int state = digitalRead(1); // get the current state of GPIO1 pin - digitalWrite(1, !state); // set pin to the opposite state - - ++count; - // when the counter reaches a certain value, start blinking like crazy - if (count == 20) - { - flipper.attach(0.1, flip); - } - // when the counter reaches yet another value, stop blinking - else if (count == 120) - { - flipper.detach(); - } -} - -void setup() { - pinMode(1, OUTPUT); - digitalWrite(1, LOW); - - // flip the pin every 0.3s - flipper.attach(0.3, flip); -} - -void loop() { -} diff --git a/sparkfun/esp8266/libraries/Ticker/examples/TickerParameter/TickerParameter.ino b/sparkfun/esp8266/libraries/Ticker/examples/TickerParameter/TickerParameter.ino deleted file mode 100644 index 80eec5e6..00000000 --- a/sparkfun/esp8266/libraries/Ticker/examples/TickerParameter/TickerParameter.ino +++ /dev/null @@ -1,36 +0,0 @@ -/* - Passing paramters to Ticker callbacks - - Apart from void(void) functions, the Ticker library supports - functions taking one argument. This argument's size has to be less or - equal to 4 bytes (so char, short, int, float, void*, char* types will do). - - This sample runs two tickers that both call one callback function, - but with different arguments. - - An LED connected to GPIO1 will be pulsing. Use a built-in LED on ESP-01 - or connect an external one to TXD on other boards. -*/ - -#include - -Ticker tickerSetHigh; -Ticker tickerSetLow; - -void setPin(int state) { - digitalWrite(1, state); -} - -void setup() { - pinMode(1, OUTPUT); - digitalWrite(1, LOW); - - // every 25 ms, call setPin(0) - tickerSetLow.attach_ms(25, setPin, 0); - - // every 26 ms, call setPin(1) - tickerSetHigh.attach_ms(26, setPin, 1); -} - -void loop() { -} diff --git a/sparkfun/esp8266/libraries/Ticker/keywords.txt b/sparkfun/esp8266/libraries/Ticker/keywords.txt deleted file mode 100644 index 89cca9a0..00000000 --- a/sparkfun/esp8266/libraries/Ticker/keywords.txt +++ /dev/null @@ -1,28 +0,0 @@ -####################################### -# Syntax Coloring Map For Wire -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -attach KEYWORD2 -attach_ms KEYWORD2 -once KEYWORD2 -once_ms KEYWORD2 -detach KEYWORD2 - -####################################### -# Instances (KEYWORD2) -####################################### - -Ticker KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/sparkfun/esp8266/libraries/Ticker/library.properties b/sparkfun/esp8266/libraries/Ticker/library.properties deleted file mode 100644 index 22b4c18d..00000000 --- a/sparkfun/esp8266/libraries/Ticker/library.properties +++ /dev/null @@ -1,8 +0,0 @@ -name=Ticker -version=1.0 -author=Ivan Grokhtokov -maintainer=Ivan Grokhtokov -sentence=Allows to call functions with a given interval. -paragraph= -url= -architectures=esp8266 diff --git a/sparkfun/esp8266/libraries/Wire/Wire.cpp b/sparkfun/esp8266/libraries/Wire/Wire.cpp deleted file mode 100644 index 03901583..00000000 --- a/sparkfun/esp8266/libraries/Wire/Wire.cpp +++ /dev/null @@ -1,237 +0,0 @@ -/* - TwoWire.cpp - TWI/I2C library for Arduino & Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts - Modified December 2014 by Ivan Grokhotkov (ivan@esp8266.com) - esp8266 support - Modified April 2015 by Hrsto Gochkov (ficeto@ficeto.com) - alternative esp8266 support -*/ - -extern "C" { - #include - #include - #include -} - -#include "twi.h" -#include "Wire.h" - -// Initialize Class Variables ////////////////////////////////////////////////// - -uint8_t TwoWire::rxBuffer[BUFFER_LENGTH]; -uint8_t TwoWire::rxBufferIndex = 0; -uint8_t TwoWire::rxBufferLength = 0; - -uint8_t TwoWire::txAddress = 0; -uint8_t TwoWire::txBuffer[BUFFER_LENGTH]; -uint8_t TwoWire::txBufferIndex = 0; -uint8_t TwoWire::txBufferLength = 0; - -uint8_t TwoWire::transmitting = 0; -void (*TwoWire::user_onRequest)(void); -void (*TwoWire::user_onReceive)(int); - -static int default_sda_pin = SDA; -static int default_scl_pin = SCL; - -// Constructors //////////////////////////////////////////////////////////////// - -TwoWire::TwoWire(){} - -// Public Methods ////////////////////////////////////////////////////////////// - -void TwoWire::begin(int sda, int scl){ - twi_init(sda, scl); - flush(); -} - -void TwoWire::pins(int sda, int scl){ - default_sda_pin = sda; - default_scl_pin = scl; -} - -void TwoWire::begin(void){ - begin(default_sda_pin, default_scl_pin); -} - -void TwoWire::begin(uint8_t address){ - // twi_setAddress(address); - // twi_attachSlaveTxEvent(onRequestService); - // twi_attachSlaveRxEvent(onReceiveService); - begin(); -} - -void TwoWire::begin(int address){ - begin((uint8_t)address); -} - -void TwoWire::setClock(uint32_t frequency){ - twi_setClock(frequency); -} - -size_t TwoWire::requestFrom(uint8_t address, size_t size, bool sendStop){ - if(size > BUFFER_LENGTH){ - size = BUFFER_LENGTH; - } - size_t read = (twi_readFrom(address, rxBuffer, size, sendStop) == 0)?size:0; - rxBufferIndex = 0; - rxBufferLength = read; - return read; -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity, uint8_t sendStop){ - return requestFrom(address, static_cast(quantity), static_cast(sendStop)); -} - -uint8_t TwoWire::requestFrom(uint8_t address, uint8_t quantity){ - return requestFrom(address, static_cast(quantity), true); -} - -uint8_t TwoWire::requestFrom(int address, int quantity){ - return requestFrom(static_cast(address), static_cast(quantity), true); -} - -uint8_t TwoWire::requestFrom(int address, int quantity, int sendStop){ - return requestFrom(static_cast(address), static_cast(quantity), static_cast(sendStop)); -} - -void TwoWire::beginTransmission(uint8_t address){ - transmitting = 1; - txAddress = address; - txBufferIndex = 0; - txBufferLength = 0; -} - -void TwoWire::beginTransmission(int address){ - beginTransmission((uint8_t)address); -} - -uint8_t TwoWire::endTransmission(uint8_t sendStop){ - int8_t ret = twi_writeTo(txAddress, txBuffer, txBufferLength, sendStop); - txBufferIndex = 0; - txBufferLength = 0; - transmitting = 0; - return ret; -} - -uint8_t TwoWire::endTransmission(void){ - return endTransmission(true); -} - -size_t TwoWire::write(uint8_t data){ - if(transmitting){ - if(txBufferLength >= BUFFER_LENGTH){ - setWriteError(); - return 0; - } - txBuffer[txBufferIndex] = data; - ++txBufferIndex; - txBufferLength = txBufferIndex; - } else { - // i2c_slave_transmit(&data, 1); - } - return 1; -} - -size_t TwoWire::write(const uint8_t *data, size_t quantity){ - if(transmitting){ - for(size_t i = 0; i < quantity; ++i){ - if(!write(data[i])) return i; - } - }else{ - // i2c_slave_transmit(data, quantity); - } - return quantity; -} - -int TwoWire::available(void){ - return rxBufferLength - rxBufferIndex; -} - -int TwoWire::read(void){ - int value = -1; - if(rxBufferIndex < rxBufferLength){ - value = rxBuffer[rxBufferIndex]; - ++rxBufferIndex; - } - return value; -} - -int TwoWire::peek(void){ - int value = -1; - if(rxBufferIndex < rxBufferLength){ - value = rxBuffer[rxBufferIndex]; - } - return value; -} - -void TwoWire::flush(void){ - rxBufferIndex = 0; - rxBufferLength = 0; - txBufferIndex = 0; - txBufferLength = 0; -} - -void TwoWire::onReceiveService(uint8_t* inBytes, int numBytes) -{ - // don't bother if user hasn't registered a callback - // if(!user_onReceive){ - // return; - // } - // // don't bother if rx buffer is in use by a master requestFrom() op - // // i know this drops data, but it allows for slight stupidity - // // meaning, they may not have read all the master requestFrom() data yet - // if(rxBufferIndex < rxBufferLength){ - // return; - // } - // // copy twi rx buffer into local read buffer - // // this enables new reads to happen in parallel - // for(uint8_t i = 0; i < numBytes; ++i){ - // rxBuffer[i] = inBytes[i]; - // } - // // set rx iterator vars - // rxBufferIndex = 0; - // rxBufferLength = numBytes; - // // alert user program - // user_onReceive(numBytes); -} - -void TwoWire::onRequestService(void){ - // // don't bother if user hasn't registered a callback - // if(!user_onRequest){ - // return; - // } - // // reset tx buffer iterator vars - // // !!! this will kill any pending pre-master sendTo() activity - // txBufferIndex = 0; - // txBufferLength = 0; - // // alert user program - // user_onRequest(); -} - -void TwoWire::onReceive( void (*function)(int) ){ - //user_onReceive = function; -} - -void TwoWire::onRequest( void (*function)(void) ){ - //user_onRequest = function; -} - -// Preinstantiate Objects ////////////////////////////////////////////////////// - -TwoWire Wire = TwoWire(); - diff --git a/sparkfun/esp8266/libraries/Wire/Wire.h b/sparkfun/esp8266/libraries/Wire/Wire.h deleted file mode 100644 index 9fc8f9c7..00000000 --- a/sparkfun/esp8266/libraries/Wire/Wire.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - TwoWire.h - TWI/I2C library for Arduino & Wiring - Copyright (c) 2006 Nicholas Zambetti. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - - Modified 2012 by Todd Krein (todd@krein.org) to implement repeated starts - Modified December 2014 by Ivan Grokhotkov (ivan@esp8266.com) - esp8266 support - Modified April 2015 by Hrsto Gochkov (ficeto@ficeto.com) - alternative esp8266 support -*/ - -#ifndef TwoWire_h -#define TwoWire_h - -#include -#include "Stream.h" - - - -#define BUFFER_LENGTH 32 - -class TwoWire : public Stream -{ - private: - static uint8_t rxBuffer[]; - static uint8_t rxBufferIndex; - static uint8_t rxBufferLength; - - static uint8_t txAddress; - static uint8_t txBuffer[]; - static uint8_t txBufferIndex; - static uint8_t txBufferLength; - - static uint8_t transmitting; - static void (*user_onRequest)(void); - static void (*user_onReceive)(int); - static void onRequestService(void); - static void onReceiveService(uint8_t*, int); - public: - TwoWire(); - void begin(int sda, int scl); - void pins(int sda, int scl) __attribute__((deprecated)); // use begin(sda, scl) in new code - void begin(); - void begin(uint8_t); - void begin(int); - void setClock(uint32_t); - void beginTransmission(uint8_t); - void beginTransmission(int); - uint8_t endTransmission(void); - uint8_t endTransmission(uint8_t); - size_t requestFrom(uint8_t address, size_t size, bool sendStop); - - uint8_t requestFrom(uint8_t, uint8_t); - uint8_t requestFrom(uint8_t, uint8_t, uint8_t); - uint8_t requestFrom(int, int); - uint8_t requestFrom(int, int, int); - - virtual size_t write(uint8_t); - virtual size_t write(const uint8_t *, size_t); - virtual int available(void); - virtual int read(void); - virtual int peek(void); - virtual void flush(void); - void onReceive( void (*)(int) ); - void onRequest( void (*)(void) ); - - inline size_t write(unsigned long n) { return write((uint8_t)n); } - inline size_t write(long n) { return write((uint8_t)n); } - inline size_t write(unsigned int n) { return write((uint8_t)n); } - inline size_t write(int n) { return write((uint8_t)n); } - using Print::write; -}; - -extern TwoWire Wire; - -#endif - diff --git a/sparkfun/esp8266/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino b/sparkfun/esp8266/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino deleted file mode 100644 index d97a9e3c..00000000 --- a/sparkfun/esp8266/libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino +++ /dev/null @@ -1,87 +0,0 @@ -// I2C SRF10 or SRF08 Devantech Ultrasonic Ranger Finder -// by Nicholas Zambetti -// and James Tichenor - -// Demonstrates use of the Wire library reading data from the -// Devantech Utrasonic Rangers SFR08 and SFR10 - -// Created 29 April 2006 - -// This example code is in the public domain. - - -#include - -void setup() -{ - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial communication at 9600bps -} - -int reading = 0; - -void loop() -{ - // step 1: instruct sensor to read echoes - Wire.beginTransmission(112); // transmit to device #112 (0x70) - // the address specified in the datasheet is 224 (0xE0) - // but i2c adressing uses the high 7 bits so it's 112 - Wire.write(byte(0x00)); // sets register pointer to the command register (0x00) - Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50) - // use 0x51 for centimeters - // use 0x52 for ping microseconds - Wire.endTransmission(); // stop transmitting - - // step 2: wait for readings to happen - delay(70); // datasheet suggests at least 65 milliseconds - - // step 3: instruct sensor to return a particular echo reading - Wire.beginTransmission(112); // transmit to device #112 - Wire.write(byte(0x02)); // sets register pointer to echo #1 register (0x02) - Wire.endTransmission(); // stop transmitting - - // step 4: request reading from sensor - Wire.requestFrom(112, 2); // request 2 bytes from slave device #112 - - // step 5: receive reading from sensor - if (2 <= Wire.available()) // if two bytes were received - { - reading = Wire.read(); // receive high byte (overwrites previous reading) - reading = reading << 8; // shift high byte to be high 8 bits - reading |= Wire.read(); // receive low byte as lower 8 bits - Serial.println(reading); // print the reading - } - - delay(250); // wait a bit since people have to read the output :) -} - - -/* - -// The following code changes the address of a Devantech Ultrasonic Range Finder (SRF10 or SRF08) -// usage: changeAddress(0x70, 0xE6); - -void changeAddress(byte oldAddress, byte newAddress) -{ - Wire.beginTransmission(oldAddress); - Wire.write(byte(0x00)); - Wire.write(byte(0xA0)); - Wire.endTransmission(); - - Wire.beginTransmission(oldAddress); - Wire.write(byte(0x00)); - Wire.write(byte(0xAA)); - Wire.endTransmission(); - - Wire.beginTransmission(oldAddress); - Wire.write(byte(0x00)); - Wire.write(byte(0xA5)); - Wire.endTransmission(); - - Wire.beginTransmission(oldAddress); - Wire.write(byte(0x00)); - Wire.write(newAddress); - Wire.endTransmission(); -} - -*/ diff --git a/sparkfun/esp8266/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino b/sparkfun/esp8266/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino deleted file mode 100644 index 4d1580a6..00000000 --- a/sparkfun/esp8266/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino +++ /dev/null @@ -1,39 +0,0 @@ -// I2C Digital Potentiometer -// by Nicholas Zambetti -// and Shawn Bonkowski - -// Demonstrates use of the Wire library -// Controls AD5171 digital potentiometer via I2C/TWI - -// Created 31 March 2006 - -// This example code is in the public domain. - -// This example code is in the public domain. - - -#include - -void setup() -{ - Wire.begin(); // join i2c bus (address optional for master) -} - -byte val = 0; - -void loop() -{ - Wire.beginTransmission(44); // transmit to device #44 (0x2c) - // device address is specified in datasheet - Wire.write(byte(0x00)); // sends instruction byte - Wire.write(val); // sends potentiometer value byte - Wire.endTransmission(); // stop transmitting - - val++; // increment value - if (val == 64) // if reached 64th position (max) - { - val = 0; // start over from lowest value - } - delay(500); -} - diff --git a/sparkfun/esp8266/libraries/Wire/examples/master_reader/master_reader.ino b/sparkfun/esp8266/libraries/Wire/examples/master_reader/master_reader.ino deleted file mode 100644 index 74f0155f..00000000 --- a/sparkfun/esp8266/libraries/Wire/examples/master_reader/master_reader.ino +++ /dev/null @@ -1,32 +0,0 @@ -// Wire Master Reader -// by Nicholas Zambetti - -// Demonstrates use of the Wire library -// Reads data from an I2C/TWI slave device -// Refer to the "Wire Slave Sender" example for use with this - -// Created 29 March 2006 - -// This example code is in the public domain. - - -#include - -void setup() -{ - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial for output -} - -void loop() -{ - Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 - - while (Wire.available()) // slave may send less than requested - { - char c = Wire.read(); // receive a byte as character - Serial.print(c); // print the character - } - - delay(500); -} diff --git a/sparkfun/esp8266/libraries/Wire/examples/master_writer/master_writer.ino b/sparkfun/esp8266/libraries/Wire/examples/master_writer/master_writer.ino deleted file mode 100644 index 482e9223..00000000 --- a/sparkfun/esp8266/libraries/Wire/examples/master_writer/master_writer.ino +++ /dev/null @@ -1,31 +0,0 @@ -// Wire Master Writer -// by Nicholas Zambetti - -// Demonstrates use of the Wire library -// Writes data to an I2C/TWI slave device -// Refer to the "Wire Slave Receiver" example for use with this - -// Created 29 March 2006 - -// This example code is in the public domain. - - -#include - -void setup() -{ - Wire.begin(); // join i2c bus (address optional for master) -} - -byte x = 0; - -void loop() -{ - Wire.beginTransmission(4); // transmit to device #4 - Wire.write("x is "); // sends five bytes - Wire.write(x); // sends one byte - Wire.endTransmission(); // stop transmitting - - x++; - delay(500); -} diff --git a/sparkfun/esp8266/libraries/Wire/keywords.txt b/sparkfun/esp8266/libraries/Wire/keywords.txt deleted file mode 100644 index ff314759..00000000 --- a/sparkfun/esp8266/libraries/Wire/keywords.txt +++ /dev/null @@ -1,32 +0,0 @@ -####################################### -# Syntax Coloring Map For Wire -####################################### - -####################################### -# Datatypes (KEYWORD1) -####################################### - -####################################### -# Methods and Functions (KEYWORD2) -####################################### - -begin KEYWORD2 -setClock KEYWORD2 -beginTransmission KEYWORD2 -endTransmission KEYWORD2 -requestFrom KEYWORD2 -send KEYWORD2 -receive KEYWORD2 -onReceive KEYWORD2 -onRequest KEYWORD2 - -####################################### -# Instances (KEYWORD2) -####################################### - -Wire KEYWORD2 - -####################################### -# Constants (LITERAL1) -####################################### - diff --git a/sparkfun/esp8266/libraries/Wire/library.properties b/sparkfun/esp8266/libraries/Wire/library.properties deleted file mode 100644 index ed9703d7..00000000 --- a/sparkfun/esp8266/libraries/Wire/library.properties +++ /dev/null @@ -1,8 +0,0 @@ -name=Wire -version=1.0 -author=Arduino -maintainer=Ivan Grokhotkov -sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. For esp8266 boards. -paragraph= -url=http://arduino.cc/en/Reference/Wire -architectures=esp8266 diff --git a/sparkfun/esp8266/platform.txt b/sparkfun/esp8266/platform.txt deleted file mode 100644 index 058497bf..00000000 --- a/sparkfun/esp8266/platform.txt +++ /dev/null @@ -1,94 +0,0 @@ - -# ESP8266 platform -# ------------------------------ - -# For more info: -# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification - -name=ESP8266 Modules -version=1.6.4 - - - - -compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/ -compiler.sdk.path={runtime.platform.path}/tools/sdk/ -compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" - -compiler.c.cmd=xtensa-lx106-elf-gcc -compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=c99 - -compiler.S.cmd=xtensa-lx106-elf-gcc -compiler.S.flags=-c -g -x assembler-with-cpp -MMD - -compiler.c.elf.flags=-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -compiler.c.elf.cmd=xtensa-lx106-elf-gcc -compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig - -compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD - -compiler.as.cmd=xtensa-lx106-elf-as - -compiler.ar.cmd=xtensa-lx106-elf-ar -compiler.ar.flags=cru - -compiler.elf2hex.cmd=esptool -compiler.elf2hex.flags= - -compiler.size.cmd=xtensa-lx106-elf-size - -compiler.esptool.cmd=esptool -compiler.esptool.cmd.windows=esptool.exe - -# This can be overriden in boards.txt -build.extra_flags=-DESP8266 - -# These can be overridden in platform.local.txt -compiler.c.extra_flags= -compiler.c.elf.extra_flags= -compiler.S.extra_flags= -compiler.cpp.extra_flags= -compiler.ar.extra_flags= -compiler.objcopy.eep.extra_flags= -compiler.elf2hex.extra_flags= - -## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Create archives -recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" - -## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" - -## Create eeprom -recipe.objcopy.eep.pattern= - -## Create hex -#recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" - -recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{build.path}/{build.project_name}.elf" -bo "{build.path}/{build.project_name}_00000.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bs .data -bs .rodata -bc -ec -eo "{build.path}/{build.project_name}.elf" -es .irom0.text "{build.path}/{build.project_name}_10000.bin" -ec - -## Compute size -recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.text|\.data|\.rodata|\.irom0\.text|)\s+([0-9]+).* -#recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* -#recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* - -# ------------------------------ - -tools.esptool.cmd=esptool -tools.esptool.cmd.windows=esptool.exe -tools.esptool.path={runtime.tools.esptool.path} - -tools.esptool.upload.protocol=esp -tools.esptool.upload.params.verbose=-vv -tools.esptool.upload.params.quiet= -tools.esptool.upload.pattern="{path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" diff --git a/sparkfun/esp8266/programmers.txt b/sparkfun/esp8266/programmers.txt deleted file mode 100644 index e69de29b..00000000 diff --git a/sparkfun/esp8266/sed b/sparkfun/esp8266/sed deleted file mode 100644 index a776b7e9..00000000 --- a/sparkfun/esp8266/sed +++ /dev/null @@ -1,95 +0,0 @@ - -# ESP8266 platform -# ------------------------------ - -# For more info: -# https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification - -name=ESP8266 Modules -version=1.6.4 - -#board-manager-package-compat-begin -runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf-gcc -runtime.tools.esptool.path={runtime.platform.path}/tools -#board-manager-package-compat-end - -compiler.path={runtime.tools.xtensa-lx106-elf-gcc.path}/bin/ -compiler.sdk.path={runtime.platform.path}/tools/sdk/ -compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" - -compiler.c.cmd=xtensa-lx106-elf-gcc -compiler.c.flags=-c -Os -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -std=c99 - -compiler.S.cmd=xtensa-lx106-elf-gcc -compiler.S.flags=-c -g -x assembler-with-cpp -MMD - -compiler.c.elf.flags=-nostdlib -Wl,--no-check-sections -u call_user_start -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/ld" "-T{build.flash_ld}" -compiler.c.elf.cmd=xtensa-lx106-elf-gcc -compiler.c.elf.libs=-lm -lgcc -lhal -lphy -lnet80211 -llwip -lwpa -lmain -lpp -lsmartconfig - -compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c -Os -mlongcalls -mtext-section-literals -fno-exceptions -fno-rtti -falign-functions=4 -std=c++11 -MMD - -compiler.as.cmd=xtensa-lx106-elf-as - -compiler.ar.cmd=xtensa-lx106-elf-ar -compiler.ar.flags=cru - -compiler.elf2hex.cmd=esptool -compiler.elf2hex.flags= - -compiler.size.cmd=xtensa-lx106-elf-size - -compiler.esptool.cmd=esptool -compiler.esptool.cmd.windows=esptool.exe - -# This can be overriden in boards.txt -build.extra_flags=-DESP8266 - -# These can be overridden in platform.local.txt -compiler.c.extra_flags= -compiler.c.elf.extra_flags= -compiler.S.extra_flags= -compiler.cpp.extra_flags= -compiler.ar.extra_flags= -compiler.objcopy.eep.extra_flags= -compiler.elf2hex.extra_flags= - -## Compile c files -recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile c++ files -recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -DF_CPU={build.f_cpu} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" - -## Create archives -recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}" - -## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{build.path}/{archive_file}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" - -## Create eeprom -recipe.objcopy.eep.pattern= - -## Create hex -#recipe.objcopy.hex.pattern="{compiler.path}{compiler.elf2hex.cmd}" {compiler.elf2hex.flags} {compiler.elf2hex.extra_flags} "{build.path}/{build.project_name}.elf" "{build.path}/{build.project_name}.hex" - -recipe.objcopy.hex.pattern="{runtime.tools.esptool.path}/{compiler.esptool.cmd}" -eo "{build.path}/{build.project_name}.elf" -bo "{build.path}/{build.project_name}_00000.bin" -bm {build.flash_mode} -bf {build.flash_freq} -bz {build.flash_size} -bs .text -bs .data -bs .rodata -bc -ec -eo "{build.path}/{build.project_name}.elf" -es .irom0.text "{build.path}/{build.project_name}_10000.bin" -ec - -## Compute size -recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=^(?:\.text|\.data|\.rodata|\.irom0\.text|)\s+([0-9]+).* -#recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* -#recipe.size.regex.eeprom=^(?:\.eeprom)\s+([0-9]+).* - -# ------------------------------ - -tools.esptool.cmd=esptool -tools.esptool.cmd.windows=esptool.exe - -tools.esptool.upload.protocol=esp -tools.esptool.upload.params.verbose=-vv -tools.esptool.upload.params.quiet= -tools.esptool.upload.pattern="{runtime.tools.esptool.path}/{cmd}" {upload.verbose} -cd {upload.resetmethod} -cb {upload.speed} -cp "{serial.port}" -ca 0x00000 -cf "{build.path}/{build.project_name}_00000.bin" -ca 0x10000 -cf "{build.path}/{build.project_name}_10000.bin" diff --git a/sparkfun/esp8266/tools/sdk/License b/sparkfun/esp8266/tools/sdk/License deleted file mode 100644 index 38adccb1..00000000 --- a/sparkfun/esp8266/tools/sdk/License +++ /dev/null @@ -1,68 +0,0 @@ -ESPRESSIF GENERAL PUBLIC LICENSE - -PREAMBLE - -The Espressif General Public License is a free, copyleft license for software and other kinds of works. -The Espressif General Public License is intended to guarantee your freedom to share and change all versions of a program released by ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD, to make sure it remains free software for all its users. We use the Espressif General Public License for all of our open-source software. -When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. -To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. -Developers that use the Espressif GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. -For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. - -TERMS AND CONDITIONS - -0. Definitions. -¡°This License¡± refers to the Espressif Public License. - -¡°The Program¡± refers to any copyrightable work licensed under this License. Each licensee is addressed as ¡°you¡±. ¡°Licensees¡± and ¡°recipients¡± may be individuals or organizations. -To ¡°modify¡± a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a ¡°modified version¡± of the earlier work or a work ¡°based on¡± the earlier work. -A ¡°covered work¡± means either the unmodified Program or a work based on the Program. -To ¡°propagate¡± a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. -To ¡°convey¡± a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. -1. Basic Permissions. -All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. -You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. -Conveying under any other circumstances is permitted solely under the conditions stated below. - -2. Protecting Users' Legal Rights From Anti-Circumvention Law. -No covered work shall be deemed part of an effective technological measure under any applicable law prohibiting or restricting circumvention of such measures. -When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. - -3. Conveying Verbatim Copies. -You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License applies to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. -You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. - -4. Conveying Modified Source Versions. -You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 3, provided that you also meet all of these conditions: -a) The work must carry prominent notices stating that you modified it, and giving a relevant date. -b) The work must carry prominent notices stating that it is released under this License. This requirement modifies the requirement in section 3 to ¡°keep intact all notices¡±. -c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. - -5. Termination. -You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License. -However, if you cease all violation of this License, then your license is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license. -Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 7. - -6. Acceptance Not Required for Having Copies. -You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. - -7. Automatic Licensing of Downstream Recipients. -Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. - -8. No Surrender of Others' Freedom. -If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. -9. Revised Versions of this License. -ESPRESSIF SYSTEMS (SHANGHAI) PTE LED may publish revised and/or new versions of the ESPRESSIF General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. -Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the Espressif General Public License ¡°or any later version¡± applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD. If the Program does not specify a version number of the Espressif General Public License, you may choose any version ever published. - -10. Disclaimer of Warranty. -THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ¡°AS IS¡± WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - -11. Limitation of Liability. -IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - - -12. Interpretation of Sections 10 and 11. -If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. - -END OF TERMS AND CONDITIONS diff --git a/sparkfun/esp8266/tools/sdk/changelog.txt b/sparkfun/esp8266/tools/sdk/changelog.txt deleted file mode 100644 index 86bb16ce..00000000 --- a/sparkfun/esp8266/tools/sdk/changelog.txt +++ /dev/null @@ -1,274 +0,0 @@ -esp_iot_sdk_v1.0.1_15_05_04_p1 -------------------------------------------- -Here is a patch for station+softAP issue that users may have, based on SDK_v1.0.1, -solved problem that connect to ESP8266 softAP may fail in station+softAP mode. - -Sorry for the inconvenience. - -esp_iot_sdk_v1.0.1_15_04_24 Release Note -------------------------------------------- - -Resolved Issues(Bugs below are eligible for Bug Bounty Program): -1. SSL connection may fail if SSL packet size larger than 2kBytes [PeteW ] -2. UDP remote IP to be 0.0.0.0 may cause reset [Jerry S] -3. Optimize wifi_get_ip_info to fix loss of wireless connectivity problem -4. Air-Kiss restart [Orgmar] - -Optimization: -1. Optimized IOT_Espressif_EspTouch.APK (apply for access from Espressif) for improved compatibility. [???] -2. TCP server can not open again immediately with the same port [624908539] -3. Update UART driver for parity bit value may be incorrect [1062583993] -4. Add define of “ICACHE_RODATA_ATTR” for Symbol 'ICACHE_RODATA_ATTR' could not be resolved. [???] -5. Add API wifi_softap_dhcps_set_offer_option to enable/disable ESP8266 softAP DHCP server default gateway. [xyz769] -6. AT register_uart_rx_intr may enter callback twice. [???] -7.optimize document that WPA password length range : 8 ~ 64 bytes [785057041] -8. ESP8266 softAP DHCP server record 8 DHCP client's IP at most [ygjeon] -9. To set static IP (wifi_set_ip_info) has to disable DHCP first(wifi_softap_dhcps_stop or wifi_station_dhcpc_stop) -10.Add example of wifi_softap_set_dhcps_lease -11. smartconfig_start can only be called in ESP8266 station mode - -Added APIs: -1. Wi-Fi related APIs: -wifi_station_set_reconnect_policy: enable/disable reconnect when ESP8266 disconnect from router,default to be enable reconnect. -wifi_set_event_handler_cb: set event handler of ESP8266 softAP or station status change. -wifi_softap_dhcps_set_offer_option: enable/disable get router information from ESP8266 softAP, default to be enable. -2. SNTP APIs: -sntp_get_current_timestamp: get current timestamp from Jan 01, 1970, 00:00 (GMT) -sntp_get_real_time: char,get real time (GTM + 8 time zone) -sntp_init: initialize SNTP -sntp_stop: stop SNTP -sntp_setserver: set SNTP server by IP -sntp_getserver: get SNTP server IP -sntp_setservername: set SNTP server by domain name -sntp_getservername: get domain name of SNTP server set by sntp_setservername -3. MDNS APIs: -espconn_mdns_init: initialize mDNS -espconn_mdns_close: close mDNS -espconn_mdns_server_register: register mDNS server -espconn_mdns_server_unregister: unregister mDNS server -espconn_mdns_get_servername: get mDNS server name -espconn_mdns_set_servername: set mDNS server name -espconn_mdns_set_hostname: get mDNS host name -espconn_mdns_get_hostname: set mDNS host name -espconn_mdns_disable: disable mDNS -espconn_mdns_enable: endisable mDNS - -AT_v0.23 Release Note: -Optimized: -1.AT+CWJAP add parameter "bssid", for several APs may have the same SSID - -New AT commands: -1. AT+CIPSENDBUF: write data into TCP-send-buffer; non-blocking. Background task automatically handles transmission. Has much higher throughput. -2. AT+CIPBUFRESET: resets segment count in TCP-send-buffer -3. AT+CIPBUFSTATUS: checks status of TCP-send-buffer -4. AT+CIPCHECKSEGID: checks if a specific segment in TCP-send-buffer has sent successfully - - - -esp_iot_sdk_v1.0.1_b2_15_04_10 release note -------------------------------------------- - -Fix bugs: -1.Call espconn_sent to send UDP packet in user_init cause reset.[BBP#2 reporter (????)] -2.UART & FlowControl issue: send data to FIFO without CTS flag will cause WDT [BBP#11 reporter (pvxx)] -3.SSL issue,add an API (espconn_secure_set_size) to set SSL buffer size [BBP#29 reporter (PeteW)] -4.UDP broadcast issue in WEP - -Optimize: -1.Add more details about measure ADC & VDD3P3 in appendix of document“2C-SDK-Espressif IoT SDK Programming Guide”[BBP#15 reporter (DarkByte)] -2.Can not do any WiFi related operation if WiFi mode is in NULL_MODE [BBP#23 reporter (hao.wang)] -3.start_ip and end_ip won't change through API wifi_softap_set_dhcps_lease [BBP#37 reporter (glb)] -4.AT get into busy state [BBP#35 reporter (tommy_hk)] -5.ssid + password length limitation when using AirKiss [BBP#45 reporter (zhchbin)] - -Add APIs: -1.espconn_secure_set_size:set buffer size for SSL packet -2.espconn_secure_get_size:get SSL buffer size -3.at_register_uart_rx_intr:set UART0 to be used by user or AT commands - -Add AT command: -1.AT+SLEEP: set ESP8266 sleep mode - -esp_iot_sdk_v1.0.1_b1_15_04_02 Release note -------------------------------------------- - -Fix bugs: -1. Connect to ESP8266 softAP fail after SmartConfig; -2. SmartConfig loses one bit of SSID - -Optimize: -1. espconn_set_opt: set configuration of TCP connection,add parameter for TCP keep-alive - -Add APIs: -1. espconn_clear_opt: clear configuration of TCP connection -2. espconn_set_keepalive: set configuration of TCP keep-alive to detect if TCP connection broke -3. espconn_get_keepalive: get configuration of TCP keep-alive - -AT_v0.23_b1 release note -Note: AT added some functions so flash size need to be 1024KB or more than that. - -Fix bug: -1. Always "busy" if TCP connection abnormally broke during AT+CIPSEND - -Optimize: -1. Add UDP transparent transmission -2. Optimize the initial value of AT+CWDHCP? -3. Add TCP keep-alive function in AT+CIPSTART - -Add AT command: -1. Add AT+CIPSENDEX which support quit from sending mode by "\0" (so an useful "\0" need to be "\\0") - -esp_iot_sdk_v1.0.0_15_03_20 Release Note ----------------------------------------- - -Optimize: -1. Optimize smartconfig to version v1.0; Please don't call any other APIs during SmartConfig. -2. Optimize AT to version 0.22.0.0; -3. Optimize the protection of system parameters, and add error-check about it; -4. Optimize beacon delay of ESP8266 softAP; -5. Optimize boot to version 1.3(b3); - - Add API system_restart_enhance: for factory test, support to load and run program in any specific address; - - Add APIs to get boot version and start address of current user bin; - - Fix compatibility problem of dual flash; -6. Optimize sniffer, structure sniffer_buf changed, please refer to document; -7. Optimize espconn; -8. Optimize pwm; -9. Other optimize to make the software more reliable; - -Add APIs: -1. system_update_cpu_freq: change CPU frequency; -2. wifi_promiscuous_set_mac: set a mac address filter during sniffer; -3. wifi_set_broadcast_if : set which interface will UDP broadcast send from; - -Fix bugs: -1. Interrupt during flash erasing will cause wdt reset; -2. Read/write rtc memory; -3. If router disconnect to ESP8266, ESP8266 won't reconnect; -4. Connect to router which hid its SSID - -AT_v0.22 release note - -Fix bug: -1. Wrong return value of AT+CIPSTATUS; -2. wdt rest after "0,CONNECT FAIL"; - -Add AT commands: -1. Change AT commands of which configuration will store into flash to two kinds: - XXX_CUR: current, only set configuration won't save it into Flash; - XXX_DEF: default, set configuration and save it to Flash -2. Add SmartConfig in AT: - AT+CWSTARTSMART/AT+CWSTOPSMART: start / stop SmartConfig - Notice: please refer to the document, call "AT+CWSTOPSMART" to stop SmartConfig first since "AT+CWSTARTSMART", then call other AT commands. Don't call any other AT commands during SmartConfig. -2. AT+SAVETRANSLINK: save transparent transmission link to Flash; - Note:AT+CIPMODE=1 set to enter transparent transmission mode, won't save to Flash. - - -Add AT APIs -1. at_customLinkMax: set the max link that allowed, most can be 10; if you want to set it, please set it before at_init; if you didn't set it, the max link allowed is 5 by default. -2. at_enter_special_state/ at_leave_special_state:Enter/leave AT processing state. In processing state, AT core will return "busy" for any further AT commands. -3. at_set_custom_info:set custom version information of AT which can be got by AT+GMR; -4. at_get_version:get version information of AT lib . - -Optimize -1. Add UDP remote ip and remote port is allowed to be parameters of "AT+CIPSEND" -2. Move "AT+CIUPDATE" from lib to AT "demo\esp_iot_sdk\examples\at", AT demo shows how to upgrade AT firmware from a local server. Notice that AT upgrade the bin files name have to be "user1.bin" and "user2.bin". -3. Optimize "AT+CIPSTA", add gateway and netmask as parameters -4. Optimize transparent transmission. - -esp_iot_sdk_v0.9.5_15_01_22 Release Note ----------------------------------------- - -AT becomes a lib attached to esp_iot_sdk, programming guide in "document" shows APIs for user to define their own AT commands, AT bin files are in \esp_iot_sdk\bin\at - -Fix bugs: -1. Incorrect status got by API : wifi_station_get_connect_status; -2. Sniffer can not quit without restart; -3. wifi_station_ap_change always return true; -4. TCP connection issues - -Add APIs: -1. system_deep_sleep_set_option: set what the chip will do when deep-sleep wake up; -2. wifi_status_led_uninstall; -3. wifi_station_ap_get_info: get information of AP that ESP8266 station connected. -4. wifi_station_dhcpc_status & wifi_softap_dhcps_status : get DHCP status -5. smart config APIs, more details in documents. -6. add beacon_interval parameter in struct softap_config -7. espconn_recv_hold and espconn_recv_unhold to block TCP receiving data and unblock it. -8. AT APIs to let user define their own AT, more details in documents. - -Optimize: -1. light sleep, modem sleep, deep sleep -2. compile method: ./gen_misc.sh, then follow the tips and steps. -3. when no buffer for os_malloc, return NULL instead of malloc assert. -4. users can enable #define USE_OPTIMIZE_PRINTF in user_config.h to remove strings of os_printf from ram to irom -5. faster the re-connection of ESP8266 station to router after deep-sleep. -6. update to boot v1.2 to support new format user.bin; -7. update ARP -8. update SSL -9. revised system_deep_sleep,system_deep_sleep(0),set no wake up timer,connect a GPIO to pin RST, the chip will wake up by a falling-edge on pin RST - -esp_iot_sdk_v0.9.4_14_12_19 Release Note ----------------------------------------- - -1. Update sniffer to support capture HT20/HT40 packet; -2. Add APIs to set and get sleep type; -3. Add APIs to get version info of sdk, delete version.h; -4. RAW in LWIP is open source now, add API of function ping; -5. Update spi driver; -6. Optimize APIs related to espconn; -7. Fix some bugs to make the software more reliable; - -Known Issue: -1. exception of small probability occured while recving multi-client data in softap -2. restart of small probability occured while tcp client reconnecting - -So sorry that we have some known issues here, we will solve it ASAP. - -esp_iot_sdk_v0.9.3_14_11_21 Release Note ----------------------------------------- - -1. Add license documentation of ESPRESSIF SDK -2. Add APIs to read and write RTC memory, and APIs to get RTC time. -3. Add APIs to swap UART0 -4. Add API to read ADC, delete adc.c. -5. Add API to read spi flash id -6. Revise struct station_config, add bssid parameters to distinguish different AP with same ssid ; - Note: if station_config.bssid_set == 1 , station_config.bssid has to be set, or connection will fail. So in general, station_config.bssid_set need to be 0. -7. Revise struct scan_config, add scan_config.show_hidden to set whether scan APs which ssid is hidden or not; not scan, set scan_config.show_hidden to be 0. - Add bss_info.is_hidden in struct bss_info to show if this APTs ssid is hidden. -8. Revise struct softap_config, add softap_config.ssid_len. If softap_config.ssid_len == 0, check ssid till find a termination characters; otherwise it depends on softap_config.ssid_len. -9. Revise API "wifi_softap_set_config" to take effect immediately, needs not restart to make the configuration enable any more. -10. Add APIs to set and get physical layer mode(802.11b/g/n) -11. Add APIs to enable and disable DHCP server of ESP8266 softAP -12. Add APIs to enable and disable DHCP client of ESP8266 station -13. Add API to set range of ip address that get from DHCP server -14. Add APIs to set and get how many TCP connections allowed at max. -15. Add APIs to set and get how many TCP clients allowed at max to a TCP server. -16. Revise "wifi_set_ip_info" and "wifi_set_macaddr" to take effect immediately. -17. Fix some bugs to make the software more reliable. - -ESP8266EX: Fix A Potential Error For UART RX in esp_iot_sdk_v0.9.2_14_10_24 ---------------------------------------------------------------------------- - -The previously released SDK for ESP8266EX inadvertently introduced a bug that may cause a little packet loss when transferring packet by Uart RX. -So for now,I will release the patch for this bug.Please download the patch from the attachment,and refer to the following steps: -Following Commands: -1. REPLACE LIBPHY.A IN SDK/LIB -2. ADD LIBPP.A TO SDK/LIB -3. MODIFY SDK/APP/MAKEFILE -4. ADD "-lpp \" AS BELOW --lgcc --lhal --lpp --lphy --lnet80211 --llwip --lwpa --lmain --lssc --lssl - -esp_iot_sdk_v0.9.2_14_10_24 Release Note ----------------------------------------- - -Initial version for public, can be compiled on both windows and lubuntu. diff --git a/sparkfun/esp8266/tools/sdk/include/c_types.h b/sparkfun/esp8266/tools/sdk/include/c_types.h deleted file mode 100644 index b5385126..00000000 --- a/sparkfun/esp8266/tools/sdk/include/c_types.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2010 - 2011 Espressif System - * - */ - -#ifndef _C_TYPES_H_ -#define _C_TYPES_H_ -#include -#include -#include - -typedef signed char sint8_t; -typedef signed short sint16_t; -typedef signed long sint32_t; -typedef signed long long sint64_t; -typedef unsigned long long u_int64_t; -typedef float real32_t; -typedef double real64_t; - -typedef unsigned char uint8; -typedef unsigned char u8; -typedef signed char sint8; -typedef signed char int8; -typedef signed char s8; -typedef unsigned short uint16; -typedef unsigned short u16; -typedef signed short sint16; -typedef signed short s16; -typedef unsigned int uint32; -typedef unsigned int u_int; -typedef unsigned int u32; -typedef signed int sint32; -typedef signed int s32; -typedef int int32; -typedef signed long long sint64; -typedef unsigned long long uint64; -typedef unsigned long long u64; -typedef float real32; -typedef double real64; - -#define __le16 u16 - -#define __packed __attribute__((packed)) - -#define LOCAL static - -#ifndef NULL -#define NULL (void *)0 -#endif /* NULL */ - -/* probably should not put STATUS here */ -typedef enum { - OK = 0, - FAIL, - PENDING, - BUSY, - CANCEL, -} STATUS; - -#define BIT(nr) (1UL << (nr)) - -#define REG_SET_BIT(_r, _b) (*(volatile uint32_t*)(_r) |= (_b)) -#define REG_CLR_BIT(_r, _b) (*(volatile uint32_t*)(_r) &= ~(_b)) - -#define DMEM_ATTR __attribute__((section(".bss"))) -#define SHMEM_ATTR - -#ifdef ICACHE_FLASH -#define ICACHE_FLASH_ATTR __attribute__((section(".irom0.text"))) -#define ICACHE_RAM_ATTR __attribute__((section(".text"))) -#define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"))) -#else -#define ICACHE_FLASH_ATTR -#define ICACHE_RAM_ATTR -#define ICACHE_RODATA_ATTR -#endif /* ICACHE_FLASH */ - -#ifndef __cplusplus -#define BOOL bool -#define TRUE true -#define FALSE false - - -#endif /* !__cplusplus */ - -#endif /* _C_TYPES_H_ */ diff --git a/sparkfun/esp8266/tools/sdk/include/eagle_soc.h b/sparkfun/esp8266/tools/sdk/include/eagle_soc.h deleted file mode 100644 index 59214159..00000000 --- a/sparkfun/esp8266/tools/sdk/include/eagle_soc.h +++ /dev/null @@ -1,312 +0,0 @@ -/* - * Copyright (c) Espressif System 2010 - 2012 - * - */ - -#ifndef _EAGLE_SOC_H_ -#define _EAGLE_SOC_H_ - -//Register Bits{{ -#define BIT31 0x80000000 -#define BIT30 0x40000000 -#define BIT29 0x20000000 -#define BIT28 0x10000000 -#define BIT27 0x08000000 -#define BIT26 0x04000000 -#define BIT25 0x02000000 -#define BIT24 0x01000000 -#define BIT23 0x00800000 -#define BIT22 0x00400000 -#define BIT21 0x00200000 -#define BIT20 0x00100000 -#define BIT19 0x00080000 -#define BIT18 0x00040000 -#define BIT17 0x00020000 -#define BIT16 0x00010000 -#define BIT15 0x00008000 -#define BIT14 0x00004000 -#define BIT13 0x00002000 -#define BIT12 0x00001000 -#define BIT11 0x00000800 -#define BIT10 0x00000400 -#define BIT9 0x00000200 -#define BIT8 0x00000100 -#define BIT7 0x00000080 -#define BIT6 0x00000040 -#define BIT5 0x00000020 -#define BIT4 0x00000010 -#define BIT3 0x00000008 -#define BIT2 0x00000004 -#define BIT1 0x00000002 -#define BIT0 0x00000001 -//}} - -//Registers Operation {{ -#define ETS_UNCACHED_ADDR(addr) (addr) -#define ETS_CACHED_ADDR(addr) (addr) - - -#define READ_PERI_REG(addr) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) -#define WRITE_PERI_REG(addr, val) (*((volatile uint32_t *)ETS_UNCACHED_ADDR(addr))) = (uint32_t)(val) -#define CLEAR_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)&(~(mask)))) -#define SET_PERI_REG_MASK(reg, mask) WRITE_PERI_REG((reg), (READ_PERI_REG(reg)|(mask))) -#define GET_PERI_REG_BITS(reg, hipos,lowpos) ((READ_PERI_REG(reg)>>(lowpos))&((1<<((hipos)-(lowpos)+1))-1)) -#define SET_PERI_REG_BITS(reg,bit_map,value,shift) (WRITE_PERI_REG((reg),(READ_PERI_REG(reg)&(~((bit_map)<<(shift))))|((value)<<(shift)) )) -//}} - -//Periheral Clock {{ -#define CPU_CLK_FREQ 80*1000000 //unit: Hz -#define APB_CLK_FREQ CPU_CLK_FREQ -#define UART_CLK_FREQ APB_CLK_FREQ -#define TIMER_CLK_FREQ (APB_CLK_FREQ>>8) //divided by 256 -//}} - -//Peripheral device base address define{{ -#define PERIPHS_DPORT_BASEADDR 0x3ff00000 -#define PERIPHS_GPIO_BASEADDR 0x60000300 -#define PERIPHS_TIMER_BASEDDR 0x60000600 -#define PERIPHS_RTC_BASEADDR 0x60000700 -#define PERIPHS_IO_MUX 0x60000800 -//}} - -//Interrupt remap control registers define{{ -#define EDGE_INT_ENABLE_REG (PERIPHS_DPORT_BASEADDR+0x04) -#define TM1_EDGE_INT_ENABLE() SET_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1) -#define TM1_EDGE_INT_DISABLE() CLEAR_PERI_REG_MASK(EDGE_INT_ENABLE_REG, BIT1) -//}} - -//GPIO reg {{ -#define GPIO_REG_READ(reg) READ_PERI_REG(PERIPHS_GPIO_BASEADDR + reg) -#define GPIO_REG_WRITE(reg, val) WRITE_PERI_REG(PERIPHS_GPIO_BASEADDR + reg, val) -#define GPIO_OUT_ADDRESS 0x00 -#define GPIO_OUT_W1TS_ADDRESS 0x04 -#define GPIO_OUT_W1TC_ADDRESS 0x08 - -#define GPIO_ENABLE_ADDRESS 0x0c -#define GPIO_ENABLE_W1TS_ADDRESS 0x10 -#define GPIO_ENABLE_W1TC_ADDRESS 0x14 -#define GPIO_OUT_W1TC_DATA_MASK 0x0000ffff - -#define GPIO_IN_ADDRESS 0x18 - -#define GPIO_STATUS_ADDRESS 0x1c -#define GPIO_STATUS_W1TS_ADDRESS 0x20 -#define GPIO_STATUS_W1TC_ADDRESS 0x24 -#define GPIO_STATUS_INTERRUPT_MASK 0x0000ffff - -#define GPIO_RTC_CALIB_SYNC PERIPHS_GPIO_BASEADDR+0x6c -#define RTC_CALIB_START BIT31 //first write to zero, then to one to start -#define RTC_PERIOD_NUM_MASK 0x3ff //max 8ms -#define GPIO_RTC_CALIB_VALUE PERIPHS_GPIO_BASEADDR+0x70 -#define RTC_CALIB_RDY_S 31 //after measure, flag to one, when start from zero to one, turn to zero -#define RTC_CALIB_VALUE_MASK 0xfffff - -#define GPIO_PIN0_ADDRESS 0x28 - -#define GPIO_ID_PIN0 0 -#define GPIO_ID_PIN(n) (GPIO_ID_PIN0+(n)) -#define GPIO_LAST_REGISTER_ID GPIO_ID_PIN(15) -#define GPIO_ID_NONE 0xffffffff - -#define GPIO_PIN_COUNT 16 - -#define GPIO_PIN_CONFIG_MSB 12 -#define GPIO_PIN_CONFIG_LSB 11 -#define GPIO_PIN_CONFIG_MASK 0x00001800 -#define GPIO_PIN_CONFIG_GET(x) (((x) & GPIO_PIN_CONFIG_MASK) >> GPIO_PIN_CONFIG_LSB) -#define GPIO_PIN_CONFIG_SET(x) (((x) << GPIO_PIN_CONFIG_LSB) & GPIO_PIN_CONFIG_MASK) - -#define GPIO_WAKEUP_ENABLE 1 -#define GPIO_WAKEUP_DISABLE (~GPIO_WAKEUP_ENABLE) -#define GPIO_PIN_WAKEUP_ENABLE_MSB 10 -#define GPIO_PIN_WAKEUP_ENABLE_LSB 10 -#define GPIO_PIN_WAKEUP_ENABLE_MASK 0x00000400 -#define GPIO_PIN_WAKEUP_ENABLE_GET(x) (((x) & GPIO_PIN_WAKEUP_ENABLE_MASK) >> GPIO_PIN_WAKEUP_ENABLE_LSB) -#define GPIO_PIN_WAKEUP_ENABLE_SET(x) (((x) << GPIO_PIN_WAKEUP_ENABLE_LSB) & GPIO_PIN_WAKEUP_ENABLE_MASK) - -#define GPIO_PIN_INT_TYPE_MASK 0x380 -#define GPIO_PIN_INT_TYPE_MSB 9 -#define GPIO_PIN_INT_TYPE_LSB 7 -#define GPIO_PIN_INT_TYPE_GET(x) (((x) & GPIO_PIN_INT_TYPE_MASK) >> GPIO_PIN_INT_TYPE_LSB) -#define GPIO_PIN_INT_TYPE_SET(x) (((x) << GPIO_PIN_INT_TYPE_LSB) & GPIO_PIN_INT_TYPE_MASK) - -#define GPIO_PAD_DRIVER_ENABLE 1 -#define GPIO_PAD_DRIVER_DISABLE (~GPIO_PAD_DRIVER_ENABLE) -#define GPIO_PIN_PAD_DRIVER_MSB 2 -#define GPIO_PIN_PAD_DRIVER_LSB 2 -#define GPIO_PIN_PAD_DRIVER_MASK 0x00000004 -#define GPIO_PIN_PAD_DRIVER_GET(x) (((x) & GPIO_PIN_PAD_DRIVER_MASK) >> GPIO_PIN_PAD_DRIVER_LSB) -#define GPIO_PIN_PAD_DRIVER_SET(x) (((x) << GPIO_PIN_PAD_DRIVER_LSB) & GPIO_PIN_PAD_DRIVER_MASK) - -#define GPIO_AS_PIN_SOURCE 0 -#define SIGMA_AS_PIN_SOURCE (~GPIO_AS_PIN_SOURCE) -#define GPIO_PIN_SOURCE_MSB 0 -#define GPIO_PIN_SOURCE_LSB 0 -#define GPIO_PIN_SOURCE_MASK 0x00000001 -#define GPIO_PIN_SOURCE_GET(x) (((x) & GPIO_PIN_SOURCE_MASK) >> GPIO_PIN_SOURCE_LSB) -#define GPIO_PIN_SOURCE_SET(x) (((x) << GPIO_PIN_SOURCE_LSB) & GPIO_PIN_SOURCE_MASK) -// }} - -// TIMER reg {{ -#define RTC_REG_READ(addr) READ_PERI_REG(PERIPHS_TIMER_BASEDDR + addr) -#define RTC_REG_WRITE(addr, val) WRITE_PERI_REG(PERIPHS_TIMER_BASEDDR + addr, val) -#define RTC_CLR_REG_MASK(reg, mask) CLEAR_PERI_REG_MASK(PERIPHS_TIMER_BASEDDR +reg, mask) -/* Returns the current time according to the timer timer. */ -#define NOW() RTC_REG_READ(FRC2_COUNT_ADDRESS) - -//load initial_value to timer1 -#define FRC1_LOAD_ADDRESS 0x00 - -//timer1's counter value(count from initial_value to 0) -#define FRC1_COUNT_ADDRESS 0x04 - -#define FRC1_CTRL_ADDRESS 0x08 - -//clear timer1's interrupt when write this address -#define FRC1_INT_ADDRESS 0x0c -#define FRC1_INT_CLR_MASK 0x00000001 - -//timer2's counter value(count from initial_value to 0) -#define FRC2_COUNT_ADDRESS 0x24 -// }} - -//RTC reg {{ -#define REG_RTC_BASE PERIPHS_RTC_BASEADDR - -#define RTC_GPIO_OUT (REG_RTC_BASE + 0x068) -#define RTC_GPIO_ENABLE (REG_RTC_BASE + 0x074) -#define RTC_GPIO_IN_DATA (REG_RTC_BASE + 0x08C) -#define RTC_GPIO_CONF (REG_RTC_BASE + 0x090) -#define PAD_XPD_DCDC_CONF (REG_RTC_BASE + 0x0A0) -//}} - -//PIN Mux reg {{ -#define PERIPHS_IO_MUX_FUNC 0x13 -#define PERIPHS_IO_MUX_FUNC_S 4 -#define PERIPHS_IO_MUX_PULLUP BIT7 -#define PERIPHS_IO_MUX_PULLDWN BIT6 -#define PERIPHS_IO_MUX_SLEEP_PULLUP BIT3 -#define PERIPHS_IO_MUX_SLEEP_PULLDWN BIT2 -#define PERIPHS_IO_MUX_SLEEP_OE BIT1 -#define PERIPHS_IO_MUX_OE BIT0 - -#define PERIPHS_IO_MUX_CONF_U (PERIPHS_IO_MUX + 0x00) -#define SPI0_CLK_EQU_SYS_CLK BIT8 -#define SPI1_CLK_EQU_SYS_CLK BIT9 - -#define PERIPHS_IO_MUX_MTDI_U (PERIPHS_IO_MUX + 0x04) -#define FUNC_MTDI 0 -#define FUNC_I2SI_DATA 1 -#define FUNC_HSPIQ_MISO 2 -#define FUNC_GPIO12 3 -#define FUNC_UART0_DTR 4 - -#define PERIPHS_IO_MUX_MTCK_U (PERIPHS_IO_MUX + 0x08) -#define FUNC_MTCK 0 -#define FUNC_I2SI_BCK 1 -#define FUNC_HSPID_MOSI 2 -#define FUNC_GPIO13 3 -#define FUNC_UART0_CTS 4 - -#define PERIPHS_IO_MUX_MTMS_U (PERIPHS_IO_MUX + 0x0C) -#define FUNC_MTMS 0 -#define FUNC_I2SI_WS 1 -#define FUNC_HSPI_CLK 2 -#define FUNC_GPIO14 3 -#define FUNC_UART0_DSR 4 - -#define PERIPHS_IO_MUX_MTDO_U (PERIPHS_IO_MUX + 0x10) -#define FUNC_MTDO 0 -#define FUNC_I2SO_BCK 1 -#define FUNC_HSPI_CS0 2 -#define FUNC_GPIO15 3 -#define FUNC_U0RTS 4 -#define FUNC_UART0_RTS 4 - -#define PERIPHS_IO_MUX_U0RXD_U (PERIPHS_IO_MUX + 0x14) -#define FUNC_U0RXD 0 -#define FUNC_I2SO_DATA 1 -#define FUNC_GPIO3 3 -#define FUNC_CLK_XTAL_BK 4 - -#define PERIPHS_IO_MUX_U0TXD_U (PERIPHS_IO_MUX + 0x18) -#define FUNC_U0TXD 0 -#define FUNC_SPICS1 1 -#define FUNC_GPIO1 3 -#define FUNC_CLK_RTC_BK 4 - -#define PERIPHS_IO_MUX_SD_CLK_U (PERIPHS_IO_MUX + 0x1c) -#define FUNC_SDCLK 0 -#define FUNC_SPICLK 1 -#define FUNC_GPIO6 3 -#define UART1_CTS 4 - -#define PERIPHS_IO_MUX_SD_DATA0_U (PERIPHS_IO_MUX + 0x20) -#define FUNC_SDDATA0 0 -#define FUNC_SPIQ_MISO 1 -#define FUNC_SPIQ 1 -#define FUNC_GPIO7 3 -#define FUNC_U1TXD 4 -#define FUNC_UART1_TXD 4 - -#define PERIPHS_IO_MUX_SD_DATA1_U (PERIPHS_IO_MUX + 0x24) -#define FUNC_SDDATA1 0 -#define FUNC_SPID_MOSI 1 -#define FUNC_SPID 1 -#define FUNC_GPIO8 3 -#define FUNC_U1RXD 4 -#define FUNC_UART1_RXD 4 -#define FUNC_SDDATA1_U1RXD 7 - -#define PERIPHS_IO_MUX_SD_DATA2_U (PERIPHS_IO_MUX + 0x28) -#define FUNC_SDDATA2 0 -#define FUNC_SPIHD 1 -#define FUNC_GPIO9 3 -#define UFNC_HSPIHD 4 - -#define PERIPHS_IO_MUX_SD_DATA3_U (PERIPHS_IO_MUX + 0x2c) -#define FUNC_SDDATA3 0 -#define FUNC_SPIWP 1 -#define FUNC_GPIO10 3 -#define FUNC_HSPIWP 4 - -#define PERIPHS_IO_MUX_SD_CMD_U (PERIPHS_IO_MUX + 0x30) -#define FUNC_SDCMD 0 -#define FUNC_SPICS0 1 -#define FUNC_GPIO11 3 -#define U1RTS 4 -#define UART1_RTS 4 - -#define PERIPHS_IO_MUX_GPIO0_U (PERIPHS_IO_MUX + 0x34) -#define FUNC_GPIO0 0 -#define FUNC_SPICS2 1 -#define FUNC_CLK_OUT 4 - -#define PERIPHS_IO_MUX_GPIO2_U (PERIPHS_IO_MUX + 0x38) -#define FUNC_GPIO2 0 -#define FUNC_I2SO_WS 1 -#define FUNC_U1TXD_BK 2 -#define FUNC_UART1_TXD_BK 2 -#define FUNC_U0TXD_BK 4 -#define FUNC_UART0_TXD_BK 4 - -#define PERIPHS_IO_MUX_GPIO4_U (PERIPHS_IO_MUX + 0x3C) -#define FUNC_GPIO4 0 -#define FUNC_CLK_XTAL 1 - -#define PERIPHS_IO_MUX_GPIO5_U (PERIPHS_IO_MUX + 0x40) -#define FUNC_GPIO5 0 -#define FUNC_CLK_RTC 1 - -#define PIN_PULLUP_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP) -#define PIN_PULLUP_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLUP) -#define PIN_PULLDWN_DIS(PIN_NAME) CLEAR_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN) -#define PIN_PULLDWN_EN(PIN_NAME) SET_PERI_REG_MASK(PIN_NAME, PERIPHS_IO_MUX_PULLDWN) -#define PIN_FUNC_SELECT(PIN_NAME, FUNC) do { \ - CLEAR_PERI_REG_MASK(PIN_NAME, (PERIPHS_IO_MUX_FUNC<= GPIO_ID_PIN0) && (reg_id <= GPIO_ID_PIN(GPIO_PIN_COUNT-1))) - -#define GPIO_REGID_TO_PINIDX(reg_id) ((reg_id) - GPIO_ID_PIN0) - -typedef enum { - GPIO_PIN_INTR_DISABLE = 0, - GPIO_PIN_INTR_POSEDGE = 1, - GPIO_PIN_INTR_NEGEDGE = 2, - GPIO_PIN_INTR_ANYEDGE = 3, - GPIO_PIN_INTR_LOLEVEL = 4, - GPIO_PIN_INTR_HILEVEL = 5 -} GPIO_INT_TYPE; - -#define GPIO_OUTPUT_SET(gpio_no, bit_value) \ - gpio_output_set(bit_value<>gpio_no)&BIT0) - -/* GPIO interrupt handler, registered through gpio_intr_handler_register */ -typedef void (* gpio_intr_handler_fn_t)(uint32 intr_mask, void *arg); - - -/* - * Initialize GPIO. This includes reading the GPIO Configuration DataSet - * to initialize "output enables" and pin configurations for each gpio pin. - * Must be called once during startup. - */ -void gpio_init(void); - -/* - * Change GPIO pin output by setting, clearing, or disabling pins. - * In general, it is expected that a bit will be set in at most one - * of these masks. If a bit is clear in all masks, the output state - * remains unchanged. - * - * There is no particular ordering guaranteed; so if the order of - * writes is significant, calling code should divide a single call - * into multiple calls. - */ -void gpio_output_set(uint32 set_mask, - uint32 clear_mask, - uint32 enable_mask, - uint32 disable_mask); - -/* - * Sample the value of GPIO input pins and returns a bitmask. - */ -uint32 gpio_input_get(void); - -/* - * Set the specified GPIO register to the specified value. - * This is a very general and powerful interface that is not - * expected to be used during normal operation. It is intended - * mainly for debug, or for unusual requirements. - */ -void gpio_register_set(uint32 reg_id, uint32 value); - -/* Get the current value of the specified GPIO register. */ -uint32 gpio_register_get(uint32 reg_id); - -/* - * Register an application-specific interrupt handler for GPIO pin - * interrupts. Once the interrupt handler is called, it will not - * be called again until after a call to gpio_intr_ack. Any GPIO - * interrupts that occur during the interim are masked. - * - * The application-specific handler is called with a mask of - * pending GPIO interrupts. After processing pin interrupts, the - * application-specific handler may wish to use gpio_intr_pending - * to check for any additional pending interrupts before it returns. - */ -void gpio_intr_handler_register(gpio_intr_handler_fn_t fn, void *arg); - -/* Determine which GPIO interrupts are pending. */ -uint32 gpio_intr_pending(void); - -/* - * Acknowledge GPIO interrupts. - * Intended to be called from the gpio_intr_handler_fn. - */ -void gpio_intr_ack(uint32 ack_mask); - -void gpio_pin_wakeup_enable(uint32 i, GPIO_INT_TYPE intr_state); - -void gpio_pin_wakeup_disable(); - -void gpio_pin_intr_state_set(uint32 i, GPIO_INT_TYPE intr_state); - -#endif // _GPIO_H_ diff --git a/sparkfun/esp8266/tools/sdk/include/ip_addr.h b/sparkfun/esp8266/tools/sdk/include/ip_addr.h deleted file mode 100644 index fc488ea8..00000000 --- a/sparkfun/esp8266/tools/sdk/include/ip_addr.h +++ /dev/null @@ -1,68 +0,0 @@ -#ifndef __IP_ADDR_H__ -#define __IP_ADDR_H__ - -#include "c_types.h" - -struct ip_addr { - uint32 addr; -}; - -typedef struct ip_addr ip_addr_t; - -struct ip_info { - struct ip_addr ip; - struct ip_addr netmask; - struct ip_addr gw; -}; - -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((uint32)((d) & 0xff) << 24) | \ - ((uint32)((c) & 0xff) << 16) | \ - ((uint32)((b) & 0xff) << 8) | \ - (uint32)((a) & 0xff) - -/** - * Determine if two address are on the same network. - * - * @arg addr1 IP address 1 - * @arg addr2 IP address 2 - * @arg mask network identifier mask - * @return !0 if the network identifiers of both address match - */ -#define ip_addr_netcmp(addr1, addr2, mask) (((addr1)->addr & \ - (mask)->addr) == \ - ((addr2)->addr & \ - (mask)->addr)) - -/** Set an IP address given by the four byte-parts. - Little-endian version that prevents the use of htonl. */ -#define IP4_ADDR(ipaddr, a,b,c,d) \ - (ipaddr)->addr = ((uint32)((d) & 0xff) << 24) | \ - ((uint32)((c) & 0xff) << 16) | \ - ((uint32)((b) & 0xff) << 8) | \ - (uint32)((a) & 0xff) - -#define ip4_addr1(ipaddr) (((uint8*)(ipaddr))[0]) -#define ip4_addr2(ipaddr) (((uint8*)(ipaddr))[1]) -#define ip4_addr3(ipaddr) (((uint8*)(ipaddr))[2]) -#define ip4_addr4(ipaddr) (((uint8*)(ipaddr))[3]) - -#define ip4_addr1_16(ipaddr) ((uint16)ip4_addr1(ipaddr)) -#define ip4_addr2_16(ipaddr) ((uint16)ip4_addr2(ipaddr)) -#define ip4_addr3_16(ipaddr) ((uint16)ip4_addr3(ipaddr)) -#define ip4_addr4_16(ipaddr) ((uint16)ip4_addr4(ipaddr)) - - -/** 255.255.255.255 */ -#define IPADDR_NONE ((uint32)0xffffffffUL) -/** 0.0.0.0 */ -#define IPADDR_ANY ((uint32)0x00000000UL) -uint32 ipaddr_addr(const char *cp); - -#define IP2STR(addr) (uint8_t)(addr & 0xFF), (uint8_t)((addr >> 8) & 0xFF), (uint8_t)((addr >> 16) & 0xFF), (uint8_t)((addr >> 24) & 0xFF) -#define IPSTR "%d.%d.%d.%d" - -#define MAC2STR(mac) (uint8_t)mac[0], (uint8_t)mac[1], (uint8_t)mac[2], (uint8_t)mac[3], (uint8_t)mac[4], (uint8_t)mac[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" - -#endif /* __IP_ADDR_H__ */ diff --git a/sparkfun/esp8266/tools/sdk/include/json/json.h b/sparkfun/esp8266/tools/sdk/include/json/json.h deleted file mode 100644 index 2308b5b7..00000000 --- a/sparkfun/esp8266/tools/sdk/include/json/json.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) 2011-2012, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - */ - -/** - * \file - * A few JSON defines used for parsing and generating JSON. - * \author - * Niclas Finne - * Joakim Eriksson - */ - -#ifndef __JSON_H__ -#define __JSON_H__ - -#define JSON_TYPE_ARRAY '[' -#define JSON_TYPE_OBJECT '{' -#define JSON_TYPE_PAIR ':' -#define JSON_TYPE_PAIR_NAME 'N' /* for N:V pairs */ -#define JSON_TYPE_STRING '"' -#define JSON_TYPE_INT 'I' -#define JSON_TYPE_NUMBER '0' -#define JSON_TYPE_ERROR 0 - -/* how should we handle null vs false - both can be 0? */ -#define JSON_TYPE_NULL 'n' -#define JSON_TYPE_TRUE 't' -#define JSON_TYPE_FALSE 'f' - -#define JSON_TYPE_CALLBACK 'C' - -enum { - JSON_ERROR_OK, - JSON_ERROR_SYNTAX, - JSON_ERROR_UNEXPECTED_ARRAY, - JSON_ERROR_UNEXPECTED_END_OF_ARRAY, - JSON_ERROR_UNEXPECTED_OBJECT, - JSON_ERROR_UNEXPECTED_STRING -}; - -#define JSON_CONTENT_TYPE "application/json" - -#endif /* __JSON_H__ */ diff --git a/sparkfun/esp8266/tools/sdk/include/json/jsonparse.h b/sparkfun/esp8266/tools/sdk/include/json/jsonparse.h deleted file mode 100644 index e1cb67a4..00000000 --- a/sparkfun/esp8266/tools/sdk/include/json/jsonparse.h +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2011-2012, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - */ - -#ifndef __JSONPARSE_H__ -#define __JSONPARSE_H__ - -#include "c_types.h" -#include "json/json.h" - -#ifdef JSONPARSE_CONF_MAX_DEPTH -#define JSONPARSE_MAX_DEPTH JSONPARSE_CONF_MAX_DEPTH -#else -#define JSONPARSE_MAX_DEPTH 10 -#endif - -struct jsonparse_state { - const char *json; - int pos; - int len; - int depth; - /* for handling atomic values */ - int vstart; - int vlen; - char vtype; - char error; - char stack[JSONPARSE_MAX_DEPTH]; -}; - -/** - * \brief Initialize a JSON parser state. - * \param state A pointer to a JSON parser state - * \param json The string to parse as JSON - * \param len The length of the string to parse - * - * This function initializes a JSON parser state for - * parsing a string as JSON. - */ -void jsonparse_setup(struct jsonparse_state *state, const char *json, - int len); - -/* move to next JSON element */ -int jsonparse_next(struct jsonparse_state *state); - -/* copy the current JSON value into the specified buffer */ -int jsonparse_copy_value(struct jsonparse_state *state, char *buf, - int buf_size); - -/* get the current JSON value parsed as an int */ -int jsonparse_get_value_as_int(struct jsonparse_state *state); - -/* get the current JSON value parsed as a long */ -long jsonparse_get_value_as_long(struct jsonparse_state *state); - -/* get the current JSON value parsed as a unsigned long */ -unsigned long jsonparse_get_value_as_ulong(struct jsonparse_state *state); - -/* get the length of the current JSON value */ -int jsonparse_get_len(struct jsonparse_state *state); - -/* get the type of the current JSON value */ -int jsonparse_get_type(struct jsonparse_state *state); - -/* compare the JSON value with the specified string */ -int jsonparse_strcmp_value(struct jsonparse_state *state, const char *str); - -#endif /* __JSONPARSE_H__ */ diff --git a/sparkfun/esp8266/tools/sdk/include/json/jsontree.h b/sparkfun/esp8266/tools/sdk/include/json/jsontree.h deleted file mode 100644 index 0ffe9d15..00000000 --- a/sparkfun/esp8266/tools/sdk/include/json/jsontree.h +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2011-2012, Swedish Institute of Computer Science. - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * This file is part of the Contiki operating system. - */ - -/** - * \file - * JSON output generation - * \author - * Niclas Finne - * Joakim Eriksson - */ - -#ifndef __JSONTREE_H__ -#define __JSONTREE_H__ - -#include "c_types.h" -#include "json/json.h" - -#ifdef JSONTREE_CONF_MAX_DEPTH -#define JSONTREE_MAX_DEPTH JSONTREE_CONF_MAX_DEPTH -#else -#define JSONTREE_MAX_DEPTH 10 -#endif /* JSONTREE_CONF_MAX_DEPTH */ - -struct jsontree_context { - struct jsontree_value *values[JSONTREE_MAX_DEPTH]; - uint16_t index[JSONTREE_MAX_DEPTH]; - int (* putchar)(int); - uint8_t depth; - uint8_t path; - int callback_state; -}; - -struct jsontree_value { - uint8_t type; - /* followed by a value */ -}; - -struct jsontree_string { - uint8_t type; - const char *value; -}; - -struct jsontree_int { - uint8_t type; - int value; -}; - -/* NOTE: the jsontree_callback set will receive a jsonparse state */ -struct jsonparse_state; -struct jsontree_callback { - uint8_t type; - int (* output)(struct jsontree_context *js_ctx); - int (* set)(struct jsontree_context *js_ctx, struct jsonparse_state *parser); -}; - -struct jsontree_pair { - const char *name; - struct jsontree_value *value; -}; - -struct jsontree_object { - uint8_t type; - uint8_t count; - struct jsontree_pair *pairs; -}; - -struct jsontree_array { - uint8_t type; - uint8_t count; - struct jsontree_value **values; -}; - -#define JSONTREE_STRING(text) {JSON_TYPE_STRING, (text)} -#define JSONTREE_PAIR(name, value) {(name), (struct jsontree_value *)(value)} -#define JSONTREE_CALLBACK(output, set) {JSON_TYPE_CALLBACK, (output), (set)} - -#define JSONTREE_OBJECT(name, ...) \ - static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \ - static struct jsontree_object name = { \ - JSON_TYPE_OBJECT, \ - sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \ - jsontree_pair_##name } - -#define JSONTREE_PAIR_ARRAY(value) (struct jsontree_value *)(value) -#define JSONTREE_ARRAY(name, ...) \ - static struct jsontree_value* jsontree_value_##name[] = {__VA_ARGS__}; \ - static struct jsontree_array name = { \ - JSON_TYPE_ARRAY, \ - sizeof(jsontree_value_##name)/sizeof(struct jsontree_value*), \ - jsontree_value_##name } - -#define JSONTREE_OBJECT_EXT(name, ...) \ - static struct jsontree_pair jsontree_pair_##name[] = {__VA_ARGS__}; \ - struct jsontree_object name = { \ - JSON_TYPE_OBJECT, \ - sizeof(jsontree_pair_##name)/sizeof(struct jsontree_pair), \ - jsontree_pair_##name } - -void jsontree_setup(struct jsontree_context *js_ctx, - struct jsontree_value *root, int (* putchar)(int)); -void jsontree_reset(struct jsontree_context *js_ctx); - -const char *jsontree_path_name(const struct jsontree_context *js_ctx, - int depth); - -void jsontree_write_int(const struct jsontree_context *js_ctx, int value); -void jsontree_write_int_array(const struct jsontree_context *js_ctx, const int *text, uint32 length); - -void jsontree_write_atom(const struct jsontree_context *js_ctx, - const char *text); -void jsontree_write_string(const struct jsontree_context *js_ctx, - const char *text); -int jsontree_print_next(struct jsontree_context *js_ctx); -struct jsontree_value *jsontree_find_next(struct jsontree_context *js_ctx, - int type); - -#endif /* __JSONTREE_H__ */ diff --git a/sparkfun/esp8266/tools/sdk/include/mem.h b/sparkfun/esp8266/tools/sdk/include/mem.h deleted file mode 100644 index ac92e74d..00000000 --- a/sparkfun/esp8266/tools/sdk/include/mem.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef __MEM_H__ -#define __MEM_H__ - -//void *pvPortMalloc( size_t xWantedSize ); -//void vPortFree( void *pv ); -//void *pvPortZalloc(size_t size); - -#define os_malloc pvPortMalloc -#define os_free vPortFree -#define os_zalloc pvPortZalloc -#define os_realloc pvPortRealloc - -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/os_type.h b/sparkfun/esp8266/tools/sdk/include/os_type.h deleted file mode 100644 index a9901061..00000000 --- a/sparkfun/esp8266/tools/sdk/include/os_type.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * copyright (c) Espressif System 2010 - * - * mapping to ETS structures - * - */ -#ifndef _OS_TYPES_H_ -#define _OS_TYPES_H_ - -#include "ets_sys.h" - -#define os_signal_t ETSSignal -#define os_param_t ETSParam -#define os_event_t ETSEvent -#define os_task_t ETSTask -#define os_timer_t ETSTimer -#define os_timer_func_t ETSTimerFunc - -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/osapi.h b/sparkfun/esp8266/tools/sdk/include/osapi.h deleted file mode 100644 index 11e03803..00000000 --- a/sparkfun/esp8266/tools/sdk/include/osapi.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 Espressif System - */ - -#ifndef _OSAPI_H_ -#define _OSAPI_H_ - -#include -#include "user_config.h" - -#define os_bzero ets_bzero -#define os_delay_us ets_delay_us -#define os_install_putc1 ets_install_putc1 -#define os_install_putc2 ets_install_putc2 -#define os_intr_lock ets_intr_lock -#define os_intr_unlock ets_intr_unlock -#define os_isr_attach ets_isr_attach -#define os_isr_mask ets_isr_mask -#define os_isr_unmask ets_isr_unmask -#define os_memcmp ets_memcmp -#define os_memcpy ets_memcpy -#define os_memmove ets_memmove -#define os_memset ets_memset -#define os_putc ets_putc -#define os_str2macaddr ets_str2macaddr -#define os_strcat strcat -#define os_strchr strchr -#define os_strcmp ets_strcmp -#define os_strcpy ets_strcpy -#define os_strlen ets_strlen -#define os_strncmp ets_strncmp -#define os_strncpy ets_strncpy -#define os_strstr ets_strstr -#ifdef USE_US_TIMER -#define os_timer_arm_us(a, b, c) ets_timer_arm_new(a, b, c, 0) -#endif -#define os_timer_arm(a, b, c) ets_timer_arm_new(a, b, c, 1) -#define os_timer_disarm ets_timer_disarm -#define os_timer_done ets_timer_done -#define os_timer_handler_isr ets_timer_handler_isr -#define os_timer_init ets_timer_init -#define os_timer_setfn ets_timer_setfn - -#define os_sprintf ets_sprintf -#define os_update_cpu_frequency ets_update_cpu_frequency - -#ifdef USE_OPTIMIZE_PRINTF -#define os_printf(fmt, ...) do { \ - static const char flash_str[] ICACHE_RODATA_ATTR = fmt; \ - os_printf_plus(flash_str, ##__VA_ARGS__); \ - } while(0) -#else -extern int os_printf_plus(const char * format, ...) __attribute__ ((format (printf, 1, 2))); -#define os_printf os_printf_plus -#endif - -#endif - diff --git a/sparkfun/esp8266/tools/sdk/include/ping.h b/sparkfun/esp8266/tools/sdk/include/ping.h deleted file mode 100644 index 4ecd032b..00000000 --- a/sparkfun/esp8266/tools/sdk/include/ping.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __PING_H__ -#define __PING_H__ - - -typedef void (* ping_recv_function)(void* arg, void *pdata); -typedef void (* ping_sent_function)(void* arg, void *pdata); - -struct ping_option{ - uint32 count; - uint32 ip; - uint32 coarse_time; - ping_recv_function recv_function; - ping_sent_function sent_function; - void* reverse; -}; - -struct ping_resp{ - uint32 total_count; - uint32 resp_time; - uint32 seqno; - uint32 timeout_count; - uint32 bytes; - uint32 total_bytes; - uint32 total_time; - sint8 ping_err; -}; - -bool ping_start(struct ping_option *ping_opt); -bool ping_regist_recv(struct ping_option *ping_opt, ping_recv_function ping_recv); -bool ping_regist_sent(struct ping_option *ping_opt, ping_sent_function ping_sent); - -#endif /* __PING_H__ */ diff --git a/sparkfun/esp8266/tools/sdk/include/queue.h b/sparkfun/esp8266/tools/sdk/include/queue.h deleted file mode 100644 index a760c8db..00000000 --- a/sparkfun/esp8266/tools/sdk/include/queue.h +++ /dev/null @@ -1,204 +0,0 @@ -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -#define QMD_SAVELINK(name, link) -#define TRASHIT(x) - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_REMOVE_AFTER(curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define SLIST_REMOVE_AFTER(elm, field) do { \ - SLIST_NEXT(elm, field) = \ - SLIST_NEXT(SLIST_NEXT(elm, field), field); \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ - struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ - } - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ - struct { \ - struct type *stqe_next; /* next element */ \ - } - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ - } while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ - } while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ - } while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ - } while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - } while (0) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? \ - NULL : \ - ((struct type *)(void *) \ - ((char *)((head)->stqh_last) - __offsetof(struct type, field)))) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - STAILQ_REMOVE_AFTER(head, curelm, field); \ - } \ - TRASHIT(*oldnext); \ - } while (0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ - } while (0) - -#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ - if ((STAILQ_NEXT(elm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - } while (0) - -#define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ - STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_FIRST(head2) = swap_first; \ - (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ - (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ - (head2)->stqh_last = &STAILQ_FIRST(head2); \ - } while (0) - -#define STAILQ_INSERT_CHAIN_HEAD(head, elm_chead, elm_ctail, field) do { \ - if ((STAILQ_NEXT(elm_ctail, field) = STAILQ_FIRST(head)) == NULL ) { \ - (head)->stqh_last = &STAILQ_NEXT(elm_ctail, field); \ - } \ - STAILQ_FIRST(head) = (elm_chead); \ - } while (0) - -#endif /* !_SYS_QUEUE_H_ */ diff --git a/sparkfun/esp8266/tools/sdk/include/smartconfig.h b/sparkfun/esp8266/tools/sdk/include/smartconfig.h deleted file mode 100644 index 22b04ff1..00000000 --- a/sparkfun/esp8266/tools/sdk/include/smartconfig.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (C) 2015 -2018 Espressif System - * - */ - -#ifndef __SMARTCONFIG_H__ -#define __SMARTCONFIG_H__ - -typedef void (*sc_callback_t)(void *data); - -typedef enum { - SC_STATUS_WAIT = 0, - SC_STATUS_FIND_CHANNEL, - SC_STATUS_GETTING_SSID_PSWD, - SC_STATUS_GOT_SSID_PSWD, - SC_STATUS_LINK, - SC_STATUS_LINK_OVER, -} sc_status; - -typedef enum { - SC_TYPE_ESPTOUCH = 0, - SC_TYPE_AIRKISS, -} sc_type; - -sc_status smartconfig_get_status(void); -const char *smartconfig_get_version(void); -bool smartconfig_start(sc_type type, sc_callback_t cb, ...); -bool smartconfig_stop(void); - -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/sntp.h b/sparkfun/esp8266/tools/sdk/include/sntp.h deleted file mode 100644 index 2d2749a3..00000000 --- a/sparkfun/esp8266/tools/sdk/include/sntp.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef __SNTP_H__ -#define __SNTP_H__ - -#include "os_type.h" -#ifdef LWIP_OPEN_SRC -#include "lwip/ip_addr.h" -#else -#include "ip_addr.h" -#endif -/** - * get the seconds since Jan 01, 1970, 00:00 (GMT) - */ -uint32 sntp_get_current_timestamp(); -/** - * get real time (GTM + 8 time zone) - */ -char* sntp_get_real_time(long t); -/** - * Initialize this module. - * Send out request instantly or after SNTP_STARTUP_DELAY(_FUNC). - */ -void sntp_init(void); -/** - * Stop this module. - */ -void sntp_stop(void); -/** - * Initialize one of the NTP servers by IP address - * - * @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS - * @param dnsserver IP address of the NTP server to set - */ -void sntp_setserver(unsigned char idx, ip_addr_t *addr); -/** - * Obtain one of the currently configured by IP address (or DHCP) NTP servers - * - * @param numdns the index of the NTP server - * @return IP address of the indexed NTP server or "ip_addr_any" if the NTP - * server has not been configured by address (or at all). - */ -ip_addr_t sntp_getserver(unsigned char idx); -/** - * Initialize one of the NTP servers by name - * - * @param numdns the index of the NTP server to set must be < SNTP_MAX_SERVERS,now sdk support SNTP_MAX_SERVERS = 3 - * @param dnsserver DNS name of the NTP server to set, to be resolved at contact time - */ -void sntp_setservername(unsigned char idx, char *server); -/** - * Obtain one of the currently configured by name NTP servers. - * - * @param numdns the index of the NTP server - * @return IP address of the indexed NTP server or NULL if the NTP - * server has not been configured by name (or at all) - */ -char *sntp_getservername(unsigned char idx); - -#define sntp_servermode_dhcp(x) - -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/spi_flash.h b/sparkfun/esp8266/tools/sdk/include/spi_flash.h deleted file mode 100644 index 347e1b92..00000000 --- a/sparkfun/esp8266/tools/sdk/include/spi_flash.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * copyright (c) Espressif System 2010 - * - */ - -#ifndef SPI_FLASH_H -#define SPI_FLASH_H - -typedef enum { - SPI_FLASH_RESULT_OK, - SPI_FLASH_RESULT_ERR, - SPI_FLASH_RESULT_TIMEOUT -} SpiFlashOpResult; - -typedef struct{ - uint32 deviceId; - uint32 chip_size; // chip size in byte - uint32 block_size; - uint32 sector_size; - uint32 page_size; - uint32 status_mask; -} SpiFlashChip; - -#define SPI_FLASH_SEC_SIZE 4096 - -extern SpiFlashChip * flashchip; // in ram ROM-BIOS - -uint32 spi_flash_get_id(void); -SpiFlashOpResult spi_flash_erase_sector(uint16 sec); -SpiFlashOpResult spi_flash_write(uint32 des_addr, uint32 *src_addr, uint32 size); -SpiFlashOpResult spi_flash_read(uint32 src_addr, uint32 *des_addr, uint32 size); - -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/uart_register.h b/sparkfun/esp8266/tools/sdk/include/uart_register.h deleted file mode 100644 index 6398879e..00000000 --- a/sparkfun/esp8266/tools/sdk/include/uart_register.h +++ /dev/null @@ -1,128 +0,0 @@ -//Generated at 2012-07-03 18:44:06 -/* - * Copyright (c) 2010 - 2011 Espressif System - * - */ - -#ifndef UART_REGISTER_H_INCLUDED -#define UART_REGISTER_H_INCLUDED -#define REG_UART_BASE( i ) (0x60000000+(i)*0xf00) -//version value:32'h062000 - -#define UART_FIFO( i ) (REG_UART_BASE( i ) + 0x0) -#define UART_RXFIFO_RD_BYTE 0x000000FF -#define UART_RXFIFO_RD_BYTE_S 0 - -#define UART_INT_RAW( i ) (REG_UART_BASE( i ) + 0x4) -#define UART_RXFIFO_TOUT_INT_RAW (BIT(8)) -#define UART_BRK_DET_INT_RAW (BIT(7)) -#define UART_CTS_CHG_INT_RAW (BIT(6)) -#define UART_DSR_CHG_INT_RAW (BIT(5)) -#define UART_RXFIFO_OVF_INT_RAW (BIT(4)) -#define UART_FRM_ERR_INT_RAW (BIT(3)) -#define UART_PARITY_ERR_INT_RAW (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_RAW (BIT(1)) -#define UART_RXFIFO_FULL_INT_RAW (BIT(0)) - -#define UART_INT_ST( i ) (REG_UART_BASE( i ) + 0x8) -#define UART_RXFIFO_TOUT_INT_ST (BIT(8)) -#define UART_BRK_DET_INT_ST (BIT(7)) -#define UART_CTS_CHG_INT_ST (BIT(6)) -#define UART_DSR_CHG_INT_ST (BIT(5)) -#define UART_RXFIFO_OVF_INT_ST (BIT(4)) -#define UART_FRM_ERR_INT_ST (BIT(3)) -#define UART_PARITY_ERR_INT_ST (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_ST (BIT(1)) -#define UART_RXFIFO_FULL_INT_ST (BIT(0)) - -#define UART_INT_ENA( i ) (REG_UART_BASE( i ) + 0xC) -#define UART_RXFIFO_TOUT_INT_ENA (BIT(8)) -#define UART_BRK_DET_INT_ENA (BIT(7)) -#define UART_CTS_CHG_INT_ENA (BIT(6)) -#define UART_DSR_CHG_INT_ENA (BIT(5)) -#define UART_RXFIFO_OVF_INT_ENA (BIT(4)) -#define UART_FRM_ERR_INT_ENA (BIT(3)) -#define UART_PARITY_ERR_INT_ENA (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_ENA (BIT(1)) -#define UART_RXFIFO_FULL_INT_ENA (BIT(0)) - -#define UART_INT_CLR( i ) (REG_UART_BASE( i ) + 0x10) -#define UART_RXFIFO_TOUT_INT_CLR (BIT(8)) -#define UART_BRK_DET_INT_CLR (BIT(7)) -#define UART_CTS_CHG_INT_CLR (BIT(6)) -#define UART_DSR_CHG_INT_CLR (BIT(5)) -#define UART_RXFIFO_OVF_INT_CLR (BIT(4)) -#define UART_FRM_ERR_INT_CLR (BIT(3)) -#define UART_PARITY_ERR_INT_CLR (BIT(2)) -#define UART_TXFIFO_EMPTY_INT_CLR (BIT(1)) -#define UART_RXFIFO_FULL_INT_CLR (BIT(0)) - -#define UART_CLKDIV( i ) (REG_UART_BASE( i ) + 0x14) -#define UART_CLKDIV_CNT 0x000FFFFF -#define UART_CLKDIV_S 0 - -#define UART_AUTOBAUD( i ) (REG_UART_BASE( i ) + 0x18) -#define UART_GLITCH_FILT 0x000000FF -#define UART_GLITCH_FILT_S 8 -#define UART_AUTOBAUD_EN (BIT(0)) - -#define UART_STATUS( i ) (REG_UART_BASE( i ) + 0x1C) -#define UART_TXD (BIT(31)) -#define UART_RTSN (BIT(30)) -#define UART_DTRN (BIT(29)) -#define UART_TXFIFO_CNT 0x000000FF -#define UART_TXFIFO_CNT_S 16 -#define UART_RXD (BIT(15)) -#define UART_CTSN (BIT(14)) -#define UART_DSRN (BIT(13)) -#define UART_RXFIFO_CNT 0x000000FF -#define UART_RXFIFO_CNT_S 0 - -#define UART_CONF0( i ) (REG_UART_BASE( i ) + 0x20) -#define UART_TXFIFO_RST (BIT(18)) -#define UART_RXFIFO_RST (BIT(17)) -#define UART_IRDA_EN (BIT(16)) -#define UART_TX_FLOW_EN (BIT(15)) -#define UART_LOOPBACK (BIT(14)) -#define UART_IRDA_RX_INV (BIT(13)) -#define UART_IRDA_TX_INV (BIT(12)) -#define UART_IRDA_WCTL (BIT(11)) -#define UART_IRDA_TX_EN (BIT(10)) -#define UART_IRDA_DPLX (BIT(9)) -#define UART_TXD_BRK (BIT(8)) -#define UART_SW_DTR (BIT(7)) -#define UART_SW_RTS (BIT(6)) -#define UART_STOP_BIT_NUM 0x00000003 -#define UART_STOP_BIT_NUM_S 4 -#define UART_BIT_NUM 0x00000003 -#define UART_BIT_NUM_S 2 -#define UART_PARITY_EN (BIT(1)) -#define UART_PARITY (BIT(0)) - -#define UART_CONF1( i ) (REG_UART_BASE( i ) + 0x24) -#define UART_RX_TOUT_EN (BIT(31)) -#define UART_RX_TOUT_THRHD 0x0000007F -#define UART_RX_TOUT_THRHD_S 24 -#define UART_RX_FLOW_EN (BIT(23)) -#define UART_RX_FLOW_THRHD 0x0000007F -#define UART_RX_FLOW_THRHD_S 16 -#define UART_TXFIFO_EMPTY_THRHD 0x0000007F -#define UART_TXFIFO_EMPTY_THRHD_S 8 -#define UART_RXFIFO_FULL_THRHD 0x0000007F -#define UART_RXFIFO_FULL_THRHD_S 0 - -#define UART_LOWPULSE( i ) (REG_UART_BASE( i ) + 0x28) -#define UART_LOWPULSE_MIN_CNT 0x000FFFFF -#define UART_LOWPULSE_MIN_CNT_S 0 - -#define UART_HIGHPULSE( i ) (REG_UART_BASE( i ) + 0x2C) -#define UART_HIGHPULSE_MIN_CNT 0x000FFFFF -#define UART_HIGHPULSE_MIN_CNT_S 0 - -#define UART_PULSE_NUM( i ) (REG_UART_BASE( i ) + 0x30) -#define UART_PULSE_NUM_CNT 0x0003FF -#define UART_PULSE_NUM_CNT_S 0 - -#define UART_DATE( i ) (REG_UART_BASE( i ) + 0x78) -#define UART_ID( i ) (REG_UART_BASE( i ) + 0x7C) -#endif // UART_REGISTER_H_INCLUDED diff --git a/sparkfun/esp8266/tools/sdk/include/upgrade.h b/sparkfun/esp8266/tools/sdk/include/upgrade.h deleted file mode 100644 index 3b6bb70f..00000000 --- a/sparkfun/esp8266/tools/sdk/include/upgrade.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef __UPGRADE_H__ -#define __UPGRADE_H__ - -#define SPI_FLASH_SEC_SIZE 4096 - -#define USER_BIN1 0x00 -#define USER_BIN2 0x01 - -#define UPGRADE_FLAG_IDLE 0x00 -#define UPGRADE_FLAG_START 0x01 -#define UPGRADE_FLAG_FINISH 0x02 - -#define UPGRADE_FW_BIN1 0x00 -#define UPGRADE_FW_BIN2 0x01 - -typedef void (*upgrade_states_check_callback)(void * arg); - -//#define UPGRADE_SSL_ENABLE - -struct upgrade_server_info { - uint8 ip[4]; - uint16 port; - - uint8 upgrade_flag; - - uint8 pre_version[16]; - uint8 upgrade_version[16]; - - uint32 check_times; - uint8 *url; - - upgrade_states_check_callback check_cb; - struct espconn *pespconn; -}; - -#define UPGRADE_FLAG_IDLE 0x00 -#define UPGRADE_FLAG_START 0x01 -#define UPGRADE_FLAG_FINISH 0x02 - -//bool system_upgrade_start(struct upgrade_server_info *server); -bool system_upgrade_start_ssl(struct upgrade_server_info *server); -void system_upgrade_init(); -void system_upgrade_deinit(); -bool system_upgrade(uint8 *data, uint16 len); - -#ifdef UPGRADE_SSL_ENABLE -bool system_upgrade_start_ssl(struct upgrade_server_info *server); -#else -bool system_upgrade_start(struct upgrade_server_info *server); -#endif -#endif diff --git a/sparkfun/esp8266/tools/sdk/include/user_interface.h b/sparkfun/esp8266/tools/sdk/include/user_interface.h deleted file mode 100644 index 1fa01edd..00000000 --- a/sparkfun/esp8266/tools/sdk/include/user_interface.h +++ /dev/null @@ -1,390 +0,0 @@ -/* - * Copyright (C) 2013 -2014 Espressif System - * - */ - -#ifndef __USER_INTERFACE_H__ -#define __USER_INTERFACE_H__ - -#include "os_type.h" -#ifdef LWIP_OPEN_SRC -#include "lwip/ip_addr.h" -#else -#include "ip_addr.h" -#endif - -#include "queue.h" -#include "user_config.h" -#include "spi_flash.h" - -#ifndef MAC2STR -#define MAC2STR(a) (a)[0], (a)[1], (a)[2], (a)[3], (a)[4], (a)[5] -#define MACSTR "%02x:%02x:%02x:%02x:%02x:%02x" -#endif - -enum rst_reason { - DEFAULT_RST_FLAG = 0, - WDT_RST_FLAG = 1, - EXP_RST_FLAG = 2 -}; - -struct rst_info{ - uint32 flag; - uint32 exccause; - uint32 epc1; - uint32 epc2; - uint32 epc3; - uint32 excvaddr; - uint32 depc; -}; - -#define UPGRADE_FW_BIN1 0x00 -#define UPGRADE_FW_BIN2 0x01 - -void system_restore(void); -void system_restart(void); - -bool system_deep_sleep_set_option(uint8 option); -void system_deep_sleep(uint32 time_in_us); - -uint8 system_upgrade_userbin_check(void); -void system_upgrade_reboot(void); -uint8 system_upgrade_flag_check(); -void system_upgrade_flag_set(uint8 flag); - -void system_timer_reinit(void); -uint32 system_get_time(void); - -/* user task's prio must be 0/1/2 !!!*/ -enum { - USER_TASK_PRIO_0 = 0, - USER_TASK_PRIO_1, - USER_TASK_PRIO_2, - USER_TASK_PRIO_MAX -}; - -bool system_os_task(os_task_t task, uint8 prio, os_event_t *queue, uint8 qlen); -bool system_os_post(uint8 prio, os_signal_t sig, os_param_t par); - -void system_print_meminfo(void); -uint32 system_get_free_heap_size(void); - -void system_set_os_print(uint8 onoff); -uint8 system_get_os_print(); - -uint64 system_mktime(uint32 year, uint32 mon, uint32 day, uint32 hour, uint32 min, uint32 sec); - -uint32 system_get_chip_id(void); - -typedef void (* init_done_cb_t)(void); - -void system_init_done_cb(init_done_cb_t cb); - -uint32 system_rtc_clock_cali_proc(void); -uint32 system_get_rtc_time(void); - -bool system_rtc_mem_read(uint8 src_addr, void *des_addr, uint16 load_size); -bool system_rtc_mem_write(uint8 des_addr, const void *src_addr, uint16 save_size); - -void system_uart_swap(void); - -uint16 system_adc_read(void); -uint16 system_get_vdd33(void); - -const char *system_get_sdk_version(void); - -#define SYS_BOOT_ENHANCE_MODE 0 -#define SYS_BOOT_NORMAL_MODE 1 - -#define SYS_BOOT_NORMAL_BIN 0 -#define SYS_BOOT_TEST_BIN 1 - -uint8 system_get_boot_version(void); -uint32 system_get_userbin_addr(void); -uint8 system_get_boot_mode(void); -bool system_restart_enhance(uint8 bin_type, uint32 bin_addr); - -#define SYS_CPU_80MHZ 80 -#define SYS_CPU_160MHZ 160 - -bool system_update_cpu_freq(uint8 freq); -uint8 system_get_cpu_freq(void); - -#define NULL_MODE 0x00 -#define STATION_MODE 0x01 -#define SOFTAP_MODE 0x02 -#define STATIONAP_MODE 0x03 - -typedef enum _auth_mode { - AUTH_OPEN = 0, - AUTH_WEP, - AUTH_WPA_PSK, - AUTH_WPA2_PSK, - AUTH_WPA_WPA2_PSK, - AUTH_MAX -} AUTH_MODE; - -uint8 wifi_get_opmode(void); -uint8 wifi_get_opmode_default(void); -bool wifi_set_opmode(uint8 opmode); -bool wifi_set_opmode_current(uint8 opmode); -uint8 wifi_get_broadcast_if(void); -bool wifi_set_broadcast_if(uint8 interface); - -struct bss_info { - STAILQ_ENTRY(bss_info) next; - - uint8 bssid[6]; - uint8 ssid[32]; - uint8 channel; - sint8 rssi; - AUTH_MODE authmode; - uint8 is_hidden; -}; - -typedef struct _scaninfo { - STAILQ_HEAD(, bss_info) *pbss; - struct espconn *pespconn; - uint8 totalpage; - uint8 pagenum; - uint8 page_sn; - uint8 data_cnt; -} scaninfo; - -typedef void (* scan_done_cb_t)(void *arg, STATUS status); - -struct station_config { - uint8 ssid[32]; - uint8 password[64]; - uint8 bssid_set; // Note: If bssid_set is 1, station will just connect to the router - // with both ssid[] and bssid[] matched. Please check about this. - uint8 bssid[6]; -}; - -bool wifi_station_get_config(struct station_config *config); -bool wifi_station_get_config_default(struct station_config *config); -bool wifi_station_set_config(struct station_config *config); -bool wifi_station_set_config_current(struct station_config *config); - -bool wifi_station_connect(void); -bool wifi_station_disconnect(void); - -struct scan_config { - uint8 *ssid; // Note: ssid == NULL, don't filter ssid. - uint8 *bssid; // Note: bssid == NULL, don't filter bssid. - uint8 channel; // Note: channel == 0, scan all channels, otherwise scan set channel. - uint8 show_hidden; // Note: show_hidden == 1, can get hidden ssid routers' info. -}; - -bool wifi_station_scan(struct scan_config *config, scan_done_cb_t cb); - -uint8 wifi_station_get_auto_connect(void); -bool wifi_station_set_auto_connect(uint8 set); - -bool wifi_station_set_reconnect_policy(bool set); - -enum { - STATION_IDLE = 0, - STATION_CONNECTING, - STATION_WRONG_PASSWORD, - STATION_NO_AP_FOUND, - STATION_CONNECT_FAIL, - STATION_GOT_IP -}; - -enum dhcp_status { - DHCP_STOPPED, - DHCP_STARTED -}; - -uint8 wifi_station_get_connect_status(void); - -uint8 wifi_station_get_current_ap_id(void); -bool wifi_station_ap_change(uint8 current_ap_id); -bool wifi_station_ap_number_set(uint8 ap_number); - -bool wifi_station_dhcpc_start(void); -bool wifi_station_dhcpc_stop(void); -enum dhcp_status wifi_station_dhcpc_status(void); - -struct softap_config { - uint8 ssid[32]; - uint8 password[64]; - uint8 ssid_len; // Note: Recommend to set it according to your ssid - uint8 channel; // Note: support 1 ~ 13 - AUTH_MODE authmode; // Note: Don't support AUTH_WEP in softAP mode. - uint8 ssid_hidden; // Note: default 0 - uint8 max_connection; // Note: default 4, max 4 - uint16 beacon_interval; // Note: support 100 ~ 60000 ms, default 100 -}; - -bool wifi_softap_get_config(struct softap_config *config); -bool wifi_softap_get_config_default(struct softap_config *config); -bool wifi_softap_set_config(struct softap_config *config); -bool wifi_softap_set_config_current(struct softap_config *config); - -struct station_info { - STAILQ_ENTRY(station_info) next; - - uint8 bssid[6]; - struct ip_addr ip; -}; - -struct dhcps_lease { - struct ip_addr start_ip; - struct ip_addr end_ip; -}; - -enum dhcps_offer_option{ - OFFER_START = 0x00, - OFFER_ROUTER = 0x01, - OFFER_END -}; - -struct station_info * wifi_softap_get_station_info(void); -void wifi_softap_free_station_info(void); -uint8 wifi_station_get_ap_info(struct station_config config[]); - -bool wifi_softap_dhcps_start(void); -bool wifi_softap_dhcps_stop(void); -bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please); -enum dhcp_status wifi_softap_dhcps_status(void); -bool wifi_softap_dhcps_set_offer_option(uint8 level, void* optarg); - -#define STATION_IF 0x00 -#define SOFTAP_IF 0x01 - -bool wifi_get_ip_info(uint8 if_index, struct ip_info *info); -bool wifi_set_ip_info(uint8 if_index, struct ip_info *info); -bool wifi_get_macaddr(uint8 if_index, uint8 *macaddr); -bool wifi_set_macaddr(uint8 if_index, uint8 *macaddr); - -uint8 wifi_get_channel(void); -bool wifi_set_channel(uint8 channel); - -void wifi_status_led_install(uint8 gpio_id, uint32 gpio_name, uint8 gpio_func); -void wifi_status_led_uninstall(); - -/** Get the absolute difference between 2 u32_t values (correcting overflows) - * 'a' is expected to be 'higher' (without overflow) than 'b'. */ -#define ESP_U32_DIFF(a, b) (((a) >= (b)) ? ((a) - (b)) : (((a) + ((b) ^ 0xFFFFFFFF) + 1))) - -void wifi_promiscuous_enable(uint8 promiscuous); - -typedef void (* wifi_promiscuous_cb_t)(uint8 *buf, uint16 len); - -void wifi_set_promiscuous_rx_cb(wifi_promiscuous_cb_t cb); - -void wifi_promiscuous_set_mac(const uint8_t *address); - -enum phy_mode { - PHY_MODE_11B = 1, - PHY_MODE_11G = 2, - PHY_MODE_11N = 3 -}; - -enum phy_mode wifi_get_phy_mode(void); -bool wifi_set_phy_mode(enum phy_mode mode); - -enum sleep_type { - NONE_SLEEP_T = 0, - LIGHT_SLEEP_T, - MODEM_SLEEP_T -}; - -bool wifi_set_sleep_type(enum sleep_type type); -enum sleep_type wifi_get_sleep_type(void); - -enum { - EVENT_STAMODE_CONNECTED = 0, - EVENT_STAMODE_DISCONNECTED, - EVENT_STAMODE_AUTHMODE_CHANGE, - EVENT_STAMODE_GOT_IP, - EVENT_SOFTAPMODE_STACONNECTED, - EVENT_SOFTAPMODE_STADISCONNECTED, - EVENT_MAX -}; - -enum { - REASON_UNSPECIFIED = 1, - REASON_AUTH_EXPIRE = 2, - REASON_AUTH_LEAVE = 3, - REASON_ASSOC_EXPIRE = 4, - REASON_ASSOC_TOOMANY = 5, - REASON_NOT_AUTHED = 6, - REASON_NOT_ASSOCED = 7, - REASON_ASSOC_LEAVE = 8, - REASON_ASSOC_NOT_AUTHED = 9, - REASON_DISASSOC_PWRCAP_BAD = 10, /* 11h */ - REASON_DISASSOC_SUPCHAN_BAD = 11, /* 11h */ - REASON_IE_INVALID = 13, /* 11i */ - REASON_MIC_FAILURE = 14, /* 11i */ - REASON_4WAY_HANDSHAKE_TIMEOUT = 15, /* 11i */ - REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, /* 11i */ - REASON_IE_IN_4WAY_DIFFERS = 17, /* 11i */ - REASON_GROUP_CIPHER_INVALID = 18, /* 11i */ - REASON_PAIRWISE_CIPHER_INVALID = 19, /* 11i */ - REASON_AKMP_INVALID = 20, /* 11i */ - REASON_UNSUPP_RSN_IE_VERSION = 21, /* 11i */ - REASON_INVALID_RSN_IE_CAP = 22, /* 11i */ - REASON_802_1X_AUTH_FAILED = 23, /* 11i */ - REASON_CIPHER_SUITE_REJECTED = 24, /* 11i */ - - REASON_BEACON_TIMEOUT = 200, - REASON_NO_AP_FOUND = 201, -}; - -typedef struct { - uint8 ssid[32]; - uint8 ssid_len; - uint8 bssid[6]; - uint8 channel; -} Event_StaMode_Connected_t; - -typedef struct { - uint8 ssid[32]; - uint8 ssid_len; - uint8 bssid[6]; - uint8 reason; -} Event_StaMode_Disconnected_t; - -typedef struct { - uint8 old_mode; - uint8 new_mode; -} Event_StaMode_AuthMode_Change_t; - -typedef struct { - struct ip_addr ip; - struct ip_addr mask; - struct ip_addr gw; -} Event_StaMode_Got_IP_t; - -typedef struct { - uint8 mac[6]; - uint8 aid; -} Event_SoftAPMode_StaConnected_t; - -typedef struct { - uint8 mac[6]; - uint8 aid; -} Event_SoftAPMode_StaDisconnected_t; - -typedef union { - Event_StaMode_Connected_t connected; - Event_StaMode_Disconnected_t disconnected; - Event_StaMode_AuthMode_Change_t auth_change; - Event_StaMode_Got_IP_t got_ip; - Event_SoftAPMode_StaConnected_t sta_connected; - Event_SoftAPMode_StaDisconnected_t sta_disconnected; -} Event_Info_u; - -typedef struct _esp_event { - uint32 event; - Event_Info_u event_info; -} System_Event_t; - -typedef void (* wifi_event_handler_cb_t)(System_Event_t *event); - -void wifi_set_event_handler_cb(wifi_event_handler_cb_t cb); - -#endif diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.app.v6.common.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.app.v6.common.ld deleted file mode 100644 index 986b441f..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.app.v6.common.ld +++ /dev/null @@ -1,185 +0,0 @@ -/* This linker script generated from xt-genldscripts.tpp for LSP . */ -/* Linker Script for ld -N */ - -PHDRS -{ - dport0_0_phdr PT_LOAD; - dram0_0_phdr PT_LOAD; - dram0_0_bss_phdr PT_LOAD; - iram1_0_phdr PT_LOAD; - irom0_0_phdr PT_LOAD; -} - - -/* Default entry point: */ -ENTRY(call_user_start) -PROVIDE(_memmap_vecbase_reset = 0x40000000); -/* Various memory-map dependent cache attribute settings: */ -_memmap_cacheattr_wb_base = 0x00000110; -_memmap_cacheattr_wt_base = 0x00000110; -_memmap_cacheattr_bp_base = 0x00000220; -_memmap_cacheattr_unused_mask = 0xFFFFF00F; -_memmap_cacheattr_wb_trapnull = 0x2222211F; -_memmap_cacheattr_wba_trapnull = 0x2222211F; -_memmap_cacheattr_wbna_trapnull = 0x2222211F; -_memmap_cacheattr_wt_trapnull = 0x2222211F; -_memmap_cacheattr_bp_trapnull = 0x2222222F; -_memmap_cacheattr_wb_strict = 0xFFFFF11F; -_memmap_cacheattr_wt_strict = 0xFFFFF11F; -_memmap_cacheattr_bp_strict = 0xFFFFF22F; -_memmap_cacheattr_wb_allvalid = 0x22222112; -_memmap_cacheattr_wt_allvalid = 0x22222112; -_memmap_cacheattr_bp_allvalid = 0x22222222; -PROVIDE(_memmap_cacheattr_reset = _memmap_cacheattr_wb_trapnull); - -SECTIONS -{ - - .dport0.rodata : ALIGN(4) - { - _dport0_rodata_start = ABSOLUTE(.); - *(.dport0.rodata) - *(.dport.rodata) - _dport0_rodata_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.literal : ALIGN(4) - { - _dport0_literal_start = ABSOLUTE(.); - *(.dport0.literal) - *(.dport.literal) - _dport0_literal_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .dport0.data : ALIGN(4) - { - _dport0_data_start = ABSOLUTE(.); - *(.dport0.data) - *(.dport.data) - _dport0_data_end = ABSOLUTE(.); - } >dport0_0_seg :dport0_0_phdr - - .data : ALIGN(4) - { - _data_start = ABSOLUTE(.); - *(.data) - *(.data.*) - *(.gnu.linkonce.d.*) - *(.data1) - *(.sdata) - *(.sdata.*) - *(.gnu.linkonce.s.*) - *(.sdata2) - *(.sdata2.*) - *(.gnu.linkonce.s2.*) - *(.jcr) - _data_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .rodata : ALIGN(4) - { - _rodata_start = ABSOLUTE(.); - *(.rodata) - *(.rodata.*) - *(.gnu.linkonce.r.*) - *(.rodata1) - __XT_EXCEPTION_TABLE__ = ABSOLUTE(.); - *(.xt_except_table) - *(.gcc_except_table) - *(.gnu.linkonce.e.*) - *(.gnu.version_r) - *(.eh_frame) - . = (. + 3) & ~ 3; - /* C++ constructor and destructor tables, properly ordered: */ - __init_array_start = ABSOLUTE(.); - KEEP (*crtbegin.o(.ctors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) - KEEP (*(SORT(.ctors.*))) - KEEP (*(.ctors)) - __init_array_end = ABSOLUTE(.); - KEEP (*crtbegin.o(.dtors)) - KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) - KEEP (*(SORT(.dtors.*))) - KEEP (*(.dtors)) - /* C++ exception handlers table: */ - __XT_EXCEPTION_DESCS__ = ABSOLUTE(.); - *(.xt_except_desc) - *(.gnu.linkonce.h.*) - __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.); - *(.xt_except_desc_end) - *(.dynamic) - *(.gnu.version_d) - . = ALIGN(4); /* this table MUST be 4-byte aligned */ - _bss_table_start = ABSOLUTE(.); - LONG(_bss_start) - LONG(_bss_end) - _bss_table_end = ABSOLUTE(.); - _rodata_end = ABSOLUTE(.); - } >dram0_0_seg :dram0_0_phdr - - .bss ALIGN(8) (NOLOAD) : ALIGN(4) - { - . = ALIGN (8); - _bss_start = ABSOLUTE(.); - *(.dynsbss) - *(.sbss) - *(.sbss.*) - *(.gnu.linkonce.sb.*) - *(.scommon) - *(.sbss2) - *(.sbss2.*) - *(.gnu.linkonce.sb2.*) - *(.dynbss) - *(.bss) - *(.bss.*) - *(.gnu.linkonce.b.*) - *(COMMON) - . = ALIGN (8); - _bss_end = ABSOLUTE(.); - _heap_start = ABSOLUTE(.); -/* _stack_sentry = ALIGN(0x8); */ - } >dram0_0_seg :dram0_0_bss_phdr -/* __stack = 0x3ffc8000; */ - - .irom0.text : ALIGN(4) - { - _irom0_text_start = ABSOLUTE(.); - *core_esp8266_*.o(.literal*, .text*) - *spiffs*.o(.literal*, .text*) - *.cpp.o(.literal*, .text*) - *libm.a:(.literal .text .literal.* .text.*) - *libsmartconfig.a:(.literal .text .literal.* .text.*) - *(.irom0.literal .irom.literal .irom.text.literal .irom0.text .irom.text) - _irom0_text_end = ABSOLUTE(.); - _flash_code_end = ABSOLUTE(.); - } >irom0_0_seg :irom0_0_phdr - - .text : ALIGN(4) - { - _stext = .; - _text_start = ABSOLUTE(.); - *(.entry.text) - *(.init.literal) - *(.init) - *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*) - *(.fini.literal) - *(.fini) - *(.gnu.version) - _text_end = ABSOLUTE(.); - _etext = .; - } >iram1_0_seg :iram1_0_phdr - - .lit4 : ALIGN(4) - { - _lit4_start = ABSOLUTE(.); - *(*.lit4) - *(.lit4.*) - *(.gnu.linkonce.lit4.*) - _lit4_end = ABSOLUTE(.); - } >iram1_0_seg :iram1_0_phdr - - -} - -/* get ROM code address */ -INCLUDE "../ld/eagle.rom.addr.v6.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.16m.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.16m.ld deleted file mode 100644 index b1624e76..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.16m.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 16M chips */ -/* irom0 940KB */ -/* eeprom 20KB */ -/* spiffs 15MB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xEB000 -} - -PROVIDE ( _SPIFFS_start = 0x40300000 ); -PROVIDE ( _SPIFFS_end = 0x41200000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m128.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m128.ld deleted file mode 100644 index ddd57a57..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m128.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 1M chips */ -/* irom0 812KB */ -/* spiffs 128KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xCB000 -} - -PROVIDE ( _SPIFFS_start = 0x402DB000 ); -PROVIDE ( _SPIFFS_end = 0x402FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m256.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m256.ld deleted file mode 100644 index 57b6a33f..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m256.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 1M chips */ -/* irom0 684KB */ -/* spiffs 256KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xAB000 -} - -PROVIDE ( _SPIFFS_start = 0x402BB000 ); -PROVIDE ( _SPIFFS_end = 0x402FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m512.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m512.ld deleted file mode 100644 index 1ffd7e67..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m512.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 1M chips */ -/* irom0 428KB */ -/* spiffs 512KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0x6B000 -} - -PROVIDE ( _SPIFFS_start = 0x4027B000 ); -PROVIDE ( _SPIFFS_end = 0x402FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m64.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m64.ld deleted file mode 100644 index ca3d64c6..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.1m64.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 1M chips */ -/* irom0 876KB */ -/* spiffs 64KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xDB000 -} - -PROVIDE ( _SPIFFS_start = 0x402EB000 ); -PROVIDE ( _SPIFFS_end = 0x402FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.2m.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.2m.ld deleted file mode 100644 index cd6af277..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.2m.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 2M chips */ -/* irom0 960KB */ -/* spiffs 1004KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xF0000 -} - -PROVIDE ( _SPIFFS_start = 0x40300000 ); -PROVIDE ( _SPIFFS_end = 0x403FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.4m.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.4m.ld deleted file mode 100644 index 7df2fa8a..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.4m.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 4M chips */ -/* irom0 960KB */ -/* spiffs 3052KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xF0000 -} - -PROVIDE ( _SPIFFS_start = 0x40300000 ); -PROVIDE ( _SPIFFS_end = 0x405FB000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.512k.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.512k.ld deleted file mode 100644 index 05160fe9..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.512k.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 512K chips */ -/* irom0 364KB */ -/* spiffs 64KB */ -/* eeprom 20KB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0x5B000 -} - -PROVIDE ( _SPIFFS_start = 0x4026B000 ); -PROVIDE ( _SPIFFS_end = 0x4027B000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.8m.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.flash.8m.ld deleted file mode 100644 index b3eeddf2..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.flash.8m.ld +++ /dev/null @@ -1,17 +0,0 @@ -/* Flash Split for 8M chips */ -/* irom0 940KB */ -/* eeprom 20KB */ -/* spiffs 7MB */ - -MEMORY -{ - dport0_0_seg : org = 0x3FF00000, len = 0x10 - dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 - irom0_0_seg : org = 0x40210000, len = 0xEB000 -} - -PROVIDE ( _SPIFFS_start = 0x40300000 ); -PROVIDE ( _SPIFFS_end = 0x40A00000 ); - -INCLUDE "../ld/eagle.app.v6.common.ld" diff --git a/sparkfun/esp8266/tools/sdk/ld/eagle.rom.addr.v6.ld b/sparkfun/esp8266/tools/sdk/ld/eagle.rom.addr.v6.ld deleted file mode 100644 index 076a240d..00000000 --- a/sparkfun/esp8266/tools/sdk/ld/eagle.rom.addr.v6.ld +++ /dev/null @@ -1,347 +0,0 @@ -PROVIDE ( Cache_Read_Disable = 0x400047f0 ); -PROVIDE ( Cache_Read_Enable = 0x40004678 ); -PROVIDE ( FilePacketSendReqMsgProc = 0x400035a0 ); -PROVIDE ( FlashDwnLdParamCfgMsgProc = 0x4000368c ); -PROVIDE ( FlashDwnLdStartMsgProc = 0x40003538 ); -PROVIDE ( FlashDwnLdStopReqMsgProc = 0x40003658 ); -PROVIDE ( GetUartDevice = 0x40003f4c ); -PROVIDE ( MD5Final = 0x40009900 ); -PROVIDE ( MD5Init = 0x40009818 ); -PROVIDE ( MD5Update = 0x40009834 ); -PROVIDE ( MemDwnLdStartMsgProc = 0x400036c4 ); -PROVIDE ( MemDwnLdStopReqMsgProc = 0x4000377c ); -PROVIDE ( MemPacketSendReqMsgProc = 0x400036f0 ); -PROVIDE ( RcvMsg = 0x40003eac ); -PROVIDE ( SHA1Final = 0x4000b648 ); -PROVIDE ( SHA1Init = 0x4000b584 ); -PROVIDE ( SHA1Transform = 0x4000a364 ); -PROVIDE ( SHA1Update = 0x4000b5a8 ); -PROVIDE ( SPI_read_status = 0x400043c8 ); -PROVIDE ( SPI_write_status = 0x40004400 ); -PROVIDE ( SPI_write_enable = 0x4000443c ); -PROVIDE ( Wait_SPI_Idle = 0x4000448c ); -PROVIDE ( SPIEraseArea = 0x40004b44 ); -PROVIDE ( SPIEraseBlock = 0x400049b4 ); -PROVIDE ( SPIEraseChip = 0x40004984 ); -PROVIDE ( SPIEraseSector = 0x40004a00 ); -PROVIDE ( SPILock = 0x400048a8 ); -PROVIDE ( SPIParamCfg = 0x40004c2c ); -PROVIDE ( SPIRead = 0x40004b1c ); -PROVIDE ( SPIReadModeCnfig = 0x400048ec ); -PROVIDE ( SPIUnlock = 0x40004878 ); -PROVIDE ( SPIWrite = 0x40004a4c ); -PROVIDE ( SelectSpiFunction = 0x40003f58 ); -PROVIDE ( SendMsg = 0x40003cf4 ); -PROVIDE ( UartConnCheck = 0x40003230 ); -PROVIDE ( UartConnectProc = 0x400037a0 ); -PROVIDE ( UartDwnLdProc = 0x40003368 ); -PROVIDE ( UartGetCmdLn = 0x40003ef4 ); -PROVIDE ( UartRegReadProc = 0x4000381c ); -PROVIDE ( UartRegWriteProc = 0x400037ac ); -PROVIDE ( UartRxString = 0x40003c30 ); -PROVIDE ( Uart_Init = 0x40003a14 ); -PROVIDE ( _DebugExceptionVector = 0x40000010 ); -PROVIDE ( _DoubleExceptionVector = 0x40000070 ); -PROVIDE ( _KernelExceptionVector = 0x40000030 ); -PROVIDE ( _NMIExceptionVector = 0x40000020 ); -PROVIDE ( _ResetHandler = 0x400000a4 ); -PROVIDE ( _ResetVector = 0x40000080 ); -PROVIDE ( _UserExceptionVector = 0x40000050 ); -PROVIDE ( __adddf3 = 0x4000c538 ); -PROVIDE ( __addsf3 = 0x4000c180 ); -PROVIDE ( __divdf3 = 0x4000cb94 ); -PROVIDE ( __divdi3 = 0x4000ce60 ); -PROVIDE ( __divsi3 = 0x4000dc88 ); -PROVIDE ( __extendsfdf2 = 0x4000cdfc ); -PROVIDE ( __fixdfsi = 0x4000ccb8 ); -PROVIDE ( __fixunsdfsi = 0x4000cd00 ); -PROVIDE ( __fixunssfsi = 0x4000c4c4 ); -PROVIDE ( __floatsidf = 0x4000e2f0 ); -PROVIDE ( __floatsisf = 0x4000e2ac ); -PROVIDE ( __floatunsidf = 0x4000e2e8 ); -PROVIDE ( __floatunsisf = 0x4000e2a4 ); -PROVIDE ( __muldf3 = 0x4000c8f0 ); -PROVIDE ( __muldi3 = 0x40000650 ); -PROVIDE ( __mulsf3 = 0x4000c3dc ); -PROVIDE ( __subdf3 = 0x4000c688 ); -PROVIDE ( __subsf3 = 0x4000c268 ); -PROVIDE ( __truncdfsf2 = 0x4000cd5c ); -PROVIDE ( __udivdi3 = 0x4000d310 ); -PROVIDE ( __udivsi3 = 0x4000e21c ); -PROVIDE ( __umoddi3 = 0x4000d770 ); -PROVIDE ( __umodsi3 = 0x4000e268 ); -PROVIDE ( __umulsidi3 = 0x4000dcf0 ); -PROVIDE ( _rom_store = 0x4000e388 ); -PROVIDE ( _rom_store_table = 0x4000e328 ); -PROVIDE ( _start = 0x4000042c ); -PROVIDE ( _xtos_alloca_handler = 0x4000dbe0 ); -PROVIDE ( _xtos_c_wrapper_handler = 0x40000598 ); -PROVIDE ( _xtos_cause3_handler = 0x40000590 ); -PROVIDE ( _xtos_ints_off = 0x4000bda4 ); -PROVIDE ( _xtos_ints_on = 0x4000bd84 ); -PROVIDE ( _xtos_l1int_handler = 0x4000048c ); -PROVIDE ( _xtos_p_none = 0x4000dbf8 ); -PROVIDE ( _xtos_restore_intlevel = 0x4000056c ); -PROVIDE ( _xtos_return_from_exc = 0x4000dc54 ); -PROVIDE ( _xtos_set_exception_handler = 0x40000454 ); -PROVIDE ( _xtos_set_interrupt_handler = 0x4000bd70 ); -PROVIDE ( _xtos_set_interrupt_handler_arg = 0x4000bd28 ); -PROVIDE ( _xtos_set_intlevel = 0x4000dbfc ); -PROVIDE ( _xtos_set_min_intlevel = 0x4000dc18 ); -PROVIDE ( _xtos_set_vpri = 0x40000574 ); -PROVIDE ( _xtos_syscall_handler = 0x4000dbe4 ); -PROVIDE ( _xtos_unhandled_exception = 0x4000dc44 ); -PROVIDE ( _xtos_unhandled_interrupt = 0x4000dc3c ); -PROVIDE ( aes_decrypt = 0x400092d4 ); -PROVIDE ( aes_decrypt_deinit = 0x400092e4 ); -PROVIDE ( aes_decrypt_init = 0x40008ea4 ); -PROVIDE ( aes_unwrap = 0x40009410 ); -PROVIDE ( base64_decode = 0x40009648 ); -PROVIDE ( base64_encode = 0x400094fc ); -PROVIDE ( bzero = 0x4000de84 ); -PROVIDE ( cmd_parse = 0x40000814 ); -PROVIDE ( conv_str_decimal = 0x40000b24 ); -PROVIDE ( conv_str_hex = 0x40000cb8 ); -PROVIDE ( convert_para_str = 0x40000a60 ); -PROVIDE ( dtm_get_intr_mask = 0x400026d0 ); -PROVIDE ( dtm_params_init = 0x4000269c ); -PROVIDE ( dtm_set_intr_mask = 0x400026c8 ); -PROVIDE ( dtm_set_params = 0x400026dc ); -PROVIDE ( eprintf = 0x40001d14 ); -PROVIDE ( eprintf_init_buf = 0x40001cb8 ); -PROVIDE ( eprintf_to_host = 0x40001d48 ); -PROVIDE ( est_get_printf_buf_remain_len = 0x40002494 ); -PROVIDE ( est_reset_printf_buf_len = 0x4000249c ); -PROVIDE ( ets_bzero = 0x40002ae8 ); -PROVIDE ( ets_char2xdigit = 0x40002b74 ); -PROVIDE ( ets_delay_us = 0x40002ecc ); -PROVIDE ( ets_enter_sleep = 0x400027b8 ); -PROVIDE ( ets_external_printf = 0x40002578 ); -PROVIDE ( ets_get_cpu_frequency = 0x40002f0c ); -PROVIDE ( ets_getc = 0x40002bcc ); -PROVIDE ( ets_install_external_printf = 0x40002450 ); -PROVIDE ( ets_install_putc1 = 0x4000242c ); -PROVIDE ( ets_install_putc2 = 0x4000248c ); -PROVIDE ( ets_install_uart_printf = 0x40002438 ); -PROVIDE ( ets_intr_lock = 0x40000f74 ); -PROVIDE ( ets_intr_unlock = 0x40000f80 ); -PROVIDE ( ets_isr_attach = 0x40000f88 ); -PROVIDE ( ets_isr_mask = 0x40000f98 ); -PROVIDE ( ets_isr_unmask = 0x40000fa8 ); -PROVIDE ( ets_memcmp = 0x400018d4 ); -PROVIDE ( ets_memcpy = 0x400018b4 ); -PROVIDE ( ets_memmove = 0x400018c4 ); -PROVIDE ( ets_memset = 0x400018a4 ); -PROVIDE ( ets_post = 0x40000e24 ); -PROVIDE ( ets_printf = 0x400024cc ); -PROVIDE ( ets_putc = 0x40002be8 ); -PROVIDE ( ets_rtc_int_register = 0x40002a40 ); -PROVIDE ( ets_run = 0x40000e04 ); -PROVIDE ( ets_set_idle_cb = 0x40000dc0 ); -PROVIDE ( ets_set_user_start = 0x40000fbc ); -PROVIDE ( ets_str2macaddr = 0x40002af8 ); -PROVIDE ( ets_strcmp = 0x40002aa8 ); -PROVIDE ( ets_strcpy = 0x40002a88 ); -PROVIDE ( ets_strlen = 0x40002ac8 ); -PROVIDE ( ets_strncmp = 0x40002ab8 ); -PROVIDE ( ets_strncpy = 0x40002a98 ); -PROVIDE ( ets_strstr = 0x40002ad8 ); -PROVIDE ( ets_task = 0x40000dd0 ); -PROVIDE ( ets_timer_arm = 0x40002cc4 ); -PROVIDE ( ets_timer_disarm = 0x40002d40 ); -PROVIDE ( ets_timer_done = 0x40002d80 ); -PROVIDE ( ets_timer_handler_isr = 0x40002da8 ); -PROVIDE ( ets_timer_init = 0x40002e68 ); -PROVIDE ( ets_timer_setfn = 0x40002c48 ); -PROVIDE ( ets_uart_printf = 0x40002544 ); -PROVIDE ( ets_update_cpu_frequency = 0x40002f04 ); -PROVIDE ( ets_vprintf = 0x40001f00 ); -PROVIDE ( ets_wdt_disable = 0x400030f0 ); -PROVIDE ( ets_wdt_enable = 0x40002fa0 ); -PROVIDE ( ets_wdt_get_mode = 0x40002f34 ); -PROVIDE ( ets_wdt_init = 0x40003170 ); -PROVIDE ( ets_wdt_restore = 0x40003158 ); -PROVIDE ( ets_write_char = 0x40001da0 ); -PROVIDE ( get_first_seg = 0x4000091c ); -PROVIDE ( gpio_init = 0x40004c50 ); -PROVIDE ( gpio_input_get = 0x40004cf0 ); -PROVIDE ( gpio_intr_ack = 0x40004dcc ); -PROVIDE ( gpio_intr_handler_register = 0x40004e28 ); -PROVIDE ( gpio_intr_pending = 0x40004d88 ); -PROVIDE ( gpio_intr_test = 0x40004efc ); -PROVIDE ( gpio_output_set = 0x40004cd0 ); -PROVIDE ( gpio_pin_intr_state_set = 0x40004d90 ); -PROVIDE ( gpio_pin_wakeup_disable = 0x40004ed4 ); -PROVIDE ( gpio_pin_wakeup_enable = 0x40004e90 ); -PROVIDE ( gpio_register_get = 0x40004d5c ); -PROVIDE ( gpio_register_set = 0x40004d04 ); -PROVIDE ( hmac_md5 = 0x4000a2cc ); -PROVIDE ( hmac_md5_vector = 0x4000a160 ); -PROVIDE ( hmac_sha1 = 0x4000ba28 ); -PROVIDE ( hmac_sha1_vector = 0x4000b8b4 ); -PROVIDE ( lldesc_build_chain = 0x40004f40 ); -PROVIDE ( lldesc_num2link = 0x40005050 ); -PROVIDE ( lldesc_set_owner = 0x4000507c ); -PROVIDE ( main = 0x40000fec ); -PROVIDE ( md5_vector = 0x400097ac ); -PROVIDE ( mem_calloc = 0x40001c2c ); -PROVIDE ( mem_free = 0x400019e0 ); -PROVIDE ( mem_init = 0x40001998 ); -PROVIDE ( mem_malloc = 0x40001b40 ); -PROVIDE ( mem_realloc = 0x40001c6c ); -PROVIDE ( mem_trim = 0x40001a14 ); -PROVIDE ( mem_zalloc = 0x40001c58 ); -PROVIDE ( memcmp = 0x4000dea8 ); -PROVIDE ( memcpy = 0x4000df48 ); -PROVIDE ( memmove = 0x4000e04c ); -PROVIDE ( memset = 0x4000e190 ); -PROVIDE ( multofup = 0x400031c0 ); -PROVIDE ( pbkdf2_sha1 = 0x4000b840 ); -PROVIDE ( phy_get_romfuncs = 0x40006b08 ); -PROVIDE ( rand = 0x40000600 ); -PROVIDE ( rc4_skip = 0x4000dd68 ); -PROVIDE ( recv_packet = 0x40003d08 ); -PROVIDE ( remove_head_space = 0x40000a04 ); -PROVIDE ( rijndaelKeySetupDec = 0x40008dd0 ); -PROVIDE ( rijndaelKeySetupEnc = 0x40009300 ); -PROVIDE ( rom_abs_temp = 0x400060c0 ); -PROVIDE ( rom_ana_inf_gating_en = 0x40006b10 ); -PROVIDE ( rom_cal_tos_v50 = 0x40007a28 ); -PROVIDE ( rom_chip_50_set_channel = 0x40006f84 ); -PROVIDE ( rom_chip_v5_disable_cca = 0x400060d0 ); -PROVIDE ( rom_chip_v5_enable_cca = 0x400060ec ); -PROVIDE ( rom_chip_v5_rx_init = 0x4000711c ); -PROVIDE ( rom_chip_v5_sense_backoff = 0x4000610c ); -PROVIDE ( rom_chip_v5_tx_init = 0x4000718c ); -PROVIDE ( rom_dc_iq_est = 0x4000615c ); -PROVIDE ( rom_en_pwdet = 0x400061b8 ); -PROVIDE ( rom_get_bb_atten = 0x40006238 ); -PROVIDE ( rom_get_corr_power = 0x40006260 ); -PROVIDE ( rom_get_fm_sar_dout = 0x400062dc ); -PROVIDE ( rom_get_noisefloor = 0x40006394 ); -PROVIDE ( rom_get_power_db = 0x400063b0 ); -PROVIDE ( rom_i2c_readReg = 0x40007268 ); -PROVIDE ( rom_i2c_readReg_Mask = 0x4000729c ); -PROVIDE ( rom_i2c_writeReg = 0x400072d8 ); -PROVIDE ( rom_i2c_writeReg_Mask = 0x4000730c ); -PROVIDE ( rom_iq_est_disable = 0x40006400 ); -PROVIDE ( rom_iq_est_enable = 0x40006430 ); -PROVIDE ( rom_linear_to_db = 0x40006484 ); -PROVIDE ( rom_mhz2ieee = 0x400065a4 ); -PROVIDE ( rom_pbus_dco___SA2 = 0x40007bf0 ); -PROVIDE ( rom_pbus_debugmode = 0x4000737c ); -PROVIDE ( rom_pbus_enter_debugmode = 0x40007410 ); -PROVIDE ( rom_pbus_exit_debugmode = 0x40007448 ); -PROVIDE ( rom_pbus_force_test = 0x4000747c ); -PROVIDE ( rom_pbus_rd = 0x400074d8 ); -PROVIDE ( rom_pbus_set_rxgain = 0x4000754c ); -PROVIDE ( rom_pbus_set_txgain = 0x40007610 ); -PROVIDE ( rom_pbus_workmode = 0x40007648 ); -PROVIDE ( rom_pbus_xpd_rx_off = 0x40007688 ); -PROVIDE ( rom_pbus_xpd_rx_on = 0x400076cc ); -PROVIDE ( rom_pbus_xpd_tx_off = 0x400076fc ); -PROVIDE ( rom_pbus_xpd_tx_on = 0x40007740 ); -PROVIDE ( rom_pbus_xpd_tx_on__low_gain = 0x400077a0 ); -PROVIDE ( rom_phy_reset_req = 0x40007804 ); -PROVIDE ( rom_restart_cal = 0x4000781c ); -PROVIDE ( rom_rfcal_pwrctrl = 0x40007eb4 ); -PROVIDE ( rom_rfcal_rxiq = 0x4000804c ); -PROVIDE ( rom_rfcal_rxiq_set_reg = 0x40008264 ); -PROVIDE ( rom_rfcal_txcap = 0x40008388 ); -PROVIDE ( rom_rfcal_txiq = 0x40008610 ); -PROVIDE ( rom_rfcal_txiq_cover = 0x400088b8 ); -PROVIDE ( rom_rfcal_txiq_set_reg = 0x40008a70 ); -PROVIDE ( rom_rfpll_reset = 0x40007868 ); -PROVIDE ( rom_rfpll_set_freq = 0x40007968 ); -PROVIDE ( rom_rxiq_cover_mg_mp = 0x40008b6c ); -PROVIDE ( rom_rxiq_get_mis = 0x40006628 ); -PROVIDE ( rom_sar_init = 0x40006738 ); -PROVIDE ( rom_set_ana_inf_tx_scale = 0x4000678c ); -PROVIDE ( rom_set_channel_freq = 0x40006c50 ); -PROVIDE ( rom_set_loopback_gain = 0x400067c8 ); -PROVIDE ( rom_set_noise_floor = 0x40006830 ); -PROVIDE ( rom_set_rxclk_en = 0x40006550 ); -PROVIDE ( rom_set_txbb_atten = 0x40008c6c ); -PROVIDE ( rom_set_txclk_en = 0x4000650c ); -PROVIDE ( rom_set_txiq_cal = 0x40008d34 ); -PROVIDE ( rom_start_noisefloor = 0x40006874 ); -PROVIDE ( rom_start_tx_tone = 0x400068b4 ); -PROVIDE ( rom_stop_tx_tone = 0x4000698c ); -PROVIDE ( rom_tx_mac_disable = 0x40006a98 ); -PROVIDE ( rom_tx_mac_enable = 0x40006ad4 ); -PROVIDE ( rom_txtone_linear_pwr = 0x40006a1c ); -PROVIDE ( rom_write_rfpll_sdm = 0x400078dc ); -PROVIDE ( roundup2 = 0x400031b4 ); -PROVIDE ( rtc_enter_sleep = 0x40002870 ); -PROVIDE ( rtc_get_reset_reason = 0x400025e0 ); -PROVIDE ( rtc_intr_handler = 0x400029ec ); -PROVIDE ( rtc_set_sleep_mode = 0x40002668 ); -PROVIDE ( save_rxbcn_mactime = 0x400027a4 ); -PROVIDE ( save_tsf_us = 0x400027ac ); -PROVIDE ( send_packet = 0x40003c80 ); -PROVIDE ( sha1_prf = 0x4000ba48 ); -PROVIDE ( sha1_vector = 0x4000a2ec ); -PROVIDE ( sip_alloc_to_host_evt = 0x40005180 ); -PROVIDE ( sip_get_ptr = 0x400058a8 ); -PROVIDE ( sip_get_state = 0x40005668 ); -PROVIDE ( sip_init_attach = 0x4000567c ); -PROVIDE ( sip_install_rx_ctrl_cb = 0x4000544c ); -PROVIDE ( sip_install_rx_data_cb = 0x4000545c ); -PROVIDE ( sip_post = 0x400050fc ); -PROVIDE ( sip_post_init = 0x400056c4 ); -PROVIDE ( sip_reclaim_from_host_cmd = 0x4000534c ); -PROVIDE ( sip_reclaim_tx_data_pkt = 0x400052c0 ); -PROVIDE ( sip_send = 0x40005808 ); -PROVIDE ( sip_to_host_chain_append = 0x40005864 ); -PROVIDE ( sip_to_host_evt_send_done = 0x40005234 ); -PROVIDE ( slc_add_credits = 0x400060ac ); -PROVIDE ( slc_enable = 0x40005d90 ); -PROVIDE ( slc_from_host_chain_fetch = 0x40005f24 ); -PROVIDE ( slc_from_host_chain_recycle = 0x40005e94 ); -PROVIDE ( slc_init_attach = 0x40005c50 ); -PROVIDE ( slc_init_credit = 0x4000608c ); -PROVIDE ( slc_pause_from_host = 0x40006014 ); -PROVIDE ( slc_reattach = 0x40005c1c ); -PROVIDE ( slc_resume_from_host = 0x4000603c ); -PROVIDE ( slc_select_tohost_gpio = 0x40005dc0 ); -PROVIDE ( slc_select_tohost_gpio_mode = 0x40005db8 ); -PROVIDE ( slc_send_to_host_chain = 0x40005de4 ); -PROVIDE ( slc_set_host_io_max_window = 0x40006068 ); -PROVIDE ( slc_to_host_chain_recycle = 0x40005f10 ); -PROVIDE ( software_reset = 0x4000264c ); -PROVIDE ( spi_flash_attach = 0x40004644 ); -PROVIDE ( srand = 0x400005f0 ); -PROVIDE ( strcmp = 0x4000bdc8 ); -PROVIDE ( strcpy = 0x4000bec8 ); -PROVIDE ( strlen = 0x4000bf4c ); -PROVIDE ( strncmp = 0x4000bfa8 ); -PROVIDE ( strncpy = 0x4000c0a0 ); -PROVIDE ( strstr = 0x4000e1e0 ); -PROVIDE ( timer_insert = 0x40002c64 ); -PROVIDE ( uartAttach = 0x4000383c ); -PROVIDE ( uart_baudrate_detect = 0x40003924 ); -PROVIDE ( uart_buff_switch = 0x400038a4 ); -PROVIDE ( uart_div_modify = 0x400039d8 ); -PROVIDE ( uart_rx_intr_handler = 0x40003bbc ); -PROVIDE ( uart_rx_one_char = 0x40003b8c ); -PROVIDE ( uart_rx_one_char_block = 0x40003b64 ); -PROVIDE ( uart_rx_readbuff = 0x40003ec8 ); -PROVIDE ( uart_tx_one_char = 0x40003b30 ); -PROVIDE ( wepkey_128 = 0x4000bc40 ); -PROVIDE ( wepkey_64 = 0x4000bb3c ); -PROVIDE ( xthal_bcopy = 0x40000688 ); -PROVIDE ( xthal_copy123 = 0x4000074c ); -PROVIDE ( xthal_get_ccompare = 0x4000dd4c ); -PROVIDE ( xthal_get_ccount = 0x4000dd38 ); -PROVIDE ( xthal_get_interrupt = 0x4000dd58 ); -PROVIDE ( xthal_get_intread = 0x4000dd58 ); -PROVIDE ( xthal_memcpy = 0x400006c4 ); -PROVIDE ( xthal_set_ccompare = 0x4000dd40 ); -PROVIDE ( xthal_set_intclear = 0x4000dd60 ); -PROVIDE ( xthal_spill_registers_into_stack_nw = 0x4000e320 ); -PROVIDE ( xthal_window_spill = 0x4000e324 ); -PROVIDE ( xthal_window_spill_nw = 0x4000e320 ); - -PROVIDE ( Te0 = 0x3fffccf0 ); -PROVIDE ( UartDev = 0x3fffde10 ); -PROVIDE ( flashchip = 0x3fffc714); diff --git a/sparkfun/esp8266/tools/sdk/lib/libhal.a b/sparkfun/esp8266/tools/sdk/lib/libhal.a deleted file mode 100644 index b7a43bdf..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libhal.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libjson.a b/sparkfun/esp8266/tools/sdk/lib/libjson.a deleted file mode 100644 index cc7c69ab..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libjson.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/liblwip.a b/sparkfun/esp8266/tools/sdk/lib/liblwip.a deleted file mode 100644 index d3c356dc..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/liblwip.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libmain.a b/sparkfun/esp8266/tools/sdk/lib/libmain.a deleted file mode 100644 index 265466dc..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libmain.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libnet80211.a b/sparkfun/esp8266/tools/sdk/lib/libnet80211.a deleted file mode 100644 index 2fa845c3..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libnet80211.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libphy.a b/sparkfun/esp8266/tools/sdk/lib/libphy.a deleted file mode 100644 index cb026f94..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libphy.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libpp.a b/sparkfun/esp8266/tools/sdk/lib/libpp.a deleted file mode 100644 index d28457b1..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libpp.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libsmartconfig.a b/sparkfun/esp8266/tools/sdk/lib/libsmartconfig.a deleted file mode 100644 index 39bfe39d..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libsmartconfig.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libssc.a b/sparkfun/esp8266/tools/sdk/lib/libssc.a deleted file mode 100644 index ab02abe1..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libssc.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libssl.a b/sparkfun/esp8266/tools/sdk/lib/libssl.a deleted file mode 100644 index 6c54acc2..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libssl.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libupgrade.a b/sparkfun/esp8266/tools/sdk/lib/libupgrade.a deleted file mode 100644 index 39eb41a5..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libupgrade.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/lib/libwpa.a b/sparkfun/esp8266/tools/sdk/lib/libwpa.a deleted file mode 100644 index c3d04200..00000000 Binary files a/sparkfun/esp8266/tools/sdk/lib/libwpa.a and /dev/null differ diff --git a/sparkfun/esp8266/tools/sdk/version b/sparkfun/esp8266/tools/sdk/version deleted file mode 100644 index fd9c79de..00000000 --- a/sparkfun/esp8266/tools/sdk/version +++ /dev/null @@ -1 +0,0 @@ -1.0.1_15_05_04_p1 \ No newline at end of file diff --git a/sparkfun/esp8266/variants/.DS_Store b/sparkfun/esp8266/variants/.DS_Store deleted file mode 100644 index 5008ddfc..00000000 Binary files a/sparkfun/esp8266/variants/.DS_Store and /dev/null differ diff --git a/sparkfun/esp8266/variants/generic/pins_arduino.h b/sparkfun/esp8266/variants/generic/pins_arduino.h deleted file mode 100644 index b2ff8f1c..00000000 --- a/sparkfun/esp8266/variants/generic/pins_arduino.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 17 -#define NUM_ANALOG_INPUTS 1 - -#define analogInputToDigitalPin(p) ((p > 0)?NOT_A_PIN:0) -#define digitalPinToInterrupt(p) (((p) < EXTERNAL_NUM_INTERRUPTS)?p:NOT_A_PIN) -#define digitalPinHasPWM(p) (((p) < NUM_DIGITAL_PINS)?p:NOT_A_PIN) - -static const uint8_t SDA = 4; -static const uint8_t SCL = 5; - -static const uint8_t SS = 15; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -static const uint8_t BUILTIN_LED = 1; - -static const uint8_t A0 = 17; - -// These serial port names are intended to allow libraries and architecture-neutral -// sketches to automatically default to the correct port name for a particular type -// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, -// the first hardware serial port whose RX/TX pins are not dedicated to another use. -// -// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor -// -// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial -// -// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library -// -// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. -// -// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX -// pins are NOT connected to anything by default. -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial -#define SERIAL_PORT_HARDWARE_OPEN Serial - -#endif /* Pins_Arduino_h */ diff --git a/sparkfun/esp8266/variants/nodemcu/pins_arduino.h b/sparkfun/esp8266/variants/nodemcu/pins_arduino.h deleted file mode 100644 index 3a0e8f2f..00000000 --- a/sparkfun/esp8266/variants/nodemcu/pins_arduino.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 17 -#define NUM_ANALOG_INPUTS 1 - -#define analogInputToDigitalPin(p) ((p > 0)?NOT_A_PIN:0) -#define digitalPinToInterrupt(p) (((p) < EXTERNAL_NUM_INTERRUPTS)?p:NOT_A_PIN) -#define digitalPinHasPWM(p) (((p) < NUM_DIGITAL_PINS)?p:NOT_A_PIN) - -static const uint8_t SDA = 4; -static const uint8_t SCL = 5; - -static const uint8_t SS = 15; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -static const uint8_t BUILTIN_LED = 1; - -static const uint8_t A0 = 17; - -static const uint8_t D0 = 16; -static const uint8_t D1 = 5; -static const uint8_t D2 = 4; -static const uint8_t D3 = 0; -static const uint8_t D4 = 2; -static const uint8_t D5 = 14; -static const uint8_t D6 = 12; -static const uint8_t D7 = 13; -static const uint8_t D8 = 15; -static const uint8_t D9 = 3; -static const uint8_t D10 = 1; - -// These serial port names are intended to allow libraries and architecture-neutral -// sketches to automatically default to the correct port name for a particular type -// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, -// the first hardware serial port whose RX/TX pins are not dedicated to another use. -// -// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor -// -// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial -// -// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library -// -// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. -// -// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX -// pins are NOT connected to anything by default. -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial -#define SERIAL_PORT_HARDWARE_OPEN Serial - -#endif /* Pins_Arduino_h */ diff --git a/sparkfun/esp8266/variants/thing/pins_arduino.h b/sparkfun/esp8266/variants/thing/pins_arduino.h deleted file mode 100644 index e7ce67bf..00000000 --- a/sparkfun/esp8266/variants/thing/pins_arduino.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - Modified for ESP8266 platform by Ivan Grokhotkov, 2014-2015. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#define EXTERNAL_NUM_INTERRUPTS 16 -#define NUM_DIGITAL_PINS 17 -#define NUM_ANALOG_INPUTS 1 - -#define analogInputToDigitalPin(p) ((p > 0)?NOT_A_PIN:0) -#define digitalPinToInterrupt(p) (((p) < EXTERNAL_NUM_INTERRUPTS)?p:NOT_A_PIN) -#define digitalPinHasPWM(p) (((p) < NUM_DIGITAL_PINS)?p:NOT_A_PIN) - -static const uint8_t SDA = 2; -static const uint8_t SCL = 14; - -static const uint8_t SS = 15; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 12; -static const uint8_t SCK = 14; - -static const uint8_t BUILTIN_LED = 5; - -static const uint8_t A0 = 17; - -// These serial port names are intended to allow libraries and architecture-neutral -// sketches to automatically default to the correct port name for a particular type -// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, -// the first hardware serial port whose RX/TX pins are not dedicated to another use. -// -// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor -// -// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial -// -// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library -// -// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. -// -// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX -// pins are NOT connected to anything by default. -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial -#define SERIAL_PORT_HARDWARE_OPEN Serial - -#endif /* Pins_Arduino_h */ diff --git a/sparkfun/esp8266/variants/wifio/WifioProtocol.h b/sparkfun/esp8266/variants/wifio/WifioProtocol.h deleted file mode 100644 index 525ca81b..00000000 --- a/sparkfun/esp8266/variants/wifio/WifioProtocol.h +++ /dev/null @@ -1,152 +0,0 @@ -/* - WifioProtocol.h - virtual IO protocol for the WIFIO board - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef WIFIO_PROTOCOL_H -#define WIFIO_PROTOCOL_H - -#include -#include "Arduino.h" - -inline void protocolError() -{ - delay(5); - twi_stop(); -} - -namespace wifio { - -const uint8_t MAGIC = 0x05; - -enum Command { - CMD_NONE, - CMD_SYNC, - CMD_PINMODE, - CMD_DIGITALWRITE, - CMD_DIGITALREAD, - CMD_DIGITALREADRESULT, - CMD_ANALOGWRITE, - CMD_ANALOGREAD, - CMD_ANALOGREADRESULT, - CMD_INVALID, -}; - -struct CommandHeader { - uint8_t magic : 4; - uint8_t cmd : 4; -}; - -struct SyncCommand { - CommandHeader header; - uint8_t val : 7; - uint8_t parity : 1; -}; - -struct PinModeCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t mode : 2; - uint8_t parity : 1; -}; - -struct DigitalWriteCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t value : 1; - uint8_t unused : 1; - uint8_t parity : 1; -}; - -struct DigitalReadCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t unused : 2; - uint8_t parity : 1; -}; - -struct DigitalReadResultCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t value : 1; - uint8_t unused : 1; - uint8_t parity : 1; -}; - -struct AnalogWriteCommand { - CommandHeader header; - uint8_t value; - uint8_t pin : 5; - uint8_t unused : 2; - uint8_t parity : 1; -}; - -struct AnalogReadCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t unused : 2; - uint8_t parity : 1; -}; - -struct AnalogReadResultCommand { - CommandHeader header; - uint8_t pin : 5; - uint8_t val_h : 3; - uint8_t val_l : 7; - uint8_t parity : 1; -}; - - -template -void sendCommand(uint8_t addr, T& t) -{ - // TODO: calculate parity - t.parity = 1; - if (twi_writeTo(addr, reinterpret_cast(&t), sizeof(T), true) != sizeof(T)) - { - protocolError(); - } -} - -template -bool sendCommandWaitForReply(uint8_t addr, TC& c, Command rt, TR& r, int32_t d_us) -{ - c.parity = 1; - if (twi_writeTo(addr, reinterpret_cast(&c), sizeof(TC), true) != sizeof(TC)) - { - protocolError(); - return false; - } - if (d_us) - { - delayMicroseconds(d_us); - } - if (twi_readFrom(addr, reinterpret_cast(&r), sizeof(TR), true) != sizeof(TR) || r.header.cmd != rt) - { - protocolError(); - return false; - } - return true; -} - - -}// namespace wifio - -#endif//WIFIO_PROTOCOL_H - diff --git a/sparkfun/esp8266/variants/wifio/WifioWiring.cpp b/sparkfun/esp8266/variants/wifio/WifioWiring.cpp deleted file mode 100644 index d2b607b4..00000000 --- a/sparkfun/esp8266/variants/wifio/WifioWiring.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - WifioWiring.cpp - Wiring API implementation for the WIFIO board - - Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "wiring_private.h" -#include "WifioProtocol.h" - - -namespace wifio { - const int WIFIO_AVR_SLAVE_ADDR=0x23; - - void pinMode(int avrPin, int mode) { - PinModeCommand cmd { MAGIC, CMD_PINMODE, static_cast(avrPin), static_cast(mode) }; - sendCommand(WIFIO_AVR_SLAVE_ADDR, cmd); - } - - void digitalWrite(int avrPin, int value) { - DigitalWriteCommand cmd { MAGIC, CMD_DIGITALWRITE, static_cast(avrPin), static_cast(value) }; - sendCommand(WIFIO_AVR_SLAVE_ADDR, cmd); - } - - int digitalRead(int avrPin) { - DigitalReadCommand cmd { MAGIC, CMD_DIGITALREAD, static_cast(avrPin) }; - DigitalReadResultCommand reply = { 0 }; - sendCommandWaitForReply(WIFIO_AVR_SLAVE_ADDR, cmd, CMD_DIGITALREADRESULT, reply, 0); - return reply.value; - } - - void analogWrite(int avrPin, int value) { - AnalogWriteCommand cmd { MAGIC, CMD_ANALOGWRITE, static_cast(value), static_cast(avrPin) }; - sendCommand(WIFIO_AVR_SLAVE_ADDR, cmd); - } - - int analogRead(int avrPin) { - AnalogReadCommand cmd { MAGIC, CMD_ANALOGREAD, static_cast(avrPin) }; - AnalogReadResultCommand reply = { 0 }; - sendCommandWaitForReply(WIFIO_AVR_SLAVE_ADDR, cmd, CMD_ANALOGREADRESULT, reply, 120); - return ((reply.val_h << 7) | reply.val_l); - } - -} // namespace wifio - -extern "C" void __pinMode(uint8_t pin, uint8_t mode); -extern "C" void __digitalWrite(uint8_t pin, uint8_t val); -extern "C" int __digitalRead(uint8_t pin); -extern "C" void __analogWrite(uint8_t pin, int val); -// extern "C" void __attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode); -// extern "C" void __detachInterrupt(uint8_t pin); -extern "C" void __initPins(); -extern "C" int __analogRead(uint8_t pin); - - -extern "C" void pinMode(uint8_t pin, uint8_t mode){ - if (pin >= ESP_PINS_OFFSET) { // esp pin - __pinMode(pin - ESP_PINS_OFFSET, mode); - } - else { // AVR pin - wifio::pinMode(pin, mode); - } -} - -extern "C" void digitalWrite(uint8_t pin, uint8_t value) { - if (pin >= ESP_PINS_OFFSET) { // esp pin - __digitalWrite(pin - ESP_PINS_OFFSET, value); - } - else { // AVR pin - wifio::digitalWrite(pin, value); - } -} - -extern "C" int digitalRead(uint8_t pin) { - if (pin >= ESP_PINS_OFFSET) { - return __digitalRead(pin - ESP_PINS_OFFSET); - } - else { - return wifio::digitalRead(pin); - } -} - -extern "C" int analogRead(uint8_t pin) { - if (pin >= ESP_PINS_OFFSET) { - return __analogRead(pin - ESP_PINS_OFFSET); - } - else { - return wifio::analogRead(pin); - } -} - -extern "C" void analogWrite(uint8_t pin, int value) { - if (pin >= ESP_PINS_OFFSET) { - __analogWrite(pin - ESP_PINS_OFFSET, value); - } - else { - wifio::analogWrite(pin, value); - } -} - - -void initVariant() { - twi_setClock(100000); - twi_init(SDA, SCL); -} diff --git a/sparkfun/esp8266/variants/wifio/pins_arduino.h b/sparkfun/esp8266/variants/wifio/pins_arduino.h deleted file mode 100644 index c2a2f986..00000000 --- a/sparkfun/esp8266/variants/wifio/pins_arduino.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - pins_arduino.h - Pin definition functions for Arduino - Part of Arduino - http://www.arduino.cc/ - - Copyright (c) 2007 David A. Mellis - Modified for ESP8266 WIFIO board by Ivan Grokhotkov, 2015. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General - Public License along with this library; if not, write to the - Free Software Foundation, Inc., 59 Temple Place, Suite 330, - Boston, MA 02111-1307 USA - - $Id: wiring.h 249 2007-02-03 16:52:51Z mellis $ -*/ - -#ifndef Pins_Arduino_h -#define Pins_Arduino_h - -#define NUM_DIGITAL_PINS 36 -#define NUM_ANALOG_INPUTS 1 -#define ESP_PINS_OFFSET 20 - -static const uint8_t SDA = 4; -static const uint8_t SCL = 5; - -static const uint8_t SS = 12; -static const uint8_t MOSI = 13; -static const uint8_t MISO = 14; -static const uint8_t SCK = 15; - -static const uint8_t A0 = 14; -static const uint8_t A1 = 15; -static const uint8_t A2 = 16; -static const uint8_t A3 = 17; -static const uint8_t A4 = 18; -static const uint8_t A5 = 19; -static const uint8_t A6 = 20; -static const uint8_t A7 = 21; - -static const uint8_t E0 = ESP_PINS_OFFSET + 0; -static const uint8_t E1 = ESP_PINS_OFFSET + 1; -static const uint8_t E2 = ESP_PINS_OFFSET + 2; -static const uint8_t E3 = ESP_PINS_OFFSET + 3; -static const uint8_t E4 = ESP_PINS_OFFSET + 4; -static const uint8_t E5 = ESP_PINS_OFFSET + 5; -static const uint8_t E11 = ESP_PINS_OFFSET + 11; -static const uint8_t E12 = ESP_PINS_OFFSET + 12; -static const uint8_t E13 = ESP_PINS_OFFSET + 13; -static const uint8_t E14 = ESP_PINS_OFFSET + 14; -static const uint8_t E15 = ESP_PINS_OFFSET + 15; -static const uint8_t E16 = ESP_PINS_OFFSET + 16; - -static const uint8_t BUILTIN_LED = 2; - -#define SERIAL_PORT_MONITOR Serial -#define SERIAL_PORT_USBVIRTUAL Serial -#define SERIAL_PORT_HARDWARE Serial -#define SERIAL_PORT_HARDWARE_OPEN Serial - -#endif /* Pins_Arduino_h */ diff --git a/sparkfun/samd/boards.txt b/sparkfun/samd/boards.txt index c8a7e4e0..8d58000f 100644 --- a/sparkfun/samd/boards.txt +++ b/sparkfun/samd/boards.txt @@ -14,6 +14,8 @@ # License along with this library; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +menu.cache=Cache + samd21_dev.name=SparkFun SAMD21 Dev Breakout samd21_dev.vid.0=0x1B4F samd21_dev.pid.0=0x8D21 @@ -22,6 +24,7 @@ samd21_dev.pid.1=0x0D21 samd21_dev.upload.tool=bossac samd21_dev.upload.protocol=sam-ba samd21_dev.upload.maximum_size=262144 +samd21_dev.upload.maximum_data_size=32768 samd21_dev.upload.use_1200bps_touch=true samd21_dev.upload.wait_for_upload_port=true samd21_dev.upload.native_usb=true @@ -34,7 +37,7 @@ samd21_dev.build.core=arduino samd21_dev.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} samd21_dev.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld samd21_dev.build.openocdscript=openocd_scripts/arduino_zero.cfg -samd21_dev.build.variant=arduino_zero +samd21_dev.build.variant=SparkFun_SAMD21_Dev samd21_dev.build.variant_system_lib= samd21_dev.build.extra_combine_flags= samd21_dev.build.vid=0x1B4F @@ -50,6 +53,7 @@ samd21_mini.pid.1=0x0D21 samd21_mini.upload.tool=bossac samd21_mini.upload.protocol=sam-ba samd21_mini.upload.maximum_size=262144 +samd21_mini.upload.maximum_data_size=32768 samd21_mini.upload.use_1200bps_touch=true samd21_mini.upload.wait_for_upload_port=true samd21_mini.upload.native_usb=true @@ -106,6 +110,7 @@ samd21_9dof.pid.1=0x9D0F samd21_9dof.upload.tool=bossac samd21_9dof.upload.protocol=sam-ba samd21_9dof.upload.maximum_size=262144 +samd21_9dof.upload.maximum_data_size=32768 samd21_9dof.upload.use_1200bps_touch=true samd21_9dof.upload.wait_for_upload_port=true samd21_9dof.upload.native_usb=true @@ -125,4 +130,251 @@ samd21_9dof.build.extra_combine_flags= samd21_9dof.build.vid=0x1B4F samd21_9dof.build.pid=0x9D0F samd21_9dof.bootloader.tool=openocd -samd21_9dof.bootloader.file=zero/SparkFun_9DoF_Razor_M0.bin \ No newline at end of file +samd21_9dof.bootloader.file=zero/SparkFun_9DoF_Razor_M0.bin + +samd21_proRF.name=SparkFun SAMD21 Pro RF +samd21_proRF.vid.0=0x1B4F +samd21_proRF.pid.0=0x214F +samd21_proRF.vid.1=0x1B4F +samd21_proRF.pid.1=0x215F +samd21_proRF.upload.tool=bossac +samd21_proRF.upload.protocol=sam-ba +samd21_proRF.upload.maximum_size=262144 +samd21_proRF.upload.maximum_data_size=32768 +samd21_proRF.upload.use_1200bps_touch=true +samd21_proRF.upload.wait_for_upload_port=true +samd21_proRF.upload.native_usb=true +samd21_proRF.build.mcu=cortex-m0plus +samd21_proRF.build.f_cpu=48000000L +samd21_proRF.build.usb_product="SFE SAMD21 Pro RF" +samd21_proRF.build.usb_manufacturer="SparkFun" +samd21_proRF.build.board=SAMD_ZERO +samd21_proRF.build.core=arduino +samd21_proRF.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} +samd21_proRF.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +samd21_proRF.build.openocdscript=openocd_scripts/arduino_zero.cfg +samd21_proRF.build.variant=SparkFun_ProRF +samd21_proRF.build.variant_system_lib= +samd21_proRF.build.extra_combine_flags= +samd21_proRF.build.vid=0x1B4F +samd21_proRF.build.pid=0x214F +samd21_proRF.bootloader.tool=openocd +samd21_proRF.bootloader.file=zero/Sparkfun_SAMD21_ProRF.bin + +samd21_proRF_1w.name=SparkFun SAMD21 Pro RF 1W +samd21_proRF_1w.vid.0=0x1B4F +samd21_proRF_1w.pid.0=0x8D21 +samd21_proRF_1w.vid.1=0x1B4F +samd21_proRF_1w.pid.1=0x3ABA +samd21_proRF_1w.upload.tool=bossac +samd21_proRF_1w.upload.protocol=sam-ba +samd21_proRF_1w.upload.maximum_size=262144 +samd21_proRF_1w.upload.maximum_data_size=32768 +samd21_proRF_1w.upload.use_1200bps_touch=true +samd21_proRF_1w.upload.wait_for_upload_port=true +samd21_proRF_1w.upload.native_usb=true +samd21_proRF_1w.build.mcu=cortex-m0plus +samd21_proRF_1w.build.f_cpu=48000000L +samd21_proRF_1w.build.usb_product="SFE SAMD21 Pro RF 1W" +samd21_proRF_1w.build.usb_manufacturer="SparkFun" +samd21_proRF_1w.build.board=SAMD_ZERO +samd21_proRF_1w.build.core=arduino +samd21_proRF_1w.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} +samd21_proRF_1w.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +samd21_proRF_1w.build.openocdscript=openocd_scripts/arduino_zero.cfg +samd21_proRF_1w.build.variant=SparkFun_ProRF_1W +samd21_proRF_1w.build.variant_system_lib= +samd21_proRF_1w.build.extra_combine_flags= +samd21_proRF_1w.build.vid=0x1B4F +samd21_proRF_1w.build.pid=0x3ABA +samd21_proRF_1w.bootloader.tool=openocd +samd21_proRF_1w.bootloader.file=zero/SparkFun_SAMD21_ProRF_1W.bin + +RedBoard_Turbo.name=SparkFun RedBoard Turbo +RedBoard_Turbo.vid.0=0x1B4F +RedBoard_Turbo.pid.0=0x0015 +RedBoard_Turbo.vid.1=0x1B4F +RedBoard_Turbo.pid.1=0xF015 +RedBoard_Turbo.upload.tool=bossac +RedBoard_Turbo.upload.protocol=sam-ba +RedBoard_Turbo.upload.maximum_size=262144 +RedBoard_Turbo.upload.maximum_data_size=32768 +RedBoard_Turbo.upload.offset=0x2000 +RedBoard_Turbo.upload.use_1200bps_touch=true +RedBoard_Turbo.upload.wait_for_upload_port=true +RedBoard_Turbo.upload.native_usb=true +RedBoard_Turbo.build.mcu=cortex-m0plus +RedBoard_Turbo.build.f_cpu=48000000L +RedBoard_Turbo.build.usb_product="RedBoard Turbo" +RedBoard_Turbo.build.usb_manufacturer="SparkFun" +RedBoard_Turbo.build.board=SAMD_ZERO +RedBoard_Turbo.build.core=arduino +RedBoard_Turbo.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} +RedBoard_Turbo.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +RedBoard_Turbo.build.openocdscript=openocd_scripts/arduino_zero.cfg +RedBoard_Turbo.build.variant=SparkFun_RedBoard_Turbo +RedBoard_Turbo.build.variant_system_lib= +RedBoard_Turbo.build.extra_combine_flags= +RedBoard_Turbo.build.vid=0x1B4F +RedBoard_Turbo.build.pid=0x0015 +RedBoard_Turbo.bootloader.tool=openocd +RedBoard_Turbo.bootloader.file=turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.bin + +LoRaSerial.name=SparkFun LoRaSerial +LoRaSerial.vid.0=0x1B4F +LoRaSerial.pid.0=0x002A +LoRaSerial.vid.1=0x1B4F +LoRaSerial.pid.1=0x002B +LoRaSerial.upload.tool=bossac +LoRaSerial.upload.protocol=sam-ba +LoRaSerial.upload.maximum_size=262144 +LoRaSerial.upload.maximum_data_size=32768 +LoRaSerial.upload.offset=0x2000 +LoRaSerial.upload.use_1200bps_touch=true +LoRaSerial.upload.wait_for_upload_port=true +LoRaSerial.upload.native_usb=true +LoRaSerial.build.mcu=cortex-m0plus +LoRaSerial.build.f_cpu=48000000L +LoRaSerial.build.usb_product="LoRaSerial" +LoRaSerial.build.usb_manufacturer="SparkFun" +LoRaSerial.build.board=SAMD_ZERO +LoRaSerial.build.core=arduino +LoRaSerial.build.extra_flags=-D__SAMD21G18A__ {build.usb_flags} +LoRaSerial.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +LoRaSerial.build.openocdscript=openocd_scripts/arduino_zero.cfg +LoRaSerial.build.variant=SparkFun_LoRaSerial +LoRaSerial.build.variant_system_lib= +LoRaSerial.build.extra_combine_flags= +LoRaSerial.build.vid=0x1B4F +LoRaSerial.build.pid=0x002A +LoRaSerial.bootloader.tool=openocd +LoRaSerial.bootloader.file=LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.bin + +samd51_thing_plus.name=SparkFun SAMD51 Thing Plus +samd51_thing_plus.vid.0=0x1B4F +samd51_thing_plus.pid.0=0x0016 +samd51_thing_plus.vid.1=0x1B4F +samd51_thing_plus.pid.1=0xF016 +samd51_thing_plus.upload.tool=bossac18 +samd51_thing_plus.upload.protocol=sam-ba +samd51_thing_plus.upload.maximum_size=507904 +samd51_thing_plus.upload.maximum_data_size=262144 +samd51_thing_plus.upload.offset=0x4000 +samd51_thing_plus.upload.use_1200bps_touch=true +samd51_thing_plus.upload.wait_for_upload_port=true +samd51_thing_plus.upload.native_usb=true +samd51_thing_plus.build.mcu=cortex-m4 +samd51_thing_plus.build.f_cpu=120000000L +samd51_thing_plus.build.usb_product="SparkFun SAMD51 Thing Plus" +samd51_thing_plus.build.usb_manufacturer="SparkFun Electronics" +samd51_thing_plus.build.board=SAMD51_THING_PLUS +samd51_thing_plus.build.core=arduino51 +samd51_thing_plus.build.extra_flags=-D__SAMD51J20A__ -D__SAMD51__ {build.usb_flags} -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 +samd51_thing_plus.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +samd51_thing_plus.build.openocdscript=openocd_scripts/arduino_zero.cfg +samd51_thing_plus.build.variant=SparkFun_SAMD51_Thing_Plus +samd51_thing_plus.build.variant_system_lib= +samd51_thing_plus.build.vid=0x1B4F +samd51_thing_plus.build.pid=0xF016 +samd51_thing_plus.bootloader.tool=openocd +samd51_thing_plus.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16 +samd51_thing_plus.menu.cache.on=Enabled +samd51_thing_plus.menu.cache.on.build.cache_flags=-DENABLE_CACHE +samd51_thing_plus.menu.cache.off=Disabled +samd51_thing_plus.menu.cache.off.build.cache_flags= +samd51_thing_plus.bootloader.file=SAMD51/bootloader-sfe-samd51-thing-v2.0.0-34-ga8591b7-dirty.bin + +qwiic_micro_samd21e.name=SparkFun Qwiic Micro +qwiic_micro_samd21e.vid.0=0x1B4F +qwiic_micro_samd21e.pid.0=0x0019 +qwiic_micro_samd21e.vid.1=0x1B4F +qwiic_micro_samd21e.pid.1=0xF019 +qwiic_micro_samd21e.upload.tool=bossac +qwiic_micro_samd21e.upload.protocol=sam-ba +qwiic_micro_samd21e.upload.maximum_size=262144 +qwiic_micro_samd21e.upload.maximum_data_size=32768 +qwiic_micro_samd21e.upload.offset=0x2000 +qwiic_micro_samd21e.upload.use_1200bps_touch=true +qwiic_micro_samd21e.upload.wait_for_upload_port=true +qwiic_micro_samd21e.upload.native_usb=true +qwiic_micro_samd21e.build.mcu=cortex-m0plus +qwiic_micro_samd21e.build.f_cpu=48000000L +qwiic_micro_samd21e.build.usb_product="SparkFun Qwiic Micro" +qwiic_micro_samd21e.build.usb_manufacturer="SparkFun" +qwiic_micro_samd21e.build.board=QWIIC_MICRO +qwiic_micro_samd21e.build.core=arduino +qwiic_micro_samd21e.build.extra_flags=-DCRYSTALLESS -D__SAMD21E18A__ -DQWIIC_MICRO_SAMD21E -DARM_MATH_CM0PLUS {build.usb_flags} +qwiic_micro_samd21e.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +qwiic_micro_samd21e.build.openocdscript=openocd_scripts/arduino_zero.cfg +qwiic_micro_samd21e.build.variant=SparkFun_Qwiic_Micro +qwiic_micro_samd21e.build.variant_system_lib= +qwiic_micro_samd21e.build.extra_combine_flags= +qwiic_micro_samd21e.build.vid=0x1B4F +qwiic_micro_samd21e.build.pid=0xF019 +qwiic_micro_samd21e.bootloader.tool=openocd +qwiic_micro_samd21e.bootloader.file=QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.bin + +QwiicBridge.name=SparkFun Qwiic USB Bridge +QwiicBridge.vid.0=0x1B4F +QwiicBridge.pid.0=0x0D24 +QwiicBridge.vid.1=0x1B4F +QwiicBridge.pid.1=0x0D24 +QwiicBridge.upload.tool=bossac +QwiicBridge.upload.protocol=sam-ba +QwiicBridge.upload.maximum_size=262144 +QwiicBridge.upload.maximum_data_size=32768 +QwiicBridge.upload.offset=0x2000 +QwiicBridge.upload.use_1200bps_touch=true +QwiicBridge.upload.wait_for_upload_port=true +QwiicBridge.upload.native_usb=true +QwiicBridge.build.mcu=cortex-m0plus +QwiicBridge.build.f_cpu=48000000L +QwiicBridge.build.usb_product="Qwiic USB Bridge" +QwiicBridge.build.usb_manufacturer="SparkFun" +QwiicBridge.build.board=SAMD_ZERO +QwiicBridge.build.core=arduino +QwiicBridge.build.extra_flags=-D__SAMD21G18A__ -DCRYSTALLESS {build.usb_flags} +QwiicBridge.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +QwiicBridge.build.openocdscript=openocd_scripts/arduino_zero.cfg +QwiicBridge.build.variant=SparkFun_Qwiic_USB_Bridge +QwiicBridge.build.variant_system_lib= +QwiicBridge.build.extra_combine_flags= +QwiicBridge.build.vid=0x1B4F +QwiicBridge.build.pid=0x0D24 +QwiicBridge.bootloader.tool=openocd +QwiicBridge.bootloader.file=QwiicBridge/bootloader-sparkfun-qwiic-bridge.bin + +micromod_samd51.name=SparkFun SAMD51 MicroMod +micromod_samd51.vid.0=0x1B4F +micromod_samd51.pid.0=0x0020 +micromod_samd51.vid.1=0x1B4F +micromod_samd51.pid.1=0xF020 +micromod_samd51.upload.tool=bossac18 +micromod_samd51.upload.protocol=sam-ba +micromod_samd51.upload.maximum_size=507904 +micromod_samd51.upload.maximum_data_size=262144 +micromod_samd51.upload.offset=0x4000 +micromod_samd51.upload.use_1200bps_touch=true +micromod_samd51.upload.wait_for_upload_port=true +micromod_samd51.upload.native_usb=true +micromod_samd51.build.mcu=cortex-m4 +micromod_samd51.build.f_cpu=120000000L +micromod_samd51.build.usb_product="SparkFun SAMD51 MicroMod" +micromod_samd51.build.usb_manufacturer="SparkFun Electronics" +micromod_samd51.build.board=SAMD51_MICROMOD +micromod_samd51.build.core=arduino51 +micromod_samd51.build.extra_flags=-D__SAMD51J20A__ -D__SAMD51__ {build.usb_flags} -D__FPU_PRESENT -DARM_MATH_CM4 -mfloat-abi=hard -mfpu=fpv4-sp-d16 +micromod_samd51.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld +micromod_samd51.build.openocdscript=openocd_scripts/arduino_zero.cfg +micromod_samd51.build.variant=SparkFun_SAMD51_MicroMod +micromod_samd51.build.variant_system_lib= +micromod_samd51.build.vid=0x1B4F +micromod_samd51.build.pid=0xF020 +micromod_samd51.bootloader.tool=openocd +micromod_samd51.compiler.arm.cmsis.ldflags="-L{build.variant.path}" -larm_cortexM4lf_math -mfloat-abi=hard -mfpu=fpv4-sp-d16 +micromod_samd51.menu.cache.on=Enabled +micromod_samd51.menu.cache.on.build.cache_flags=-DENABLE_CACHE +micromod_samd51.menu.cache.off=Disabled +micromod_samd51.menu.cache.off.build.cache_flags= +micromod_samd51.bootloader.file=SAMD51/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.bin + diff --git a/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.bin b/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.bin new file mode 100644 index 00000000..bd115af8 Binary files /dev/null and b/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.bin differ diff --git a/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.hex b/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.hex new file mode 100644 index 00000000..d72e5fe4 --- /dev/null +++ b/sparkfun/samd/bootloaders/LoRaSerial/SparkFun-LoRaSerial-UF2-Bootloader.hex @@ -0,0 +1,490 @@ +:10000000D82D002089020000850200008702000030 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000008502000049 +:100030000000000000000000850200007D020000BA +:100040008502000085020000850200008502000094 +:100050008502000085020000850200008502000084 +:100060008502000085020000850200008502000074 +:100070008502000085020000850200008502000064 +:100080008502000085020000850200008502000054 +:100090008502000000000000000000008502000052 +:1000A0008502000085020000850200008502000034 +:1000B00000000000074B1A00197DC907FCD520215C +:1000C000FF31198304494008D8611980137DDB078B +:1000D000FCD570470040004102A5FFFF10B50400A9 +:1000E000044B9C4200D910BD20000134FFF7E2FF11 +:1000F000FF34F5E7FFFF0300002330B59A4200D13B +:1001000030BD9C000D5901330551F7E7F0B580254E +:10011000104B114E5C68114FAC435C60002A00D15B +:10012000F0BD1400102A00D91024121B1E801D7D62 +:10013000ED07FCD5A400A44600240D590551043454 +:100140006445FAD1001909191F801C7DE407FCD50C +:10015000E4E7C0460040004144A5FFFF04A5FFFFBF +:10016000802270B5002304000D005200E958E058C9 +:10017000814203D104339342F8D170BD2000FFF7D0 +:1001800099FF402229002000FFF7C0FFF5E700009B +:10019000024A53785BB2002BFBDB7047000C004037 +:1001A00010230249CA681A42FCD070470008004078 +:1001B0001E21F8B50226254A254C5368254D8B4350 +:1001C00033435360A660FFF7E3FF234B6360FFF701 +:1001D000DFFFAE84FFF7E4FF204B1B689B0E3F2B35 +:1001E00000D1203B002602271D4A9B0213431D4AD3 +:1001F000EA62AB62AE84FFF7D3FF1B4BAB84FFF721 +:10020000CFFFAB8C3B43AB84FFF7CAFF3F22638831 +:10021000934380221F4367806388D2011343638026 +:10022000A660FFF7B5FF114B6360FFF7B1FFC02178 +:100230000F4A104B10485360036A09061B021B0A41 +:100240000B430362072396601360F8BD0040004132 +:10025000000C0040000800400600010024608000FF +:10026000FF01000080BB0A1C2405000000070300FA +:1002700010E000E0E703000000ED00E010B500F042 +:10028000EDF810BDFEE7FEE71E4A1F4B70B51F4993 +:100290009A4232D100211E4B1E4A934230D3FF2294 +:1002A0001D4B032193431D4A0C2593600222082411 +:1002B00030261B4B1B485A62C3788B431343C370D1 +:1002C000C378AB432343C370174B987BB0430600FE +:1002D000202030439873987BA84304439C73987BF9 +:1002E000884302439A738023104A51680B4353603A +:1002F00000F084FEFEE701CA01C38B42FBD3C9E7CD +:1003000002C3CAE7A81C000000000020CC010020A6 +:10031000CC010020D40D00200000000000ED00E022 +:10032000FC70004100500041004800410040004185 +:10033000F0B5124E7388002B17D108241A0292B21E +:1003400015B2AC4667465500AAB2002F02DA0C4A35 +:100350005540AAB2013CA4B2002CF1D15C0032534A +:100360008022013352009342E7D10B0A43405B00E5 +:10037000F05A0902484080B2F0BDC046CC010020CE +:100380002110000001230002984200D87047C046A7 +:100390000133F9E770B505001C2400200F260B007F +:1003A000E3403340002A09D1002B07D1002C0BD0A9 +:1003B000002809D1043C231DF1D170BD092B03DDB8 +:1003C00037332B540130F5E73033FAE7054B064A53 +:1003D0001A60BFF34F8F054B054ADA60BFF34F8FAA +:1003E000FEE7C046FC7F0020EF6926F000ED00E04C +:1003F0000400FA0510B50B4A1368002B0ED10A4908 +:1004000011600A490A6801320A600949086800282F +:1004100006D0824204D30B60FFF7D8FF013B136084 +:1004200010BDC046D4030020DC050000000A0020F7 +:10043000040A0020054B064A1A60BFF34F8F054B94 +:10044000054ADA60BFF34F8FFEE7C046FC7F00200D +:10045000EF6916F000ED00E00400FA0510B5194A46 +:1004600019491368013313600A68002A0CD0174831 +:100470001018834203D18024154824040460934259 +:1004800001D100230B6010BD1248DBB20278002BB3 +:1004900010D180210E4B0904196011000A39C9B22C +:1004A0000D4BF02902D91978494219701B78D218DE +:1004B0000270E8E79342E6D18022084B12041A60EA +:1004C000E1E7C046CC030020D003002018FCFFFF6A +:1004D00098440041010000200000002094440041A5 +:1004E000074B084A1B681168994207D2FA21C900D4 +:1004F0005B1813608022044B12041A607047C046D8 +:10050000CC030020D003002094440041044B8022FF +:1005100019001204883198330A601A607047C04687 +:100520000044004170470000202370B5354A0F2079 +:10053000D1690B43D361012233490B7813430B700C +:10054000324B19788143197006211C7821431970A8 +:100550002F490C7822430A701A7802401A706022E0 +:1005600019780A431A702B4B2B4A5A805A78D209B1 +:10057000FCD12A4B013219780A431A709A78D207B3 +:10058000FCD41F2026490A68520B0240824200D147 +:1005900005221C8D234D024092012C4022431A85D6 +:1005A0000A68920C02401F2A00D1023A1F24188DBB +:1005B0002240A043024307201A850A68D20D024058 +:1005C000824200D10322198D0240174812030140D4 +:1005D0000A437F211A851A7814480A401A700422A7 +:1005E00019780A430C211A7058621A898A431A81B1 +:1005F0001A890B398A431A8180220021520001F0A6 +:100600003EFA70BD00040040584400413C440041A3 +:1006100059440041000C00400640000000500041D9 +:10062000246080003FF8FFFFFF8FFFFF4C0A00208F +:10063000F7B51C00314B06005B6A0F0015000193F3 +:10064000002C05D1443454432D4BE418FFF7D2FE5F +:1006500063782278934210D2D51ABD4200D93D006A +:10066000002E08D0211DC9182A00300001F0FEF923 +:1006700063785B1963702800FEBD019BA1786A0155 +:10068000D318002911D1211D196059681D48890B03 +:10069000890359605968014059601B495518402128 +:1006A0002879014329710121A170144900255118AD +:1006B000019116495218127AD207DCD55D68A278EA +:1006C000EDB22570022A04D11968201D2A0001F01C +:1006D000CDF9BD4200D93D00002E0CD06570211D22 +:1006E0002A00300001F0C2F90122019BFF331A7287 +:1006F0000023A370BFE76670F6E7C04600500041D4 +:100700004C0B0020FF3F00F000510041FF50004122 +:1007100010B50023FFF78CFF10BDF8B505000C00E5 +:1007200016001F00002C00D1F8BD210028003B005E +:100730003200FFF77DFF241A2D18F3E7F8B50E00FD +:100740001F4955014C6A2C19002B1BD063695B00B3 +:100750005B08636120616369B2049B0B920C9B038D +:10076000134363616369174A1748134063612A188A +:10077000022380211500137291712A7A1A42FCD04B +:100780003000F8BD012163695B005B0F03339940C2 +:10079000B14208D8043A531E9A416369D2075B00FC +:1007A0005B081343D5E744275743084A0437BF186B +:1007B00001003200380001F059F93800CAE7C0469C +:1007C00000500041FF3F00F0FF5000414C0B002063 +:1007D00010B50023FFF7B2FF10BD000010B5054BA8 +:1007E0001B888B4200D90B0000221900FFF7F0FF95 +:1007F00010BDC046FA03002007B500216B460A0071 +:10080000D81D0170FFF7E4FF07BD0000F0B59BB0F5 +:10081000FFF7F0FD0822C04CA38B1A400392039B04 +:10082000BE4A002B2ED00823A38380231121402011 +:10083000A372C024517090715371B94BB94D59686E +:10084000A405294021435960596929400C43B64900 +:100850005C611960B549B64C196159680C4080213A +:100860008902214359605968890B89035960507185 +:100870000022B04B1A70AF4B1878431E9841C0B29B +:100880001BB0F0BD1021137A8C460B42F3D01172CD +:10089000A949A94D8979A84B0191A7490198CF7918 +:1008A0009B883902014309B2029169460989A2482D +:1008B0000091067AC07AAD7A000228439E499F4D86 +:1008C000497A2880402509020E439D4836B2B1B2CC +:1008D0005571834200D1B4E13AD88120400083426F +:1008E00000D1C3E117D8822B00D191E108D8802B29 +:1008F00000D188E1812B00D185E120239371BAE7F3 +:10090000802149008B42F8D00221FF318B42F4D183 +:10091000FFF772FFAFE78B48834204D00BD8A221C8 +:10092000FF318B42E9D10021082208A801F0A7F885 +:10093000082108A8CDE0C02080008342DDD0E7D8A0 +:1009400040388342D9D10729D7D1A3317E48C0E0AE +:100950007E498B42DCD000D99AE07D498B4214D885 +:1009600001398B4200D3ADE07A498B42DBD0603154 +:10097000FF318B42C1D1FFF73FFF8023029A5B42D8 +:100980001343654ADBB2937275E788216948090110 +:100990008B4200D1A2E180318B42AED1029B302745 +:1009A0000370FFF729FFA02303225B00E254C0225B +:1009B0005B4B5C49586C92050840104358644620D4 +:1009C000FF30255464488026186490204000275446 +:1009D000586B0840104358639220400026545F48EB +:1009E00080261863B02040002554586F084058678F +:1009F000B2204000265403263C302654FC3884465E +:100A00009C44604606680E4016430660A626FF36E4 +:100A1000A5551E005248A0363060C0267600A75566 +:100A20001F0094373E6880200E4016433E60C22669 +:100A30007600A0551E004B4F90363760E0264427C5 +:100A40007600A7550436A555A055C42084469C447D +:100A5000604606680E4016430660D42084469C44D7 +:100A6000604606680E4016430660F0268020760039 +:100A7000A7550436A555A0551C00E4342068F4336E +:100A8000084010432060186801400A431A60F2E6EB +:100A900035498B4200D13BE705D834498B4200D120 +:100AA00036E7334932E733498B4200D130E73249E8 +:100AB0008B4200D10FE131498B4200D01DE7082164 +:100AC0002F4806E0802300995B00994204D112214F +:100AD0002C48FFF783FECEE6802300999B009942C5 +:100AE00002D199212848F4E7032F7CD1019B032BE5 +:100AF00000D902E708AC48220021200000F0BFFF27 +:100B0000019B6770002B43D1043323701F4B63801C +:100B100021782000DDE7C04600500041FF50004131 +:100B20004C0A0020FFFFFF8F0C0A0020500B002012 +:100B3000FF3F00F0D8030020080A0020FA0300203D +:100B400002030000A1020000F000002021090000C3 +:100B500081060000A1030000D80B0020940B0020A8 +:100B6000A40C0020600C002021200000210A0000BD +:100B7000210B000021220000A1FE0000A1210000A5 +:100B8000E8000020AC1A000040000020090400002A +:100B900004AE3200524B23CB23C200252F001B682A +:100BA0001360AB004F4AF358D01919680122FFF7C0 +:100BB000F1FB01353F18042DF3D10023494AD355E9 +:100BC000494B4A4A9B799B009D58280000F05FFFE3 +:100BD00023000130400020702A7802330135002ABA +:100BE00096D01A70F8E70F2F02D13921404870E7EC +:100BF000212F02D109213F486BE7222F00D07CE64C +:100C000021213D4865E7002308A80380022160E711 +:100C1000039B08A803800823194200D06DE6073320 +:100C200019400831413349011E4205D0334BC918E0 +:100C30008B799B06DB0FE8E7304BC9188B79DB0615 +:100C4000F8E70F230B4000D157E608200140009839 +:100C5000084300D051E60833284A5B019B1832064E +:100C600002D520225A7153E66246FBE70F230B4060 +:100C700000D142E6082001400098084300D03CE63D +:100C80005B01320613D51E491C4A9A185B182021B5 +:100C9000D879084200D13BE659711B7A2B4200D12A +:100CA00036E613004022FF331A723E3ADAE7604616 +:100CB0001349124A9A185B18D979014200D127E6E4 +:100CC000202158711B7A0B4200D121E61300FF331B +:100CD00019720122C6E7002308A803800121F8E663 +:100CE0009C1A0000D9030020080A0020FC1A00000A +:100CF00004000020DC000020C01A00000050004169 +:100D0000FF50004110B5FFF70FFC0022034B1A7093 +:100D10000223034A11780B43137010BDD80300203F +:100D20000050004110B50C000122FFF751FD2000DA +:100D300010BD10B50C000122FFF74AFD200010BDC8 +:100D400070B504000D00FFF761FD03000020834231 +:100D500004D0022229002000FFF7DAFC70BD70B534 +:100D600005000C00FFF752FD002807D000230222E7 +:100D700021002800FFF7D1FC200070BD0400FBE734 +:100D800030B500232025934200DB30BD0C78002CC9 +:100D900003D00131C4540133F5E72C00FAE7000019 +:100DA000F8B580220C00050092000021200000F020 +:100DB00066FE002D0CD13E224B49200000F056FE6D +:100DC000FF2355225B00E254484B9218E254F8BDD1 +:100DD0007E2D24D86B1E3E2B00D93F3B002B11D01B +:100DE0001B02581C424D434EFF301A1F591CAA4289 +:100DF00003D8B34211D08BB223800B00023481425E +:100E0000F3D1E4E7F0222100FF2022700A31621CB6 +:100E10009142E5D010700132FAE7374BECE7822DB2 +:100E200031D87F2DD3D130490B222B312000FFF751 +:100E3000A7FF80272823314EE3727D3D3F03F368EF +:100E400020343800002B02D0180000F020FE030AE6 +:100E50006377030C2077A377000E2B0AE077A57643 +:100E6000E3760B2231002000FFF78AFF67224D2333 +:100E700001355242ADB22274637422766376103625 +:100E8000052DDCD1A3E72B00833B012B0CD81B4A9B +:100E90001B01D318DD68280000F0F9FD29000200CD +:100EA000200000F0E3FD92E7154B853D29029942B1 +:100EB00000D98CE7134B144A2360144B6360FE2364 +:100EC0005B00E2508023DB00A3618023A0688022C6 +:100ED0009B0103432000A3600D4B52006561E1605C +:100EE0002261E3612030DCE70C1B0000FF01000001 +:100EF000FF03000003040000FFFF0000C81B000008 +:100F0000FFFF03005546320A306FB10A57515D9E0C +:100F1000882BED6870B516001D000A682E4B0C007A +:100F20009A4251D12D4B4A689A424DD1FE2252002D +:100F30002B4B8A589A4247D18B689A0403D5294A89 +:100F4000C969914240D1DB0711D4802322695B003B +:100F50009A420CD1E068C3B2002B08D1224B234A3D +:100F6000C318934203D821002031FFF7F9F8002D70 +:100F70002BD0A369002B28D029681D4A8B4206D0AC +:100F8000934201D8002901D001235B422B606369A1 +:100F9000934219D80721012219408A40DB08EB1837 +:100FA000197AD2B20A4204D168680A4301301A722F +:100FB00068606A682B689A4206D3002E04D10D4BF4 +:100FC0001B681E330C4A136070BD002EFCD1094B08 +:100FD0001B682D33FF33F5E75546320A57515D9EA6 +:100FE000306FB10A882BED6800E0FFFFFFDF0300E0 +:100FF00063040000000A0020040A0020F8B53A4DFE +:10100000AB68002B00D0FEE7FFF780FA374B1E6875 +:10101000374BF218F8239B029A4213D8354B364AC5 +:101020001968364C364B914232D11978354AC90786 +:1010300002D4216891422BD0334B22601B68334A83 +:1010400032331360FFF7B4F8BFF35F8F62B6FFF778 +:1010500059FE4020FFF766FA80270A2301262C4D0F +:10106000FF012B70FFF7D2FB2A4C00280AD023780F +:10107000DBB2002B05D1254A38001360FFF752FA86 +:101080002E7026702378002B24D000F0BDFAFCE7E8 +:101090001B78DB07DB0F0DD00023802223601E4B63 +:1010A00012041A6080239B011A6882F30888AB60DF +:1010B0003047C7E72168194A914201D12360C1E74F +:1010C0002168104B9942E7D0FA2022604000FFF7D8 +:1010D00059F9E1E72378002BC4D1FF33C046013B27 +:1010E000002BFBD1BEE7C04600ED00E0042000006D +:1010F00000E0FFFFB42000007CB0EE87FC7F002002 +:1011000038040040EF6926F0000A0020040A00209D +:1011100000000020FC03002094440041EF6916F019 +:1011200010B5054C12220021200000F0A8FCF0238D +:101130002370E63BE37110BD3B060020F8B50500C7 +:101140000E0017000024AB68A34200D8F8BD802130 +:10115000AA7833008900E868FFF7DFFA80235B0193 +:10116000E01801223B00E968FFF7D4FE0134EAE70A +:1011700070B5130006000C00150000200A000121C4 +:10118000FFF756FA0023984206D02B0022001F21B9 +:101190003000FFF74DFA0123180070BD10B504228E +:1011A0000D210248FFF714FB10BDC0469A01002034 +:1011B00010B50B480B494279037912021A4383791F +:1011C0001B041A43C3791B0613431A0A0B714A7195 +:1011D0001A0C1B0E8A71CB71FFF7E0FF10BDC046E1 +:1011E0001C0600209A01002070B504220D00FFF7B4 +:1011F000EFFA164C85420FD0FFF792FF012304222D +:101200002373134B9A700022DA701A715A719A7113 +:101210001A735A73FFF7CCFFFFF782FF0023237383 +:10122000637A217A1B020B43A17A09040B43E17A0A +:1012300009061943491B0B0A217263720B0C090E34 +:10124000A372E172FFF7B4FF70BDC0469A0100209F +:101250003B06002070B5184C142205000021200028 +:1012600000F00DFC154A002D1FD021000823D07D71 +:1012700008313F26527C32401C2A01D0B24205D1AF +:101280000F4A0C330A800522DBB2CA70191C834254 +:1012900000D9011CC9B2002D0BD0023B9BB21B022E +:1012A00023802000FFF7A0FF70BDD07C211D042308 +:1012B000DFE7013B2370F4E7000600201C06002056 +:1012C0001C0A0000F0B5070000242B4B85B0597CA8 +:1012D00003AAD170997C9170D97C5170197D1170DD +:1012E000997D02AAD170DB7D937053880193019B95 +:1012F000A34208D8FFF714FF0022204B1A73FFF710 +:1013000057FF05B0F0BDFFF781FA0028F9D0039B25 +:101310001B4EE518002F1FD031002800FFF740FDBD +:101320008021042289003000FFF752FA134A013469 +:10133000517A137A09021943937A1B041943D37A19 +:101340001B060B430F495B18190A13725172190CD3 +:101350001B0E9172D372CAE780213B003000052238 +:101360008900FFF7DAF9084B3A0031002800FFF74F +:10137000D1FDFFF7B5F8D9E71C0600209A0100203F +:101380000004002000FEFFFF50060020F0B585B0ED +:1013900000F03CFB454E002205213000FFF7E8FE3F +:1013A000002858D0737A357A1B022B43B57A404C0B +:1013B0002D042B43F57A00272D061D432B0A63725B +:1013C0002B0CA3722B0E2572E372F37B1E2B1BD00A +:1013D00021D8122B41D013D8BB4215D0032B31D0CA +:1013E000FFF79EFE012305222373324B9A700022E1 +:1013F000DA701A715A719A711A7320325A7307E0AF +:101400001A2B39D01B2BEBD1FFF78AFE0023237355 +:10141000FFF7CEFE1FE0282B34D00BD8232B35D07E +:10142000252BDDD1802324489B024360234B0821D8 +:1014300003600EE02F2BE7D05A2B21D02A2BCFD1DF +:10144000380020E0F37C191C122B00D91221194816 +:10145000C9B2FFF7C9FE05B0F0BD194C194920000B +:1014600018220830FFF78CFCF37C191C242B00D9C0 +:101470002421C9B22000ECE73800FFF7EBFEEAE7D1 +:101480000120FAE70120FFF71DFFE4E70C260E49D3 +:10149000320001A800F0EAFAB54203D92672677259 +:1014A000A772E7720C2101A8D3E7C0461C060020F2 +:1014B0009A0100203B0600201406002000003E7F19 +:1014C000A8010020EA1A0000611C000072B6BFF3F8 +:1014D0005F8F044B044A9A829A830022034B9A60DE +:1014E0007047C04600500041FF03000000ED00E0DF +:1014F000F0B5C7B00FAF0400FFF7E8FF44220021AA +:10150000380000F0BCFA9822002120A800F0B7FAB9 +:1015100002230F21BB70A37862780B40A37063682D +:101520000A400893002307AD264E627009932B737F +:10153000012220ABE16824480796FFF7EBFC20AAC4 +:1015400039002000FFF7FAFD627801230D21280001 +:10155000FFF7F4F80196002607ADA1783A002800BD +:10156000FFF706FE002823D0019B03AE03936B68B0 +:101570007360AB68B36000233373EB7B002B10D038 +:101580002A2B1CD1ED8A02AB6DBA5D80ADB2A5608D +:1015900020AA39002000FFF7D1FDB3686D025D1B62 +:1015A000B560627801230D213000FFF7C7F8D2E75C +:1015B000064B9E4201D9FEF709FF0136CCE7FEF744 +:1015C00039FFEEE755534253FF0F0000F8240100A6 +:1015D00030B5EFF30883054C2360036883F3088874 +:1015E0004568A847236883F3088830BDC80D0020EC +:1015F00007B5010001226846FEF7CCFE08216846C7 +:10160000FFF790FB07BD0000F7B57A230022804C5E +:10161000804922600B7000920193FFF7B7FE7E4D68 +:1016200040212800FFF78CFB7C4B1860009B2B545B +:10163000002801D0FEF754FF794B009A1D60794BCA +:101640001A607848754B02681F68BA42E5D2744D3B +:1016500029680B78FF2B36D0734E232B00D0B3E0D4 +:101660006C4B1B78532B33D133680132013102604C +:101670002960BA1A9A4200D91A006C4D20682A6073 +:1016800000F0F4F9674829680368654ACB18013B04 +:10169000036010684B1EC3181360634B644D1B68D6 +:1016A0002970C9B28B4203D9591A2068FFF757FB3A +:1016B000C046584B019A1A705B4B009A1A60584A00 +:1016C000136801331360574A136801331360B8E796 +:1016D000522B04D131682068FFF72BFBE9E74F2B31 +:1016E00003D1336822681370E3E7482B03D13368D2 +:1016F00022681380DDE7572B0AD14E4B22689A42AD +:1017000002D14D48FEF70EFF236832681A60D0E719 +:101710006F2B04D101212068FFF704FBC9E7682B78 +:1017200005D1022123681B8833603000F4E7772B52 +:1017300004D1236804211B683360F6E7472B09D1E5 +:101740003068FFF745FF3D4B1B78002BB1D00121DE +:101750003B48E1E7542BACD04E2BAAD0562B02D1FC +:101760002A213848D8E7582B05D13068FEF7B6FC57 +:1017700003213548D0E7592B0DD132682068334B0F +:10178000002A03D1186003213148C5E7920819687F +:10179000FEF7BCFCF7E75A2B8BD13768002625688B +:1017A000EF19AF4209D101212A48FFF7BBFA3000F7 +:1017B000FFF71EFF03212848AEE728783100FEF727 +:1017C000B7FD01350600ECE71A00303AD1B209291D +:1017D00004D833681B011343336070E71A00413AA1 +:1017E000052A03D83268373B1201F4E71A00613A40 +:1017F000052A03D83268573B1201ECE72C2B03D1A2 +:1018000033682360009BE7E7024A1370FAE7C0469B +:10181000C40D0020780D0020800D0020700D0020E8 +:10182000740D00207C0D0020CC0D0020D00D002078 +:101830006C0D00200CED00E040004000E8060020A8 +:10184000971C00006D1C0000991C0000EC06002095 +:101850009D1C0000A11C0000A31C0000F8B50300A3 +:10186000473304001A78402103000020FEF7E0FE11 +:10187000002801D10020F8BD0023257923706BB228 +:10188000002BF7DB3F272000A61DF38F2F404830A9 +:10189000C018611D3A0000F0E9F83F23F08F9D4326 +:1018A000C01980B2002D01D1F087E3E70023F38750 +:1018B000E1E7F0B506000C001F0093B001923F2550 +:1018C000AC4203DC2500002F00D140373B0002AAC8 +:1018D0002B43137002AB31002A00581C00F0C6F8ED +:1018E0006B4640211A7902A80123FEF727FF7619DB +:1018F000641BE4D113B0F0BD030010B547331A7870 +:10190000043148300023FFF7D4FF10BDF7B50400C1 +:10191000FFF7A4FF002841D0230048339A88A06C29 +:101920001A80002201385A80082865D800F094F8FF +:1019300015052327252A473E3700314E300000F099 +:10194000A6F80500200031004C302A0000F08EF887 +:1019500029002000FFF7D0FF20E00123E364FF33DC +:1019600023658023DB006365A0235B00A365254B13 +:101970001421E365EDE7FEF729FD0021E9E7FEF715 +:1019800059FDFAE720000021FFF7B6FF206D1E4B3E +:10199000984203D921005431FEF7E2FBF7BD210044 +:1019A000626D5831206DFEF7A7FBE6E72000656DFC +:1019B000216D4C302A00FEF79FFBA900C9E70027E4 +:1019C000236D666D5D1CFF35BE4201DC7100C0E712 +:1019D00000216B1EFF3B5A1C18780192FEF7A8FCF1 +:1019E000019B0100AB42F6D123007A004C33013554 +:1019F00098520137FF35E7E701225A80BDE7C0461C +:101A0000F81B0000882BED68FF1F00000748062226 +:101A1000030010B547331A70FFF778FF0448072218 +:101A2000030047331A70FFF771FF10BDF006002066 +:101A30007808002010B5E2B00400FFF747FDC4228B +:101A400000215200684600F01AF847236B441C70CE +:101A50006846FFF75BFFFBE702B47146490849009F +:101A6000095C49008E4402BC7047C046002310B593 +:101A70009A4200D110BDCC5CC4540133F8E7030096 +:101A80001218934200D1704719700133F9E700230F +:101A9000C25C0133002AFBD1581E70470CA08000A5 +:101AA00040A0800044A0800048A0800012011002E5 +:101AB000EF0201404F1B2A00014201020301000016 +:101AC0000697FF0901A101150026FF007508954042 +:101AD0000901810295400901910295010901B102B4 +:101AE000C0537061726B46756E0053414D44323184 +:101AF000204C6F526153657269616C0000000000F8 +:101B0000E11A0000EA1A0000D9030020EB3C9055CE +:101B10004632205546322000020101000240007E7C +:101B20003EF03F0001000100000000000000000046 +:101B300000002942004200535041524B46554E008E +:101B4000000046415431362020203C21646F6374EC +:101B50007970652068746D6C3E0A3C68746D6C3EEB +:101B60003C626F64793E3C7363726970743E0A6CC8 +:101B70006F636174696F6E2E7265706C6163652846 +:101B80002268747470733A2F2F7777772E73706191 +:101B9000726B66756E2E636F6D2F70726F647563F6 +:101BA00074732F313933313122293B0A3C2F73634F +:101BB000726970743E3C2F626F64793E3C2F68748A +:101BC0006D6C3E0A00000000494E464F5F5546329C +:101BD00054585400F81B0000494E4445582020201A +:101BE00048544D004A1B000043555252454E542064 +:101BF000554632000000000055463220426F6F7497 +:101C00006C6F616465722076332E342E302D38313E +:101C10002D67613637396462652053464857524F05 +:101C20000D0A4D6F64656C3A2053414D44323120AA +:101C30004C6F526153657269616C0D0A426F61723B +:101C4000642D49443A2053414D44323147313841A3 +:101C50002D4C6F526153657269616C2D76310D0A9E +:101C6000000000000800003E800200020076312ED5 +:101C700031205B41726475696E6F3A58595A5D2024 +:101C800046656220313320323032332031303A33EE +:101C9000333A35380A0D000600580A0D00590A0D6E +:081CA000005A00230A0D0000A8 +:101CA80001C80000050F3900021810050038B608F1 +:101CB80034A909A0478BFDA0768815B665000101F7 +:101CC800001C100500DF60DDD88945C74C9CD26533 +:101CD8009D9E648A9F00000306AA0002000000007F +:101CE8000902990005010080FA080B0002020201AE +:101CF800000904000001020201000524001001048B +:101D080024020605240600010524010301070583B2 +:101D1800030800FF09040100020A0000000705810A +:101D28000240000007050202400000090402000208 +:101D38000806500007058402400000070505024018 +:101D4800000009040300020300000009210001004B +:101D5800012221000705860340000107050603400C +:101D680000010904040002FF2A0100070587034057 +:101D780000010705070340000100000009040300F3 +:101D8800020300000300000000C201000000080078 +:101D98000A00000000000306AA0008000200040070 +:101DA800A0001400030057494E555342000000009C +:101DB8000000000000008400040007002A0044001E +:101DC8006500760069006300650049006E007400D4 +:101DD80065007200660061006300650047005500F9 +:101DE800490044007300000050007B0039003200B5 +:101DF8004300450036003400360032002D0039001B +:101E08004300370037002D003400360046004500F7 +:101E18002D0039003300330042002D00330031001B +:101E280043004200390043003500420042003300BD +:101E3800420039007D000000000055534253000065 +:101E480000000000000000000080020220000000E6 +:101E5800000000000000000000000000000000007A +:0C1E68000000000000000000312E3030AF +:101FF00000000000351A0000F1140000F81B00007A +:00000001FF diff --git a/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board.mk b/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board.mk new file mode 100644 index 00000000..0a90fdf6 --- /dev/null +++ b/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board.mk @@ -0,0 +1,2 @@ +CHIP_FAMILY = samd21 +CHIP_VARIANT = SAMD21G18A diff --git a/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board_config.h b/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board_config.h new file mode 100644 index 00000000..c60c2a50 --- /dev/null +++ b/sparkfun/samd/bootloaders/LoRaSerial/sparkfun-samd21-loraserial/board_config.h @@ -0,0 +1,15 @@ +#ifndef BOARD_CONFIG_H +#define BOARD_CONFIG_H + +#define VENDOR_NAME "SparkFun" +#define PRODUCT_NAME "SAMD21 LoRaSerial" +#define VOLUME_LABEL "SPARKFUN" +#define INDEX_URL "https://www.sparkfun.com/products/19311" +#define BOARD_ID "SAMD21G18A-LoRaSerial-v1" + +#define USB_VID 0x1B4F +#define USB_PID 0x002A + +#define LED_PIN PIN_PB23 + +#endif diff --git a/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.bin b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.bin new file mode 100644 index 00000000..cc1d7b23 Binary files /dev/null and b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.bin differ diff --git a/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.elf b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.elf new file mode 100644 index 00000000..b6b51e33 Binary files /dev/null and b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.elf differ diff --git a/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.hex b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.hex new file mode 100644 index 00000000..6d1bf194 --- /dev/null +++ b/sparkfun/samd/bootloaders/QwiicBridge/bootloader-sparkfun-qwiic-bridge.hex @@ -0,0 +1,487 @@ +:10000000D82D002089020000850200008702000030 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000008502000049 +:100030000000000000000000850200007D020000BA +:100040008502000085020000850200008502000094 +:100050008502000085020000850200008502000084 +:100060008502000085020000850200008502000074 +:100070008502000085020000850200008502000064 +:100080008502000085020000850200008502000054 +:100090008502000000000000000000008502000052 +:1000A0008502000085020000850200008502000034 +:1000B00000000000074B1A7DD207FCD52022FF323A +:1000C0001A83054A4008D8611A801A7DD207FCD5E8 +:1000D0007047C0460040004102A5FFFF70B5802573 +:1000E0000400ED02AC4200D370BD20000134FFF7E4 +:1000F000E1FFFF34F6E7002330B59A4200D130BD6E +:100100009C000D5901330551F7E70000F0B580253B +:10011000104C114E6368114FAB436360002A00D14D +:10012000F0BD1300102A00D91023D21A2680257D95 +:10013000ED07FCD59B009C460023CD58C5500433E9 +:100140006345FAD1C018C9182780237DDB07FCD589 +:10015000E4E7C0460040004144A5FFFF04A5FFFFBF +:10016000802270B5002304000D005200E958E058C9 +:10017000814203D104339342F8D170BD2000FFF7D0 +:1001800099FF402229002000FFF7C0FFF5E700009B +:10019000024A53785BB2002BFBDB7047000C004037 +:1001A00010230249CA681A42FCD070470008004078 +:1001B0001E21F8B50226254A254C5368254D8B4350 +:1001C00033435360A660FFF7E3FF234B6360FFF701 +:1001D000DFFFAE84FFF7E4FF204B1B689B0E3F2B35 +:1001E00000D1203B002602271D4A9B0213431D4AD3 +:1001F000EA62AB62AE84FFF7D3FF1B4BAB84FFF721 +:10020000CFFFAB8C3B43AB84FFF7CAFF3F22638831 +:1002100093431F43802367806288DB01134363801D +:10022000A660FFF7B5FF114B6360FFF7B1FFC02178 +:100230000F4A104B10485360036A09061B021B0A41 +:100240000B430362072396601360F8BD0040004132 +:10025000000C0040000800400600010024608000FF +:10026000FF01000080BB0A1C2405000000070300FA +:1002700010E000E0E703000000ED00E010B500F042 +:10028000FBF810BDFEE7FEE72449254870B5814222 +:100290000AD0244BC41E0022A34203D303331A1AEC +:1002A0009208920001F0DAFB1F48204BC11E002289 +:1002B000994203D803331A1A92089200002101F0E0 +:1002C000D6FBFF221A4B032193431A4A0C25936055 +:1002D000022208243026184B18485A62C3788B43F0 +:1002E0001343C370C378AB432343C370144B987B51 +:1002F000B0430600202030439873987BA843044302 +:100300009C73987B884302439A7380230D4A5168FB +:100310000B43536000F064FEFEE7C046781C00000B +:1003200000000020CC010020CC010020D40D0020D2 +:100330000000000000ED00E0FC70004100500041B2 +:100340000048004100400041F7B5134D01906B8813 +:10035000002B18D1082738001A0292B214B2A44612 +:1003600066465400A2B2002E02DA0C4A5440A2B2F1 +:10037000013880B20028F1D158002A52802201337E +:1003800052009342E7D1019A0B0A53405800285A71 +:100390000902484080B2FEBDCC01002021100000BF +:1003A00001230002984200D87047C0460133F9E7A4 +:1003B00070B505001C2400200F260B00E3403340DD +:1003C000002A09D1002B07D1002C0BD0002809D11D +:1003D000043C231DF1D170BD092B03DD37332B54B1 +:1003E0000130F5E73033FAE7054B064A1A60BFF3F0 +:1003F0004F8F054B054ADA60BFF34F8FFEE7C046CB +:10040000FC7F0020EF6926F000ED00E00400FA0513 +:1004100010B50B4A1368002B0ED10A4911600A4926 +:100420000A6801320A6009490868002806D0824239 +:1004300004D30B60FFF7D8FF013B136010BDC0462B +:10044000DC030020DC050000D8030020D0030020DE +:10045000054B064A1A60BFF34F8F054B054ADA6019 +:10046000BFF34F8FFEE7C046FC7F0020EF6916F018 +:1004700000ED00E00400FA0510B5194A19491368A7 +:10048000013313600A68002A0CD017481018834201 +:1004900003D18024154824028461934201D10023B2 +:1004A0000B6010BD1248DBB20278002B10D1802106 +:1004B0000E4B0902996111000A39C9B20D4BF0299E +:1004C00002D91978494219701B78D2180270E8E7EE +:1004D0009342E6D18022054B12025A61E1E7C04601 +:1004E000CC030020D403002018FCFFFF004400418F +:1004F0000100002000000020074B084A1B6811681B +:10050000994207D2FA21C9005B1813608022044B7C +:1005100012025A617047C046CC030020D403002069 +:10052000004400418022024B12029A609A61704797 +:100530000044004170470000202370B5354A0F2069 +:10054000D1690B43D361012233490B7813430B70FC +:10055000324B19788143197006211C782143197098 +:100560002F490C7822430A701A7802401A706022D0 +:1005700019780A431A702B4A2B4B53805378DB09A6 +:10058000FCD10122294B19780A431A709A78D207B4 +:10059000FCD41F2026490A68520B0240824200D137 +:1005A00005221C8D234D024092012C4022431A85C6 +:1005B0000A68920C02401F2A00D1023A1F24188DAB +:1005C0002240A043024307201A850A68D20D024048 +:1005D000824200D10322198D0240174812030140C4 +:1005E0000A437F211A851A7814480A401A70042297 +:1005F00019780A430C211A7058621A898A431A81A1 +:100600001A890B398A431A8180220021520001F095 +:100610002EFA70BD00040040584400413C440041A3 +:1006200059440041000C00400640000000500041C9 +:10063000246080003FF8FFFFFF8FFFFF6C06002063 +:10064000F7B51C00314B06005B6A0F0015000193E3 +:10065000002C05D1443454432D4BE418FFF7D8FE49 +:1006600063782278934210D2D51ABD4200D93D005A +:10067000002E08D0211DC9182A00300001F0EEF923 +:1006800063785B1963702800FEBD019BA1786A0145 +:10069000D318002911D1211D196059681D48890BF3 +:1006A000890359605968014059601B495518402118 +:1006B0002879014329710121A1701449002551189D +:1006C000019116495218127AD207DCD55D68A278DA +:1006D000EDB22570022A04D12A001968201D01F00C +:1006E000BDF9BD4200D93D00002E0CD02A003000DB +:1006F0006570211D01F0B2F90122019BFF331A72CE +:100700000023A370BFE76670F6E7C04600500041C3 +:1007100028040020FF3F00F000510041FF5000413D +:1007200010B50023FFF78CFF10BDF8B505000C00D5 +:1007300016001F00002C00D1F8BD210028003B004E +:100740003200FFF77DFF241A2D18F3E7F8B50D00EE +:100750001F4956014C6A3419002B1BD063695B009A +:100760005B08636120616369AA049B0B920C9B0385 +:10077000134363616369174A174813406361321872 +:1007800002238021160013729171327A1A42FCD032 +:100790002800F8BD012163695B005B0F03339940BA +:1007A000A94209D8043A531E9A416369D1075B00F4 +:1007B0005A080A436261D5E744275743074A04377A +:1007C000BF1801002A00380001F048F93800C9E7D5 +:1007D00000500041FF3F00F0FF500041280400207E +:1007E00010B50023FFF7B2FF10BD000010B5054A99 +:1007F0000B001188994200D919000022FFF7F0FF81 +:1008000010BDC0466C07002007B500216B460A00EA +:10081000D81D0170FFF7E4FF07BD0000F0B5B94C2B +:100820009BB0FFF7F5FDA38B08211A000A40039245 +:10083000B54A0B422ED080234020A183A372C0244E +:100840000931517090715371B04BB14D5968A40585 +:10085000294021435960596929400C43AD495C61E5 +:1008600004311960AC49AD4C196159680C408021C4 +:100870008902214359605968890B89035960507175 +:100880000022A74B1A70A64B1878431E9841C0B29D +:100890001BB0F0BD1020137A0342F4D09D4D1072AE +:1008A0006D899C48AC46664680799E4D0290994879 +:1008B000984BC788C0792E80402501909B88954829 +:1008C000994E00895571B34200D1B0E136DC8124E4 +:1008D0006400A34200D1BFE115DC822B00D190E17E +:1008E00006DC803B012B00D886E120239371CAE708 +:1008F000802149008B42F8D00221FF318B42F4D194 +:10090000FFF782FFBFE7B02189008B4200D16DE184 +:100910000EDC0139FF398B42E7D0A23B8349FF3B14 +:100920000B42E2D1002308210893099308A8C4E0F0 +:10093000C02189008B42D8D07D49DFE77D488342C2 +:10094000DED000DD96E07C498B4212DC01398B421F +:1009500000DBACE079498B42E4D06031FF318B425F +:10096000C3D1FFF751FF80235B423B43DBB2A3724D +:1009700089E788216A4809018B4200D195E08031DE +:100980008B42B2D10770FFF73FFFA02303225B0029 +:10099000E254C0225D4B5E49586C920508401043FA +:1009A00058644620FF30255465483027186490204D +:1009B00040002754586B802608401043586392200B +:1009C000400026545F481863B02040002554586FFB +:1009D00008405867B220400026543C307D3E2654E3 +:1009E000FC3884469C44604606680E401643066008 +:1009F000A626FF36A5551E005348A0363060C026F7 +:100A00007600A7551F0094373E6880200E4016439D +:100A10003E60C2267600A0551E004C4F90363760CF +:100A2000E02644277600A7550436A555A055C019E1 +:100A300084469C44604606680E4016430660D420F7 +:100A400084469C44604606680E4016430660F026C5 +:100A500080207600A7550436A555A0551C00E43427 +:100A60002068F433084010432060186801400A43AE +:100A70001A6008E73648834200D122E10ADC354992 +:100A80008B4200D13CE7344934480B40834200D1CB +:100A900036E72AE732498B4200D131E731498B42B0 +:100AA00000D022E7002308A80380012105E080236D +:100AB0005B009F4204D112212B48FFF797FEE2E62C +:100AC00080239B009F4202D199212848F5E7019B92 +:100AD000032B78D1029B032B00D906E708AC4822F0 +:100AE0000021200000F0C3FF019B6370029B002BDC +:100AF0003ED1092204332370A270E37020002178D4 +:100B0000DBE7C04600500041FF5000416C0600206A +:100B1000FFFFFF8FE00300202C040020FF3F00F0C8 +:100B2000240400206C07002002030000FFFE0000E8 +:100B3000010300002109000081060000A10300005C +:100B4000B404002070040020800500203C05002033 +:100B5000A121000021200000FFFEFFFF210A00006C +:100B600021220000A1FE0000B81A00004000002071 +:100B700004AE3200544B23CB23C200252F001B6848 +:100B80001360AB00514AF358D01919680122FFF7DE +:100B90000FFC01353F18042DF3D100234B4AD355E8 +:100BA0004B4B4C4A9B799B009D58280000F067FFF7 +:100BB00023000130400020702A7802330135002ADA +:100BC0009CD01A70F8E7019B0F2B02D139214248C3 +:100BD00073E7019B212B02D1092140486DE7019B5E +:100BE000222B00D081E621213D4866E7072800D06E +:100BF0007BE6AA213B4860E7039B08A8022103800B +:100C00005BE7084200D070E60F2350220340083310 +:100C10005B01104206D0344A9B189B799B06DB0F80 +:100C200008A8EBE7304A9B189B79DB06F7E70F240F +:100C300003002340204200D157E60140394300D051 +:100C400053E6294A08335B019B18020602D520228D +:100C50005A7155E61022FBE70F240300234020427F +:100C600000D142E60140394300D03EE65B01020676 +:100C700013D51E491C4A9A185B182021D8790842BE +:100C800000D13DE659711B7A2B4200D138E61300A2 +:100C90004022FF331A723E3ADAE710201349124A13 +:100CA0009A185B18D979014200D129E658711B7A4C +:100CB00001180B4200D123E61300FF330122197201 +:100CC000C6E70B48F9E6C046A81A0000480600200F +:100CD000E0030020F01A000004000020DC000020E7 +:100CE000CC1A0000F000002000500041FF500041ED +:100CF000E800002010B5FFF71FFC0022034B1A701C +:100D00000223034A11780B43137010BD2404002002 +:100D10000050004110B50C000122FFF761FD2000DA +:100D200010BD10B50C000122FFF75AFD200010BDC8 +:100D300070B504000D00FFF771FD03000020834231 +:100D400004D0022229002000FFF7EAFC70BD70B534 +:100D500005000C00FFF762FD002807D000230222E7 +:100D600021002800FFF7E1FC200070BD0400FBE734 +:100D700030B500232025934200DB30BD0C78002CD9 +:100D800003D00131C4540133F5E72C00FAE7000029 +:100D9000F8B580220C00050000212000920000F030 +:100DA00066FE002D0CD13E2220004A4900F056FE7E +:100DB000FF2355225B00E254474B9218E254F8BDE2 +:100DC0007E2D23D86E1E3E2E01D9403D2E00002ED2 +:100DD00012D080253302581C404EFF30ED001A1F00 +:100DE000591CAA4203D2B3420ED08BB223800B000F +:100DF00002348142F3D1E2E7F0230922FF2123707C +:100E0000601C00F034FEE4E7354BEFE7822D31D86B +:100E10007F2DD4D12F490B2220002B31FFF7A8FFC3 +:100E2000802728232F4EE3727D3D3F03F0683B006F +:100E30002034002802D000F022FE03001A0A237793 +:100E400062771A0C1B0EE3772B0A3100A277A57686 +:100E50000B22E3762000FFF78BFF67224D2301353D +:100E60005242ADB222746374227663761036052D39 +:100E7000DCD1A4E72B00833B012B0CD8194A1B01C2 +:100E8000D318DD68280000F0FAFD290002002000D8 +:100E900000F0E4FD93E78023853D2902DB029942BF +:100EA00000D38CE7104B114A2360114B2000636084 +:100EB000FE235B00E2508023DB00A36180238022BD +:100EC0009B01A3600B4B52006561E1602261E3610D +:100ED0002030DDE7001B0000FF01000003040000DC +:100EE000FFFF0000AC1B00005546320A306FB10A0C +:100EF00057515D9E882BED6870B516001D000A687D +:100F00002F4B0C009A4252D12E4B4A689A424ED136 +:100F1000FE2252002C4B8A589A4248D18B689A0480 +:100F200003D52A4AC969914241D1DB0712D48023F3 +:100F300022695B009A420DD1E068C3B2002B09D14F +:100F4000F822234B9202C318934203D2210020318E +:100F5000FFF706F9002D2BD0A369002B28D02968B4 +:100F60001C4A8B4206D0934201D8002901D00123AC +:100F70005B422B606369934219D8072201211A4012 +:100F80009140DB08EB181A7AC8B2114204D16968A3 +:100F9000024301311A7269606A682B689A4206D36B +:100FA000002E04D10C4B1B681E330C4A136070BD1D +:100FB000002EFCD1084B1B682D33FF33F5E7C046EC +:100FC0005546320A57515D9E306FB10A882BED6845 +:100FD00000E0FFFF63040000D8030020D0030020DE +:100FE000F8B53A4EB368002B00D0FEE7FFF79AFA47 +:100FF000374B1D68374BEA18F8239B029A4213D8E7 +:10100000354B364A1968364C364B914232D11978F5 +:10101000354AC90702D4216891422BD0334B226054 +:101020001B68334A32331360FFF7C2F8BFF35F8F98 +:1010300062B6FFF75FFE4020FFF77CFA80270A23A5 +:1010400001262C4DFF012B70FFF7E8FB2A4C0028EE +:101050000AD02378DAB2002B05D1254B38001A606C +:10106000FFF768FA2E7026702378002B25D000F049 +:10107000BBFAFCE71B78DB07DA0F002B0DD000234F +:10108000802223601D4B12025A6180239B011A6843 +:1010900082F30888B3602847C6E72168184B994255 +:1010A00001D12260C0E721680F4A9142E7D0FA20BF +:1010B00023604000FFF774F9E1E72378002BC3D1E8 +:1010C000FF33C046013B002BFBD1BDE700ED00E044 +:1010D0000420000000E0FFFFB42000007CB0EE8799 +:1010E000FC7F002038040040EF6926F0D803002080 +:1010F000D0030020000000206E07002000440041C3 +:10110000EF6916F010B5054C12220021200000F006 +:10111000AEFCF0232370E63BE37110BDAB09002069 +:1011200010B5FFF7EFFF0022014B1A7310BDC04648 +:101130009A010020F7B580270400160000250191D0 +:10114000BF00A368AB4200D8F7BD3900A278019B6D +:10115000E068FFF7EAFA80235B01E8180122330018 +:10116000E168FFF7C9FE0135EBE770B51300060033 +:101170000C00150000200A000121FFF761FA00238E +:10118000984206D02B0022001F213000FFF758FAAA +:101190000123180070BD000010B504220D21024883 +:1011A000FFF71EFB10BDC0469A01002010B50B4C86 +:1011B0000B4861792379A27909021943E379120472 +:1011C00011431B060B431A0A037142711A0C1B0EC2 +:1011D0008271C371FFF7E0FF10BDC0468C0900208B +:1011E0009A01002070B504220D00FFF7F9FA154CA2 +:1011F00085420FD0FFF786FF012304222373124B91 +:101200009A700022DA701A715A719A711A735A73AD +:10121000FFF7CCFFFFF784FF637A217A1B020B43B1 +:10122000A17AE27A0904120619431143491B0B0AF9 +:10123000217263720B0C090EA372E172FFF7B6FF05 +:1012400070BDC0469A010020AB09002070B5184C53 +:10125000142205000021200000F009FC154A002D91 +:101260001FD021000823D07D08313F26527C324018 +:101270001C2A01D0B24205D10F4A0C330A80052244 +:10128000DBB2CA70191C834200D9011CC9B2002DFF +:101290000BD0023B9BB21B0223802000FFF7A2FF72 +:1012A00070BD0423D07C211DDFE7013B2370F4E7F0 +:1012B000700900208C0900201C0A0000F0B5040011 +:1012C00000252A4B85B0597C03AAD170997C917076 +:1012D000D97C5170197D1170997D02AAD170DB7D86 +:1012E000937053880193019BAB4205D8FFF718FF19 +:1012F000FFF75CFF05B0F0BDFFF790FA0028F9D0CA +:10130000039B1B4FEE18002C1FD039003000FFF755 +:101310003FFD8021042238008900FFF761FA154A59 +:101320000135507A137A917A00021843D37A09046E +:1013300008431B06104903435B18190A13725172C4 +:10134000190C1B0E9172D372CDE780212300380057 +:1013500005228900FFF7E9F9220039003000074B28 +:10136000FFF7CAFDFFF7C8F8D9E7C0468C0900208F +:10137000700700209A01002000FEFFFFC009002036 +:101380007FB500F031FB444E002205213000FFF70D +:10139000ECFE002849D0737A327AB57A1B021A43E0 +:1013A000F37A2D041B0615433C4C1D432B0A637234 +:1013B0002B0CA3722B0E2572E372F07B2F2827D8FB +:1013C000192815D8032827D012282FD0002840D05C +:1013D000FFF798FE012305222373314B9A700022F8 +:1013E000DA701A715A719A711A7320325A7332E094 +:1013F0001A381528ECD800F01DFB282CEBEB2CEB51 +:10140000EBEBEB3FEB31EBEB39EB3DEBEBEBEB2CB1 +:101410005A28DDD1012019E0F37C191C122B00D9C8 +:1014200012211F48C9B2FFF7DDFE7FBD1D4C1E49CA +:10143000200018220830FFF79BFCF37C191C242B9A +:1014400000D924212000C9B2EDE70020FFF7FEFEFD +:10145000EBE7FFF765FEFFF7A9FEE6E780231348F9 +:101460009B024360124B08210360DCE70120FFF779 +:1014700025FFDAE70020FAE70C260E49320001A822 +:1014800000F0ECFAB54204D9002326726372A3720D +:10149000E3720C2101A8C6E78C0900209A01002004 +:1014A000AB090020A8010020951A00008409002043 +:1014B00000003E7F321C000072B6BFF35F8F044B0A +:1014C000044A9A829A830022034B9A607047C0466E +:1014D00000500041FF03000000ED00E0F0B5C5B092 +:1014E0000DAF0400FFF7E8FF44220021380000F0B0 +:1014F000BEFA982200211EA800F0B9FA02230F219B +:10150000BB70A37862780B40A370264B0A4005930A +:10151000636805AD06930023E16807932248627073 +:101520002B7301221EABFFF7E7FC390020001EAA37 +:10153000FFF700FE280001230D216278FFF706F96E +:10154000002505AE3A003000A178FFF70EFE002816 +:101550001ED0144B01AD0193069B6B60079BAB60E3 +:1015600000232B73F37B002BE4D02A2B17D16B467F +:10157000B27D3900DA70F27D20009A705E881EAA72 +:10158000A660FFF7D7FDAB6876029E1BAE60D1E781 +:10159000064B9D4201D9FEF727FF0135D1E7FEF743 +:1015A00057FFC7E755534253FF0F0000F8240100CF +:1015B00030B5EFF30883054C2360036883F3088894 +:1015C0004568A847236883F3088830BDB80A00201F +:1015D00007B5010001226846FEF7EAFE08216846C9 +:1015E000FFF798FB07BD0000F8B500237A227F4C77 +:1015F00023607F4B1A70FFF7C3FE7E4D4021280009 +:10160000FFF796FB7C4B186000232B54984201D0C7 +:10161000FEF772FF0022794B1D60794B1A60784803 +:10162000754B02681F68BA42E5D2744E31680B7878 +:10163000FF2B36D0734D232B00D0B3E06C4B1B78BF +:10164000532B33D12B680132013102603160BA1A59 +:101650009A4200D91A006C4D20682A6000F0FEF909 +:10166000674829680368654ACB18013B0360106826 +:101670004B1EC3181360634B644D1B682970C9B2BD +:101680008B4203D92068591AFFF761FBC0467A22C2 +:10169000574B1A7000225B4B1A60584A136801338B +:1016A0001360574A136801331360B8E7522B04D113 +:1016B00029682068FFF735FBE9E74F2B03D12B683A +:1016C00022681370E3E7482B03D12B68226813804C +:1016D000DDE7572B0AD14E4B22689A4202D14D4882 +:1016E000FEF728FF23682A681A60D0E76F2B04D121 +:1016F00001212068FFF70EFBC9E7682B05D1022105 +:1017000023681B882B602800F4E7772B04D123681B +:1017100004211B682B60F6E7472B09D12868FFF7E7 +:1017200047FF3D4B1B78002BB1D001213B48E1E73F +:10173000542BACD04E2BAAD0562B02D12A2138489C +:10174000D8E7582B05D12868FEF7C8FC0321354897 +:10175000D0E7592B0DD12A682068334B002A03D1DA +:10176000186003213148C5E719689208FEF7CEFCDE +:10177000F7E75A2B8BD12F6800252668F719B74257 +:1017800009D101212A48FFF7C5FA2800FFF720FFF9 +:1017900003212848AEE729003078FEF7D5FD013651 +:1017A0000500ECE71A00303AD1B2092904D82B68B9 +:1017B0001B0113432B6070E71A00413A052A03D836 +:1017C0002A68373B1201F4E71A00613A052A03D868 +:1017D0002A68573B1201ECE72C2B03D12B682360BE +:1017E0000023E7E7024A1370FAE7C046B40A002074 +:1017F000590A0020600A0020AC0A0020B00A00202C +:10180000A40A00205C0A0020C00A0020A80A0020C8 +:101810000CED00E040004000580A00203E1C000093 +:101820004E1C0000401C0000BC0A0020441C0000AC +:10183000481C00004A1C00000300F7B547330400B1 +:101840001A78402103000020FEF7FAFE002801D19B +:101850000020FEBD00232370237901930423E35667 +:10186000002BF5DB3F262000019FA51DEB8F3740A5 +:101870004830C0183A00611D00F0F0F8E88F019B75 +:10188000C01980B2B34301D1E887E1E70023EB87B9 +:10189000DFE7F0B506000C001F0093B001923F2572 +:1018A000AC4203DC2500002F00D140373B0002AAE8 +:1018B0002B43137002AB31002A00581C00F0CEF805 +:1018C0006B4640211A7902A80123FEF73FFF7619E3 +:1018D000641BE4D113B0F0BD030010B547331A7890 +:1018E000043100234830FFF7D4FF10BDF7B50400E2 +:1018F000FFF7A2FF002842D0230048339A88A06C4B +:101900001A80002201385A80082865D800F09CF817 +:1019100015052327252A483F3800314E300000F0B6 +:10192000AEF80500200031002A004C3000F096F897 +:1019300029002000FFF7D0FF21E00123E364FF33FB +:1019400023658023DB006365A0235B00A365254B33 +:101950001421E365EDE7FEF747FD0021E9E7FEF717 +:1019600077FDFAE720000021FFF7B6FF8023206D06 +:101970009B01984203D321005431FEF7F1FBF7BDE0 +:101980002100626D206D5831FEF7B5FBE5E72000C0 +:10199000656D216D2A004C30FEF7ADFBA900C8E74C +:1019A0000026636D276D0193019BB34201DC590052 +:1019B000BFE73D0000212B001878FEF7C5FC7B1C1B +:1019C0000135FF3301009D42F5D1230072004C33F5 +:1019D0002F0098520136E7E701225A80BDE7C04642 +:1019E000DC1B0000882BED6807480622030010B5B9 +:1019F00047331A70FFF77AFF044807220300473382 +:101A00001A70FFF773FF10BDC40A00204C0C0020B1 +:101A100010B5E2B00400FFF74FFDC4220021684674 +:101A2000520000F024F847236B441C706846FFF70F +:101A30005DFFFBE702B471464908490009564900B9 +:101A40008E4402BC7047C04602B471464908490042 +:101A5000095C49008E4402BC7047C046002310B5A3 +:101A60009A4200D110BDCC5CC4540133F8E70300A6 +:101A70008218934200D1704719700133F9E70023AF +:101A8000C25C0133002AFBD1581E7047537061724B +:101A90006B66756E00517769696320555342204229 +:101AA00072696467650000000CA0800040A080009F +:101AB00044A0800048A0800012011002EF02014003 +:101AC0004F1B240D01420102030100000697FF098C +:101AD00001A101150026FF0075089540090181024A +:101AE00095400901910295010901B102C000000071 +:101AF000000000008C1A0000951A00004806002023 +:101B0000EB3C905546322055463220000201010040 +:101B10000240007E3EF03F00010001000000000096 +:101B20000000000000002942004200535041524B87 +:101B300046554E00000046415431362020203C21BD +:101B4000646F63747970652068746D6C3E0A3C68DC +:101B5000746D6C3E3C626F64793E3C736372697075 +:101B6000743E0A6C6F636174696F6E2E7265706C7F +:101B7000616365282268747470733A2F2F777777C2 +:101B80002E737061726B66756E2E636F6D2F2229D6 +:101B90003B0A3C2F7363726970743E3C2F626F6422 +:101BA000793E3C2F68746D6C3E0A0000494E464FEA +:101BB0005F55463254585400DC1B0000494E4445E2 +:101BC0005820202048544D003E1B000043555252DF +:101BD000454E542055463200000000005546322044 +:101BE000426F6F746C6F6164657220205346485772 +:101BF000524F0D0A4D6F64656C3A205177696963E5 +:101C000020555342204272696467650D0A426F6134 +:101C100072642D49443A2051776969632D42726993 +:101C20006467652D537061726B66756E2D76300D2D +:101C30000A000000000800003E80020002000600CA +:101C4000580A0D00590A0D005A00230A0D0076317A +:101C50002E31205B41726475696E6F3A58595A5D36 +:101C6000204A756C20323520323032322032333AFD +:081C700035303A30360A0D0050 +:101C780001C80000050F3900021810050038B60821 +:101C880034A909A0478BFDA0768815B66500010127 +:101C9800001C100500DF60DDD88945C74C9CD26563 +:101CA8009D9E648A9F00000306AA000200000000AF +:101CB8000902990005010080FA080B0002020201DE +:101CC80000090400000102020100052400100104BB +:101CD80024020605240600010524010301070583E3 +:101CE800030800FF09040100020A0000000705813B +:101CF8000240000007050202400000090402000239 +:101D08000806500007058402400000070505024048 +:101D1800000009040300020300000009210001007B +:101D2800012221000705860340000107050603403C +:101D380000010904040002FF2A0100070587034087 +:101D48000001070507034000010000000904030023 +:101D5800020300000300000000C2010000000800A8 +:101D68000A00000000000306AA00080002000400A0 +:101D7800A0001400030057494E55534200000000CC +:101D88000000000000008400040007002A0044004E +:101D98006500760069006300650049006E00740004 +:101DA8006500720066006100630065004700550029 +:101DB800490044007300000050007B0039003200E5 +:101DC8004300450036003400360032002D0039004B +:101DD8004300370037002D00340036004600450028 +:101DE8002D0039003300330042002D00330031004C +:101DF80043004200390043003500420042003300EE +:101E0800420039007D000000000055534253000095 +:101E18000000000000000000008002022000000016 +:101E280000000000000000000000000000000000AA +:0C1E38000000000000000000312E3030DF +:101FF00000000000111A0000DD140000DC1B0000CE +:00000001FF diff --git a/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.bin b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.bin new file mode 100644 index 00000000..8ca7714e Binary files /dev/null and b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.bin differ diff --git a/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.elf b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.elf new file mode 100644 index 00000000..6f3c5d64 Binary files /dev/null and b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.elf differ diff --git a/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.hex b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.hex new file mode 100644 index 00000000..dfbe8f1d --- /dev/null +++ b/sparkfun/samd/bootloaders/QwiicMicro/bootloader-sparkfun-qwiic-micro-v3.4.0-53-gfbd9bd1-dirty.hex @@ -0,0 +1,497 @@ +:10000000D82D0020810200007D0200007F02000048 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000007D02000051 +:1000300000000000000000007D02000075020000CA +:100040007D0200007D0200007D0200007D020000B4 +:100050007D0200007D0200007D0200007D020000A4 +:100060007D0200007D0200007D0200007D02000094 +:100070007D02000000000000000000007D02000082 +:100080007D0200007D0200007D0200007D02000074 +:100090007D02000000000000000000007D02000062 +:1000A0007D0200007D0200007D0200007D02000054 +:1000B00000000000074B1A7DD207FBD52022FF323B +:1000C0001A83054A4008D8611A801A7DD207FCD5E8 +:1000D0007047C0460040004102A5FFFF10B5041C58 +:1000E000044B9C4205D8201C0134FFF7E3FFFF348A +:1000F000F6E710BDFFFF0300002330B5934204D0A4 +:100100009C000D5901330551F8E730BD70B58025CD +:100110000F4B5C68AC435C60002A18D0141E102C96 +:1001200000D910240B4D121B1D801D7DED07FCD541 +:10013000A50000240E5906510434AC42FAD100192E +:100140000919054C1C801C7DE407FCD5E4E770BD53 +:100150000040004144A5FFFF04A5FFFF38B5002380 +:10016000CA58C458A24205D1802204335200934297 +:10017000F6D108E00D1C041CFFF79CFF201C291C75 +:100180004022FFF7C3FF38BD024B5B785BB2002B08 +:10019000FADB7047000C0040024BDB68DB06FBD546 +:1001A0007047C046000800401E21F8B50226254AC7 +:1001B000254C5368254D8B4333435360A660FFF7AE +:1001C000E3FF234B6360FFF7DFFFAE84FFF7E4FF3D +:1001D000204B1B689B0E3F2B00D1203B00260227A3 +:1001E0001D4A9B0213431D4AEA62AB62AE84FFF7CD +:1001F000D3FF1B4BAB84FFF7CFFFAB8C3B43AB84F0 +:10020000FFF7CAFF3F22638893433B436380802309 +:100210006288DB0113436380A660FFF7B5FF114BD3 +:100220006360FFF7B1FFC0200F4A104B10495360C5 +:100230000B6A00061B021B0A03430B62072396602E +:100240001360F8BD00400041000C00400008004071 +:100250000600010024608000FF01000080BB0A1C32 +:10026000240500000007030010E000E0E7030000A1 +:1002700000ED00E008B500F0F3F808BDFEE7FEE78A +:100280002048214970B50023884201D11F4B07E067 +:100290001F4CCA18A242F9D2C45804331460F7E7BD +:1002A0001C4A934202D2002204C3F9E7FF21022430 +:1002B0000325194B194A8B430C2693600822184BCF +:1002C00018495C62CB78AB432343CB70CB78B34304 +:1002D0001343CB703021144B987B8843103908436B +:1002E0009873997BB1431143997380219A7BAA43F8 +:1002F00022439A730D4A53680B43536000F096FEF5 +:10030000FEE7C0461C1D000000000020D0010020B8 +:10031000D0010020D80D00200000000000ED00E01A +:10032000FC70004100500041004800410040004185 +:10033000F0B50024104A5388A34215D108252302A2 +:100340009BB21FB25E00B3B2002F02DA0B4B5E40CD +:10035000B3B2013DADB2002DF3D1650053538023FC +:1003600001345B009C42E9D10B0A58404000105A0E +:100370000902414088B2F0BDD001002021100000E8 +:1003800001230002834202D2C0460133FAE77047DC +:10039000F0B5071C1C2500200C1C0F23EC401C4052 +:1003A000002A05D1002C03D1002D01D000280AD04D +:1003B000261C431C9C4630363B18092C01DD373483 +:1003C000261C60461E70043D2B1DE5D1F0BD0000CB +:1003D000054A064B1A60BFF34F8F054A054BDA609A +:1003E000BFF34F8FFEE7C046EF6926F0FC7F002089 +:1003F0000400FA0500ED00E008B50B4A1368002B75 +:100400000ED10A4911600A490A6801320A60094995 +:100410000868002806D0824204D30B60FFF7D8FF9B +:10042000013B136008BDC046D8030020DC05000076 +:10043000040A0020080A0020054A064B1A60BFF390 +:100440004F8F054A054BDA60BFF34F8FFEE7C0467A +:10045000EF6916F0FC7F00200400FA0500ED00E0D3 +:1004600010B5194A136801331360184A116800293E +:100470000CD017480818834203D180241548E400A3 +:1004800084618B421FD1002313601CE0DBB2124A4F +:10049000002B11D180210F4BC900996114780F49AD +:1004A000201C0A38C0B2F02802D9087840420870EF +:1004B0000B78E318137006E012789A4203D1802279 +:1004C000044BD2005A6110BDD0030020D403002099 +:1004D00018FCFFFF00440041010000200000002044 +:1004E000074B084A1B681168994207D2FA21C900D4 +:1004F0005B1813608022044BD2005A617047C046DB +:10050000D0030020D4030020004400418022024B8D +:10051000D2009A609A617047004400417047000021 +:10052000202110B50124334AD3690B43D361324AE9 +:100530001A391378234313700F22304B18789043E5 +:1005400018701878084318702D48017821430170FD +:1005500019780A4060211A701A780A431A70294BD8 +:10056000294A5A805A78D209FCD10121274B1A789E +:100570000A431A709A78D207FCD42548026892037D +:10058000D20E1F2A00D11A3A1C8D9101214A224015 +:100590001F240A431A8502685202D20EA24200D1D9 +:1005A0001D22198D2240A1430A431A850268920137 +:1005B000520F072A00D1043A188D1103164A02403F +:1005C0000A431A857F22197814480A4004211A70B8 +:1005D0001A780A431A7058621A8908318A431A81B4 +:1005E0001A890B398A431A8180220021520001F0B6 +:1005F00078FA10BD00040040584400413C440041DA +:1006000059440041000C00400640000000500041E9 +:10061000246080003FF8FFFFFF8FFFFF500A00209B +:10062000F7B51C1C314B071C5B6A0D1C161C019393 +:10063000002C05D1443454432D4BE418FFF7DCFE65 +:1006400061782378994210D25B1A9D4200D91D1C13 +:10065000281C002F49D061180431381C2A1C01F0D5 +:1006600037FA6378EB1863703EE0019BA178720162 +:10067000D318002911D1211D19605968890B8903EC +:10068000596058681B490140402059601A49561862 +:100690003179014331710121A170144900205118B1 +:1006A000019116495218127AD2071ED55E68A278B7 +:1006B000F6B22670022A04D11968201D321C01F0FE +:1006C00007FAB54200D9351C002F06D06570211DF0 +:1006D000381C2A1C01F0FCF900E067700122019B24 +:1006E000FF331A720023A370281CFEBD0050004186 +:1006F000500B0020FF3F00F000510041FF5000412F +:1007000008B50023FFF78CFF08BDF8B5051C0C1CCD +:10071000161C1F1C002C08D0281C211C321C3B1C42 +:10072000FFF77EFF241A2D18F4E7F8BDF8B50F1C6B +:10073000214955014C6A84462C19002B05D0636968 +:10074000061C5B005B0863611BE0391C63695B008E +:100750005B0F0333D9400AD0043A531E9A41D307A2 +:100760006269061C520052081A43626109E044267D +:100770007243124B6146D6180436301C3A1C01F005 +:10078000A7F92661BB049A0C63699B0B9B03134377 +:10079000636162690A4B13406361074BEA18094BB6 +:1007A000ED1802232B727E33AB71131CFF331B7ABF +:1007B0009B07FAD5381CF8BD00500041500B0020B3 +:1007C000FF3F00F0FF50004108B50023FFF7AEFFE8 +:1007D00008BD000008B5044B1B88994200D9191CBC +:1007E0000022FFF7F1FF08BDE003002007B500215C +:1007F0006B460A1CD81DFFF7E7FF07BDF0B59FB099 +:10080000FFF7FAFD0823D64CA28B1A4006920699F0 +:10081000D44A002927D011214020C025A383783352 +:10082000A372517090715371CF4BD0495C68AD0584 +:100830000C402C435C605C69214029435961CC49E0 +:100840001960CC4919615C68CB4921408024A4021D +:10085000214359605968890B8903596050710022FE +:10086000C64B1A704BE21026137A334200D146E28F +:10087000C34816720379079343799C46837905939D +:10088000C77905993B0219436B4601919B880293F6 +:10089000417A037A090219436B4603919B890493B9 +:1008A000C37A857A1B022B43B64D2B8040256346C5 +:1008B000557107991B020B43B34907908B4200D136 +:1008C000C0E131D881204000834200D1D2E114D868 +:1008D000822B00D19CE108D8802B00D194E1812BA0 +:1008E00000D00AE20CA80023A9E1802149008B4234 +:1008F00000D102E20221FF31CBE0A4498B4200D1BA +:10090000F0E105D8A221FF318B4200D0F5E1E9E109 +:10091000C02189008B4200D1EFE100D9EAE14039E2 +:100920008B4200D16AE1E8E199498B4200D1E1E1D3 +:1009300000D9A4E097498B4216D801398B4200D3E5 +:10094000B9E095498B4200D1CCE16031FF318B4257 +:1009500000D0D2E1FFF74AFF8023019A5B421343A4 +:100960007F4ADBB29372CAE18821844809018B4235 +:1009700000D1B5E180318B4200D0BEE16B461B79DE +:1009800030270370FFF732FFA0230322C0215B0052 +:10099000E254754B754A586C8905104008435864F9 +:1009A0004620FF3025547D48802618649020400062 +:1009B0002754586B10400843586301966E469220A6 +:1009C000367940002654764880261863B0204000CF +:1009D0002554586F1040586701966E46B2203679FC +:1009E0004000265403263C302654FC3884469C4460 +:1009F0006046066816400E430660A626FF36A555DB +:100A00001E1C6848A0363060C0267600A7551F1C03 +:100A100094373E68802016400E433E60C226760022 +:100A2000A0551E1C604F90363760E02644277600A4 +:100A3000A7550436A555A055C01984469C44604668 +:100A4000066816400E430660D42084469C446046E7 +:100A5000066816400E430660F02680207600A755F3 +:100A60000436A555A0551C1CE4342068F43310400E +:100A700008432060186802400A431A603FE14B496E +:100A80008B4200D136E108D849498B4200D131E18F +:100A900048498B4200D12DE12FE147498B4200D1DB +:100AA00016E146498B4200D117E145498B4200D0FF +:100AB00023E144481AE1802302995B00994202D164 +:100AC0004148122113E1802302999B00994202D1EF +:100AD0003E4899210BE1032F00D07FE0059B032BBB +:100AE00000D90AE10CAC201C0021482200F0F9FFDB +:100AF000059B6770002B05D1092204332370A27077 +:100B0000E37029E008AE321C314B23CB23C2002511 +:100B10002F1C1B6813602F4B0122D8197359043501 +:100B20001968FFF735FC3F18102DF4D10025294B2B +:100B3000294ADD55079B9B799B009E58301C00F08D +:100B4000D8FF013040002070735D6A1C002B03D079 +:100B500051006354151CF7E72178201CC7E0C046FC +:100B600000500041FF500041500A0020FFFFFF8F5E +:100B7000100A0020540B0020FF3F00F0DC0300208F +:100B80000C0A0020E003002002030000A102000084 +:100B90002109000081060000A1030000DC0B0020F9 +:100BA000980B0020A80C0020640C002021200000DD +:100BB000210A0000210B000021220000A1FE0000FC +:100BC000A1210000880100206C1B0000EC00002027 +:100BD000001B0000E20300205C1B00000F2F02D16D +:100BE0004A48392183E0212F02D1494809217EE07A +:100BF000222F00D081E04748212178E0049B072B79 +:100C00007BD14548AA2172E06B460CA81B8B16E0ED +:100C10006B461B8B0CA8038050230399049F19403B +:100C2000413B1F40072F68D83C4B08377F01FF1816 +:100C3000BB79002901D09B0600E0DB06DB0F0380B7 +:100C4000022154E00F23049F1F40029B002B54D12C +:100C50007B1E062B51D87F230399083799432F4BCE +:100C60007F01C9B2FF18002902D020237B7141E027 +:100C70007E713FE00F23049F1F40029B002B3CD15D +:100C80007B1E062B39D87F230399254A9943234B92 +:100C90007F01C9B2FB18BF1800290CD02022F979B6 +:100CA000114227D07A713A7A2A4223D04022FF3368 +:100CB0001A723E3A0AE0FA7932421BD020227E7143 +:100CC000397A114216D0FF331A721F3A5A7111E065 +:100CD0006A46144B12795A700CE000230CA803806A +:100CE000012104E000230CA80C930D930821FFF7C9 +:100CF00071FD04E0FFF77AFD01E0202393710A4BB8 +:100D00001878431E9841C0B21FB0F0BD0400002007 +:100D100090010020101B0000400000200050004106 +:100D2000FF500041DD030020DC03002008B5FFF781 +:100D3000F7FB00230221044A1370044A5370044A4B +:100D400013780B43137008BDDC030020DD03002083 +:100D50000050004110B50C1C0122FFF735FD201C8E +:100D600010BD10B50C1C0122FFF72EFD201C10BD7C +:100D700038B5051C0C1CFFF741FD031C0020834205 +:100D800004D0281C211C0222FFF7BAFC38BD38B55C +:100D9000051C0C1CFFF732FD0023984205D0281CCF +:100DA000211C0222FFF7B1FC231C181C38BD031CB8 +:100DB00010B51C1A944208DA0C78002C01D00131CD +:100DC00000E020241C700133F3E710BD802270B5D1 +:100DD0009200051C0C1C081C002100F082FE002D56 +:100DE0000CD13E22201C4C4900F072FEFF235522FC +:100DF0005B00E254494B9218E2548CE07E2D25D8DA +:100E00006B1E3E2B00D93F3B002B03D01B02591C0D +:100E1000FF3113E0F022211C22700A31621C8A4249 +:100E2000F4D0FF2010700132F9E73D4883420BD027 +:100E300093B22380131C02348A426CD039481D1FA0 +:100E40005A1C8542F6D8F0E7374BF2E7822D33D8AB +:100E50007F2D60D13049201C2B310B22FFF7A7FFDB +:100E600028230026314DE3720C35286820340028F1 +:100E700002D000F03EFE01E080200003291C030A9E +:100E80006377030CA377B31C9BB22077A376000E85 +:100E90001B0AE077E3760B220C39201CFFF787FF53 +:100EA00067224D23524201362274637422766376A0 +:100EB0001035032ED9D12EE02B1C833B012B0AD8F1 +:100EC0001A4A1B01D318DD68281C00F012FE291CE9 +:100ED000021C201C1DE0164B853D290299421AD8A0 +:100EE000144B154A2360154B6360FE235B00E250F0 +:100EF0008023DB00A3618023A06880229B01034341 +:100F0000201CA3600E4B52006561E1602261E36129 +:100F1000203000F0DDFD70BD661C0000FF01000008 +:100F200003040000FF030000FFFF0000A41C0000FA +:100F3000FFFF03005546320A306FB10A57515D9EDC +:100F4000882BED6870B530480C6884425AD12F4820 +:100F50004C68844256D1FE2040000C582C488442F4 +:100F600050D18868840403D52A4CCD69A54249D163 +:100F70001C1C151C0E1CC30710D480230A695B00BF +:100F80009A420BD1C868C3B2002B07D1224BC218BA +:100F9000224B9A4202D82031FFF7E0F8002C29D0EA +:100FA000B369002B26D021681D4A994206D093428E +:100FB00001D8002901D001235B4223607369934269 +:100FC00020D8072201211A409140DB08E318CAB259 +:100FD000197A114204D10A431A72636801336360BB +:100FE000626823689A420DD3002D0BD10D4B1B680C +:100FF0001E3305E0002D05D10A4B1B682D33FF334E +:10100000094A136070BDC0465546320A57515D9E6D +:10101000306FB10A882BED6800E0FFFFFFDF0300AF +:1010200063040000040A0020080A002070B53B4D4C +:10103000AB68002B00D0FEE7FFF768FA384B1E685C +:10104000384BF218F8239B029A4237D8364B374A6E +:101050001968374C374B91420CD11978364AC90779 +:1010600002D42168914205D0344B22601B68344A77 +:10107000323308E01A78012313400FD12068314938 +:101080002B4A884201D1136018E010682A4B98421D +:1010900004D0FA2011604000FFF772F9002380228B +:1010A0002360294BD2005A612848FFF737FA802382 +:1010B0009B011A6882F30888AB603047FFF774F829 +:1010C000BFF35F8F62B6FFF731FE4020FFF726FACD +:1010D0000A231F4C2370FFF791FB1E4D00280DD0F3 +:1010E0002B78DBB2002B07D18020154AC00113609A +:1010F000FFF714FA0123237001232B702B78002BA8 +:1011000002D000F0A9FAFCE72B78002BE3D1FF33E3 +:10111000C046013B002BFBD1DDE7C04600ED00E0FF +:101120000420000000E0FFFFB42000007CB0EE8748 +:10113000FC7F002038040040EF6926F0040A0020FC +:10114000080A0020EF6916F000440041400040000A +:10115000000000200304002010B5054C0021201CD5 +:10116000122200F0BEFCF0232370E63BE37110BDB9 +:10117000C406002008B5FFF7EFFF0022014B1A73E9 +:1011800008BDC046C0010020F8B5051C0E1C171C88 +:101190000024AB689C4210D28021AA78E8688900BC +:1011A000331CFFF7B2FA80235B01E018E9680122E3 +:1011B0003B1CFFF7C7FE0134EBE7F8BD70B50D1C13 +:1011C000141C061C231C002001212A1CFFF728FAEE +:1011D0000023984206D0231C301C1F212A1CFFF735 +:1011E0001FFA0123181C70BD08B503480D21042205 +:1011F000FFF7EAFA08BDC046C001002038B50B4D24 +:101200000B4C6A792879AB79120202431B04134311 +:101210001A1CEB791B0613431A0A237162711A0C0C +:101220001B0EA271E371FFF7DFFF38BD0C04002035 +:10123000C001002038B504220D1CFFF7C5FA164C7A +:10124000A8420FD0FFF788FF012304222373134B1A +:101250009A700022DA701A715A719A711A735A735D +:10126000FFF7CCFFFFF786FF637A207AA17A1B0293 +:10127000034309041A1C0B1CE17A134309061943A2 +:10128000491B0B0A217263720B0C090EA372E172E7 +:10129000FFF7B4FF38BDC046C0010020C4060020DF +:1012A00070B5194D0021041C1422281C00F019FCF3 +:1012B000281C1649002C04D0021CCD7D08320823BE +:1012C00002E00423CD7C021D4E7C3F2131401C29CD +:1012D00001D03F2907D11C211170123951700C33F4 +:1012E0000539D170DBB2191CAB4200D9291CC9B237 +:1012F000002C04D0023B9BB21B02038001E0013BA7 +:101300000370FFF797FF70BDD80600200C04002083 +:10131000F7B52A4B01AA597C061CD170997C002490 +:101320009170D97C5170197D11706A46951C9A7D17 +:101330006A70DB7D2B702B889C4239D2FFF75EFAF6 +:10134000002839D01E4F002E0BD0019B391CE0180D +:10135000FFF73CFD8021381C89000422FFF734FA96 +:101360000FE08021381C89000522331CFFF7CDF9DE +:10137000019B391CE018321C124BFFF7E3FDFFF70D +:10138000AFF811480134427A077A837A12023A435D +:101390001B0413431A1CC37A1B0613430B4A9B18E6 +:1013A0001A0A037242721A0C1B0E8272C372C2E7CF +:1013B000FFF7E0FEFFF722FFF7BDC0460C04002058 +:1013C000C40400202C040020C001002000FEFFFF08 +:1013D000F0B585B000F04CFB474E0521301C0022D3 +:1013E000FFF7ECFE002800D183E0737A317AB47AFB +:1013F0001B020B4324041A1C231CF47A13432406F7 +:101400001C433E4D230A6B72230CAB72230E2C72CD +:10141000EB72F37B00271E2B43D00CD8122B29D064 +:1014200004D8BB423DD0032B1CD050E01A2B32D045 +:101430001B2B36D04BE0282B36D00BD8232B37D0A4 +:10144000252B44D180232E489B0243602D4B08213D +:1014500003601DE02F2B24D05A2B1ED02A2B36D10F +:10146000381C22E0F37C191C122B00D91221C9B2BE +:1014700025480DE0254C2649201C18220830FFF78E +:1014800096FCF37C191C242B00D92421201CC9B202 +:10149000FFF7D0FE2DE0381C00E00120FFF700FF31 +:1014A00027E0FFF767FE22E00120FFF731FF20E091 +:1014B0000C2601A81749321C00F00AFBB44203D9DC +:1014C0002E726F72AF72EF7201A80C21E0E7FFF786 +:1014D00043FE0123094A137305220B4B9A70002225 +:1014E000DA701A715A719A711A7320325A73FFF7AF +:1014F00085FE05B0F0BDC0460C040020C0010020F0 +:101500000404002000003E7FC40600209C0100204F +:10151000491B0000D41C000072B6BFF35F8F044B60 +:10152000044A9A829A830022034B9A607047C0460D +:1015300000500041FF03000000ED00E0F0B5C7B02F +:101540000FAF041CFFF7E8FF00214422381C00F015 +:10155000C8FA0021982220A800F0C3FA0223BB7029 +:1015600062780D331A406270A27807AD1340A37001 +:101570006368284E08930023274809932B73E1687A +:1015800020AB01220796FFF7DDFC201C391C20AAA6 +:10159000FFF7FAFD6278281C0D210123FFF7C6F83A +:1015A0000196002507AEA178301C3A1CFFF706FE15 +:1015B000002806D1194B9D4201D9FEF709FF0135DC +:1015C000F0E7019B03AD039373686B60B368AB6096 +:1015D00000232B73F37B002B14D02A2B10D1B27D68 +:1015E00002ABDA70F27D201C9A705E88391CA6600E +:1015F00020AAFFF7C9FDAB6876029E1BAE6001E032 +:10160000FEF71AFF6278281C0D210123FFF78EF8E0 +:10161000C7E7C04653425355FF0F0000F8240100AE +:1016200030B5EFF30883054C2360036883F3088823 +:101630004568A847236883F3088830BDCC0D002097 +:1016400007B5011C01226846FEF7A2FE6846082184 +:10165000FFF780FB07BD000000237A22F0B5854C20 +:1016600085B02360844B1A700193FFF7B1FE834D60 +:101670004021281CFFF77CFB0022814B2A54186074 +:101680000393904201D0FEF72BFF7E4B00211F1CDD +:101690007D4A1D6011607C4D039B2A681868824258 +:1016A000E3D2784B19689C460B78FF2B00D1DBE026 +:1016B000764E232B00D0B3E0019B1B78532B2CD10B +:1016C000904218D9634601311960336801322A60AB +:1016D000821A9A4200D91A1C6D4E2068326000F0BE +:1016E000F7F9694933680A689A180A603A68D218A3 +:1016F0003A60684A13702B68013B2B603B68013BE2 +:101700003B60644B1978614B1B68994203D2591AAC +:101710002068FFF73CFBC0467BE0522B04D12068D9 +:101720003168FFF71EFB74E04F2B03D1336822684A +:1017300013706EE0482B03D133682268138068E091 +:10174000572B0AD1544B22689A4202D15348FEF7D4 +:10175000E5FE236832681A605BE06F2B01D12068D8 +:1017600019E0682B05D12368301C1B8802213360E7 +:101770004DE0772B05D12368301C1B6804213360B2 +:1017800045E0472B09D13068FFF74AFF444B1B78EF +:10179000002B3ED04348012139E0542B39D04E2B49 +:1017A00037D0562B02D140482A2130E0582B04D1A3 +:1017B0003068FEF793FC3D4828E0592B0DD1326884 +:1017C0003B4B002A02D122681A6004E0920820688C +:1017D0001968FEF79BFC374818E05A2B19D133687B +:1017E00000262568EB180293029B9D4206D02878BC +:1017F000311CFEF79DFD0135061CF5E701212E4841 +:10180000FFF7A8FA301CFFF71BFF2C480321FFF756 +:10181000A1FA7A23019A137000221C4B1A601FE070 +:101820001A1C303AD1B2092902D833681B010CE0E6 +:101830001A1C413A052A01D8373B04E01A1C613AC8 +:10184000052A04D8573B32681201134307E02C2BBA +:1018500002D13368236001E0019A137000233360E2 +:10186000084A136801331360074A13680133136091 +:1018700011E7C046C80D00207C0D0020840D00201B +:10188000740D0020780D0020800D0020D00D002068 +:10189000D40D0020700D00200CED00E04000400051 +:1018A000F00600200A1D0000E01C00000C1D0000D6 +:1018B000EC060020101D0000141D0000161D000085 +:1018C000F8B5031C041C47331A7800204021231C60 +:1018D000FEF7A6FE002801D100201AE0002325799A +:1018E00023706BB2002BF7DB3F27A61DF08F2F4034 +:1018F00048302018611D3A1C00F0EAF83F23F08FB1 +:101900009D43381880B2002D01D1F087E4E7002311 +:10191000F387F8BDF0B5061C0C1C1F1C93B0019298 +:101920003F25AC4203DC251C002F00D140372B1C87 +:1019300002AA3B431370311C501C2A1C00F0C8F84B +:101940006B4602A81A7940210123FEF7EFFE7619B3 +:10195000641BE5D113B0F0BD10B5031C041C473364 +:1019600048341A780431201C0023FFF7D3FF10BD40 +:10197000F7B5071CFFF7A4FF002872D03B1C4833C3 +:101980009A88B86C1A80002201385A80082862D8D8 +:1019900000F094F8130522256328453C3500314DAD +:1019A000281C00F0A6F8041C381C291C4C30221CF2 +:1019B00000F08EF8381C211C51E00123FB64FF333A +:1019C0003B658023DB007B65A0235B00BB65264B6A +:1019D000381CFB65142142E0FEF7FAFC3DE0FEF7FF +:1019E0002BFD3AE0381C0021FFF7B6FF386D1F4B86 +:1019F000984236D9391C5431FEF7B0FB31E0391C1E +:101A0000386D58317A6DFEF777FB26E0381C7C6D17 +:101A1000396D4C30221CFEF76FFBA10019E03E1C13 +:101A200000257B6D3C6D00934C36009B9D420FDA88 +:101A30000021631CFF3301932078FEF779FC019BA2 +:101A40000134011C9C42F7D1308001350236ECE7AD +:101A50005900381C03E001225A80381C0021FFF78E +:101A60007BFFF7BDF61B0000882BED68FF1F000011 +:101A7000074808B5031C062247331A70FFF778FFA2 +:101A800004480722031C47331A70FFF771FF08BD93 +:101A9000F40600207C08002010B5E2B0041CFFF71B +:101AA0003BFDC42268460021520000F01AF847238B +:101AB0006B441C706846FFF75BFFFBE702B471469E +:101AC00049084900095C49008E4402BC7047C04681 +:101AD000002310B5934203D0CC5CC4540133F9E722 +:101AE00010BD031C8218934202D019700133FAE72B +:101AF00070470023C25C0133002AFBD1581E704797 +:101B00000CA0800040A0800044A0800048A080007D +:101B10000697FF0901A101150026FF0075089540F1 +:101B20000901810295400901910295010901B10263 +:101B3000C0000000537061726B46756E20456C6585 +:101B40006374726F6E696373005177696963204DC6 +:101B50006963726F2053616D4432310000000000F0 +:101B6000341B0000491B0000E20300201201100298 +:101B7000EF0201404F1B1900014201020301000066 +:101B80003C21646F63747970652068746D6C3E0AE3 +:101B90003C68746D6C3E3C626F64793E3C7363726A +:101BA0006970743E0A6C6F636174696F6E2E726542 +:101BB000706C6163652822687474703A2F2F73709B +:101BC00061726B66756E2E636F6D2F70726F6475C8 +:101BD0006374732F313534323322293B0A3C2F731F +:101BE00063726970743E3C2F626F64793E3C2F686B +:101BF000746D6C3E0A0055463220426F6F746C6FF4 +:101C0000616465722076332E342E302D35332D6786 +:101C1000666264396264312D646972747920534656 +:101C20004857524F0D0A4D6F64656C3A20517769E1 +:101C30006963204D6963726F2053616D4432310DC9 +:101C40000A426F6172642D49443A2053414D443237 +:101C500031453138412D51776969634D6963726F40 +:101C60002D76310D0A00EB3C905546322055463218 +:101C70002000020101000240007E3EF83F0001000A +:101C80000100000000000000000080002942004226 +:101C90000051776969634D6963726F004641543141 +:101CA00036202020494E464F5F5546325458540046 +:101CB000F61B0000494E44455820202048544D0052 +:101CC000801B000043555252454E54205546320069 +:101CD000000000000000000800003E80020002003A +:101CE00076312E31205B41726475696E6F3A5859B6 +:101CF0005A5D204175672031322032303139203031 +:101D0000393A34363A31340A0D000600580A0D00CB +:0C1D1000590A0D005A00230A0D000000C3 +:101D1C0001C80000050F3900021810050038B6087C +:101D2C0034A909A0478BFDA0768815B66500010182 +:101D3C00001C100500DF60DDD88945C74C9CD265BE +:101D4C009D9E648A9F00000306AA0002000000000A +:101D5C000A00000000000306AA00080002000400AC +:101D6C00A0001400030057494E55534200000000D8 +:101D7C000000000000008400040007002A0044005A +:101D8C006500760069006300650049006E00740010 +:101D9C006500720066006100630065004700550035 +:101DAC00490044007300000050007B0039003200F1 +:101DBC004300450036003400360032002D00390057 +:101DCC004300370037002D00340036004600450034 +:101DDC002D0039003300330042002D003300310058 +:101DEC0043004200390043003500420042003300FA +:101DFC00420039007D00000000000000090299003B +:101E0C0005010080FA080B0002020201000904001F +:101E1C000001020201000524001001042402060541 +:101E2C00240600010524010301070583030800FFB4 +:101E3C0009040100020A00000007058102400000AD +:101E4C0007050202400000090402000208065000C7 +:101E5C000705840240000007050502400000090444 +:101E6C0003000203000000092100010001222100EF +:101E7C00070586034000010705060340000109041D +:101E8C00040002FF2A010007058703400001070533 +:101E9C00070340000100000000C201000000080020 +:101EAC00090403000203000003000000008002028A +:101EBC0020000000000000000000000000000000F6 +:101ECC00000000000000000000000000312E303047 +:101EDC0053425355000000000000000000000000B9 +:101FF00000000000991A00003D150000F61B0000CB +:00000001FF diff --git a/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.bin b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.bin new file mode 100644 index 00000000..8021afda Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.bin differ diff --git a/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.elf b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.elf new file mode 100644 index 00000000..adce227b Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.elf differ diff --git a/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.hex b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.hex new file mode 100644 index 00000000..1c3fd7c4 --- /dev/null +++ b/sparkfun/samd/bootloaders/SAMD51/MicroMod/bootloader-sparkfun-samd51-micromod-v3.4.0-65-gdf89a1f-dirty.hex @@ -0,0 +1,573 @@ +:10000000E0DF0020710500006D0500006D050000B7 +:100010006D0500006D0500006D050000000000008A +:100020000000000000000000000000006D0500005E +:100030006D050000000000006D050000690500006E +:100040006D0500006D0500006D0500006D050000E8 +:100050006D0500006D0500006D0500006D050000D8 +:100060006D0500006D0500006D0500006D050000C8 +:100070006D0500006D0500006D0500006D050000B8 +:100080006D0500006D0500006D0500006D050000A8 +:100090006D0500006D0500006D0500006D05000098 +:1000A0006D0500006D0500006D0500006D05000088 +:1000B0006D0500006D0500006D0500006D05000078 +:1000C0006D0500006D0500006D0500006D05000068 +:1000D0006D0500006D0500006D0500006D05000058 +:1000E0006D0500006D0500006D0500006D05000048 +:1000F000000000006D0500006D0500006D050000AA +:100100006D0500006D0500006D0500006D05000027 +:100110006D0500006D0500006D0500006D05000017 +:100120006D0500006D0500006D0500006D05000007 +:100130006D0500006D0500006D0500006D050000F7 +:100140006D0500006D0500006D0500006D050000E7 +:100150006D0500006D0500000000000000000000BB +:10016000000000000000000000000000000000008F +:10017000000000000000000000000000000000007F +:100180006D0500006D0500006D0500006D050000A7 +:10019000000000006D0500006D0500006D05000009 +:1001A0006D0500006D0500006D0500006D05000087 +:1001B0006D0500006D0500006D0500006D05000077 +:1001C0006D0500006D0500006D0500006D05000067 +:1001D0006D0500006D0500006D0500006D05000057 +:1001E0006D0500006D0500006D0500006D05000047 +:1001F0006D0500006D0500006D0500006D05000037 +:100200006D05000000000000000000006D0500000A +:100210006D0500006D0500006D0500006D05000016 +:100220006D0500006D0500006D0500006D05000006 +:100230006D0500006D0500006D0500006D050000F6 +:100240006D0500006D0500006D0500006D050000E6 +:100250006D0500006D0500006D0500006D050000D6 +:1002600000000000B0F5801F0FD2084B4AF2015188 +:100270005A8AD207FCD5586199805A8AD207FCD590 +:1002800000F50050B0F5801FF2D3704700400041E8 +:10029000531E3AB1043851F8042B40F8042F013BA7 +:1002A0005A1CF8D1704700BFF0B4194C23886FF383 +:1002B00005132380638ADD07FCD54AF21553144DDC +:1002C000A3806B8ADC07FCD502B3114C4FF0FF37DB +:1002D0004AF2045C042A154628BF0425638ADB071A +:1002E000FCD500239D4286BF51F8236040F823606F +:1002F00040F823700133042BF4D1521B606101EBF1 +:100300008501A4F804C000EB8500E3D1F0BC704780 +:10031000004000412DE9F04F5C4B87B01A8842F451 +:1003200080421A801A8842F400421A8000AF0546C3 +:100330000E464FEA50380B1F021F01F1FC0402E089 +:10034000A34200F0968053F8040F52F8041F88422D +:10035000F6D0DFF844A11AF80830002B4FD14C49F1 +:1003600025F4FF5201EB481322F01F023A614FEAD5 +:100370004812BB6020317A6013F8012B01EB481161 +:100380008B4205D0002A49D113F8012B8B42F9D1B9 +:10039000C7F814D0ADF5005DC7F80CD0002A48D1DD +:1003A0003A494B8AD807FCD54AF2015337484D6188 +:1003B0008B80438AD907FCD501230AF80830E2B1C3 +:1003C000D7E90329A2EB0908BA68324B541E7A68B0 +:1003D0001A44924603E0A24509F580790DD014F83D +:1003E000013F002BF7D008EB090148464022FFF7F8 +:1003F0005BFFA24509F58079F1D1D7F814D04022EE +:1004000031462846FFF750FF204A538ADB07FCD5C8 +:100410001C37BD46BDE8F08F8B4204D05A1C8A427F +:1004200003F10203F8D1C7F814D0ADF5005DC7F8A9 +:100430000CD0F968BB683A695C1E01F5005B0B469D +:10044000A2EB010903E003F580735B450FD014F8BC +:10045000012F002AF7D009EB030118464FF48072F0 +:1004600001F082FD034603F580735B45EFD1012265 +:1004700096E7074BC5F3042503EB48181C37012307 +:1004800008F80530BD46BDE8F08F00BF00400041D0 +:10049000080C0020270C0020880B002030B42B49CA +:1004A0002B4A0B889BB20B80137843F00103137027 +:1004B0005368DC07FCD440F60413254913624B68EB +:1004C0005807C3F38002FAD4224B23491A771A46FD +:1004D000996292F82C30C3F30010DB06F9D41D4961 +:1004E00082F8200091F82C305D07FBD40B7F194A6D +:1004F00043F002030B7792F82C309C07FBD4536A2D +:100500001449536291F82C301807FBD49823114AF0 +:1005100081F820301369D905FCD50D4A40F6063321 +:1005200013625368C3F380015B07FAD40B4A0C4B88 +:100530000C480124547140F2E735E02407225D6045 +:1005400080F8234099601A6030BC70470040004139 +:10055000001C00400010004080BB01040008004067 +:1005600010E000E000ED00E000F0CEB8FEE700BFD4 +:10057000154A16498A4208B50ED0154B99420BD23E +:10058000013B5B1A23F003030433134452F8040BBA +:1005900041F8040B9A42F9D10E4A0F4B9A420AD203 +:1005A000013B9B1A23F0030304331344002142F858 +:1005B000041B9342FBD1094B094A23F07F0393604C +:1005C00000F0BAFEFEE700BFD821000000000020C6 +:1005D000D0010020D0010020DC1F0020000000001E +:1005E00000ED00E0F0B5DFF850E0BEF80260DEB9E3 +:1005F000AEF102070EF5FF7C41F2210532460823D9 +:1006000012F4004F03F1FF3385EA42049BB20ABFA4 +:100610005200A2B292B2002BF2D127F8022F06F5B7 +:1006200080766745B6B2E9D180EA11203EF81030F5 +:1006300083EA012188B2F0BDD0010020BFF34F8FC3 +:100640000449054BCA6802F4E0621343CB60BFF370 +:100650004F8FFEE700ED00E00400FA0500030128DB +:1006600004D9012300BF01338342FBD1704700BF8F +:1006700030B405461C24002008E06BB904B110B169 +:1006800030332B540130043C231D09D021FA04F3EC +:1006900003F00F03002AF0D0092BF1DD3733F0E728 +:1006A00030BC704708B5024B024A1A60FFF7C6FF1C +:1006B000FCFF0320EF6926F00B4A13686BB970B595 +:1006C0000A480B4D01682C6801314FF4FA6601604D +:1006D00016600CB1A14203D270BD013B136070479C +:1006E0002B60FFF7DFFF00BFD8030020081C0020AD +:1006F0000C1C002008B5024B024A1A60FFF79EFF4F +:10070000FCFF0320EF6916F01F4920480B680268C0 +:1007100001330B6042B1A2F57A718B4220D0934233 +:1007200004BF00230360704713F0FF030FD1184B81 +:1007300018494FF400029A610B78A3F10A02D2B271 +:10074000F02A18D8144A127813440B707047114AD3 +:1007500012789A42E7D10E4B4FF400025A6170476B +:100760000B4910B493424FF400048C6101D1002373 +:10077000036010BC7047084802785242D2B213445A +:1007800002700B70704700BFD0030020D40300201C +:10079000008000410100002000000020064B074AB5 +:1007A0001B681168994206D2054903F5FA634FF4B4 +:1007B0000000136048617047D0030020D40300207C +:1007C00000800041024B4FF400029A609A6170472A +:1007D00000800041704700BF30B43C4B3C4A93F866 +:1007E00058003C4940F0010083F8580093F83C0061 +:1007F00000F0F00083F83C0093F83C0040F0070064 +:1008000083F83C0093F8590040F0010083F8590048 +:1008100093F83C0000F00F0083F83C0093F83C0094 +:10082000402440F0700083F83C00C2F8A8400B69F7 +:1008300043F480630B618B6943F001038B61536860 +:100840005B07FCD44FF082421346117841F001015E +:100850001170997811F00101FBD11F4B1F481A68E4 +:100860004FF0824302F01F041D8D1F2C08BF05248A +:1008700064F38A151D85C2F344141D8D1F2C08BF17 +:100880001D2464F304051D85C2F382221C8D072AF2 +:1008900008BF032262F30E341C851A7861F3C71275 +:1008A0001A701A7842F004021A7058621A8961F3B9 +:1008B00083021A811A8922F001021204120C1A8191 +:1008C00030BC4FF4807201F05DBB00BF008000417E +:1008D000001C00400008004084008000541C0020E0 +:1008E0002DE9F8434FF0824C0746DCF824800E4691 +:1008F0001546002B51D01C4663782278934238D39A +:10090000A278680108EB4513A2B9211D40F8081030 +:10091000596862F30D015960596800F1824562F32C +:100920009B31596095F80421012142F0400285F87D +:100930000421A17000F1824999F8075115F00105D1 +:1009400014D05D68A378EDB2022B25702DD0B5428E +:1009500028BF3546FFB1657038462A46211D01F093 +:1009600003FB0122002389F80721A3702846BDE874 +:10097000F883D51AB54228BF3546002FF6D0211D81 +:10098000194438462A4601F0EFFA63782B44637025 +:100990002846BDE8F8836770E3E7074C02EB0213D3 +:1009A00004EB8304FFF788FEA6E750F808102A46F8 +:1009B000201D01F0D9FACAE7541D002071B1F8B525 +:1009C000054617461E460C462146284633463A46FB +:1009D000FFF786FF241A0544F6D1F8BD704700BF23 +:1009E00070B54FF082440E46656A144605EB421519 +:1009F000DBB16B696FF3DF736B6128616B6966F361 +:100A00000D036B616B69600100F182406FF39B33F2 +:100A1000022180226B6180F8071180F8052190F88F +:100A200007319B07FBD5304670BD6B69C3F302737A +:100A30000333012202FA03F38B4207D86B69221FAA +:100A400018BF012262F3DF736B61D6E7054A042108 +:100A5000442313FB0413134401463246184601F0A5 +:100A600083FACAE7541D00200023FFF7B9BF00BF77 +:100A70002DE9F04F4FF0824499B0FFF71DFEA38B94 +:100A800013F008032AD0C64BC64E0820802240210E +:100A90001125A083A27284F8005184F8051184F80E +:100AA00004215A68032565F31E725A605A6965F37A +:100AB0001E72BD4D5A611E601D615A68BB4D60F3C8 +:100AC0009B325A60586800226FF30D005860104640 +:100AD00084F804112A7019B0BDE8F08F94F807214A +:100AE000D60607D4B14B1878003818BF012019B0CA +:100AF000BDE8F08FAE4DDFF8CC8295F80BC06E7A72 +:100B0000A97A95F806A0EF79287AAA8840F2013EE2 +:100B100041EA0C214FF0100940EA06204AEA072C6E +:100B20004026724584F807910FFA80FBA8F8001060 +:100B30000FFA8CF984F804617CD016DC40F20115C0 +:100B4000AA4277D0B2F5817F59DB40F2A1239A42C5 +:100B500000F0D68027DDB2F5307F00F0EF804FF057 +:100B60008243202283F80521BCE7B2F5106F00F024 +:100B70002B8165DD42F2A110824200F0088149DD3F +:100B800042F22120824255D04FF6A1639A42E6D12B +:100B90000023012928BF01211A4606A8ADF8183004 +:100BA000FFF71EFF9EE740F2A1139A4200F0A880D3 +:100BB000B2F5E07FD3D0B2F5817FD0D110F00F0332 +:100BC000CDD000F008005CEA0002C8D15B0103F15F +:100BD00082431BF0800F93F8062140F0A481D106D8 +:100BE00027D5102283F8042193F80721920620D5F7 +:100BF0002021012283F8071183F8042119E0822AB9 +:100C000000F0A88043DDB2F5807FA8D1202384F8CE +:100C1000053167E742F221018A420BD09FDC40F6A2 +:100C200021239A4205D022F4007240F621139A4201 +:100C300095D100231A46194606A8FFF7D1FE51E7C1 +:100C4000B2F5A06F70D03DDD40F281639A422CDC9A +:100C5000B2F5D06F83DBBCF5807F5CD0BCF5007F44 +:100C600000F04681032F00F020810F2F00F0498112 +:100C7000212F00F04F81222F7FF471AF0023212913 +:100C800028BF21211A464B48FFF7AAFE2AE7803ADF +:100C9000012A3FF664AF022928BF02211A4606A89E +:100CA000ADF81830FFF79CFE1CE7B2F5086F7FF433 +:100CB00056AF0023012928BF01211A463B48FFF700 +:100CC0008FFE0FE740F202339A4214D110F00F0367 +:100CD0003FF445AF00F008005CEA00027FF43FAF4C +:100CE0005B011BF0800F03F1824314BF202210220E +:100CF00083F805219DE740F2A1339A427FF42FAF9C +:100D00000023082928BF08211A4606A8CDE9063382 +:100D1000FFF766FEE6E60023122928BF12211A46D5 +:100D20002548FFF75DFEDDE61A46194606A8FFF7DF +:100D300057FE69F07F03DBB2A372D3E607287FF486 +:100D40000EAF0023AA2928BFAA211A461B48FFF785 +:100D500047FEC7E605073FF559AF00F00F00400119 +:100D600000F182431BF0500F93F806414FF000034F +:100D700014BFC4F34014C4F30014022928BF022195 +:100D80001A4606A8ADF81840FFF72AFEAAE6082979 +:100D900028BF08211A460A48FFF722FEA2E600BF34 +:100DA000541C0020141C0020581D0020DC030020CF +:100DB000101C0020FC1F0000E81F0000F0000020B5 +:100DC000E800002002040020764D01931A461946DF +:100DD00006A885F80090FFF703FE734A73480321C5 +:100DE00084F84011556C302761F31E75556484F802 +:100DF0004561106484F82071D2F834C08025A0F1D8 +:100E0000440E61F31E7CC2F834C084F82451C2F849 +:100E100030E084F86061D2F874C0019B63F31E7CFB +:100E2000C2F874C084F8645184F8A011D2F8A430D8 +:100E300000F1CC0C61F31E73C2F8A43084F8A561F4 +:100E4000C2F8A0C084F88071D2F89470442388302E +:100E500061F31E77C2F8947084F88451C2F8900050 +:100E600084F8C03184F8C46184F8C451D2F8C40055 +:100E700061F31E70C2F8C400D2F8D40061F31E7092 +:100E8000C2F8D40084F8E03184F8E46184F8E451D5 +:100E9000D2F8E43061F31E73C2F8E430D2F8F430D3 +:100EA00061F31E73C2F8F4301CE6BAF1030F3FF68B +:100EB00056AE06AE30464822002101F063F88DF8A8 +:100EC0001970BAF1000F40D1042240F209438DF8A5 +:100ED0001820ADF81A30B8F800209DF8181000233B +:100EE000914228BF114630461A46FFF779FDF9E5D1 +:100EF0000023992928BF99211A462D48FFF770FD34 +:100F0000F0E50023392928BF39211A462948FFF77F +:100F100067FDE7E50023092928BF09211A4626486D +:100F2000FFF75EFDDEE594067FF583AE202283F8B1 +:100F3000042193F8072150067FF57BAE4021022261 +:100F400083F8071183F8042173E61C4BDFF87490D3 +:100F50000FCB02AC84E80F00002754F8043B09EBE8 +:100F6000070019680122FFF783FBA6420744F4D16A +:100F7000AA79134B53F82240002309F80730204682 +:100F800001F008F8431C5B008DF818302278002A25 +:100F9000A1D02346314601F8022F13F8012F002A71 +:100FA000F9D198E7DC030020541C0020E01D00204C +:100FB0004000002004000020DC000020D81F0000BA +:100FC00020200000E003002008B5FFF705FC054BDA +:100FD0004FF0824200211970137843F0020313701E +:100FE00008BD00BFDC03002010B500230C46012221 +:100FF000FFF7F6FC204610BDFFF7F6BF70B50446BC +:101000000D46FFF735FD00B970BD29462046002387 +:10101000BDE870400222FFF763BC00BF70B5054613 +:101020000E46FFF725FD60B14EB1344621462846F5 +:1010300000230222FFF754FC241A0544F6D130465F +:1010400070BD0646304670BD002A0FDD024405E043 +:1010500000F8013B824201F1010107D00B78002B1F +:10106000F6D1202300F8013B8242F7D1704700BF40 +:101070002DE9F8434FF4007204460F46084600215C +:1010800000F080FFE4B9644E3D4606F1300C344672 +:101090000FCC644528606960AA60EB60264605F1C4 +:1010A0001005F4D107CE3388AB815524AA232860DC +:1010B0006960AA6087F8FE4187F8FF31BDE8F883D0 +:1010C0007E2C20D8631E3E2B88BFA4F14003002B4A +:1010D0003ED0C3EBC352190207EB42200B1F08306E +:1010E000FC3140F6FF74B3F5805F07D25A1DA3426E +:1010F00014BF92B24FF6FF7220F8132001339942C9 +:10110000F1D1BDE8F883822C2DD9A4F18303012B02 +:1011100073D9853C2102B1F5801FCFD23F4A4048A8 +:10112000404B7C613A604FF480547860C7F8FC31E2 +:101130004FF400503C4BB8604FF48072F960BC61D2 +:101140003A61FB6107F12000BDE8F84300F00CBFF5 +:10115000F0223A7007F109003A46FF2102F8011F18 +:101160008242FBD1B5E77F2CA8D14D232F493A46C7 +:1011700007F10B003BB1013102F8013B824204D080 +:101180000B78002BF7D12023F6E72823284E294897 +:10119000FB7202252B376FF066094FF04D08A7F15F +:1011A0000B0438B300F0F6FEE06165833146224659 +:1011B00005E002F8013BBA4201F1010107D00B78CA +:1011C000002BF6D1202302F8013BBA42F7D10135BA +:1011D000ADB2052D84F8109084F8118084F8189031 +:1011E00084F8198006F1100607F120073FF466AF76 +:1011F000F068D4E74FF40010D6E70D4A02EB031372 +:10120000DC68204600F0C6FE214602463846BDE8AE +:10121000F84300F0A9BE00BF302000005546320A56 +:1012200057515D9E306FB10A604411555B2000003C +:10123000E02000001021000030B50C46394920683C +:10124000884283B001D003B030BD01F11441606821 +:1012500001F52C1101F602318842F4D13249D4F85B +:10126000FC018842EFD1A168880403D52F48E569C5 +:101270008542E8D1CD0703D42169B1F5807F2CD018 +:10128000002B3DD0A16900293AD01868814208D0CE +:1012900041F26305A94201D8002841D04FF0FF3147 +:1012A0001960616941F263008142CCD803EBD1053A +:1012B00001202C7A01F0070100FA01F12142C8B2A5 +:1012C00028D059681B688B42BDD8002ABBD1184B67 +:1012D000184A1B681E331360B5E7E06810F0FF0F73 +:1012E000CED1A0F58041B1F57C2FC9D204F1200107 +:1012F000CDE90023FFF70EF8DDE90023002BC1D173 +:10130000002AA0D10A4B0B4A1B6803F596731360A1 +:1013100003B030BD04432C72596801315960D1E7E4 +:101320001960BEE75546320A306FB10A6044115564 +:10133000081C00200C1C0020F8B53D4B9B6803B135 +:10134000FEE7FFF73FFA44F204031C68A4F580436C +:10135000B3F57C2F22D844F26822364B12689A42A9 +:101360004AD0354B1B7813F00102344B08D1344975 +:101370001868884258D01868324A90424ED12F4B94 +:1013800000221A60304A4FF480434FF4000151614B +:101390001A6882F30888264A936020472B4CFFF78F +:1013A0007DF8BFF35F8F62B6FFF70EFE284F294D21 +:1013B0004020FFF70FFA0A233B700126FFF758FB86 +:1013C00020B12B7803F0FF027BB12E702B783BB954 +:1013D0002B78002BF2D1FF2300BF013BFCD1EDE7BE +:1013E00000F0E2FA00F0E0FAFAE74FF48040226001 +:1013F000FFF7F0F93E70E8E70F4B1B78DB0704D4EA +:101400000E4A104B12689A42ABD00C4A0D49124B4F +:1014100011601B680D4C32332360C0E719604FF434 +:10142000FA70FFF71BF9AAE7084C1A60B7E700BF8C +:1014300000ED00E07CB0EE87000C0040FCFF0320D4 +:10144000EF6916F0EF6926F0008000410C1C0020C7 +:101450000000002004040020081C002030B40A4AC8 +:101460000A480B4B526842600022C3E90022C3E9DC +:101470000222F0250A241A8202731D70DC7130BC2E +:1014800004220D21FFF7F0BA240600209C01002061 +:1014900044060020F8B58368ABB104460E461746F3 +:1014A0000025A278E06833464FF40071FFF786FA12 +:1014B0003B4605F58050E1680122FFF7BDFEA368B9 +:1014C0000135AB42EDD8F8BD2DE9F047DFF8E090EB +:1014D000B9F8163099F8112099F8121082B05BBA59 +:1014E0008DF807201FFA83F899F81320ADF8023021 +:1014F00099F814308DF806108DF805208DF8043019 +:10150000B8F1000F32D0274FDFF8A8A0264D0646CD +:10151000002412E0019839462044FFF7A9FD042277 +:101520004FF400713846FFF79FFAAB680134A3F51A +:101530000073A045AB602B4619D0FFF799FA84469B +:10154000334605224FF400713846BCF1000F25D018 +:10155000002EDFD1FFF732FA01985346204432467D +:101560003946FFF769FEFFF719F9DEE70E4B0F4C1E +:10157000D9F804205A600C480022C4E90022C4E9CA +:101580000222F0260A2522821A730D2104222670D7 +:10159000E57102B0BDE8F047FFF766BA02B0BDE8FA +:1015A000F08700BF080400209C01002044060020B2 +:1015B000240600205806002030B4094B094C0022B4 +:1015C0001A60F02598704FF02060DA609A601A82F5 +:1015D000DA70998101221D705860227330BC704707 +:1015E000440600209C01002070B504220D46FFF740 +:1015F0003BFA854219D1144C144E154B7268A16800 +:1016000062600022C3E90022C3E90222491BF026DE +:101610000A251A821E70DD71A16022730A48BDE896 +:10162000704004220D21FFF71FBA074C074E00211E +:101630000420FFF7C1FF73686360204604220D2178 +:10164000FFF712FAD9E700BF9C0100202406002012 +:10165000440600201A4A002370B4C2E90033C2E9EC +:101660000233184C136138B3E17D02F108050823F9 +:10167000647C04F03F041C2C0CD03F2C0AD099420F +:1016800028BF194690B1023B1B02138070BC0C4866 +:10169000FFF7AABF0C33DBB240F61C2605249942A3 +:1016A0002E80EC7028BF19460028ECD1013B137046 +:1016B00070BC0348FFF798BFE17C151D0423D7E7F2 +:1016C000080600202406002070B513460C46154677 +:1016D00006460A4600200121FFF702F900B970BD55 +:1016E0002B46224630461F21FFF7FAF8012070BD35 +:1016F00080B50546ADF5247D72B6BFF35F8FDFF888 +:10170000E8C0374E374F4FF08243002440F2FF329B +:101710009A8221469A830DA8CCF80840442200F012 +:1017200031FC21464FF406721EA800F02BFC6A78AB +:10173000AB786868069002F00F0203F00F030221F5 +:101740006A70AB708DF836101EABE9680794012201 +:1017500040F6FF708DF820400596FFF76DFD1EAA3C +:101760000DA92846FFF796FE6A7805A801230D21EA +:10177000FFF736F9002400E00134A9780DAA05A886 +:10178000FFF7A2FF20B9BC42F6D9FEF78BFFF3E7C3 +:10179000DDE906019DF8233001960022CDE9020122 +:1017A0008DF810208BB12A2B16D1BDF82A305BBAE8 +:1017B0009CB2AC601EAA0DA92846ADF80230FFF716 +:1017C00069FE039BA3EB442303936A7801230D2155 +:1017D00001A8FFF705F9CDE7FEF78CFFF5E700BF9D +:1017E00055534253A086010000ED00E070B5564C01 +:1017F00084B000F093FB204600220521FFF764FF30 +:10180000002841D0514DE37BA668AE605A2B2FD8FB +:10181000DFE803F03C2E2E3F2E2E2E2E2E2E2E2EC7 +:101820002E2E2E2E2E2E472E2E2E2E2E2E2E54586F +:101830002E2E5B2E2E2E2E5E2E6F2E2E792E7D2E90 +:101840002E2E2E812E2E2E2E2E2E2E2E2E2E2E2E65 +:101850002E2E2E2E2E2E2E2E2E2E2E2E2E2E2E2EA8 +:101860002E2E2E2E2E2E2E2E2E2E2E2E2E2E95005F +:101870004FF400510520FFF79FFE636833486B600B +:1018800004220D21FFF7F0F804B070BDFFF7E6FD6C +:10189000FAE7E17C2E48122928BF1221FFF7A4FEA7 +:1018A000F2E72C492C481822FFF7CEFBE17C2B48AD +:1018B000242928BF2421FFF797FEE5E70020FFF742 +:1018C000C9FEE1E7FFF7CAFDDEE7FFF7C7FDDBE78B +:1018D000234B93E807000C2E01AB83E8070088BF79 +:1018E0000C2218464FF00C0188BFAA60FFF77CFE5F +:1018F000CAE71C481C4B036008214FF400334360C7 +:10190000FFF772FEC0E70120FFF7DEFDBCE7002015 +:10191000FFF7DAFDB8E70E4B62686A600022C3E9A0 +:101920000022C3E90222F0260A241A822A730D211A +:10193000042206481E70DC71FFF796F8A4E7012028 +:10194000FFF788FEA0E700BF240600209C010020CE +:1019500044060020BC1F0000B4010020AC010020A0 +:101960008C2100001C06002000003E7F72B6BFF3F1 +:101970005F8F4FF08243044940F2FF3200209A8289 +:101980009A838860704700BF00ED00E000B583B027 +:10199000014601226846FEF76BFE68460821FFF704 +:1019A00023FB03B05DF804FB2DE9F04FA249DFF8FB +:1019B000C4A2DFF8C482A14FA14EA24DDFF8A0B2AD +:1019C00000227A2383B00A608AF80030C146FFF70C +:1019D0000DFF40214846FFF711FB002408F80040A6 +:1019E000386018B9C6F800802860F0E7FEF7D6FE28 +:1019F0003968C6F800802C600029E8D023464C46A0 +:101A00002078FF280ED0232818D0A0F13003DAB2B6 +:101A1000092A42D8DBF8002043EA0213CBF8003051 +:101A2000013434602B68396801338B422B60CED28D +:101A300034682078FF28F5D02328E6D19AF80020D2 +:101A4000532A51D0522A73D04F2A46D0482A77D0F1 +:101A5000572A7CD06F2A00F09280682A00F0B1806B +:101A6000772A00F0B980472A00F09080542A0DD0E0 +:101A70004E2A0BD0562A00F0CF80582A00F0D28090 +:101A8000592A00F0BB805A2A00F0F8807A220023FD +:101A90008AF80020CBF80030C2E7A0F14103052B03 +:101AA00007D8DBF80030373840EA0310CBF80000E5 +:101AB000B6E7A0F16103052B07D8DBF800305738F3 +:101AC00040EA0310CBF80000AAE72C2849D00023F5 +:101AD0008AF80000CBF80030A2E7574BDBF8002073 +:101AE0001B681A703468D1E7DBF800000133CA1AAA +:101AF0002B60514B824228BF02461868524B611C32 +:101B00001C461A60316000F02FFA23682A684F4C97 +:101B10003068DBF8001023701A44013A2A605A1E1C +:101B2000DBB210449942306023D800BF3468ADE77F +:101B3000414BDBF800101868FFF75EFA3468A5E740 +:101B40003D4BDBF800201B681A8034689EE73A4B57 +:101B50003F4A1B6893424AD0DBF800201A60346881 +:101B600094E7354ADBF8003013600023CBF80030EF +:101B700056E7C91A304B1868FFF750FAD5E72E4BD5 +:101B800001211868FFF730FA34687FE7DBF800308E +:101B9000EFF308822F490A601A6882F30888D3F8A5 +:101BA00004C0E0472B490B6883F308882A4B1B7855 +:101BB000002B3FF46BAF29480121FFF715FA346879 +:101BC00064E71D4B26481B6802211B88CBF80030B8 +:101BD000FFF70AFA346859E7174B21481B680421BC +:101BE0001B68CBF80030FFF7FFF934684EE74FF081 +:101BF0004010FEF7EFFD104B1B68ADE7DBF800204F +:101C0000002A5BD10C4B174A1B681360164803214E +:101C1000FFF7EAF9346839E714482A21FFF7E4F9B5 +:101C2000346833E7DBF80000FEF71CFB10480321A3 +:101C3000FFF7DAF9346829E7CC1F0020781F00206D +:101C40007C1F0020841F0020D81F0020741F00204C +:101C50000CED00E0D01F002070080020982100004B +:101C6000D41F002074080020A0210000AC21000037 +:101C70009C210000801F0020881F0020134BDBF8F0 +:101C800000401B686CB11A19002421461C4614F848 +:101C9000010B0192FEF7A6FC019A94420146F6D18F +:101CA000044601210A48FFF79FF92046FFF76EFE20 +:101CB00008480321FFF798F93468E7E6064B1968EE +:101CC000024B92081868FEF7EFFA9FE7CC1F00203E +:101CD000A4210000A821000074080020F8B54021CC +:101CE00090F84720044603460020FEF7F9FDD0B1E6 +:101CF00094F9043027790026B342267013DBB4F838 +:101D0000443007F03F0504F1480018442A46611D9D +:101D100000F02AF9B4F8440017F0C00F284480B24C +:101D200003D1A4F844000020F8BDA4F84460F8BD35 +:101D30002DE9F0430D4691B01E4600EB0108D7B2E5 +:101D400043F03F093F2DA8EB050113DC002E08BF2F +:101D500040262A462E430DF101008DF8006000F068 +:101D600003F93A46684601234021FEF739FE11B0D7 +:101D7000BDE8F0838DF8009001F1300E0DF1010403 +:101D800008684A688B68D1F80CC0C4F80CC01031E0 +:101D9000714520606260A36004F11004F0D10A680C +:101DA0004B688868A060226063608B7BB1F80CC0D0 +:101DB000A3733A460123402168463F3DA4F80CC076 +:101DC000FEF70EFEBEE700BF2DE9F0470446FFF721 +:101DD00085FF50B3A36CB4F84C20A4F84820013B15 +:101DE0000022A4F84A20082B06D8DFE803F0667D1D +:101DF00089200812234D5F000123A4F84A3094F88B +:101E0000472004F148000023BDE8F0470421FFF714 +:101E10008FBF04F1480094F8472000230421FFF706 +:101E200087FF206DB0F5804F6DD2BDE8F087FEF7DB +:101E300061FCE4E7D4E91463002BD8BF4FEA4309FF +:101E400017DD04F14A0706F5807607EB43084FEAF1 +:101E50004309A6F5807500212878FEF7C3FB0135FC +:101E6000B5420146F8D127F8020FB84506F580764D +:101E7000EFD109F1040194F8472004F14800002350 +:101E8000BDE8F047FFF754BFD4E9141504F14C0046 +:101E90002A46FEF7FDF9A90094F8472004F148000E +:101EA0000431BDE8F0470023FFF742BFD4E9140234 +:101EB00004F15801FEF7ECF9A1E701254FF4807019 +:101EC0004FF480514FF4A072C4E91512C4E91350C5 +:101ED000104BE36594F8472004F148000023BDE867 +:101EE000F0471821FFF724BF0B4800F053F80A49C8 +:101EF0000546024604F14C0000F036F8291DBAE709 +:101F0000FEF7D0FB7BE704F15401BDE8F047FEF794 +:101F100001BA00BF604411551021000008B5074800 +:101F2000062380F84730FFF74FFF0548072380F866 +:101F30004730BDE80840FFF747BF00BF78080020E2 +:101F4000000A002000B5E3B00446FFF70FFD684625 +:101F50004FF4C472002100F015F88DF84740684630 +:101F6000FFF732FFFBE700BF0A44914200F1FF3365 +:101F700000D1704710B511F8014B03F8014F9142A1 +:101F8000F9D110BD02440346934200D1704703F8D3 +:101F9000011BF9E7034613F8012B002AFBD1181A9D +:101FA00001387047537061726B46756E20456C65E1 +:101FB0006374726F6E696373000000005370617226 +:101FC0006B46756E204D6963726F4D6F642053418F +:101FD0004D44353100000000FC618000106080003D +:101FE000146080001860800012011002EF020140AE +:101FF0004F1B200001420102030100000697FF0968 +:1020000001A101150026FF00750895400901810214 +:1020100095400901910295010901B102C00000003B +:1020200000000000A41F0000BC1F0000E00300200F +:10203000EB3C90554632205546322000020101000B +:102040000240007E3EF03F00010001000000000061 +:1020500000000000000029420042004D494D4F425F +:102060004F4F5400000046415431362020200000DC +:102070003C21646F63747970652068746D6C3E0AEE +:102080003C68746D6C3E3C626F64793E3C73637275 +:102090006970743E0A6C6F636174696F6E2E72654D +:1020A000706C616365282268747470733A2F2F73A3 +:1020B0007061726B66756E2E636F6D2F31363739B6 +:1020C0003122293B0A3C2F7363726970743E3C2FA6 +:1020D000626F64793E3C2F68746D6C3E0A000000AC +:1020E000494E464F5F554632545854001021000067 +:1020F000494E44455820202048544D00702000008F +:1021000043555252454E54205546320000000000BF +:1021100055463220426F6F746C6F61646572207631 +:10212000332E342E302D36352D67646638396131C3 +:10213000662D64697274792053464857524F0D0AD0 +:102140004D6F64656C3A20537061726B46756E20FA +:102150004D6963726F4D6F642053414D4435310DAD +:102160000A426F6172642D49443A2053414D44350F +:10217000314A3230412D537061726B46756E2D4D70 +:102180006963726F4D6F640D0A0000000000000863 +:1021900000003E800200020006000000580A0D0008 +:1021A000590A0D005A000000230A0D0076312E3125 +:1021B000205B41726475696E6F3A58595A5D2053BD +:1021C000657020323220323032302032303A3039AD +:0821D0003A35380A0D00000049 +:1021D80001C80000050F3900021810050038B608BC +:1021E80034A909A0478BFDA0768815B665000101C2 +:1021F800001C100500DF60DDD88945C74C9CD265FE +:102208009D9E648A9F00000306AA00020000000049 +:102218000902990005010080FA080B000202020178 +:102228000009040000010202010005240010010455 +:10223800240206052406000105240103010705837D +:10224800030800FF09040100020A000000070581D5 +:1022580002400000070502024000000904020002D3 +:1022680008065000070584024000000705050240E3 +:102278000000090403000203000000092100010016 +:1022880001222100070586034000010705060340D7 +:1022980000010904040002FF2A0100070587034022 +:1022A80000010705070340000100000009040300BE +:1022B800020300000300000000C201000000080043 +:1022C8000A00000000000306AA000800020004003B +:1022D800A0001400030057494E5553420000000067 +:1022E8000000000000008400040007002A004400E9 +:1022F8006500760069006300650049006E0074009F +:1023080065007200660061006300650047005500C3 +:10231800490044007300000050007B00390032007F +:102328004300450036003400360032002D003900E5 +:102338004300370037002D003400360046004500C2 +:102348002D0039003300330042002D0033003100E6 +:102358004300420039004300350042004200330088 +:10236800420039007D000000000000005553425330 +:1023780000000000000000000000000000800202D1 +:102388002000000000000000000000000000000025 +:10239800000000000000000000000000312E303076 +:103FF00000000000451F0000F11600001021000025 +:00000001FF diff --git a/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.bin b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.bin new file mode 100644 index 00000000..eac7fd52 Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.bin differ diff --git a/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.elf b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.elf new file mode 100644 index 00000000..1af8d3c5 Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/bootloader-sparkfun-samd51-thingplus-v3.13.0.elf differ diff --git a/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.bin b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.bin new file mode 100644 index 00000000..fab5eed2 Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.bin differ diff --git a/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.elf b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.elf new file mode 100644 index 00000000..a15fe522 Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.elf differ diff --git a/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.uf2 b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.uf2 new file mode 100644 index 00000000..d52ebc26 Binary files /dev/null and b/sparkfun/samd/bootloaders/SAMD51/Thing Plus/update-bootloader-sparkfun-samd51-thingplus-v3.13.0.uf2 differ diff --git a/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.bin b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.bin new file mode 100644 index 00000000..d0e8e4f3 Binary files /dev/null and b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.bin differ diff --git a/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.elf b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.elf new file mode 100644 index 00000000..0863bc56 Binary files /dev/null and b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.elf differ diff --git a/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.hex b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.hex new file mode 100644 index 00000000..be3fb09d --- /dev/null +++ b/sparkfun/samd/bootloaders/turbo/bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.hex @@ -0,0 +1,494 @@ +:10000000D82D002089020000850200008702000030 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000008502000049 +:100030000000000000000000850200007D020000BA +:100040008502000085020000850200008502000094 +:100050008502000085020000850200008502000084 +:100060008502000085020000850200008502000074 +:100070008502000085020000850200008502000064 +:100080008502000085020000850200008502000054 +:100090008502000000000000000000008502000052 +:1000A0008502000085020000850200008502000034 +:1000B00000000000074B1A00197DC907FCD520215C +:1000C000FF31198304494008D8611980137DDB078B +:1000D000FCD570470040004102A5FFFF10B50400A9 +:1000E000044B9C4200D910BD20000134FFF7E2FF11 +:1000F000FF34F5E7FFFF0300002330B59A4200D13B +:1001000030BD9C000D5901330551F7E7F0B580254E +:10011000104B114E5C68114FAC435C60002A00D15B +:10012000F0BD1400102A00D91024121B1E801D7D62 +:10013000ED07FCD5A400A44600240D590551043454 +:100140006445FAD1001909191F801C7DE407FCD50C +:10015000E4E7C0460040004144A5FFFF04A5FFFFBF +:10016000802270B5002304000D005200E958E058C9 +:10017000814203D104339342F8D170BD2000FFF7D0 +:1001800099FF402229002000FFF7C0FFF5E700009B +:10019000024A53785BB2002BFBDB7047000C004037 +:1001A00010230249CA681A42FCD070470008004078 +:1001B0001E21F8B50226254A254C5368254D8B4350 +:1001C00033435360A660FFF7E3FF234B6360FFF701 +:1001D000DFFFAE84FFF7E4FF204B1B689B0E3F2B35 +:1001E00000D1203B002602271D4A9B0213431D4AD3 +:1001F000EA62AB62AE84FFF7D3FF1B4BAB84FFF721 +:10020000CFFFAB8C3B43AB84FFF7CAFF3F22638831 +:10021000934380221F4367806388D2011343638026 +:10022000A660FFF7B5FF114B6360FFF7B1FFC02178 +:100230000F4A104B10485360036A09061B021B0A41 +:100240000B430362072396601360F8BD0040004132 +:10025000000C0040000800400600010024608000FF +:10026000FF01000080BB0A1C2405000000070300FA +:1002700010E000E0E703000000ED00E010B500F042 +:10028000D5F810BDFEE7FEE71E4A1F4B70B51F49AB +:100290009A4232D100211E4B1E4A934230D3FF2294 +:1002A0001D4B032193431D4A0C2593600222082411 +:1002B00030261B4B1B485A62C3788B431343C370D1 +:1002C000C378AB432343C370174B987BB0430600FE +:1002D000202030439873987BA84304439C73987BF9 +:1002E000884302439A738023104A51680B4353603A +:1002F00000F0AAFEFEE701CA01C38B42FBD3C9E7A7 +:1003000002C3CAE7EC1C000000000020CC01002062 +:10031000CC010020D40D00200000000000ED00E022 +:10032000FC70004100500041004800410040004185 +:10033000F0B5124E7388002B17D108241A0292B21E +:1003400015B2AC4667465500AAB2002F02DA0C4A35 +:100350005540AAB2013CA4B2002CF1D15C0032534A +:100360008022013352009342E7D10B0A43405B00E5 +:10037000F05A0902484080B2F0BDC046CC010020CE +:100380002110000070B5D318157801328024416027 +:100390000326013EFDD12C4200D101600626013E1C +:1003A000FDD10160641004D0E4B20226013EFDD10B +:1003B000EDE79A4200D2E7E770BD012300029842C0 +:1003C00000D87047C0460133F9E770B505001C241A +:1003D00000200F260B00E3403340002A09D1002BF8 +:1003E00007D1002C0BD0002809D1043C231DF1D1EA +:1003F00070BD092B03DD37332B540130F5E7303363 +:10040000FAE70000054B064A1A60BFF34F8F054B11 +:10041000054ADA60BFF34F8FFEE7C046FC7F00203D +:10042000EF6916F000ED00E00400FA0510B5194A76 +:1004300019491368013313600A68002A0CD0174861 +:100440001018834203D180241548A402846193428A +:1004500001D100230B6010BD1248DBB20278002BE3 +:1004600010D180210E4B8902996111000A39C9B25D +:100470000D4BF02902D91978494219701B78D2180E +:100480000270E8E79342E6D18022054B92025A615E +:10049000E1E7C046CC030020D003002018FCFFFF9A +:1004A000004400410100002000000020074B084AE2 +:1004B0001B681168994207D2FA21C9005B181360C2 +:1004C0008022044B92025A617047C046CC03002040 +:1004D000D0030020004400418022024B92029A6027 +:1004E0009A6170470044004137B5802501AC030A8A +:1004F0002370030C63700E4BED05A0709D6001200E +:100500005D61FFF75AFFEFF31083002B08D172B63D +:100510000848033322002900FFF734FF62B637BDD5 +:100520000323220029000348FFF72CFFF7E7C0460A +:10053000004400411444004110B50020FFF7D4FFEF +:10054000054B064A1A60BFF34F8F054B054ADA6028 +:10055000BFF34F8FFEE7C046FC7F0020EF6926F017 +:1005600000ED00E00400FA0510B50B4A1368002BFB +:100570000ED10A4911600A490A6801320A60094924 +:100580000868002806D0824204D30B60FFF7D4FF2E +:10059000013B136010BDC046D4030020DC05000001 +:1005A000000A0020040A0020202370B5354A0F20DD +:1005B000D1690B43D361012233490B7813430B708C +:1005C000324B19788143197006211C782143197028 +:1005D0002F490C7822430A701A7802401A70602260 +:1005E00019780A431A702B4B2B4A5A805A78D20931 +:1005F000FCD12A4B013219780A431A709A78D20733 +:10060000FCD41F2026490A68520B0240824200D1C6 +:1006100005221C8D234D024092012C4022431A8555 +:100620000A68920C02401F2A00D1023A1F24188D3A +:100630002240A043024307201A850A68D20D0240D7 +:10064000824200D10322198D024017481203014053 +:100650000A437F211A851A7814480A401A70042226 +:1006600019780A430C211A7058621A898A431A8130 +:100670001A890B398A431A8180220021520001F025 +:1006800018FA70BD00040040584400413C44004149 +:1006900059440041000C0040064000000050004159 +:1006A000246080003FF8FFFFFF8FFFFF4C0A00200F +:1006B000F7B51C00314B06005B6A0F001500019373 +:1006C000002C05D1443454432D4BE418FFF74CFF64 +:1006D00063782278934210D2D51ABD4200D93D00EA +:1006E000002E08D0211DC9182A00300001F0D8F9C9 +:1006F00063785B1963702800FEBD019BA1786A01D5 +:10070000D318002911D1211D196059681D48890B82 +:10071000890359605968014059601B4955184021A7 +:100720002879014329710121A1701449002551182C +:10073000019116495218127AD207DCD55D68A27869 +:10074000EDB22570022A04D11968201D2A0001F09B +:10075000A7F9BD4200D93D00002E0CD06570211DC7 +:100760002A00300001F09CF90122019BFF331A722C +:100770000023A370BFE76670F6E7C0460050004153 +:100780004C0B0020FF3F00F000510041FF500041A2 +:1007900010B50023FFF78CFF10BDF8B505000C0065 +:1007A00016001F00002C00D1F8BD210028003B00DE +:1007B0003200FFF77DFF241A2D18F3E7F8B50E007D +:1007C0001F4955014C6A2C19002B1BD063695B0033 +:1007D0005B08636120616369B2049B0B920C9B030D +:1007E000134363616369174A1748134063612A180A +:1007F000022380211500137291712A7A1A42FCD0CB +:100800003000F8BD012163695B005B0F0333994041 +:10081000B14208D8043A531E9A416369D2075B007B +:100820005B081343D5E744275743084A0437BF18EA +:1008300001003200380001F033F93800CAE7C04641 +:1008400000500041FF3F00F0FF5000414C0B0020E2 +:1008500010B50023FFF7B2FF10BD000010B5054B27 +:100860001B888B4200D90B0000221900FFF7F0FF14 +:1008700010BDC046FA03002007B500226B461100E8 +:10088000D81DFFF7E5FF07BDF0B59BB0FFF76CFE85 +:100890000822C04CA38B1A400392039BBE4A002B34 +:1008A0002ED00823A383802311214020A372C024CB +:1008B000517090715371B94BB94D5968A4052940D5 +:1008C00021435960596929400C43B6495C6119605C +:1008D000B549B64C196159680C4080218902214301 +:1008E00059605968890B8903596050710022B04BD7 +:1008F0001A70AF4B1878431E9841C0B21BB0F0BDC0 +:100900001021137A8C460B42F3D01172A949A94DDC +:100910008979A84B0191A7490198CF799B88390221 +:10092000014309B2029169460989A2480091067AF9 +:10093000C07AAD7A000228439E499F4D497A2880AB +:10094000402509020E439D4836B2B1B2557183422B +:1009500000D1B4E13AD881204000834200D1C3E104 +:1009600017D8822B00D191E108D8802B00D188E1E3 +:10097000812B00D185E120239371BAE780214900C2 +:100980008B42F8D00221FF318B42F4D1FFF774FF84 +:10099000AFE78B48834204D00BD8A221FF318B42B2 +:1009A000E9D10021082208A801F083F8082108A84D +:1009B000CDE0C02080008342DDD0E7D840388342BC +:1009C000D9D10729D7D1A3317E48C0E07E498B42D7 +:1009D000DCD000D99AE07D498B4214D801398B4292 +:1009E00000D3ADE07A498B42DBD06031FF318B42DE +:1009F000C1D1FFF741FF8023029A5B421343654A4E +:100A0000DBB2937275E78821694809018B4200D1F6 +:100A1000A2E180318B42AED1029B30270370FFF7F9 +:100A20002BFFA02303225B00E254C0225B4B5C49F6 +:100A3000586C92050840104358644620FF302554F6 +:100A4000644880261864902040002754586B084062 +:100A5000104358639220400026545F488026186354 +:100A6000B02040002554586F08405867B22040001D +:100A7000265403263C302654FC3884469C44604669 +:100A800006680E4016430660A626FF36A5551E00D2 +:100A90005248A0363060C0267600A7551F00943714 +:100AA0003E6880200E4016433E60C2267600A05568 +:100AB0001E004B4F90363760E02644277600A7553E +:100AC0000436A555A055C42084469C44604606685B +:100AD0000E4016430660D42084469C446046066857 +:100AE0000E4016430660F02680207600A755043697 +:100AF000A555A0551C00E4342068F4330840104389 +:100B00002060186801400A431A60F2E635498B42BA +:100B100000D13BE705D834498B4200D136E7334951 +:100B200032E733498B4200D130E732498B4200D162 +:100B30000FE131498B4200D01DE708212F4806E024 +:100B4000802300995B00994204D112212C48FFF7C1 +:100B500085FECEE6802300999B00994202D199211F +:100B60002848F4E7032F7CD1019B032B00D902E72F +:100B700008AC48220021200000F09BFF019B677019 +:100B8000002B43D1043323701F4B63802178200056 +:100B9000DDE7C04600500041FF5000414C0A0020F4 +:100BA000FFFFFF8F0C0A0020500B0020FF3F00F0DA +:100BB000D8030020080A0020FA03002002030000E6 +:100BC000A1020000F00000202109000081060000C1 +:100BD000A1030000D80B0020940B0020A40C0020DF +:100BE000600C002021200000210A0000210B0000E1 +:100BF00021220000A1FE0000A1210000E800002049 +:100C0000E01A0000400000200904000004AE320099 +:100C1000524B23CB23C200252F001B681360AB006F +:100C20004F4AF358D01919680122FFF7CEFB01355E +:100C30003F18042DF3D10023494AD355494B4A4A62 +:100C40009B799B009D58280000F03BFF230001305A +:100C5000400020702A7802330135002A96D01A709D +:100C6000F8E70F2F02D13921404870E7212F02D138 +:100C700009213F486BE7222F00D07CE621213D4827 +:100C800065E7002308A80380022160E7039B08A80A +:100C900003800823194200D06DE60733194008315C +:100CA000413349011E4205D0334BC9188B799B064D +:100CB000DB0FE8E7304BC9188B79DB06F8E70F2329 +:100CC0000B4000D157E6082001400098084300D0AF +:100CD00051E60833284A5B019B18320602D52022D0 +:100CE0005A7153E66246FBE70F230B4000D142E600 +:100CF000082001400098084300D03CE65B01320622 +:100D000013D51E491C4A9A185B182021D87908422D +:100D100000D13BE659711B7A2B4200D136E6130015 +:100D20004022FF331A723E3ADAE760461349124A0C +:100D30009A185B18D979014200D127E62021587111 +:100D40001B7A0B4200D121E61300FF3319720122F6 +:100D5000C6E7002308A803800121F8E6D01A0000A6 +:100D6000D9030020080A0020301B000004000020E6 +:100D7000DC000020F41A000000500041FF50004148 +:100D800010B5FFF711FC0022034B1A700223034A2F +:100D900011780B43137010BDD803002000500041A0 +:100DA00010B50C000122FFF753FD200010BD10B557 +:100DB0000C000122FFF74CFD200010BD70B50400AF +:100DC0000D00FFF761FD03000020834204D00222E2 +:100DD00029002000FFF7DCFC70BD70B505000C0099 +:100DE000FFF752FD002807D000230222210028002F +:100DF000FFF7D3FC200070BD0400FBE730B50023F3 +:100E00002025934200DB30BD0C78002C03D001314B +:100E1000C4540133F5E72C00FAE70000F8B580224E +:100E20000C00050092000021200000F042FE002D81 +:100E30000CD13E224449200000F032FEFF2355220F +:100E40005B00E254414B9218E254F8BD402D24D887 +:100E50006B1E1F2B00D9203B002B11D01B02581CEE +:100E60003B4D3C4EFF301A1F591CAA4203D8B342D7 +:100E700011D08BB223800B0002348142F3D1E4E71E +:100E8000F0222100FF2022700A31621C9142E5D03D +:100E900010700132FAE7304BECE7442D2AD8412D8F +:100EA000D3D129490B222B312000FFF7A7FF802740 +:100EB00028232A4EE3723F3D3F03F3682034380075 +:100EC000002B02D0180000F0FCFD030A6377030C2E +:100ED0002077A377000E2B0AA5760135E077310045 +:100EE000E3760B222000ADB2FFF788FF1036052D08 +:100EF000E3D1AAE72B00453B012B0CD8174A1B0175 +:100F0000D318DD68280000F0DCFD29000200200075 +:100F100000F0C6FD99E7124B473D2902994200D9DE +:100F200093E7104B104A2360104B20006360FE23B0 +:100F30005B00E25080238022DB0052006561A361E8 +:100F4000E16022612030E3E7401B0000FF01000068 +:100F5000FF03000003040000FFFF0000FC1B000073 +:100F6000FFFF03005546320A306FB10A57515D9EAC +:100F700070B516001C000A682B4B0D009A424AD12E +:100F80002A4B4A689A4246D1FE225200284B8A5880 +:100F90009A4240D18B68DB0710D480230A695B003A +:100FA0009A420BD1C868C3B2002B07D1214B224A09 +:100FB000C318934202D82031FFF7D2F8002C2BD06F +:100FC000AB69002B28D021681C4A8B4206D0934283 +:100FD00001D8002901D001235B4223606B69934251 +:100FE00019D80721012219408A40DB08E318197A31 +:100FF000D2B20A4204D160680A4301301A726060BA +:10100000626823689A4206D3002E04D10C4B1B68F9 +:101010001E330C4A136070BD002EFCD1084B1B68B8 +:101020002D33FF33F5E7C0465546320A57515D9ED2 +:10103000306FB10A00E0FFFFFFDF03006304000030 +:10104000000A0020040A0020F8B5364D00AFAB6856 +:10105000002B00D0FEE7FFF73FFA334B1E68334BFF +:10106000F218F8239B029A4214D8314B314A19687E +:10107000314C324B914233D11978314AC90702D4ED +:10108000216891422CD02F4B22601B682E4A2D33B1 +:10109000FF331360FFF78CF8BFF35F8F62B6FFF783 +:1010A0006FFE8020C002FFF71FFA0A230126274D9A +:1010B0002B70FFF7E9FB264C00280BD02378DBB21E +:1010C000002B06D18020204AC0001360FFF70CFAE5 +:1010D0002E7026702378002BEBD000F0B5FAFCE7D9 +:1010E0001B78DB07DB0F0DD0002380222360194B18 +:1010F00092025A6180239B011A6882F30888AB60D0 +:101100003047C7E72168144A914201D12360C1E703 +:1011100021680B4B9942E7D0FA2022604000FFF78C +:101120004CF9E1E700ED00E00420000000E0FFFFE3 +:10113000B42000007CB0EE87FC7F00203804004023 +:10114000EF6926F0000A0020040A002000000020B9 +:10115000FC03002000440041EF6916F010B5054C77 +:1011600012220021200000F0A4FCF0232370E63BB3 +:10117000E37110BD3B060020F8B505000E00170016 +:101180000024AB68A34200D8F8BD8021AA783300C0 +:101190008900E868FFF701FB80235B01E01801226A +:1011A0003B00E968FFF7E4FE0134EAE770B513009D +:1011B00006000C00150000200A000121FFF778FA54 +:1011C0000023984206D02B0022001F213000FFF799 +:1011D0006FFA0123180070BD10B504220D210248DA +:1011E000FFF736FB10BDC0469A01002010B50B4832 +:1011F0000B494279037912021A4383791B041A437B +:10120000C3791B0613431A0A0B714A711A0C1B0E81 +:101210008A71CB71FFF7E0FF10BDC0461C060020AD +:101220009A01002070B504220D00FFF711FB164C47 +:1012300085420FD0FFF792FF012304222373134B43 +:101240009A700022DA701A715A719A711A735A736D +:10125000FFF7CCFFFFF782FF00232373637A217A25 +:101260001B020B43A17A09040B43E17A09061943D7 +:10127000491B0B0A217263720B0C090EA372E172F7 +:10128000FFF7B4FF70BDC0469A0100203B06002066 +:1012900070B5184C142205000021200000F009FC54 +:1012A000154A002D1FD021000823D07D08313F268C +:1012B000527C32401C2A01D0B24205D10F4A0C3375 +:1012C0000A800522DBB2CA70191C834200D9011CB6 +:1012D000C9B2002D0BD0023B9BB21B022380200021 +:1012E000FFF7A0FF70BDD07C211D0423DFE7013B89 +:1012F0002370F4E7000600201C0600201C0A0000F2 +:10130000F0B5070000242B4B85B0597C03AAD1709F +:10131000997C9170D97C5170197D1170997D02AAC8 +:10132000D170DB7D937053880193019BA34208D851 +:10133000FFF714FF0022204B1A73FFF757FF05B089 +:10134000F0BDFFF7A1FA0028F9D0039B1B4EE5186A +:10135000002F1FD031002800FFF760FD80210422FC +:1013600089003000FFF774FA134A0134517A137A76 +:1013700009021943937A1B041943D37A1B060B43C2 +:101380000F495B18190A13725172190C1B0E9172D6 +:10139000D372CAE780213B00300005228900FFF7A5 +:1013A000FCF9084B3A0031002800FFF7E1FDFFF798 +:1013B0007DF8D9E71C0600209A01002000040020D7 +:1013C00000FEFFFF50060020F0B585B000F038FBAE +:1013D000454E002205213000FFF7E8FE002858D0D6 +:1013E000737A357A1B022B43B57A404C2D042B437C +:1013F000F57A00272D061D432B0A63722B0CA3726E +:101400002B0E2572E372F37B1E2B1BD021D8122BDF +:1014100041D013D8BB4215D0032B31D0FFF79EFE2D +:10142000012305222373324B9A700022DA701A715D +:101430005A719A711A7320325A7307E01A2B39D0F5 +:101440001B2BEBD1FFF78AFE00232373FFF7CEFEA1 +:101450001FE0282B34D00BD8232B35D0252BDDD102 +:10146000802324489B024360234B082103600EE045 +:101470002F2BE7D05A2B21D02A2BCFD1380020E0B8 +:10148000F37C191C122B00D912211948C9B2FFF79D +:10149000C9FE05B0F0BD194C1949200018220830CA +:1014A000FFF7ACFCF37C191C242B00D92421C9B212 +:1014B0002000ECE73800FFF7EBFEEAE70120FAE74F +:1014C0000120FFF71DFFE4E70C260E49320001A8BA +:1014D00000F0E6FAB54203D926726772A772E77286 +:1014E0000C2101A8D3E7C0461C0600209A01002069 +:1014F0003B0600201406002000001F3FA80100202A +:101500001E1B0000A51C000072B6BFF35F8F044BCA +:10151000044A9A829A830022034B9A607047C0461D +:1015200000500041FF03000000ED00E0F0B5C7B03F +:101530000FAF0400FFF7E8FF44220021380000F05D +:10154000B8FA9822002120A800F0B3FA02230F2154 +:10155000BB70A37862780B40A37063680A4008935D +:10156000002307AD264E627009932B73012220AB36 +:10157000E16824480796FFF7FBFC20AA3900200009 +:10158000FFF7FAFD627801230D212800FFF716F915 +:101590000196002607ADA1783A002800FFF706FE65 +:1015A000002823D0019B03AE03936B687360AB6884 +:1015B000B36000233373EB7B002B10D02A2B1CD19C +:1015C000ED8A02AB6DBA5D80ADB2A56020AA39008C +:1015D0002000FFF7D1FDB3686D025D1BB560627836 +:1015E00001230D213000FFF7E9F8D2E7064B9E42B8 +:1015F00001D9FEF7A1FF0136CCE7FEF703FFEEE7C6 +:1016000053425355FF0F0000F8240100B0B500AF5E +:10161000EFF30883054C2360036883F3088845686B +:10162000A847236883F30888BD46B0BDC80D0020D5 +:1016300007B5010001226846FEF7C7FE082168468B +:10164000FFF7AEFB07BD0000F7B57A230022804C00 +:10165000804922600B7000920193FFF7B5FE7E4D2A +:1016600040212800FFF7AAFB7C4B1860009B2B54FD +:10167000002801D0FEF71AFF794B009A1D60794BC4 +:101680001A607848754B02681F68BA42E5D2744DFB +:1016900029680B78FF2B37D0734E232B00D0B4E092 +:1016A0006C4B1B78532B34D133680132013102600B +:1016B0002960BA1A9A4200D91A006C4D20682A6033 +:1016C00000F0EEF9674829680368654ACB18013BCA +:1016D000036010684B1EC3181360FF23644D29700C +:1016E0001940614B1B688B4203D9591A2068FFF7D8 +:1016F00074FBC046574B019A1A705B4B009A1A60F4 +:10170000574A136801331360564A13680133136054 +:10171000B7E7522B04D131682068FFF748FBE9E7AF +:101720004F2B03D1336822681370E3E7482B03D1B2 +:10173000336822681380DDE7572B0AD14D4B2268AE +:101740009A4202D10020FEF7CFFE236832681A6069 +:10175000D0E76F2B04D101212068FFF721FBC9E7F7 +:10176000682B05D1022123681B8833603000F4E721 +:10177000772B04D1236804211B683360F6E7472BDD +:1017800009D13068FFF742FF3B4B1B78002BB1D0EB +:1017900001213A48E1E7542BACD04E2BAAD0562B6E +:1017A00002D12A213648D8E7582B05D13068FEF7F8 +:1017B00095FC03213348D0E7592B0DD132682068BE +:1017C000314B002A03D1186003213048C5E7920845 +:1017D0001968FEF79BFCF7E75A2B8BD13768002678 +:1017E0002568EF19AF4209D101212948FFF7D8FA3E +:1017F0003000FFF71DFF03212648AEE728783100AF +:10180000FEF796FD01350600ECE71A00303AD1B23A +:10181000092904D833681B011343336070E71A00A9 +:10182000413A052A03D83268373B1201F4E71A001F +:10183000613A052A03D83268573B1201ECE72C2B9A +:1018400003D133682360009BE7E7024A1370FAE78D +:10185000C40D0020780D0020800D0020700D0020A8 +:10186000740D00207C0D0020CC0D0020D00D002038 +:101870006C0D00200CED00E0E8060020DB1C0000F1 +:10188000B11C0000DD1C0000EC060020E11C000083 +:10189000E51C0000E71C0000F8B503004733040016 +:1018A0001A78402103000020FEF702FF002801D132 +:1018B0000020F8BD0023257923706BB2002BF7DBE5 +:1018C0003F272000A61DF38F2F404830C018611D10 +:1018D0003A0000F0E5F83F23F08F9D43C01980B235 +:1018E000002D01D1F087E3E70023F387E1E7F0B5AE +:1018F00006000C001F0093B001923F25AC4203DCB0 +:101900002500002F00D140373B0002AA2B43137063 +:1019100002AB31002A00581C00F0C2F86B4640218F +:101920001A7902A80123FEF749FF7619641BE4D156 +:1019300013B0F0BD030010B547331A7804314830B6 +:101940000023FFF7D4FF10BDF7B50400FFF7A4FF95 +:1019500000283FD0230048339A88A06C1A800022C8 +:1019600001385A80082863D800F090F81505212521 +:101970002328453C3500304E300000F0A2F8050029 +:10198000200031004C302A0000F08AF829002000A5 +:10199000FFF7D0FF1EE00123E364FF3323658023BC +:1019A000DB006365A0235B00A3651021EFE7FEF772 +:1019B000C3FD0021EBE7FEF725FDFAE7200000213B +:1019C000FFF7B8FF206D1D4B984203D92100543119 +:1019D000FEF7C6FBF7BD2100626D5831206DFEF7A2 +:1019E0008BFBE6E72000656D216D4C302A00FEF789 +:1019F00083FBA900CBE70027236D666D5D1CFF35D7 +:101A0000BE4201DC7100C2E700216B1EFF3B5A1C85 +:101A100018780192FEF78CFC019B0100AB42F6D1D5 +:101A200023007A004C33013598520137FF35E7E740 +:101A300001225A80BDE7C0462C1C0000FF1F000099 +:101A400007480622030010B547331A70FFF77CFFE2 +:101A500004480722030047331A70FFF775FF10BDD3 +:101A6000F00600207808002010B5E2B00400FFF76F +:101A70004BFDC42200215200684600F01AF84723AB +:101A80006B441C706846FFF75FFFFBE702B47146CA +:101A900049084900095C49008E4402BC7047C046B1 +:101AA000002310B59A4200D110BDCC5CC454013360 +:101AB000F8E703001218934200D170471970013300 +:101AC000F9E70023C25C0133002AFBD1581E70479E +:101AD0000CA0800040A0800044A0800048A08000AE +:101AE00012011002EF0201404F1B150001420102DA +:101AF000030100000697FF0901A101150026FF0060 +:101B000075089540090181029540090191029501EE +:101B10000901B102C0537061726B66756E00526547 +:101B200064426F61726420547572626F000000003D +:101B300000000000151B00001E1B0000D903002040 +:101B4000EB3C905546322055463220000201010000 +:101B50000240003E1FF820000100010000000000CC +:101B60000000000000002942004200535041524B47 +:101B700046554E00000046415431362020203C217D +:101B8000646F63747970652068746D6C3E0A3C689C +:101B9000746D6C3E3C626F64793E3C736372697035 +:101BA000743E0A6C6F636174696F6E2E7265706C3F +:101BB000616365282268747470733A2F2F77777782 +:101BC0002E737061726B66756E2E636F6D2F7072FF +:101BD0006F64756374732F313438313222293B0AB4 +:101BE0003C2F7363726970743E3C2F626F64793E60 +:101BF0003C2F68746D6C3E0A00000000494E464F51 +:101C00005F554632545854002C1C0000494E444540 +:101C10005820202048544D007E1B0000435552524E +:101C2000454E5420554632000000000055463220F3 +:101C3000426F6F746C6F616465722076322E302E45 +:101C4000302D61646166727569742E342D31322DC8 +:101C500067326434656337332D6469727479205355 +:101C6000464857524F0D0A4D6F64656C3A205265D5 +:101C700064426F61726420547572626F0D0A426F24 +:101C80006172642D49443A20526564426F61726406 +:101C90002D547572626F2D537061726B66756E2D67 +:101CA00076300D0A000000000800001F400200020C +:101CB0000076312E31205B41726475696E6F3A583F +:101CC000595A5D204A616E20313520323031392039 +:101CD00031323A30353A30310A0D000600580A0DDB +:0C1CE00000590A0D005A00230A0D0000F4 +:101CEC0001C80000050F3900021810050038B608AD +:101CFC0034A909A0478BFDA0768815B665000101B3 +:101D0C00001C100500DF60DDD88945C74C9CD265EE +:101D1C009D9E648A9F00000306AA0002000000003A +:101D2C000902990005010080FA080B000202020169 +:101D3C000009040000010202010005240010010446 +:101D4C00240206052406000105240103010705836E +:101D5C00030800FF09040100020A000000070581C6 +:101D6C0002400000070502024000000904020002C4 +:101D7C0008065000070584024000000705050240D4 +:101D8C000000090403000203000000092100010007 +:101D9C0001222100070586034000010705060340C8 +:101DAC0000010904040002FF2A0100070587034013 +:101DBC0000010705070340000100000009040300AF +:101DCC00020300000300000000C201000000080034 +:101DDC000A00000000000306AA000800020004002C +:101DEC00A0001400030057494E5553420000000058 +:101DFC000000000000008400040007002A004400DA +:101E0C006500760069006300650049006E0074008F +:101E1C0065007200660061006300650047005500B4 +:101E2C00490044007300000050007B003900320070 +:101E3C004300450036003400360032002D003900D6 +:101E4C004300370037002D003400360046004500B3 +:101E5C002D0039003300330042002D0033003100D7 +:101E6C00430042003900430035004100410033007B +:101E7C00420039007D000000000053425355000021 +:101E8C0000000000000000000080020220000000A2 +:101E9C000000000000000000000000000000000036 +:0C1EAC000000000000000000312E30306B +:101FF00000000000691A00002D1500002C1C0000D4 +:00000001FF diff --git a/sparkfun/samd/bootloaders/turbo/update-bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.uf2 b/sparkfun/samd/bootloaders/turbo/update-bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.uf2 new file mode 100644 index 00000000..be1bec54 Binary files /dev/null and b/sparkfun/samd/bootloaders/turbo/update-bootloader-sparkfun-redboard-turbo-v2.0.0-adafruit.4-12-g2d4ec73-dirty.uf2 differ diff --git a/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.bin b/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.bin new file mode 100644 index 00000000..d5a2e7ce Binary files /dev/null and b/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.bin differ diff --git a/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.hex b/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.hex new file mode 100644 index 00000000..2cd39042 --- /dev/null +++ b/sparkfun/samd/bootloaders/zero/SparkFun_SAMD21_ProRF_1W.hex @@ -0,0 +1,415 @@ +:10000000FC7F00204D0600003D0600004106000078 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000004506000085 +:1000300000000000000000004906000099070000D1 +:1000400010B5064C2378002B07D1054B002B02D0AE +:10005000044800E000BF0123237010BD5C000020B5 +:10006000000000006C19000008B5084B002B03D0FD +:100070000748084900E000BF07480368002B03D089 +:10008000064B002B00D0984708BDC046000000007A +:100090006C190000600000205800002000000000E3 +:1000A000154A164B1178002909D115491878097895 +:1000B0004118C9B21970802012498002C8611178B4 +:1000C0000131C9B211701978F02902D819780929BB +:1000D00009D80B4908784042C0B2087018780978EE +:1000E0004118C9B2197012781B789A4203D1802244 +:1000F000044B9202DA617047780000200100002072 +:10010000000000200044004110B5C3699C07FCD4E6 +:1001100003680224A3430360C46901231C42FBD18A +:100120000468234303600368DC07FCD4C46901232B +:100130001C42FBD1C469DC401C42F7D1084B1A4376 +:100140000260C3695A07FCD4C0239B0243608181CB +:10015000C3699C07FCD4036802221343036010BDEB +:1001600004000040037EDA07FCD5018570470000DB +:10017000027E01235107FBD5428B1A4207D1428BE5 +:10018000DA401A4203D1428B92081A4202D0034B42 +:1001900001221A70008DC0B27047C046790000205D +:1001A00070B50368041C988B1A1C0821FF320842A2 +:1001B00028D0988B174D0143802099839872112382 +:1001C00053704021144B917150715E68C0202E40D5 +:1001D000800506435E605E693540284358610F48DC +:1001E00018600F4818615D680E4828408025AD02F0 +:1001F000284358605868800B800358600023517171 +:10020000237105E0137ADA0602D5201C00F0FEFA0D +:10021000207970BDFFFFFF8F98010020980000201B +:1002200018010020FF3F00F0002303714371044BCD +:10023000016083600B78022213430B707047C04645 +:10024000A101000038B5364B2021DA6901200A43AC +:10025000DA61344B06241A7802431A70324B0F22AB +:100260001978914319701978214319702F490C7826 +:100270002043087019780A401A701A7860210A43DE +:100280001A702B4B2B4A5A805A7852B2002AFBDB49 +:10029000294B01211A780A431A709A78D107FCD4A5 +:1002A00026480268510B1F221140914200D10521BE +:1002B00011408C011D8D2249294021431985046874 +:1002C000A10C0A401F2A00D11D221C8D1F210A40AB +:1002D0008C4322431A8502680721D20D0A408A42C4 +:1002E00000D103220A40188D1103164A02400A4326 +:1002F0001A8519787F220A401A701A780421124848 +:100300000A431A7058621A890C218A431A811A8981 +:1003100001218A431A810021802201F0A6F938BD0B +:1003200000040040584400413C440041594400410D +:10033000000C004006400000005000412460800096 +:100340003FF8FFFFFF8FFFFF98010020F7B5141C57 +:10035000234A5F0101971D1CD319061C5869271CED +:100360004000400F03301033C74006D00F1C8022DE +:10037000596812060A435A6009E02F1C7B1E9F41F0 +:10038000184BBF01FF18381C221C01F065F90199B8 +:100390001348083542181761131C5269A104920BC7 +:1003A000890C92030A435A6159690F4A02200A4094 +:1003B0005A616B01F318D979032211400143D879AE +:1003C0009043021C0A43DA715979802252420A434F +:1003D0005A716B01F318DB799A07FAD5201CFEBD20 +:1003E0009801002018010020FF3F00F0F8B51E4ED4 +:1003F000041C3378151C002B12D11C4B1C4A1A64A8 +:100400005A6C920B92035A64586C1A4A02405A640E +:10041000A2235B00E25C40200243E25401233370DC +:100420004827FF37E25D012313401AD00F4B5A6C67 +:100430009204920CAA4202D25D6CAD04AD0C081C71 +:100440002A1C0B4901F008F9E25D03231A4001213F +:100450000A43E15D99430B1C1343E35500233370BA +:1004600000E01D1C281CF8BD7A0000209801002027 +:10047000D8000020FF3F00F0FF30827930239A43FC +:10048000131C2022002900D11022134383717047CE +:100490000C4BFF305A690221920B92035A61027A87 +:1004A00003231A400A43017A99430B1C1343037236 +:1004B000827980235B4213438371037A9A07FCD5C8 +:1004C0007047C0469801002080235B421943C9B29F +:1004D0008172704770B5A02303225B00C254134B96 +:1004E000134A5C6CC021144089050C4346255C64AA +:1004F000FF35402444550F4D30261D6490256D0076 +:1005000046555D6B15402943922559636D00802146 +:100510004155094D1D63B0256D0044555C6F224067 +:100520005A67B2235B00C15470BDC04698010020D9 +:10053000FFFFFF8FD80000205801002030B5364A59 +:100540001E235168082099430223194351603349FF +:100550008A6902438A613248324A9082908A034310 +:100560009382D3689807FCD52F4B01201870187818 +:10057000C40704D52C48407840B20028F7DB01209E +:100580009860587840B20028FBDB284C264844602D +:10059000587840B20028FBDB82242348E4014480E1 +:1005A000587840B20028FBDB908C8024A0439084D4 +:1005B000D068C506FCD51E4C1A48C462D4681948D8 +:1005C000E506FBD5848C1B4D2C438484D4681548E8 +:1005D000E506FBD5848C02252C438484D068040670 +:1005E000FCD51048C0684506F8D5D068C406FCD5CF +:1005F00000229A605A7852B2002AFBDB0E480A4A5F +:1006000050605A7852B2002AFBDB00230B724B7207 +:100610008B72CB7230BDC0460040004100040040E8 +:100620000C06000000080040000C0040010501001D +:10063000B805FF7D040A0000000703000EBEFEE7B8 +:100640000DBEFEE705BEFEE702BEFEE70E4A0F48FE +:1006500038B5824204D10E4A0E4B93420ED10AE0C5 +:100660000D4C9442F7D00023D1188842F3D9E558B5 +:1006700004330D60F8E700F011F804E09342FAD279 +:10068000002102C3FAE7FEE7000000205C00002022 +:10069000A40300205C0000207019000010B5324B4C +:1006A0000022197801231940304B0AD11868304ACA +:1006B000904201D1196014E01A602E4A013A002AD2 +:1006C000FCD11A602C4B1968181C4A1C09D0FF2257 +:1006D000134206D181F308889343284A9360436804 +:1006E0001847FFF72BFF62B600F0E4FD00F05AF860 +:1006F000234B8022920223499A6008220A602249F1 +:10070000041C0A60802212059A609A611F4B204ADD +:10071000C0215A60194A0906106A0002000A014302 +:10072000116200229A6007221A60A368201C984771 +:10073000184B002801D001221A701A78002A05D01F +:10074000002000F0ABFA00F031FBFCE71B78002B37 +:10075000EBD100F023FE0028E7D0012000F09EFA44 +:1007600000F024FBFCE7C04638040040FC7F00207A +:100770003581730748E801000020000000ED00E02B +:1007800000440041884400419844004110E000E0EA +:10079000E70300007B00002008B5FFF781FC00F0B4 +:1007A000E1FA08BD10B5054B054C2360FFF74AFD83 +:1007B000201C2168FFF738FD201C10BD00500041AF +:1007C0001802002070B5051CC0B0081C161C0C1CBB +:1007D00000F053FF40006A4603230230537010704C +:1007E00076080123E218013A11785A00002906D14F +:1007F000281C69460023FFF7A9FD40B070BDB34235 +:10080000F6DA684681520133ECE70000F7B5046878 +:10081000051C201CFF30037AAF4A10210B430372E2 +:10082000AE4F1378AE493B705378AE4E0B70937851 +:100830003380D178338809020B4333801179AA4B76 +:10084000198051791F8809020F431F809779A749A2 +:100850000F80D2790F8812023A430A8040224271F7 +:100860009F489E4F0278387812020243A0480F1C1E +:100870008446181C624500D1C2E020DC802149007A +:100880008A4200D185E109DC812A00D192E0822AE6 +:1008900000D195E0802A00D07BE18BE081235B00D2 +:1008A0009A4200D1D5E000DA6FE1C0239B009A4262 +:1008B00000D16EE18F4B9A4200D166E169E190234D +:1008C0001B019A4269D015DCD023DB009A4222D06A +:1008D00088231B019A4269D0A023DB009A4200D0F2 +:1008E00057E1201CFFF7D4FD3188286889B2FFF753 +:1008F000EBFD52E1804B9A4200D146E100DC48E139 +:100900007E4B9A4200D134E17D4B9A4200D040E1C7 +:1009100033886B7139E133881B0A012B08D10B88AE +:1009200012222868934201D80A8892B2754928E1B8 +:1009300033881B0A022B08D10B8843222868934274 +:1009400001D80A8892B270491BE133881B0A032B35 +:1009500000D01EE13388DBB2012B17D0002B07D06B +:10096000022B00D015E10A882868D2B2674911E04D +:10097000042201A8664900F06FFE3B880422286823 +:10098000934201D83A8892B201A9FAE00A8828680D +:100990006049D2B2FFF716FFFFE03388201C2B71AD +:1009A000FFF776FD201CFFF795FDF6E0291C01C935 +:1009B0000122E6E0584900230B8028680222E1E08A +:1009C000554900220A80188850221040534A10705E +:1009D0001E880F20304018801888032800D9D8E0DE +:1009E00012781B8808335B01E418A379002A01D030 +:1009F0009B0600E0DB06DB0F0B8028680222C0E0CC +:100A000019887F229143454AC9B2117018880F2175 +:100A1000014019803188002900D0BAE019880029E6 +:100A200000D1B6E01988032900D9B2E012781B88FA +:100A300008335B01E318002A04D05A7930218A4335 +:100A4000202103E05A7930218A4310210A435A7148 +:100A50009BE002887F239A43304BD2B21A70018800 +:100A60000F220A4002803288002A00D091E00288DA +:100A7000002A00D18DE00288032A00D989E01B7882 +:100A8000002B4DD0038808335B01E3189B799A064D +:100A900000D47AE00388302108335B01E3181A7927 +:100AA0008A4320210A431A71038808335B01E31843 +:100AB000DB795F0669D50388602108335B01E318A1 +:100AC000DA798A4340210A43DA7103880222083323 +:100AD0005B01E3184BE0C046980000208600002030 +:100AE0007E00002080000020820000208400002082 +:100AF000020300000103000021200000A1210000EA +:100B000021220000C016000004000020B0160000E2 +:100B1000A0160000A41600007C0000208700002022 +:100B2000038808335B01E3189B79D9062DD5038828 +:100B3000302108335B01E3181A798A4310210A43F4 +:100B40001A71038808335B01E318DB799A061CD518 +:100B50000388602108335B01E318DA798A43202196 +:100B60000A43DA710388012208335B01E3181A7122 +:100B70000BE00B8808222868934201D80A8892B2B9 +:100B800006490023FFF7E2FB07E0201CFFF780FC8B +:100B900003E0201C0121FFF76FFCF7BD4800002097 +:100BA00007B5054B0122019001A91868131CFFF736 +:100BB000CDFB01200EBDC0461802002013B5054B29 +:100BC0006C4607341868211C0122FFF70FFC2078BF +:100BD00016BDC0461802002010B5074C201CFFF7B8 +:100BE000DFFA031C0020834205D022684823FF332C +:100BF000D05C0123184010BD1802002010B5054A32 +:100C00000C1C031C191C10680123221CFFF79EFBFF +:100C1000201C10BD1802002070B5084C061C201CBA +:100C20000D1CFFF7BDFA0023984205D02068311C47 +:100C30002A1CFFF7DBFB031C181C70BD18020020E8 +:100C4000F8B50C4C051C201C0E1CFFF7A9FA00235C +:100C5000271C341C98420AD0002C07D0291C221CC7 +:100C60003868FFF7C3FB241A2D18F5E7331C181C4E +:100C7000F8BDC0461802002008B5031C081C111C52 +:100C80009847044B802212055A61034B64221A8054 +:100C900008BDC0460044004192000020012805D153 +:100CA000054B064A1A60064B187004E0002802D172 +:100CB000044A014B1A60704788020020F4160000B5 +:100CC000940000204017000030B50A1C1C4985B074 +:100CD0000978031C00292AD0042A01D1006804E005 +:100CE000022A01D1008800E00078520004A98B1884 +:100CF0000B3B9C1AA3420BD00F210140092902D8BB +:100D00003025294300E0373119700009013BF1E734 +:100D100001A930230B7078234B700A208B18987030 +:100D20000D20D870074B04321B68D86803E00549D2 +:100D30000968C868191CFFF79FFF05B030BDC046A1 +:100D4000880000208802002072B6EFF30883044A6E +:100D50001360036883F30888436818477047C046E8 +:100D60008C0200200D4B1A88002A09D01A88013AFB +:100D700092B21A80002A03D18022094B12059A618F +:100D8000084B1A88002A08D01A88013A92B21A80B1 +:100D9000002A02D1044B08221A60704792000020FA +:100DA000004400419000002098440041F0B591B00B +:100DB00008A9CE4A0B1C31CA31C351CA51C360CAFB +:100DC00060C3CB4BCB489A687A255203520F9200EE +:100DD0005258C94902609C68A4B262430C60C7497A +:100DE00000240A60C64A1460C64C2570C64CC74D24 +:100DF0002368281C1B6940219847002805D0C44B54 +:100E000008221A60C34B64221A80C34B0022186068 +:100E1000C24B1D60C24BC24DBF4F1A602A683B686F +:100E20009A42E3D2BD4B1B681A78FF2A00D120E218 +:100E3000232A00D0F7E1BB4E3378002B06D0B24B0B +:100E4000B9491B680222D868FFF716FFAD4B1B7823 +:100E5000532B3FD13B682A6893421ED9AF480132D9 +:100E60002A609A1AB14B01681B6801310160B04ECB +:100E70009A4201D2326000E03360A14832680068D3 +:100E8000049000F0E9FB336829685A182A60A34AE5 +:100E90001668F1181160A74A13702B68013B2B608C +:100EA0009E4B1A68013A1A60A24BA04A1B7811683F +:100EB0008B420DD222689248C91A00689269904705 +:100EC000002805D0924B08221A60924B64221A80A7 +:100ED000C04696E1522B0ED18948944A2368006897 +:100EE00011685B6903909847934B802212055A6101 +:100EF0006422924B0DE04F2B05D1814B8B4A1B682E +:100F000012681A707DE1482B05D17D4B874A1B681A +:100F100012681A8075E1572B05D1794B834A1B68FB +:100F200012681A606DE16F2B03D1754B01211868AF +:100F300007E0682B08D1724B7C481B6802211B8894 +:100F40000360FFF7C1FE5CE1772B06D16C4B77485D +:100F50001B6804211B680360F3E7472B13D1734B15 +:100F60001868FFF7F1FE764B1B6883F3088862B6BA +:100F7000744B1B78002B00D143E1634B06201B68A8 +:100F80001B6898473DE1542B04D1012333705E4B1D +:100F90001B6864E04E2B0CD13378002B06D15A4BE2 +:100FA00061491B680222D868FFF766FE0023337090 +:100FB00027E1562B57D123686349D8680122FFF7F0 +:100FC0005BFE23686149D8680322FFF755FE604D38 +:100FD0002368291CD8680122FFF74EFE23685D496B +:100FE000D8680D22FFF748FE2368291CD868012223 +:100FF000FFF742FE494F4A4D5749002339602B60A5 +:101000003A1C281C13685E1C16601B780593002B85 +:1010100003D0036801330360F4E73B4E2A6833686A +:10102000D868FFF729FE33684949D8680122FFF7DD +:1010300023FE0599296049493960384A1368581CCC +:1010400010601B78002B04D0354B1A6801321A60EF +:10105000F3E733682A68D868FFF70EFE3368D8686C +:1010600031490222CBE0314A582B17D1214E234D72 +:10107000366813682A68B10093420AD21C4D58089A +:10108000E861374828801A4D287DC607FBD55B18D4 +:10109000F2E71D4B33491B68D868AFE0592B00D0ED +:1010A0007DE01268164B3049002A02D11B680B60A4 +:1010B00070E00F4D086819686B680D4E8025AB43D2 +:1010C00092087360002A65D0284B094D2B80084E8A +:1010D000337DDD07FBD50023064D2D680195AD0856 +:1010E000AB4247D3224D024E35804AE0D416000071 +:1010F000004000414002002038020020340200205D +:1011000084020020300200208802002044020020D7 +:101110009444004190000020280200202C0200206E +:101120003C020020880000203417000090020020BC +:10113000940200202402002000440041920000207C +:101140008C020020940000201017000039170000C6 +:10115000121700005C170000141700002017000091 +:1011600002A5FFFF291700008C00002044A5FFFF07 +:1011700004A5FFFF9342B5D09D00465901334E515F +:10118000AAE7404E357DEE07FBD59D004919401971 +:10119000D21A97E73C4B3D491B68D8682EE05A2B82 +:1011A0002FD13B4B17681D680026EF19BD4206D0B2 +:1011B0002878311C00F014F90135061CF6E7324B93 +:1011C00034491B680122D868FFF756FD07230F2218 +:1011D0003240111C36093031092A00DD0731182050 +:1011E000C0186A468154013BF1D2236806A9D86829 +:1011F0000822FFF741FD23682749D8680322FFF73B +:101200003BFD264B7A221A70254B00221A60254B93 +:101210001B7893422DD01C4B23491B680122D868B0 +:10122000FFF72AFD25E0111C3039C8B21C4B0928F4 +:1012300004D81D682A01114319601AE0111C4139B4 +:10124000052903D81E68373A310106E0111C6139BF +:10125000052904D81868573A01010A4308E02C2AE6 +:1012600003D10B4A1968116001E00C490A70002291 +:101270001A600E4B1A6801321A600D4B1A6801325F +:10128000C9E5C04600400041880200202D1700003B +:1012900084020020311700003317000030020020C4 +:1012A0009002002088000020371700003C02002038 +:1012B0002C02002010B51C4B01201A780224024396 +:1012C0001A701A4B0F22197891431970197821431B +:1012D000197017490C782043087019780A401A7061 +:1012E0001A7820210A431A70124B04211A6A0A4301 +:1012F0001A62114B114A5A805A7852B2002AFBDB0B +:10130000C4220F480F499203FEF7FEFE0E4A002347 +:1013100013700E4A13700E4A13700E4A13700E4A61 +:1013200013700E4A137010BD4A4400413544004109 +:101330004B44004100040040000C004014400000F9 +:10134000000800422AF60000980200201F03002037 +:10135000990200209C020020200300201D03002091 +:1013600008B5C1B20248FEF7FDFE012008BDC04627 +:1013700000080042024B187E4007C00F7047C0466D +:101380000008004208B5FFF7F5FF0028FBD002482F +:10139000FEF7EEFE08BDC0460008004208B5FFF7A4 +:1013A000E9FF0023984205D0FFF7ECFF031C233B25 +:1013B0005A425341181C08BD70B5041C0D1C461838 +:1013C000B44204D02078FFF7CBFF0134F8E7281CA3 +:1013D00070BD10B5041CFFF7D5FF2070012010BDB3 +:1013E0000B0A5840034B4000C05A0902484080B2E3 +:1013F0007047C0466A170000F7B50024051C0F1C93 +:10140000261CBC4220D0FFF7BDFF114BC0B21B7899 +:101410000190002B1AD1311CFFF7E2FF0D4B061C87 +:101420001A88002A04D10C4A11782A1C002907D0F6 +:1014300001996A1C2970802F02D1198801391980FD +:101440000134A4B2151CDCE7301C00E00120FEBD15 +:101450001D0300209A0200201E030020F0B53E4E1E +:1014600085B0002203900C1C32703C4B914201D19C +:10147000012201E03A490C801A707F231C4201D0FE +:1014800080349C43FFF77EFF3378C0B2002B07D037 +:1014900000253570FFF776FF3378C0B2AB4236D106 +:1014A000432803D0712853D01528EBD10123009392 +:1014B0000120FFF755FF0098FFF752FF00998025A4 +:1014C000C843C0B2FFF74CFF039B00270293244A96 +:1014D0001388002B1DD1214901930978002918D1C7 +:1014E0000198FFF73DFF391C0198FFF779FF013D97 +:1014F000071C002DEBD1000AC0B2FFF731FFF8B294 +:10150000FFF72EFFFFF73EFF3378002B0AD0357030 +:101510001FE00299013B09781380029B019101337E +:101520000293DDE7C0B2062807D1009B039901337F +:10153000DBB280310093803C0391002CB8D10420B1 +:10154000FFF70EFFFFF71EFF044B01251C7000E0A4 +:101550000025281C05B0F0BD1D0300201E0300203F +:101560009A020020F0B5384C87B000230190237018 +:10157000994201D1012301E0344A1180344A6426A2 +:1015800013704320FFF7ECFE324FFFF7F3FE002805 +:1015900003D1002F03D0013FF7E7002F03D1013E15 +:1015A000002EEED14DE00125FFF7ECFE2378002B55 +:1015B00038D1C0B20290012805D004283DD10620C0 +:1015C000FFF7CEFE39E005AE0221301CFFF714FF15 +:1015D00001988021FFF710FF23780390002B18D18A +:1015E000FFF7D0FE0702FFF7CDFEBFB223783F180A +:1015F000BFB2012B0DD0039B9F4207D13378AB4282 +:1016000004D1EB437278DBB29A4204D01820FFF782 +:10161000A7FE002303E00620FFF7A2FE029B22782C +:10162000002A02D0002626700BE0012B05D1019A7A +:101630006B1C8032DDB20192B6E7054A00231370BD +:101640000126301C07B0F0BD1D0300209A020020C7 +:101650001E03002000350C0010B50023934203D078 +:10166000CC5CC4540133F9E710BD031C82189342CB +:1016700002D019700133FAE770470023C25C0133CE +:10168000002AFBD1581E7047F8B5C046F8BC08BC0C +:101690009E467047F8B5C046F8BC08BC9E467047E9 +:1016A0000403090441726475696E6F204C4C430059 +:1016B000537061726B46756E2053414D4432310058 +:1016C00012010002020000404F1B218D00020102A6 +:1016D00000010000080000001000000020000000D1 +:1016E0004000000080000000000100000002000037 +:1016F0000004000061130000851300007513000052 +:10170000B9130000D31300005D140000651500003C +:10171000760020004E6F7620313420323031360092 +:1017200031333A31323A303300580A0D00590A0D3C +:10173000005A00230A0D003E00322E300000000047 +:10174000A10B0000BD0B0000D90B0000FD0B000039 +:10175000190C0000FD0B0000410C00005B4172649D +:1017600075696E6F3A58595A5D0000002110422089 +:1017700063308440A550C660E770088129914AA172 +:101780006BB18CC1ADD1CEE1EFF1311210027332E9 +:101790005222B5529442F772D662399318837BB3C2 +:1017A0005AA3BDD39CC3FFF3DEE362244334200479 +:1017B0000114E664C774A44485546AA54BB5288512 +:1017C0000995EEE5CFF5ACC58DD5533672261116C9 +:1017D0003006D776F6669556B4465BB77AA7199762 +:1017E0003887DFF7FEE79DD7BCC7C448E558866851 +:1017F000A7784008611802282338CCC9EDD98EE9B2 +:10180000AFF9488969990AA92BB9F55AD44AB77A28 +:10181000966A711A500A333A122AFDDBDCCBBFFB01 +:101820009EEB799B588B3BBB1AABA66C877CE44C38 +:10183000C55C222C033C600C411CAEED8FFDECCD51 +:10184000CDDD2AAD0BBD688D499D977EB66ED55E08 +:10185000F44E133E322E511E700E9FFFBEEFDDDFA1 +:10186000FCCF1BBF3AAF599F788F8891A981CAB12D +:10187000EBA10CD12DC14EF16FE18010A100C2305F +:10188000E3200450254046706760B9839893FBA31A +:10189000DAB33DC31CD37FE35EF3B1029012F322AF +:1018A000D2323542145277625672EAB5CBA5A8956A +:1018B00089856EF54FE52CD50DC5E234C324A014FF +:1018C00081046674476424540544DBA7FAB79987FA +:1018D000B8975FE77EF71DC73CD7D326F23691064F +:1018E000B01657667676154634564CD96DC90EF942 +:1018F0002FE9C899E9898AB9ABA94458654806789F +:101900002768C018E1088238A3287DCB5CDB3FEB59 +:101910001EFBF98BD89BBBAB9ABB754A545A376AEE +:10192000167AF10AD01AB32A923A2EFD0FED6CDD29 +:101930004DCDAABD8BADE89DC98D267C076C645C3E +:10194000454CA23C832CE01CC10C1FEF3EFF5DCF39 +:101950007CDF9BAFBABFD98FF89F176E367E554E8E +:10196000745E932EB23ED10EF01E00000000000007 +:101970000114000009024300020100803209040042 +:1019800000010202000005240010010424020005E9 +:10199000240600010524010001070583030800FF58 +:1019A00009040100020A000000070581024000004E +:1019B000070502024000000000C20100000008000C +:0C19C00069000000410000000000000071 +:040000030000064DA6 +:00000001FF diff --git a/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.bin b/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.bin new file mode 100644 index 00000000..b3ae8abf Binary files /dev/null and b/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.bin differ diff --git a/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.hex b/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.hex new file mode 100644 index 00000000..c9eef053 --- /dev/null +++ b/sparkfun/samd/bootloaders/zero/Sparkfun_SAMD21_ProRF.hex @@ -0,0 +1,410 @@ +:10000000FC7F002015060000050600000906000020 +:1000100000000000000000000000000000000000E0 +:100020000000000000000000000000000D060000BD +:100030000000000000000000110600006D07000035 +:1000400010B5064C2378002B07D1054B002B02D0AE +:10005000044800E000BF0123237010BD5C000020B5 +:10006000000000001019000008B5084B002B03D059 +:100070000748084900E000BF07480368002B03D089 +:10008000064B002B00D0984708BDC046000000007A +:10009000101900006000002058000020000000003F +:1000A000154A164B1178002909D115491878097895 +:1000B0004118C9B21970802012498002C8611178B4 +:1000C0000131C9B211701978F02902D819780929BB +:1000D00009D80B4908784042C0B2087018780978EE +:1000E0004118C9B2197012781B789A4203D1802244 +:1000F000044B9202DA617047780000200100002072 +:10010000000000200044004110B5C3699C07FCD4E6 +:1001100003680224A3430360C46901231C42FBD18A +:100120000468234303600368DC07FCD4C46901232B +:100130001C42FBD1C469DC401C42F7D1084B1A4376 +:100140000260C3695A07FCD4C0239B0243608181CB +:10015000C3699C07FCD4036802221343036010BDEB +:1001600004000040037EDA07FCD5018570470000DB +:10017000027E01235107FBD5428B1A4207D1428BE5 +:10018000DA401A4203D1428B92081A4202D0034B42 +:1001900001221A70008DC0B27047C046790000205D +:1001A00070B50368041C988B1A1C0821FF320842A2 +:1001B00026D0802099839872112353704021144BCC +:1001C000917150715E68134DC0202E40800506432A +:1001D0005E605E693540284358610F4818600F48DB +:1001E00018615D680E4828408025AD02284358609C +:1001F0005868800B8003586000235171237105E01B +:10020000137ADA0602D5201C00F0EAFA207970BDD4 +:1002100098010020FFFFFF8F9800002018010020A8 +:10022000FF3F00F0002303714371044B01608360C2 +:100230000B78022213430B707047C046A1010000E7 +:1002400038B5364B2021DA6901200A43DA61344B94 +:1002500006241A7802431A70324B0F221978914300 +:1002600019701978214319702F490C7820430870B0 +:1002700019780A401A701A7860210A431A702B4BB9 +:100280002B4A5A805A7852B2002AFBDB294B0121B3 +:100290001A780A431A709A78D107FCD42648026863 +:1002A000510B1F221140914200D1052111408C01B8 +:1002B0001D8D22492940214319850468A10C0A405B +:1002C0001F2A00D11D221C8D1F210A408C4322436E +:1002D0001A8502680721D20D0A408A4200D1032202 +:1002E0000A40188D1103164A02400A431A851978EC +:1002F0007F220A401A701A78042112480A431A70A1 +:1003000058621A890C218A431A811A8901218A4369 +:100310001A810021802201F07AF938BD00040040E2 +:10032000584400413C44004159440041000C004005 +:100330000640000000500041246080003FF8FFFFAD +:10034000FF8FFFFF98010020F7B5141C1F4A5F01C3 +:1003500001971D1CD319061C5869271C4000400F2B +:1003600003301033C74006D00F1C80225968120694 +:100370000A435A6009E02F1C7B1E9F41144BBF01AA +:10038000FF18381C221C01F039F901990F48083573 +:1003900042181761131C5269A104920B890C920335 +:1003A0000A435A6159690B4A0A405A616B01F318B2 +:1003B0000222DA715979802252420A435A716B0142 +:1003C000F318DB799A07FAD5201CFEBD98010020AE +:1003D00018010020FF3F00F0F8B51A4E051C3378D5 +:1003E000141C002B12D1184B184A1A645A6C920B29 +:1003F00092035A64586C164A02405A64A2235B0066 +:10040000EA5C40200243EA54012333704827FF3757 +:10041000EA5D0123134012D00B4B5A6C9204920CEC +:10042000A24202D25C6CA404A40C081C221C074942 +:1004300001F0E4F80123EB550023337000E01C1CAD +:10044000201CF8BD7A00002098010020D800002070 +:10045000FF3F00F0FF3083792022002900D11022D5 +:100460001343837170470000084BFF305A69920BA9 +:1004700092035A6102230372827980235B42134301 +:100480008371037A9A07FCD57047C0469801002013 +:1004900080235B421943C9B28172704770B5A023B3 +:1004A00003225B00C254134B134A5C6CC0211440FE +:1004B00089050C4346255C64FF35402444550F4DA7 +:1004C00030261D6490256D0046555D6B154029430F +:1004D000922559636D0080214155094D1D63B0255A +:1004E0006D0044555C6F22405A67B2235B00C154D3 +:1004F00070BDC04698010020FFFFFF8FD80000208C +:100500005801002030B5364A1E235168082099430F +:1005100002231943516033498A6902438A61324890 +:10052000324A9082908A03439382D3689807FCD51D +:100530002F4B012018701878C40704D52C48407838 +:1005400040B20028F7DB01209860587840B20028BC +:10055000FBDB284C26484460587840B20028FBDB7F +:1005600082242348E4014480587840B20028FBDB11 +:10057000908C8024A0439084D068C506FCD51E4C86 +:100580001A48C462D4681948E506FBD5848C1B4D13 +:100590002C438484D4681548E506FBD5848C022559 +:1005A0002C438484D0680406FCD51048C0684506F6 +:1005B000F8D5D068C406FCD500229A605A7852B2A9 +:1005C000002AFBDB0E480A4A50605A7852B2002AD1 +:1005D000FBDB00230B724B728B72CB7230BDC046BB +:1005E00000400041000400400C06000000080040EC +:1005F000000C004001050100B805FF7D040A000061 +:10060000000703000EBEFEE70DBEFEE705BEFEE7D7 +:1006100002BEFEE70E4A0F4838B5824204D10E4AA8 +:100620000E4B93420ED10AE00D4C9442F7D00023BA +:10063000D1188842F3D9E55804330D60F8E700F08B +:1006400011F804E09342FAD2002102C3FAE7FEE770 +:10065000000000205C000020A80300205C000020B7 +:100660001419000038B5344B1A681C1C013221D013 +:10067000324A191D1160D9B200291BD1304A1078B5 +:10068000012210402F4A0AD115682F498D4201D10D +:1006900010600FE011602D4901390029FCD1116073 +:1006A000226882F30888FF229343294A9360224BF1 +:1006B0005B681847FFF726FF62B600F0CDFD00F03B +:1006C0005BF8244B8022920223499A6008220A6038 +:1006D0002249041C0A60802212059A609A61204B0C +:1006E000204AC0215A601A4A0906106A0002000A0C +:1006F0000143116200229A6007221A60A368201C3D +:100700009847194B002801D001221A701A78002A44 +:1007100005D0002000F094FA00F01AFBFCE71B78EB +:10072000002BEBD100F00CFE0028E7D0012000F0F8 +:1007300087FA00F00DFBFCE7002000001802002003 +:1007400038040040FC7F00203581730748E8010031 +:1007500000ED00E00044004188440041984400411D +:1007600010E000E0E70300007B00002008B5FFF781 +:1007700097FC00F0C9FA08BD10B5054B054C236085 +:10078000FFF75EFD201C2168FFF74CFD201C10BD0B +:10079000005000411C02002070B5051CC0B0081CB0 +:1007A000161C0C1C00F03BFF40006A46032302307D +:1007B0005370107076080123E218013A11785A003C +:1007C000002906D1281C69460023FFF7BDFD40B073 +:1007D00070BDB342F6DA684681520133ECE700009F +:1007E000F7B5BA4A04681378B949271CFF37051CC6 +:1007F000102038720B705378B648B74E0370937858 +:100800003380D178338809020B4333801179B34B9D +:100810001980517918880902084318809079B049E5 +:100820000880D2790888120202430A8040227A7135 +:10083000A84F3A78A64F120238780F1C0243A948F5 +:100840008446181C624500D1C2E020DC80214900AA +:100850008A4200D16EE109DC812A00D192E0822A2D +:1008600000D195E0802A00D064E18BE081235B0019 +:100870009A4200D1CFE000DA58E1C0239B009A42AF +:1008800000D157E1984B9A4200D14FE152E19023B9 +:100890001B019A4269D015DCD023DB009A4222D09A +:1008A00088231B019A4269D0A023DB009A4200D022 +:1008B00040E1201CFFF7D8FD3188286889B2FFF796 +:1008C000E7FD3BE1894B9A4200D12FE100DC31E1A9 +:1008D000874B9A4200D11DE1864B9A4200D029E114 +:1008E00033886B7122E133881B0A012B08D10B88F6 +:1008F00012222868934201D80A8892B27E4911E1F7 +:1009000033881B0A022B08D10B88432228689342A4 +:1009100001D80A8892B2794904E133881B0A032B73 +:1009200000D007E13388DBB2012B17D0002B07D0B2 +:10093000022B00D0FEE00A882868D2B2704911E08C +:10094000042201A86F4900F059FE3B880422286860 +:10095000934201D83A8892B201A9E3E00A88286854 +:100960006949D2B2FFF718FFE8E03388201C2B71E9 +:10097000FFF77AFD201CFFF791FDDFE0291C01C97C +:100980000122CFE0614900230B8028680222CAE0DF +:100990005E4900220A801888502210405C4A10707C +:1009A0001E880F20304018801888032800D9C1E025 +:1009B00012781B8808335B01E418A379002A01D060 +:1009C0009B0600E0DB06DB0F0B8028680222A9E013 +:1009D00019887F2291434E4AC9B2117018880F219D +:1009E000014019803188002900D0A3E0198800292E +:1009F00000D19FE01988032900D99BE012781B8859 +:100A000008335B01E318002A02D020225A718DE0DE +:100A1000102159718AE002887F239A433C4BD2B25D +:100A20001A7001880F220A4002803288002A00D002 +:100A300080E00288002A00D17CE00288032A00D9E5 +:100A400078E01B78002B1FD0038808335B01E31884 +:100A50009B799A066AD50388202208335B01E31844 +:100A60001A71038808335B01E318DB795F065DD5F3 +:100A70000388402208335B01E318DA7103880222FD +:100A800008335B01E3181EE0038808335B01E318B9 +:100A90009B79D9064AD50388102208335B01E318F5 +:100AA0001A71038808335B01E318DB799A063DD598 +:100AB0000388202208335B01E318DA7103880122DE +:100AC00008335B01E3181A7130E0C046980000203B +:100AD0007D0000208200002084000020860000208D +:100AE000800000200203000001030000212000001C +:100AF000A121000021220000641600000400002053 +:100B00005416000044160000481600007E00002025 +:100B10007C0000200B8808222868934201D80A88AC +:100B200092B207490023FFF70FFC07E0201CFFF7F4 +:100B30009BFC03E0201C0121FFF78CFCF7BDC046A5 +:100B40004800002007B5054B0122019001A9186853 +:100B5000131CFFF7F9FB01200EBDC0461C0200204C +:100B600013B5054B6C4607341868211C0122FFF7AA +:100B700033FC207816BDC0461C02002010B5074C7F +:100B8000201CFFF70DFB031C0020834205D02268C8 +:100B90004823FF33D05C0123184010BD1C02002005 +:100BA00010B5054A0C1C031C191C10680123221CDB +:100BB000FFF7CAFB201C10BD1C02002070B5084CBA +:100BC000061C201C0D1CFFF7EBFA0023984205D0F1 +:100BD0002068311C2A1CFFF7FFFB031C181C70BD8A +:100BE0001C020020F8B50C4C051C201C0E1CFFF745 +:100BF000D7FA0023271C341C98420AD0002C07D0B7 +:100C0000291C221C3868FFF7E7FB241A2D18F5E78A +:100C1000331C181CF8BDC0461C02002008B5031C7C +:100C2000081C111C9847044B802212055A61034B83 +:100C300064221A8008BDC046004400418C00002098 +:100C4000012805D1054B064A1A60064B187004E0CE +:100C5000002802D1044A014B1A6070478C02002020 +:100C60009816000094000020E416000030B50A1C1D +:100C70001C4985B00978031C00292AD0042A01D117 +:100C8000006804E0022A01D1008800E000785200E8 +:100C900004A98B180B3B9C1AA3420BD00F210140D7 +:100CA000092902D83025294300E03731197000099D +:100CB000013BF1E701A930230B7078234B700A2028 +:100CC0008B1898700D20D870074B04321B68D868B9 +:100CD00003E005490968C868191CFFF79FFF05B0C4 +:100CE00030BDC046880000208C02002072B6EFF3B1 +:100CF0000883044A1360036883F30888436818472D +:100D00007047C046900200200D4B1A88002A09D077 +:100D10001A88013A92B21A80002A03D18022094B24 +:100D200012059A61084B1A88002A08D01A88013ADD +:100D300092B21A80002A02D1044B08221A6070472E +:100D40008C000020004400418A00002098440041AB +:100D5000F0B591B008A9CE4A0B1C31CA31C351CAB3 +:100D600051C360CA60C3CB4BCB489A687A25520303 +:100D7000520F92005258C94902609C68A4B2624363 +:100D80000C60C74900240A60C64A1460C64C25702E +:100D9000C64CC74D2368281C1B6940219847002872 +:100DA00005D0C44B08221A60C34B64221A80C34B7F +:100DB00000221860C24B1D60C24BC24DBF4F1A606B +:100DC0002A683B689A42E3D2BD4B1B681A78FF2A17 +:100DD00000D120E2232A00D0F7E1BB4E3378002B6C +:100DE00006D0B24BB9491B680222D868FFF716FF3C +:100DF000AD4B1B78532B3FD13B682A6893421ED9D9 +:100E0000AF4801322A609A1AB14B01681B68013160 +:100E10000160B04E9A4201D2326000E03360A148D6 +:100E200032680068049000F0E9FB336829685A18BA +:100E30002A60A34A1668F1181160A74A13702B683C +:100E4000013B2B609E4B1A68013A1A60A24BA04AE4 +:100E50001B7811688B420DD222689248C91A00682B +:100E600092699047002805D0924B08221A60924B55 +:100E700064221A80C04696E1522B0ED18948944ACA +:100E80002368006811685B6903909847934B802240 +:100E900012055A616422924B0DE04F2B05D1814B14 +:100EA0008B4A1B6812681A707DE1482B05D17D4B77 +:100EB000874A1B6812681A8075E1572B05D1794B58 +:100EC000834A1B6812681A606DE16F2B03D1754B62 +:100ED0000121186807E0682B08D1724B7C481B6819 +:100EE00002211B880360FFF7C1FE5CE1772B06D16E +:100EF0006C4B77481B6804211B680360F3E7472BA2 +:100F000013D1734B1868FFF7F1FE764B1B6883F320 +:100F1000088862B6744B1B78002B00D143E1634B09 +:100F200006201B681B6898473DE1542B04D1012320 +:100F300033705E4B1B6864E04E2B0CD13378002B72 +:100F400006D15A4B61491B680222D868FFF766FE3A +:100F50000023337027E1562B57D123686349D868A3 +:100F60000122FFF75BFE23686149D8680322FFF77F +:100F700055FE604D2368291CD8680122FFF74EFEFC +:100F800023685D49D8680D22FFF748FE2368291CB5 +:100F9000D8680122FFF742FE494F4A4D57490023C6 +:100FA00039602B603A1C281C13685E1C16601B7885 +:100FB0000593002B03D0036801330360F4E73B4E35 +:100FC0002A683368D868FFF729FE33684949D8682A +:100FD0000122FFF723FE0599296049493960384A03 +:100FE0001368581C10601B78002B04D0354B1A680E +:100FF00001321A60F3E733682A68D868FFF70EFEFB +:101000003368D86831490222CBE0314A582B17D1D6 +:10101000214E234D366813682A68B10093420AD2E4 +:101020001C4D5808E861374828801A4D287DC607AE +:10103000FBD55B18F2E71D4B33491B68D868AFE05E +:10104000592B00D07DE01268164B3049002A02D19E +:101050001B680B6070E00F4D086819686B680D4ED7 +:101060008025AB4392087360002A65D0284B094D58 +:101070002B80084E337DDD07FBD50023064D2D6800 +:101080000195AD08AB4247D3224D024E35804AE070 +:101090007816000000400041440200203C0200207D +:1010A0003802002088020020340200208C02002038 +:1010B00048020020944400418A0000202C020020B5 +:1010C000300200204002002088000020D8160000D6 +:1010D00094020020980200202802002000440041D1 +:1010E0008C0000209002002094000020B416000024 +:1010F000DD160000B616000000170000B81600004C +:10110000C416000002A5FFFFCD16000090000020CD +:1011100044A5FFFF04A5FFFF9342B5D09D004659AB +:1011200001334E51AAE7404E357DEE07FBD59D00B9 +:1011300049194019D21A97E73C4B3D491B68D868BA +:101140002EE05A2B2FD13B4B17681D680026EF1954 +:10115000BD4206D02878311C00F014F90135061C78 +:10116000F6E7324B34491B680122D868FFF756FD79 +:1011700007230F223240111C36093031092A00DDC5 +:1011800007311820C0186A468154013BF1D2236808 +:1011900006A9D8680822FFF741FD23682749D868C7 +:1011A0000322FFF73BFD264B7A221A70254B0022C3 +:1011B0001A60254B1B7893422DD01C4B23491B688A +:1011C0000122D868FFF72AFD25E0111C3039C8B28A +:1011D0001C4B092804D81D682A01114319601AE024 +:1011E000111C4139052903D81E68373A310106E040 +:1011F000111C6139052904D81868573A01010A43BE +:1012000008E02C2A03D10B4A1968116001E00C494F +:101210000A7000221A600E4B1A6801321A600D4BD8 +:101220001A680132C9E5C046004000418C02002026 +:10123000D116000088020020D5160000D716000045 +:10124000340200209402002088000020DB160000F9 +:10125000400200203002002010B51C4B01201A78FB +:10126000022402431A701A4B0F2219789143197005 +:1012700019782143197017490C78204308701978A0 +:101280000A401A701A7820210A431A70124B04215E +:101290001A6A0A431A62114B114A5A805A7852B29A +:1012A000002AFBDBC4220F480F499203FEF72CFFF4 +:1012B0000E4A002313700E4A13700E4A13700E4A22 +:1012C00013700E4A13700E4A137010BD4A44004149 +:1012D000354400414B44004100040040000C0040F4 +:1012E00014400000000800422AF600009C02002082 +:1012F000230300209D020020A002002024030020E0 +:101300002103002008B5C1B20248FEF72BFF0120DF +:1013100008BDC04600080042024B187E4007C00FBF +:101320007047C0460008004208B5FFF7F5FF0028E7 +:10133000FBD00248FEF71CFF08BDC0460008004273 +:1013400008B5FFF7E9FF0023984205D0FFF7ECFF4F +:10135000031C233B5A425341181C08BD70B5041CA2 +:101360000D1C4618B44204D02078FFF7CBFF01349F +:10137000F8E7281C70BD10B5041CFFF7D5FF2070DE +:10138000012010BD0B0A5840034B4000C05A09020F +:10139000484080B27047C0460E170000F7B50024E1 +:1013A000051C0F1C261CBC4220D0FFF7BDFF114BB3 +:1013B000C0B21B780190002B1AD1311CFFF7E2FF5D +:1013C0000D4B061C1A88002A04D10C4A11782A1CDD +:1013D000002907D001996A1C2970802F02D1198831 +:1013E000013919800134A4B2151CDCE7301C00E07F +:1013F0000120FEBD210300209E02002022030020C8 +:10140000F0B53E4E85B0002203900C1C32703C4B70 +:10141000914201D1012201E03A490C801A707F23E8 +:101420001C4201D080349C43FFF77EFF3378C0B26A +:10143000002B07D000253570FFF776FF3378C0B258 +:10144000AB4236D1432803D0712853D01528EBD1B5 +:10145000012300930120FFF755FF0098FFF752FF8B +:1014600000998025C843C0B2FFF74CFF039B0027BB +:101470000293244A1388002B1DD121490193097836 +:10148000002918D10198FFF73DFF391C0198FFF79B +:1014900079FF013D071C002DEBD1000AC0B2FFF718 +:1014A00031FFF8B2FFF72EFFFFF73EFF3378002B36 +:1014B0000AD035701FE00299013B09781380029B26 +:1014C000019101330293DDE7C0B2062807D1009BEA +:1014D00003990133DBB280310093803C0391002CEF +:1014E000B8D10420FFF70EFFFFF71EFF044B0125C4 +:1014F0001C7000E00025281C05B0F0BD2103002071 +:10150000220300209E020020F0B5384C87B0002353 +:1015100001902370994201D1012301E0344A1180E6 +:10152000344A642613704320FFF7ECFE324FFFF776 +:10153000F3FE002803D1002F03D0013FF7E7002F6F +:1015400003D1013E002EEED14DE00125FFF7ECFE68 +:101550002378002B38D1C0B20290012805D004288E +:101560003DD10620FFF7CEFE39E005AE0221301C4A +:10157000FFF714FF01988021FFF710FF23780390F5 +:10158000002B18D1FFF7D0FE0702FFF7CDFEBFB248 +:1015900023783F18BFB2012B0DD0039B9F4207D188 +:1015A0003378AB4204D1EB437278DBB29A4204D079 +:1015B0001820FFF7A7FE002303E00620FFF7A2FE96 +:1015C000029B2278002A02D0002626700BE0012B15 +:1015D00005D1019A6B1C8032DDB20192B6E7054A53 +:1015E000002313700126301C07B0F0BD210300203A +:1015F0009E0200202203002000350C0010B50023BD +:10160000934203D0CC5CC4540133F9E710BD031CF2 +:101610008218934202D019700133FAE77047002311 +:10162000C25C0133002AFBD1581E7047F8B5C04692 +:10163000F8BC08BC9E467047F8B5C046F8BC08BC6C +:101640009E4670470403090441726475696E6F20F9 +:101650004C4C4300537061726B66756E2053414D64 +:101660004432310012010002020000404F1B5F2192 +:10167000000201020001000008000000100000004C +:101680002000000040000000800000000001000079 +:1016900000020000000400000513000029130000F0 +:1016A000191300005D1300007713000001140000FF +:1016B0000915000076002000536570203235203275 +:1016C0003031380031333A32383A343300580A0D69 +:1016D00000590A0D005A00230A0D003E00322E3038 +:1016E00000000000450B0000610B00007D0B0000B6 +:1016F000A10B0000BD0B0000A10B0000E50B0000DA +:101700005B41726475696E6F3A58595A5D0000000A +:101710002110422063308440A550C660E7700881E4 +:1017200029914AA16BB18CC1ADD1CEE1EFF131125B +:10173000100273325222B5529442F772D662399334 +:1017400018837BB35AA3BDD39CC3FFF3DEE36224AB +:10175000433420040114E664C774A44485546AA584 +:101760004BB528850995EEE5CFF5ACC58DD553363B +:10177000722611163006D776F6669556B4465BB7D4 +:101780007AA719973887DFF7FEE79DD7BCC7C4480B +:10179000E5588668A7784008611802282338CCC924 +:1017A000EDD98EE9AFF9488969990AA92BB9F55A9B +:1017B000D44AB77A966A711A500A333A122AFDDB74 +:1017C000DCCBBFFB9EEB799B588B3BBB1AABA66C6B +:1017D000877CE44CC55C222C033C600C411CAEEDC4 +:1017E0008FFDECCDCDDD2AAD0BBD688D499D977E7B +:1017F000B66ED55EF44E133E322E511E700E9FFF14 +:10180000BEEFDDDFFCCF1BBF3AAF599F788F8891C9 +:10181000A981CAB1EBA10CD12DC14EF16FE18010AD +:10182000A100C230E3200450254046706760B983B0 +:101830009893FBA3DAB33DC31CD37FE35EF3B102FD +:101840009012F322D2323542145277625672EAB5C0 +:10185000CBA5A89589856EF54FE52CD50DC5E2344D +:10186000C324A01481046674476424540544DBA790 +:10187000FAB79987B8975FE77EF71DC73CD7D3269D +:10188000F2369106B01657667676154634564CD920 +:101890006DC90EF92FE9C899E9898AB9ABA94458ED +:1018A000654806782768C018E1088238A3287DCBF0 +:1018B0005CDB3FEB1EFBF98BD89BBBAB9ABB754A3D +:1018C000545A376A167AF10AD01AB32A923A2EFD80 +:1018D0000FED6CDD4DCDAABD8BADE89DC98D267C8D +:1018E000076C645C454CA23C832CE01CC10C1FEFD0 +:1018F0003EFF5DCF7CDF9BAFBABFD98FF89F176EDD +:10190000367E554E745E932EB23ED10EF01E000010 +:0419100000000000D3 +:10191400011400000902430002010080320904009E +:101924000001020200000524001001042402000545 +:10193400240600010524010001070583030800FFB4 +:1019440009040100020A00000007058102400000AA +:10195400070502024000000000C201000000080068 +:0C196400690000004100000000000000CD +:0400000300000615DE +:00000001FF diff --git a/sparkfun/samd/bootloaders/zero/board_definitions.h b/sparkfun/samd/bootloaders/zero/board_definitions.h index bf74359b..ff74048c 100644 --- a/sparkfun/samd/bootloaders/zero/board_definitions.h +++ b/sparkfun/samd/bootloaders/zero/board_definitions.h @@ -29,6 +29,10 @@ #include "board_definitions_sparkfun_9dofRazor.h" #elif defined(BOARD_ID_sparkfun_samd21_dev) #include "board_definitions_sparkfun_samd21dev.h" +#elif defined(BOARD_ID_sparkfun_samd21_proRF) + #include "board_definitions_sparkfun_samd21_proRF.h" +#elif defined(BOARD_ID_sparkfun_samd21_proRF_1w) + #include "board_definitions_sparkfun_samd21_proRF_1w.h" #else #error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h #endif diff --git a/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF.h b/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF.h new file mode 100644 index 00000000..eff624ac --- /dev/null +++ b/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF.h @@ -0,0 +1,81 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _BOARD_DEFINITIONS_H_ +#define _BOARD_DEFINITIONS_H_ + +/* + * USB device definitions + */ +#define STRING_PRODUCT "Sparkfun SAMD21" +#define USB_VID_HIGH 0x1B +#define USB_VID_LOW 0x4F +#define USB_PID_HIGH 0x21 +#define USB_PID_LOW 0x5F + +/* + * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by + * quickly tapping two times on the reset button. + * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not + * be touched from the loaded application. + */ +#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) +#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) + +/* + * If BOOT_LOAD_PIN is defined the bootloader is started if the selected + * pin is tied LOW. + */ +//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 +//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 + +#define BOOT_USART_MODULE SERCOM0 +#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 +#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val +#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 +#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 +#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 +#define BOOT_USART_PAD1 PINMUX_UNUSED +#define BOOT_USART_PAD0 PINMUX_UNUSED + + +/* Master clock frequency */ +#define CPU_FREQUENCY (48000000ul) +#define VARIANT_MCK CPU_FREQUENCY + +/* Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/* Calibration values for DFLL48 pll */ +#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) +#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) + +/* + * LEDs definitions + */ +#define BOARD_LED_PORT (0) +#define BOARD_LED_PIN (17) + +#define BOARD_LEDRX_PORT (1) +#define BOARD_LEDRX_PIN (3) + +#define BOARD_LEDTX_PORT (0) +#define BOARD_LEDTX_PIN (27) + +#endif // _BOARD_DEFINITIONS_H_ diff --git a/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF_1w.h b/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF_1w.h new file mode 100644 index 00000000..c57d1d05 --- /dev/null +++ b/sparkfun/samd/bootloaders/zero/board_definitions_sparkfun_samd21_proRF_1w.h @@ -0,0 +1,81 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _BOARD_DEFINITIONS_H_ +#define _BOARD_DEFINITIONS_H_ + +/* + * USB device definitions + */ +#define STRING_PRODUCT "Sparkfun SAMD21 ProRF 1W" +#define USB_VID_HIGH 0x1B +#define USB_VID_LOW 0x4F +#define USB_PID_HIGH 0x3A +#define USB_PID_LOW 0xBA + +/* + * If BOOT_DOUBLE_TAP_ADDRESS is defined the bootloader is started by + * quickly tapping two times on the reset button. + * BOOT_DOUBLE_TAP_ADDRESS must point to a free SRAM cell that must not + * be touched from the loaded application. + */ +#define BOOT_DOUBLE_TAP_ADDRESS (0x20007FFCul) +#define BOOT_DOUBLE_TAP_DATA (*((volatile uint32_t *) BOOT_DOUBLE_TAP_ADDRESS)) + +/* + * If BOOT_LOAD_PIN is defined the bootloader is started if the selected + * pin is tied LOW. + */ +//#define BOOT_LOAD_PIN PIN_PA21 // Pin 7 +//#define BOOT_LOAD_PIN PIN_PA15 // Pin 5 + +#define BOOT_USART_MODULE SERCOM0 +#define BOOT_USART_BUS_CLOCK_INDEX PM_APBCMASK_SERCOM0 +#define BOOT_USART_PER_CLOCK_INDEX GCLK_CLKCTRL_ID_SERCOM0_CORE_Val +#define BOOT_USART_PAD_SETTINGS UART_RX_PAD3_TX_PAD2 +#define BOOT_USART_PAD3 PINMUX_PA11C_SERCOM0_PAD3 +#define BOOT_USART_PAD2 PINMUX_PA10C_SERCOM0_PAD2 +#define BOOT_USART_PAD1 PINMUX_UNUSED +#define BOOT_USART_PAD0 PINMUX_UNUSED + + +/* Master clock frequency */ +#define CPU_FREQUENCY (48000000ul) +#define VARIANT_MCK CPU_FREQUENCY + +/* Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/* Calibration values for DFLL48 pll */ +#define NVM_SW_CALIB_DFLL48M_COARSE_VAL (58) +#define NVM_SW_CALIB_DFLL48M_FINE_VAL (64) + +/* + * LEDs definitions + */ +#define BOARD_LED_PORT (0) +#define BOARD_LED_PIN (17) + +#define BOARD_LEDRX_PORT (1) +#define BOARD_LEDRX_PIN (3) + +#define BOARD_LEDTX_PORT (0) +#define BOARD_LEDTX_PIN (27) + +#endif // _BOARD_DEFINITIONS_H_ diff --git a/sparkfun/samd/cores/arduino/Print.cpp b/sparkfun/samd/cores/arduino/Print.cpp index 33ee7210..136329cc 100644 --- a/sparkfun/samd/cores/arduino/Print.cpp +++ b/sparkfun/samd/cores/arduino/Print.cpp @@ -238,14 +238,14 @@ size_t Print::printFloat(double number, uint8_t digits) // Print the decimal point, but only if there are digits beyond if (digits > 0) { - n += print("."); + n += print('.'); } // Extract digits from the remainder one at a time while (digits-- > 0) { remainder *= 10.0; - unsigned int toPrint = (unsigned int)remainder; + unsigned int toPrint = (unsigned int)(remainder); n += print(toPrint); remainder -= toPrint; } diff --git a/sparkfun/samd/cores/arduino/Print.h b/sparkfun/samd/cores/arduino/Print.h index 9fc26742..dfb645cb 100644 --- a/sparkfun/samd/cores/arduino/Print.h +++ b/sparkfun/samd/cores/arduino/Print.h @@ -28,6 +28,9 @@ #define DEC 10 #define HEX 16 #define OCT 8 +#ifdef BIN // Prevent warnings if BIN is previously defined in "iotnx4.h" or similar +#undef BIN +#endif #define BIN 2 class Print @@ -54,6 +57,10 @@ class Print return write((const uint8_t *)buffer, size); } + // default to zero, meaning "a single write may block" + // should be overriden by subclasses with buffering + virtual int availableForWrite() { return 0; } + size_t print(const __FlashStringHelper *); size_t print(const String &); size_t print(const char[]); @@ -78,6 +85,8 @@ class Print size_t println(double, int = 2); size_t println(const Printable&); size_t println(void); + + virtual void flush() { /* Empty implementation for backward compatibility */ } }; #endif diff --git a/sparkfun/samd/cores/arduino/RingBuffer.cpp b/sparkfun/samd/cores/arduino/RingBuffer.cpp deleted file mode 100644 index d877a6e3..00000000 --- a/sparkfun/samd/cores/arduino/RingBuffer.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (c) 2014 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "RingBuffer.h" -#include - -RingBuffer::RingBuffer( void ) -{ - memset( _aucBuffer, 0, SERIAL_BUFFER_SIZE ) ; - clear(); -} - -void RingBuffer::store_char( uint8_t c ) -{ - int i = nextIndex(_iHead); - - // if we should be storing the received character into the location - // just before the tail (meaning that the head would advance to the - // current location of the tail), we're about to overflow the buffer - // and so we don't write the character or advance the head. - if ( i != _iTail ) - { - _aucBuffer[_iHead] = c ; - _iHead = i ; - } -} - -void RingBuffer::clear() -{ - _iHead = 0; - _iTail = 0; -} - -int RingBuffer::read_char() -{ - if(_iTail == _iHead) - return -1; - - uint8_t value = _aucBuffer[_iTail]; - _iTail = nextIndex(_iTail); - - return value; -} - -int RingBuffer::available() -{ - int delta = _iHead - _iTail; - - if(delta < 0) - return SERIAL_BUFFER_SIZE + delta; - else - return delta; -} - -int RingBuffer::peek() -{ - if(_iTail == _iHead) - return -1; - - return _aucBuffer[_iTail]; -} - -int RingBuffer::nextIndex(int index) -{ - return (uint32_t)(index + 1) % SERIAL_BUFFER_SIZE; -} - -bool RingBuffer::isFull() -{ - return (nextIndex(_iHead) == _iTail); -} diff --git a/sparkfun/samd/cores/arduino/RingBuffer.h b/sparkfun/samd/cores/arduino/RingBuffer.h index e212e6b6..e706cc4f 100644 --- a/sparkfun/samd/cores/arduino/RingBuffer.h +++ b/sparkfun/samd/cores/arduino/RingBuffer.h @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#ifdef __cplusplus + #ifndef _RING_BUFFER_ #define _RING_BUFFER_ @@ -25,26 +27,118 @@ // using a ring buffer (I think), in which head is the index of the location // to which to write the next incoming character and tail is the index of the // location from which to read. -#define SERIAL_BUFFER_SIZE 64 +#ifndef SERIAL_BUFFER_SIZE +#define SERIAL_BUFFER_SIZE 256 +#endif -class RingBuffer +template +class RingBufferN { public: - uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ; - int _iHead ; - int _iTail ; + uint8_t _aucBuffer[N] ; + volatile int _iHead ; + volatile int _iTail ; public: - RingBuffer( void ) ; + RingBufferN( void ) ; void store_char( uint8_t c ) ; - void clear(); - int read_char(); - int available(); - int peek(); - bool isFull(); + void clear(); + int read_char(); + int available(); + int availableForStore(); + int peek(); + bool isFull(); private: - int nextIndex(int index); -} ; + int nextIndex(int index); +}; + +typedef RingBufferN RingBuffer; + + +template +RingBufferN::RingBufferN( void ) +{ + memset( _aucBuffer, 0, N ) ; + clear(); +} + +template +void RingBufferN::store_char( uint8_t c ) +{ + int i = nextIndex(_iHead); + + // if we should be storing the received character into the location + // just before the tail (meaning that the head would advance to the + // current location of the tail), we're about to overflow the buffer + // and so we don't write the character or advance the head. + if ( i != _iTail ) + { + _aucBuffer[_iHead] = c ; + _iHead = i ; + } +} + +template +void RingBufferN::clear() +{ + _iHead = 0; + _iTail = 0; +} + +template +int RingBufferN::read_char() +{ + if(_iTail == _iHead) + return -1; + + uint8_t value = _aucBuffer[_iTail]; + _iTail = nextIndex(_iTail); + + return value; +} + +template +int RingBufferN::available() +{ + int delta = _iHead - _iTail; + + if(delta < 0) + return N + delta; + else + return delta; +} + +template +int RingBufferN::availableForStore() +{ + if (_iHead >= _iTail) + return N - 1 - _iHead + _iTail; + else + return _iTail - _iHead - 1; +} + +template +int RingBufferN::peek() +{ + if(_iTail == _iHead) + return -1; + + return _aucBuffer[_iTail]; +} + +template +int RingBufferN::nextIndex(int index) +{ + return (uint32_t)(index + 1) % N; +} + +template +bool RingBufferN::isFull() +{ + return (nextIndex(_iHead) == _iTail); +} #endif /* _RING_BUFFER_ */ + +#endif /* __cplusplus */ diff --git a/sparkfun/samd/cores/arduino/SERCOM.cpp b/sparkfun/samd/cores/arduino/SERCOM.cpp index 44d2fbc2..61e53a9c 100644 --- a/sparkfun/samd/cores/arduino/SERCOM.cpp +++ b/sparkfun/samd/cores/arduino/SERCOM.cpp @@ -19,6 +19,12 @@ #include "SERCOM.h" #include "variant.h" +#ifndef WIRE_RISE_TIME_NANOSECONDS +// Default rise time in nanoseconds, based on 4.7K ohm pull up resistors +// you can override this value in your variant if needed +#define WIRE_RISE_TIME_NANOSECONDS 125 +#endif + SERCOM::SERCOM(Sercom* s) { sercom = s; @@ -173,6 +179,16 @@ int SERCOM::writeDataUART(uint8_t data) return 1; } +void SERCOM::enableDataRegisterEmptyInterruptUART() +{ + sercom->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; +} + +void SERCOM::disableDataRegisterEmptyInterruptUART() +{ + sercom->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; +} + /* ========================= * ===== Sercom SPI * ========================= @@ -240,11 +256,11 @@ void SERCOM::enableSPI() void SERCOM::disableSPI() { - while(sercom->SPI.SYNCBUSY.bit.ENABLE) { //Waiting then enable bit from SYNCBUSY is equal to 0; } + //Setting the enable bit to 0 sercom->SPI.CTRLA.bit.ENABLE = 0; } @@ -360,7 +376,7 @@ void SERCOM::enableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I²C master mode + // Enable the I2C master mode sercom->I2CM.CTRLA.bit.ENABLE = 1 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) @@ -381,7 +397,7 @@ void SERCOM::disableWIRE() { // I2C Master and Slave modes share the ENABLE bit function. - // Enable the I²C master mode + // Enable the I2C master mode sercom->I2CM.CTRLA.bit.ENABLE = 0 ; while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) @@ -390,17 +406,20 @@ void SERCOM::disableWIRE() } } -void SERCOM::initSlaveWIRE( uint8_t ucAddress ) +void SERCOM::initSlaveWIRE( uint8_t ucAddress, bool enableGeneralCall ) { // Initialize the peripheral clock and interruption initClockNVIC() ; resetWIRE() ; // Set slave mode - sercom->I2CS.CTRLA.bit.MODE = I2C_SLAVE_OPERATION ; + sercom->I2CS.CTRLA.bit.MODE = I2C_SLAVE_OPERATION; sercom->I2CS.ADDR.reg = SERCOM_I2CS_ADDR_ADDR( ucAddress & 0x7Ful ) | // 0x7F, select only 7 bits - SERCOM_I2CS_ADDR_ADDRMASK( 0x00ul ) ; // 0x00, only match exact address + SERCOM_I2CS_ADDR_ADDRMASK( 0x00ul ); // 0x00, only match exact address + if (enableGeneralCall) { + sercom->I2CS.ADDR.reg |= SERCOM_I2CS_ADDR_GENCEN; // enable general call (address 0x00) + } // Set the interrupt register sercom->I2CS.INTENSET.reg = SERCOM_I2CS_INTENSET_PREC | // Stop @@ -432,7 +451,7 @@ void SERCOM::initMasterWIRE( uint32_t baudrate ) // sercom->I2CM.INTENSET.reg = SERCOM_I2CM_INTENSET_MB | SERCOM_I2CM_INTENSET_SB | SERCOM_I2CM_INTENSET_ERROR ; // Synchronous arithmetic baudrate - sercom->I2CM.BAUD.bit.BAUD = SystemCoreClock / ( 2 * baudrate) - 1 ; + sercom->I2CM.BAUD.bit.BAUD = SystemCoreClock / ( 2 * baudrate) - 5 - (((SystemCoreClock / 1000000) * WIRE_RISE_TIME_NANOSECONDS) / (2 * 1000)); } void SERCOM::prepareNackBitWIRE( void ) @@ -652,16 +671,20 @@ void SERCOM::initClockNVIC( void ) clockId = GCM_SERCOM3_CORE; IdNvic = SERCOM3_IRQn; } + #if defined(SERCOM4) else if(sercom == SERCOM4) { clockId = GCM_SERCOM4_CORE; IdNvic = SERCOM4_IRQn; } + #endif // SERCOM4 + #if defined(SERCOM5) else if(sercom == SERCOM5) { clockId = GCM_SERCOM5_CORE; IdNvic = SERCOM5_IRQn; } + #endif // SERCOM5 if ( IdNvic == PendSV_IRQn ) { @@ -671,7 +694,7 @@ void SERCOM::initClockNVIC( void ) // Setting NVIC NVIC_EnableIRQ(IdNvic); - NVIC_SetPriority (IdNvic, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (IdNvic, SERCOM_NVIC_PRIORITY); /* set Priority */ //Setting clock GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID( clockId ) | // Generic Clock 0 (SERCOMx) diff --git a/sparkfun/samd/cores/arduino/SERCOM.h b/sparkfun/samd/cores/arduino/SERCOM.h index 79249011..4b1568b5 100644 --- a/sparkfun/samd/cores/arduino/SERCOM.h +++ b/sparkfun/samd/cores/arduino/SERCOM.h @@ -21,7 +21,8 @@ #include "sam.h" -#define SERCOM_FREQ_REF 48000000 +#define SERCOM_FREQ_REF 48000000 +#define SERCOM_NVIC_PRIORITY ((1<<__NVIC_PRIO_BITS) - 1) typedef enum { @@ -163,6 +164,8 @@ class SERCOM int writeDataUART(uint8_t data) ; bool isUARTError() ; void acknowledgeUARTError() ; + void enableDataRegisterEmptyInterruptUART(); + void disableDataRegisterEmptyInterruptUART(); /* ========== SPI ========== */ void initSPI(SercomSpiTXPad mosi, SercomRXPad miso, SercomSpiCharSize charSize, SercomDataOrder dataOrder) ; @@ -182,7 +185,7 @@ class SERCOM bool isReceiveCompleteSPI( void ) ; /* ========== WIRE ========== */ - void initSlaveWIRE(uint8_t address) ; + void initSlaveWIRE(uint8_t address, bool enableGeneralCall = false) ; void initMasterWIRE(uint32_t baudrate) ; void resetWIRE( void ) ; diff --git a/sparkfun/samd/cores/arduino/Stream.cpp b/sparkfun/samd/cores/arduino/Stream.cpp index f6654653..d2846316 100644 --- a/sparkfun/samd/cores/arduino/Stream.cpp +++ b/sparkfun/samd/cores/arduino/Stream.cpp @@ -27,7 +27,7 @@ #define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait -// private method to read stream with timeout +// protected method to read stream with timeout int Stream::timedRead() { int c; @@ -39,7 +39,7 @@ int Stream::timedRead() return -1; // -1 indicates timeout } -// private method to peek stream with timeout +// protected method to peek stream with timeout int Stream::timedPeek() { int c; diff --git a/sparkfun/samd/cores/arduino/Stream.h b/sparkfun/samd/cores/arduino/Stream.h index dd54e8c6..c3311c3c 100644 --- a/sparkfun/samd/cores/arduino/Stream.h +++ b/sparkfun/samd/cores/arduino/Stream.h @@ -51,15 +51,14 @@ class Stream : public Print protected: unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read unsigned long _startMillis; // used for timeout measurement - int timedRead(); // private method to read stream with timeout - int timedPeek(); // private method to peek stream with timeout + int timedRead(); // read stream with timeout + int timedPeek(); // peek stream with timeout int peekNextDigit(LookaheadMode lookahead, bool detectDecimal); // returns the next numeric digit in the stream or -1 if timeout public: virtual int available() = 0; virtual int read() = 0; virtual int peek() = 0; - virtual void flush() = 0; Stream() {_timeout=1000;} diff --git a/sparkfun/samd/cores/arduino/USB/SAMD21_USBDevice.h b/sparkfun/samd/cores/arduino/USB/SAMD21_USBDevice.h index c8fafb40..90822e14 100644 --- a/sparkfun/samd/cores/arduino/USB/SAMD21_USBDevice.h +++ b/sparkfun/samd/cores/arduino/USB/SAMD21_USBDevice.h @@ -108,6 +108,7 @@ class USBDevice_SAMD21G18x { inline void epBank1EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL1 = 1; } inline void epBank0EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT0 = 1; } inline void epBank1EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT1 = 1; } + inline void epBank0DisableSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.RXSTP = 1; } inline void epBank0DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL0 = 1; } inline void epBank1DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL1 = 1; } @@ -322,32 +323,32 @@ class DoubleBufferedEPOutHandler : public EPHandler { if (incoming == 0) { last0 = usbd.epBank0ByteCount(ep); if (last0 != 0) { - incoming = 1; - usbd.epBank0SetAddress(ep, const_cast(data1)); - synchronized { + incoming = 1; + usbd.epBank0SetAddress(ep, const_cast(data1)); + synchronized { ready0 = true; - if (ready1) { - notify = true; - return; + if (ready1) { + notify = true; + return; + } + notify = false; } - notify = false; - } } } else { last1 = usbd.epBank0ByteCount(ep); if (last1 != 0) { - incoming = 0; - usbd.epBank0SetAddress(ep, const_cast(data0)); - synchronized { - ready1 = true; - if (ready0) { - notify = true; - return; + incoming = 0; + usbd.epBank0SetAddress(ep, const_cast(data0)); + synchronized { + ready1 = true; + if (ready0) { + notify = true; + return; + } + notify = false; } - notify = false; } } - } release(); } } diff --git a/sparkfun/samd/cores/arduino/USB/USBCore.cpp b/sparkfun/samd/cores/arduino/USB/USBCore.cpp index 6f983c0a..773d8fcc 100644 --- a/sparkfun/samd/cores/arduino/USB/USBCore.cpp +++ b/sparkfun/samd/cores/arduino/USB/USBCore.cpp @@ -16,6 +16,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#if defined(USBCON) + #include #include "SAMD21_USBDevice.h" @@ -177,6 +179,15 @@ uint32_t USBDeviceClass::sendConfiguration(uint32_t maxlen) return true; } +static void utox8(uint32_t val, char* s) { + for (int i = 0; i < 8; i++) { + int d = val & 0XF; + val = (val >> 4); + + s[7 - i] = d > 9 ? 'A' + d - 10 : '0' + d; + } +} + bool USBDeviceClass::sendDescriptor(USBSetup &setup) { uint8_t t = setup.wValueH; @@ -221,8 +232,19 @@ bool USBDeviceClass::sendDescriptor(USBSetup &setup) } else if (setup.wValueL == ISERIAL) { #ifdef PLUGGABLE_USB_ENABLED + // from section 9.3.3 of the datasheet + #define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C) + #define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040) + #define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x0080A044) + #define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x0080A048) + char name[ISERIAL_MAX_LEN]; - PluggableUSB().getShortName(name); + utox8(SERIAL_NUMBER_WORD_0, &name[0]); + utox8(SERIAL_NUMBER_WORD_1, &name[8]); + utox8(SERIAL_NUMBER_WORD_2, &name[16]); + utox8(SERIAL_NUMBER_WORD_3, &name[24]); + + PluggableUSB().getShortName(&name[32]); return sendStringDescriptor((uint8_t*)name, setup.wLength); #endif } @@ -432,7 +454,9 @@ void USBDeviceClass::initEP(uint32_t ep, uint32_t config) } else if (config == (USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_OUT(0))) { - epHandlers[ep] = new DoubleBufferedEPOutHandler(usbd, ep, 256); + if (epHandlers[ep] == NULL) { + epHandlers[ep] = new DoubleBufferedEPOutHandler(usbd, ep, 256); + } } else if (config == (USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_IN(0))) { @@ -948,3 +972,4 @@ void USBDeviceClass::ISRHandler() // USBDevice class instance USBDeviceClass USBDevice; +#endif diff --git a/sparkfun/samd/cores/arduino/USB/USBCore.h b/sparkfun/samd/cores/arduino/USB/USBCore.h index cba8089a..75fd9e3d 100644 --- a/sparkfun/samd/cores/arduino/USB/USBCore.h +++ b/sparkfun/samd/cores/arduino/USB/USBCore.h @@ -100,6 +100,9 @@ // bMaxPower in Configuration Descriptor #define USB_CONFIG_POWER_MA(mA) ((mA)/2) +#ifndef USB_CONFIG_POWER + #define USB_CONFIG_POWER (500) +#endif #define CDC_V1_10 0x0110 #define CDC_COMMUNICATION_INTERFACE_CLASS 0x02 @@ -258,7 +261,7 @@ _Pragma("pack()") * idVendor, idProduct, bcdDevice, iManufacturer, iProduct, iSerialNumber, bNumConfigurations */ #define D_CONFIG(_totalLength,_interfaces) \ - { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) } + { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) } /* Table 9-10. Standard Configuration Descriptor * bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration * bmAttributes, bMaxPower */ diff --git a/sparkfun/samd/cores/arduino/USB/USBDesc.h b/sparkfun/samd/cores/arduino/USB/USBDesc.h index 6088ee08..1962be3d 100644 --- a/sparkfun/samd/cores/arduino/USB/USBDesc.h +++ b/sparkfun/samd/cores/arduino/USB/USBDesc.h @@ -26,6 +26,9 @@ #ifdef CDC_ENABLED #define CDC_INTERFACE_COUNT 2 #define CDC_ENPOINT_COUNT 3 +#else +#define CDC_INTERFACE_COUNT 0 +#define CDC_ENPOINT_COUNT 0 #endif // CDC @@ -41,7 +44,7 @@ #define CDC_TX CDC_ENDPOINT_IN #endif -#define ISERIAL_MAX_LEN 33 +#define ISERIAL_MAX_LEN 65 // Defined string description #define IMANUFACTURER 1 diff --git a/sparkfun/samd/cores/arduino/Uart.cpp b/sparkfun/samd/cores/arduino/Uart.cpp index 37b6e690..7e8c027a 100644 --- a/sparkfun/samd/cores/arduino/Uart.cpp +++ b/sparkfun/samd/cores/arduino/Uart.cpp @@ -20,13 +20,24 @@ #include "Arduino.h" #include "wiring_private.h" -Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX) +#define NO_RTS_PIN 255 +#define NO_CTS_PIN 255 +#define RTS_RX_THRESHOLD 10 + +Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX) : + Uart(_s, _pinRX, _pinTX, _padRX, _padTX, NO_RTS_PIN, NO_CTS_PIN) +{ +} + +Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX, uint8_t _pinRTS, uint8_t _pinCTS) { sercom = _s; uc_pinRX = _pinRX; uc_pinTX = _pinTX; - uc_padRX=_padRX ; - uc_padTX=_padTX; + uc_padRX = _padRX ; + uc_padTX = _padTX; + uc_pinRTS = _pinRTS; + uc_pinCTS = _pinCTS; } void Uart::begin(unsigned long baudrate) @@ -39,6 +50,23 @@ void Uart::begin(unsigned long baudrate, uint16_t config) pinPeripheral(uc_pinRX, g_APinDescription[uc_pinRX].ulPinType); pinPeripheral(uc_pinTX, g_APinDescription[uc_pinTX].ulPinType); + if (uc_padTX == UART_TX_RTS_CTS_PAD_0_2_3) { + if (uc_pinCTS != NO_CTS_PIN) { + pinPeripheral(uc_pinCTS, g_APinDescription[uc_pinCTS].ulPinType); + } + } + + if (uc_pinRTS != NO_RTS_PIN) { + pinMode(uc_pinRTS, OUTPUT); + + EPortType rtsPort = g_APinDescription[uc_pinRTS].ulPort; + pul_outsetRTS = &PORT->Group[rtsPort].OUTSET.reg; + pul_outclrRTS = &PORT->Group[rtsPort].OUTCLR.reg; + ul_pinMaskRTS = (1ul << g_APinDescription[uc_pinRTS].ulPin); + + *pul_outclrRTS = ul_pinMaskRTS; + } + sercom->initUART(UART_INT_CLOCK, SAMPLE_RATE_x16, baudrate); sercom->initFrame(extractCharSize(config), LSB_FIRST, extractParity(config), extractNbStopBit(config)); sercom->initPads(uc_padTX, uc_padRX); @@ -50,10 +78,13 @@ void Uart::end() { sercom->resetUART(); rxBuffer.clear(); + txBuffer.clear(); } void Uart::flush() { + while(txBuffer.available()); // wait until TX buffer is empty + sercom->flushUART(); } @@ -61,6 +92,23 @@ void Uart::IrqHandler() { if (sercom->availableDataUART()) { rxBuffer.store_char(sercom->readDataUART()); + + if (uc_pinRTS != NO_RTS_PIN) { + // RX buffer space is below the threshold, de-assert RTS + if (rxBuffer.availableForStore() < RTS_RX_THRESHOLD) { + *pul_outsetRTS = ul_pinMaskRTS; + } + } + } + + if (sercom->isDataRegisterEmptyUART()) { + if (txBuffer.available()) { + uint8_t data = txBuffer.read_char(); + + sercom->writeDataUART(data); + } else { + sercom->disableDataRegisterEmptyInterruptUART(); + } } if (sercom->isUARTError()) { @@ -79,7 +127,7 @@ int Uart::available() int Uart::availableForWrite() { - return (sercom->isDataRegisterEmptyUART() ? 1 : 0); + return txBuffer.availableForStore(); } int Uart::peek() @@ -89,12 +137,50 @@ int Uart::peek() int Uart::read() { - return rxBuffer.read_char(); + int c = rxBuffer.read_char(); + + if (uc_pinRTS != NO_RTS_PIN) { + // if there is enough space in the RX buffer, assert RTS + if (rxBuffer.availableForStore() > RTS_RX_THRESHOLD) { + *pul_outclrRTS = ul_pinMaskRTS; + } + } + + return c; } size_t Uart::write(const uint8_t data) { - sercom->writeDataUART(data); + if (sercom->isDataRegisterEmptyUART() && txBuffer.available() == 0) { + sercom->writeDataUART(data); + } else { + // spin lock until a spot opens up in the buffer + while(txBuffer.isFull()) { + uint8_t interruptsEnabled = ((__get_PRIMASK() & 0x1) == 0); + + if (interruptsEnabled) { + uint32_t exceptionNumber = (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk); + + if (exceptionNumber == 0 || + NVIC_GetPriority((IRQn_Type)(exceptionNumber - 16)) > SERCOM_NVIC_PRIORITY) { + // no exception or called from an ISR with lower priority, + // wait for free buffer spot via IRQ + continue; + } + } + + // interrupts are disabled or called from ISR with higher or equal priority than the SERCOM IRQ + // manually call the UART IRQ handler when the data register is empty + if (sercom->isDataRegisterEmptyUART()) { + IrqHandler(); + } + } + + txBuffer.store_char(data); + + sercom->enableDataRegisterEmptyInterruptUART(); + } + return 1; } diff --git a/sparkfun/samd/cores/arduino/Uart.h b/sparkfun/samd/cores/arduino/Uart.h index 02d30bd4..8f80ea9c 100644 --- a/sparkfun/samd/cores/arduino/Uart.h +++ b/sparkfun/samd/cores/arduino/Uart.h @@ -28,6 +28,7 @@ class Uart : public HardwareSerial { public: Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX); + Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX, uint8_t _pinRTS, uint8_t _pinCTS); void begin(unsigned long baudRate); void begin(unsigned long baudrate, uint16_t config); void end(); @@ -46,11 +47,17 @@ class Uart : public HardwareSerial private: SERCOM *sercom; RingBuffer rxBuffer; + RingBuffer txBuffer; uint8_t uc_pinRX; uint8_t uc_pinTX; SercomRXPad uc_padRX; SercomUartTXPad uc_padTX; + uint8_t uc_pinRTS; + volatile uint32_t* pul_outsetRTS; + volatile uint32_t* pul_outclrRTS; + uint32_t ul_pinMaskRTS; + uint8_t uc_pinCTS; SercomNumberStopBit extractNbStopBit(uint16_t config); SercomUartCharSize extractCharSize(uint16_t config); diff --git a/sparkfun/samd/cores/arduino/Udp.h b/sparkfun/samd/cores/arduino/Udp.h index d0524465..89f31c67 100644 --- a/sparkfun/samd/cores/arduino/Udp.h +++ b/sparkfun/samd/cores/arduino/Udp.h @@ -41,7 +41,7 @@ class UDP : public Stream { public: - virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use + virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure virtual void stop() =0; // Finish with the UDP socket diff --git a/sparkfun/samd/cores/arduino/WInterrupts.c b/sparkfun/samd/cores/arduino/WInterrupts.c index 70d9acd0..c78ddf62 100644 --- a/sparkfun/samd/cores/arduino/WInterrupts.c +++ b/sparkfun/samd/cores/arduino/WInterrupts.c @@ -21,12 +21,17 @@ #include -static voidFuncPtr callbacksInt[EXTERNAL_NUM_INTERRUPTS]; +static voidFuncPtr ISRcallback[EXTERNAL_NUM_INTERRUPTS]; +static uint32_t ISRlist[EXTERNAL_NUM_INTERRUPTS]; +static uint32_t nints; // Stores total number of attached interrupts + /* Configure I/O interrupt sources */ static void __initialize() { - memset(callbacksInt, 0, sizeof(callbacksInt)); + memset(ISRlist, 0, sizeof(ISRlist)); + memset(ISRcallback, 0, sizeof(ISRcallback)); + nints = 0; NVIC_DisableIRQ(EIC_IRQn); NVIC_ClearPendingIRQ(EIC_IRQn); @@ -71,48 +76,70 @@ void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode) } // Enable wakeup capability on pin in case being used during sleep - EIC->WAKEUP.reg |= (1 << in); + uint32_t inMask = 1 << in; + EIC->WAKEUP.reg |= inMask; // Assign pin to EIC pinPeripheral(pin, PIO_EXTINT); - // Assign callback to interrupt - callbacksInt[in] = callback; - - // Look for right CONFIG register to be addressed - if (in > EXTERNAL_INT_7) { - config = 1; - } else { - config = 0; - } - - // Configure the interrupt mode - pos = (in - (8 * config)) << 2; - switch (mode) + // Only store when there is really an ISR to call. + // This allow for calling attachInterrupt(pin, NULL, mode), we set up all needed register + // but won't service the interrupt, this way we also don't need to check it inside the ISR. + if (callback) { - case LOW: - EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_LOW_Val << pos; - break; + // Store interrupts to service in order of when they were attached + // to allow for first come first serve handler + uint32_t current = 0; + + // Check if we already have this interrupt + for (current=0; current EXTERNAL_INT_7) { + config = 1; + pos = (in - 8) << 2; + } else { + config = 0; + pos = in << 2; + } - case HIGH: - EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_HIGH_Val << pos; - break; + // Configure the interrupt mode + EIC->CONFIG[config].reg &=~ (EIC_CONFIG_SENSE0_Msk << pos); // Reset sense mode, important when changing trigger mode during runtime + switch (mode) + { + case LOW: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_LOW_Val << pos; + break; - case CHANGE: - EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_BOTH_Val << pos; - break; + case HIGH: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_HIGH_Val << pos; + break; - case FALLING: - EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_FALL_Val << pos; - break; + case CHANGE: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_BOTH_Val << pos; + break; - case RISING: - EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_RISE_Val << pos; - break; - } + case FALLING: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_FALL_Val << pos; + break; + case RISING: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_RISE_Val << pos; + break; + } + } // Enable the interrupt - EIC->INTENSET.reg = EIC_INTENSET_EXTINT(1 << in); + EIC->INTENSET.reg = EIC_INTENSET_EXTINT(inMask); } /* @@ -128,10 +155,27 @@ void detachInterrupt(uint32_t pin) if (in == NOT_AN_INTERRUPT || in == EXTERNAL_INT_NMI) return; - EIC->INTENCLR.reg = EIC_INTENCLR_EXTINT(1 << in); + uint32_t inMask = 1 << in; + EIC->INTENCLR.reg = EIC_INTENCLR_EXTINT(inMask); // Disable wakeup capability on pin during sleep - EIC->WAKEUP.reg &= ~(1 << in); + EIC->WAKEUP.reg &= ~inMask; + + // Remove callback from the ISR list + uint32_t current; + for (current=0; currentINTFLAG.reg & (1 << i)) != 0) + if ((EIC->INTFLAG.reg & ISRlist[i]) != 0) { - // Call the callback function if assigned - if (callbacksInt[i]) { - callbacksInt[i](); - } - + // Call the callback function + ISRcallback[i](); // Clear the interrupt - EIC->INTFLAG.reg = 1 << i; + EIC->INTFLAG.reg = ISRlist[i]; } } } diff --git a/sparkfun/samd/cores/arduino/avr/pgmspace.h b/sparkfun/samd/cores/arduino/avr/pgmspace.h index 0f732bba..de92051a 100644 --- a/sparkfun/samd/cores/arduino/avr/pgmspace.h +++ b/sparkfun/samd/cores/arduino/avr/pgmspace.h @@ -103,7 +103,7 @@ typedef const void* uint_farptr_t; #define pgm_read_word(addr) (*(const unsigned short *)(addr)) #define pgm_read_dword(addr) (*(const unsigned long *)(addr)) #define pgm_read_float(addr) (*(const float *)(addr)) -#define pgm_read_ptr(addr) (*(const void *)(addr)) +#define pgm_read_ptr(addr) (*(const void **)(addr)) #define pgm_read_byte_near(addr) pgm_read_byte(addr) #define pgm_read_word_near(addr) pgm_read_word(addr) diff --git a/sparkfun/samd/cores/arduino/delay.c b/sparkfun/samd/cores/arduino/delay.c index ea000abb..19aed212 100644 --- a/sparkfun/samd/cores/arduino/delay.c +++ b/sparkfun/samd/cores/arduino/delay.c @@ -26,7 +26,7 @@ extern "C" { /** Tick Counter united by ms */ static volatile uint32_t _ulTickCount=0 ; -uint32_t millis( void ) +unsigned long millis( void ) { // todo: ensure no interrupts return _ulTickCount ; @@ -36,7 +36,7 @@ uint32_t millis( void ) // Theory: repeatedly take readings of SysTick counter, millis counter and SysTick interrupt pending flag. // When it appears that millis counter and pending is stable and SysTick hasn't rolled over, use these // values to calculate micros. If there is a pending SysTick, add one to the millis counter in the calculation. -uint32_t micros( void ) +unsigned long micros( void ) { uint32_t ticks, ticks2; uint32_t pend, pend2; @@ -61,7 +61,7 @@ uint32_t micros( void ) // a runtime multiplication and shift, saving a few cycles } -void delay( uint32_t ms ) +void delay( unsigned long ms ) { if ( ms == 0 ) { diff --git a/sparkfun/samd/cores/arduino/delay.h b/sparkfun/samd/cores/arduino/delay.h index 1df845bd..64f39b13 100644 --- a/sparkfun/samd/cores/arduino/delay.h +++ b/sparkfun/samd/cores/arduino/delay.h @@ -19,13 +19,13 @@ #ifndef _DELAY_ #define _DELAY_ +#include +#include "variant.h" + #ifdef __cplusplus extern "C" { #endif -#include -#include "variant.h" - /** * \brief Returns the number of milliseconds since the Arduino board began running the current program. * @@ -33,7 +33,7 @@ extern "C" { * * \return Number of milliseconds since the program started (uint32_t) */ -extern uint32_t millis( void ) ; +extern unsigned long millis( void ) ; /** * \brief Returns the number of microseconds since the Arduino board began running the current program. @@ -45,7 +45,7 @@ extern uint32_t millis( void ) ; * * \note There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second. */ -extern uint32_t micros( void ) ; +extern unsigned long micros( void ) ; /** * \brief Pauses the program for the amount of time (in miliseconds) specified as parameter. @@ -53,15 +53,15 @@ extern uint32_t micros( void ) ; * * \param dwMs the number of milliseconds to pause (uint32_t) */ -extern void delay( uint32_t dwMs ) ; +extern void delay( unsigned long dwMs ) ; /** * \brief Pauses the program for the amount of time (in microseconds) specified as parameter. * * \param dwUs the number of microseconds to pause (uint32_t) */ -static __inline__ void delayMicroseconds( uint32_t ) __attribute__((always_inline, unused)) ; -static __inline__ void delayMicroseconds( uint32_t usec ) +static __inline__ void delayMicroseconds( unsigned int ) __attribute__((always_inline, unused)) ; +static __inline__ void delayMicroseconds( unsigned int usec ) { if ( usec == 0 ) { diff --git a/sparkfun/samd/cores/arduino/startup.c b/sparkfun/samd/cores/arduino/startup.c index 9e77bd9d..d66bfa8e 100644 --- a/sparkfun/samd/cores/arduino/startup.c +++ b/sparkfun/samd/cores/arduino/startup.c @@ -139,7 +139,7 @@ void SystemInit( void ) /* DFLL Configuration in Closed Loop mode, cf product datasheet chapter 15.6.7.1 - Closed-Loop Operation */ /* Remove the OnDemand mode, Bug http://avr32.icgroup.norway.atmel.com/bugzilla/show_bug.cgi?id=9905 */ - SYSCTRL->DFLLCTRL.bit.ONDEMAND = 0 ; + SYSCTRL->DFLLCTRL.reg = SYSCTRL_DFLLCTRL_ENABLE; while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) { @@ -148,7 +148,7 @@ void SystemInit( void ) SYSCTRL->DFLLMUL.reg = SYSCTRL_DFLLMUL_CSTEP( 31 ) | // Coarse step is 31, half of the max value SYSCTRL_DFLLMUL_FSTEP( 511 ) | // Fine step is 511, half of the max value - SYSCTRL_DFLLMUL_MUL( (VARIANT_MCK/VARIANT_MAINOSC) ) ; // External 32KHz is the reference + SYSCTRL_DFLLMUL_MUL( (VARIANT_MCK + VARIANT_MAINOSC/2) / VARIANT_MAINOSC ) ; // External 32KHz is the reference while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) { @@ -158,7 +158,6 @@ void SystemInit( void ) #if defined(CRYSTALLESS) #define NVM_SW_CALIB_DFLL48M_COARSE_VAL 58 - #define NVM_SW_CALIB_DFLL48M_FINE_VAL 64 // Turn on DFLL uint32_t coarse =( *((uint32_t *)(NVMCTRL_OTP4) + (NVM_SW_CALIB_DFLL48M_COARSE_VAL / 32)) >> (NVM_SW_CALIB_DFLL48M_COARSE_VAL % 32) ) @@ -166,19 +165,28 @@ void SystemInit( void ) if (coarse == 0x3f) { coarse = 0x1f; } - uint32_t fine =( *((uint32_t *)(NVMCTRL_OTP4) + (NVM_SW_CALIB_DFLL48M_FINE_VAL / 32)) >> (NVM_SW_CALIB_DFLL48M_FINE_VAL % 32) ) - & ((1 << 10) - 1); - if (fine == 0x3ff) { - fine = 0x1ff; - } + // TODO(tannewt): Load this value from memory we've written previously. There + // isn't a value from the Atmel factory. + uint32_t fine = 0x1ff; SYSCTRL->DFLLVAL.bit.COARSE = coarse; SYSCTRL->DFLLVAL.bit.FINE = fine; /* Write full configuration to DFLL control register */ - SYSCTRL->DFLLCTRL.reg = SYSCTRL_DFLLCTRL_USBCRM | /* USB correction */ + SYSCTRL->DFLLMUL.reg = SYSCTRL_DFLLMUL_CSTEP( 0x1f / 4 ) | // Coarse step is 31, half of the max value + SYSCTRL_DFLLMUL_FSTEP( 10 ) | + SYSCTRL_DFLLMUL_MUL( (48000) ) ; + + SYSCTRL->DFLLCTRL.reg = 0; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + SYSCTRL->DFLLCTRL.reg = SYSCTRL_DFLLCTRL_MODE | SYSCTRL_DFLLCTRL_CCDIS | - SYSCTRL_DFLLCTRL_WAITLOCK | - SYSCTRL_DFLLCTRL_QLDIS ; /* Disable Quick lock */ + SYSCTRL_DFLLCTRL_USBCRM | /* USB correction */ + SYSCTRL_DFLLCTRL_BPLCKC; while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) { diff --git a/sparkfun/samd/cores/arduino/wiring.c b/sparkfun/samd/cores/arduino/wiring.c index ce12d32c..d1c04086 100644 --- a/sparkfun/samd/cores/arduino/wiring.c +++ b/sparkfun/samd/cores/arduino/wiring.c @@ -66,10 +66,10 @@ void init( void ) NVIC_SetPriority (SysTick_IRQn, (1 << __NVIC_PRIO_BITS) - 2); /* set Priority for Systick Interrupt (2nd lowest) */ // Clock PORT for Digital I/O -// PM->APBBMASK.reg |= PM_APBBMASK_PORT ; +// PM->APBBMASK.reg |= PM_APBBMASK_PORT ; // // // Clock EIC for I/O interrupts -// PM->APBAMASK.reg |= PM_APBAMASK_EIC ; +// PM->APBAMASK.reg |= PM_APBAMASK_EIC ; // Clock SERCOM for Serial PM->APBCMASK.reg |= PM_APBCMASK_SERCOM0 | PM_APBCMASK_SERCOM1 | PM_APBCMASK_SERCOM2 | PM_APBCMASK_SERCOM3 | PM_APBCMASK_SERCOM4 | PM_APBCMASK_SERCOM5 ; @@ -80,11 +80,13 @@ void init( void ) // Clock ADC/DAC for Analog PM->APBCMASK.reg |= PM_APBCMASK_ADC | PM_APBCMASK_DAC ; + /* // Setup all pins (digital and analog) in INPUT mode (default is nothing) for (uint32_t ul = 0 ; ul < NUM_DIGITAL_PINS ; ul++ ) { - pinMode( ul, INPUT ) ; + pinMode( ul, INPUT ) ; } + */ // Initialize Analog Controller // Setting clock diff --git a/sparkfun/samd/cores/arduino/wiring_analog.c b/sparkfun/samd/cores/arduino/wiring_analog.c index a30d2826..dcdd1622 100644 --- a/sparkfun/samd/cores/arduino/wiring_analog.c +++ b/sparkfun/samd/cores/arduino/wiring_analog.c @@ -42,9 +42,9 @@ static void syncDAC() { } // Wait for synchronization of registers between the clock domains -static __inline__ void syncTC_8(Tc* TCx) __attribute__((always_inline, unused)); -static void syncTC_8(Tc* TCx) { - while (TCx->COUNT8.STATUS.bit.SYNCBUSY); +static __inline__ void syncTC_16(Tc* TCx) __attribute__((always_inline, unused)); +static void syncTC_16(Tc* TCx) { + while (TCx->COUNT16.STATUS.bit.SYNCBUSY); } // Wait for synchronization of registers between the clock domains @@ -212,7 +212,7 @@ void analogWrite(uint32_t pin, uint32_t value) if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM) { - value = mapResolution(value, _writeResolution, 8); + value = mapResolution(value, _writeResolution, 16); uint32_t tcNum = GetTCNumber(pinDesc.ulPWMChannel); uint8_t tcChannel = GetTCChannelNumber(pinDesc.ulPWMChannel); @@ -254,37 +254,31 @@ void analogWrite(uint32_t pin, uint32_t value) // -- Configure TC Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); // Disable TCx - TCx->COUNT8.CTRLA.bit.ENABLE = 0; - syncTC_8(TCx); - // Set Timer counter Mode to 8 bits, normal PWM, prescaler 1/256 - TCx->COUNT8.CTRLA.reg |= TC_CTRLA_MODE_COUNT8 | TC_CTRLA_WAVEGEN_NPWM | TC_CTRLA_PRESCALER_DIV256; - syncTC_8(TCx); + TCx->COUNT16.CTRLA.bit.ENABLE = 0; + syncTC_16(TCx); + // Set Timer counter Mode to 16 bits, normal PWM + TCx->COUNT16.CTRLA.reg |= TC_CTRLA_MODE_COUNT16 | TC_CTRLA_WAVEGEN_NPWM; + syncTC_16(TCx); // Set the initial value - TCx->COUNT8.CC[tcChannel].reg = (uint8_t) value; - syncTC_8(TCx); - // Set PER to maximum counter value (resolution : 0xFF) - TCx->COUNT8.PER.reg = 0xFF; - syncTC_8(TCx); + TCx->COUNT16.CC[tcChannel].reg = (uint32_t) value; + syncTC_16(TCx); // Enable TCx - TCx->COUNT8.CTRLA.bit.ENABLE = 1; - syncTC_8(TCx); + TCx->COUNT16.CTRLA.bit.ENABLE = 1; + syncTC_16(TCx); } else { // -- Configure TCC Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); // Disable TCCx TCCx->CTRLA.bit.ENABLE = 0; syncTCC(TCCx); - // Set prescaler to 1/256 - TCCx->CTRLA.reg |= TCC_CTRLA_PRESCALER_DIV256; - syncTCC(TCCx); - // Set TCx as normal PWM + // Set TCCx as normal PWM TCCx->WAVE.reg |= TCC_WAVE_WAVEGEN_NPWM; syncTCC(TCCx); // Set the initial value TCCx->CC[tcChannel].reg = (uint32_t) value; syncTCC(TCCx); - // Set PER to maximum counter value (resolution : 0xFF) - TCCx->PER.reg = 0xFF; + // Set PER to maximum counter value (resolution : 0xFFFF) + TCCx->PER.reg = 0xFFFF; syncTCC(TCCx); // Enable TCCx TCCx->CTRLA.bit.ENABLE = 1; @@ -293,9 +287,9 @@ void analogWrite(uint32_t pin, uint32_t value) } else { if (tcNum >= TCC_INST_NUM) { Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); - TCx->COUNT8.CC[tcChannel].reg = (uint8_t) value; - syncTC_8(TCx); - } else { + TCx->COUNT16.CC[tcChannel].reg = (uint32_t) value; + syncTC_16(TCx); + } else { Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); TCCx->CTRLBSET.bit.LUPD = 1; syncTCC(TCCx); diff --git a/sparkfun/samd/cores/arduino51/Arduino.h b/sparkfun/samd/cores/arduino51/Arduino.h new file mode 100644 index 00000000..e645743b --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Arduino.h @@ -0,0 +1,133 @@ +/* + Arduino.h - Main include file for the Arduino SDK + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef Arduino_h +#define Arduino_h + +#include +#include +#include +#include +#include + +typedef bool boolean; +typedef uint8_t byte; +typedef uint16_t word; + +// some libraries and sketches depend on this AVR stuff, +// assuming Arduino.h or WProgram.h automatically includes it... +// +#include "avr/pgmspace.h" +#include "avr/interrupt.h" +#include "avr/io.h" + +#include "binary.h" +#include "itoa.h" + +#ifdef __cplusplus +extern "C"{ +#endif // __cplusplus + +// Include Atmel headers +#include "sam.h" + +#include "wiring_constants.h" + +#define clockCyclesPerMicrosecond() ( SystemCoreClock / 1000000L ) +#define clockCyclesToMicroseconds(a) ( ((a) * 1000L) / (SystemCoreClock / 1000L) ) +#define microsecondsToClockCycles(a) ( (a) * (SystemCoreClock / 1000000L) ) + +void yield( void ) ; + +/* system functions */ +int main( void ); +void init( void ); + +/* sketch */ +void setup( void ) ; +void loop( void ) ; + +#include "WVariant.h" + +#ifdef __cplusplus +} // extern "C" +#endif + +// The following headers are for C++ only compilation +#ifdef __cplusplus + #include "WCharacter.h" + #include "WString.h" + #include "Tone.h" + #include "WMath.h" + #include "HardwareSerial.h" + #include "pulse.h" +#endif +#include "delay.h" +#ifdef __cplusplus + #include "Uart.h" +#endif + +// Include board variant +#include "variant.h" + +#include "wiring.h" +#include "wiring_digital.h" +#include "wiring_analog.h" +#include "wiring_shift.h" +#include "WInterrupts.h" + +// undefine stdlib's abs if encountered +#ifdef abs +#undef abs +#endif // abs + +#define min(a,b) ((a)<(b)?(a):(b)) +#define max(a,b) ((a)>(b)?(a):(b)) +#define abs(x) ((x)>0?(x):-(x)) +#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt))) +#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5)) +#define radians(deg) ((deg)*DEG_TO_RAD) +#define degrees(rad) ((rad)*RAD_TO_DEG) +#define sq(x) ((x)*(x)) + +#define interrupts() __enable_irq() +#define noInterrupts() __disable_irq() + +#define lowByte(w) ((uint8_t) ((w) & 0xff)) +#define highByte(w) ((uint8_t) ((w) >> 8)) + +#define bitRead(value, bit) (((value) >> (bit)) & 0x01) +#define bitSet(value, bit) ((value) |= (1UL << (bit))) +#define bitClear(value, bit) ((value) &= ~(1UL << (bit))) +#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit)) + +#define bit(b) (1UL << (b)) + +#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606) +// Interrupts +#define digitalPinToInterrupt(P) ( P ) +#endif + +// USB Device +#include "USB/USBDesc.h" +#include "USB/USBCore.h" +#include "USB/USBAPI.h" +#include "USB/USB_host.h" + +#endif // Arduino_h diff --git a/sparkfun/samd/cores/arduino51/Client.h b/sparkfun/samd/cores/arduino51/Client.h new file mode 100644 index 00000000..b8e5d935 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Client.h @@ -0,0 +1,45 @@ +/* + Client.h - Base class that provides Client + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef client_h +#define client_h +#include "Print.h" +#include "Stream.h" +#include "IPAddress.h" + +class Client : public Stream { + +public: + virtual int connect(IPAddress ip, uint16_t port) =0; + virtual int connect(const char *host, uint16_t port) =0; + virtual size_t write(uint8_t) =0; + virtual size_t write(const uint8_t *buf, size_t size) =0; + virtual int available() = 0; + virtual int read() = 0; + virtual int read(uint8_t *buf, size_t size) = 0; + virtual int peek() = 0; + virtual void flush() = 0; + virtual void stop() = 0; + virtual uint8_t connected() = 0; + virtual operator bool() = 0; +protected: + uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; +}; + +#endif diff --git a/sparkfun/samd/cores/arduino51/HardwareSerial.h b/sparkfun/samd/cores/arduino51/HardwareSerial.h new file mode 100644 index 00000000..6180b074 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/HardwareSerial.h @@ -0,0 +1,84 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef HardwareSerial_h +#define HardwareSerial_h + +#include + +#include "Stream.h" + +#define HARDSER_PARITY_EVEN (0x1ul) +#define HARDSER_PARITY_ODD (0x2ul) +#define HARDSER_PARITY_NONE (0x3ul) +#define HARDSER_PARITY_MASK (0xFul) + +#define HARDSER_STOP_BIT_1 (0x10ul) +#define HARDSER_STOP_BIT_1_5 (0x20ul) +#define HARDSER_STOP_BIT_2 (0x30ul) +#define HARDSER_STOP_BIT_MASK (0xF0ul) + +#define HARDSER_DATA_5 (0x100ul) +#define HARDSER_DATA_6 (0x200ul) +#define HARDSER_DATA_7 (0x300ul) +#define HARDSER_DATA_8 (0x400ul) +#define HARDSER_DATA_MASK (0xF00ul) + +#define SERIAL_5N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_5) +#define SERIAL_6N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_6) +#define SERIAL_7N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_7) +#define SERIAL_8N1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_NONE | HARDSER_DATA_8) +#define SERIAL_5N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_5) +#define SERIAL_6N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_6) +#define SERIAL_7N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_7) +#define SERIAL_8N2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_NONE | HARDSER_DATA_8) +#define SERIAL_5E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_5) +#define SERIAL_6E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_6) +#define SERIAL_7E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_7) +#define SERIAL_8E1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_EVEN | HARDSER_DATA_8) +#define SERIAL_5E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_5) +#define SERIAL_6E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_6) +#define SERIAL_7E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_7) +#define SERIAL_8E2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_EVEN | HARDSER_DATA_8) +#define SERIAL_5O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_5) +#define SERIAL_6O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_6) +#define SERIAL_7O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_7) +#define SERIAL_8O1 (HARDSER_STOP_BIT_1 | HARDSER_PARITY_ODD | HARDSER_DATA_8) +#define SERIAL_5O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_5) +#define SERIAL_6O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_6) +#define SERIAL_7O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_7) +#define SERIAL_8O2 (HARDSER_STOP_BIT_2 | HARDSER_PARITY_ODD | HARDSER_DATA_8) + +class HardwareSerial : public Stream +{ + public: + virtual void begin(unsigned long) {} + virtual void begin(unsigned long, uint16_t) {} + virtual void end() {} + virtual int available(void) = 0; + virtual int peek(void) = 0; + virtual int read(void) = 0; + virtual void flush(void) = 0; + virtual size_t write(uint8_t) = 0; + using Print::write; // pull in write(str) and write(buf, size) from Print + virtual operator bool() = 0; +}; + +extern void serialEventRun(void) __attribute__((weak)); + +#endif diff --git a/sparkfun/samd/cores/arduino51/IPAddress.cpp b/sparkfun/samd/cores/arduino51/IPAddress.cpp new file mode 100644 index 00000000..76aefa8b --- /dev/null +++ b/sparkfun/samd/cores/arduino51/IPAddress.cpp @@ -0,0 +1,116 @@ +/* + IPAddress.cpp - Base class that provides IPAddress + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +IPAddress::IPAddress() +{ + _address.dword = 0; +} + +IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) +{ + _address.bytes[0] = first_octet; + _address.bytes[1] = second_octet; + _address.bytes[2] = third_octet; + _address.bytes[3] = fourth_octet; +} + +IPAddress::IPAddress(uint32_t address) +{ + _address.dword = address; +} + +IPAddress::IPAddress(const uint8_t *address) +{ + memcpy(_address.bytes, address, sizeof(_address.bytes)); +} + +bool IPAddress::fromString(const char *address) +{ + // TODO: add support for "a", "a.b", "a.b.c" formats + + uint16_t acc = 0; // Accumulator + uint8_t dots = 0; + + while (*address) + { + char c = *address++; + if (c >= '0' && c <= '9') + { + acc = acc * 10 + (c - '0'); + if (acc > 255) { + // Value out of [0..255] range + return false; + } + } + else if (c == '.') + { + if (dots == 3) { + // Too much dots (there must be 3 dots) + return false; + } + _address.bytes[dots++] = acc; + acc = 0; + } + else + { + // Invalid char + return false; + } + } + + if (dots != 3) { + // Too few dots (there must be 3 dots) + return false; + } + _address.bytes[3] = acc; + return true; +} + +IPAddress& IPAddress::operator=(const uint8_t *address) +{ + memcpy(_address.bytes, address, sizeof(_address.bytes)); + return *this; +} + +IPAddress& IPAddress::operator=(uint32_t address) +{ + _address.dword = address; + return *this; +} + +bool IPAddress::operator==(const uint8_t* addr) const +{ + return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; +} + +size_t IPAddress::printTo(Print& p) const +{ + size_t n = 0; + for (int i =0; i < 3; i++) + { + n += p.print(_address.bytes[i], DEC); + n += p.print('.'); + } + n += p.print(_address.bytes[3], DEC); + return n; +} + diff --git a/sparkfun/samd/cores/arduino51/IPAddress.h b/sparkfun/samd/cores/arduino51/IPAddress.h new file mode 100644 index 00000000..d762f2c0 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/IPAddress.h @@ -0,0 +1,78 @@ +/* + IPAddress.h - Base class that provides IPAddress + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef IPAddress_h +#define IPAddress_h + +#include +#include "Printable.h" +#include "WString.h" + +// A class to make it easier to handle and pass around IP addresses + +class IPAddress : public Printable { +private: + union { + uint8_t bytes[4]; // IPv4 address + uint32_t dword; + } _address; + + // Access the raw byte array containing the address. Because this returns a pointer + // to the internal structure rather than a copy of the address this function should only + // be used when you know that the usage of the returned uint8_t* will be transient and not + // stored. + uint8_t* raw_address() { return _address.bytes; }; + +public: + // Constructors + IPAddress(); + IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); + IPAddress(uint32_t address); + IPAddress(const uint8_t *address); + + bool fromString(const char *address); + bool fromString(const String &address) { return fromString(address.c_str()); } + + // Overloaded cast operator to allow IPAddress objects to be used where a pointer + // to a four-byte uint8_t array is expected + operator uint32_t() const { return _address.dword; }; + bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; }; + bool operator==(const uint8_t* addr) const; + + // Overloaded index operator to allow getting and setting individual octets of the address + uint8_t operator[](int index) const { return _address.bytes[index]; }; + uint8_t& operator[](int index) { return _address.bytes[index]; }; + + // Overloaded copy operators to allow initialisation of IPAddress objects from other types + IPAddress& operator=(const uint8_t *address); + IPAddress& operator=(uint32_t address); + + virtual size_t printTo(Print& p) const; + + friend class EthernetClass; + friend class UDP; + friend class Client; + friend class Server; + friend class DhcpClass; + friend class DNSClient; +}; + +const IPAddress INADDR_NONE(0,0,0,0); + +#endif diff --git a/sparkfun/samd/cores/arduino51/Print.cpp b/sparkfun/samd/cores/arduino51/Print.cpp new file mode 100644 index 00000000..136329cc --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Print.cpp @@ -0,0 +1,254 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include +#include +#include "Arduino.h" + +#include "Print.h" + +// Public Methods ////////////////////////////////////////////////////////////// + +/* default implementation: may be overridden */ +size_t Print::write(const uint8_t *buffer, size_t size) +{ + size_t n = 0; + while (size--) { + if (write(*buffer++)) n++; + else break; + } + return n; +} + +size_t Print::print(const __FlashStringHelper *ifsh) +{ + return print(reinterpret_cast(ifsh)); +} + +size_t Print::print(const String &s) +{ + return write(s.c_str(), s.length()); +} + +size_t Print::print(const char str[]) +{ + return write(str); +} + +size_t Print::print(char c) +{ + return write(c); +} + +size_t Print::print(unsigned char b, int base) +{ + return print((unsigned long) b, base); +} + +size_t Print::print(int n, int base) +{ + return print((long) n, base); +} + +size_t Print::print(unsigned int n, int base) +{ + return print((unsigned long) n, base); +} + +size_t Print::print(long n, int base) +{ + if (base == 0) { + return write(n); + } else if (base == 10) { + if (n < 0) { + int t = print('-'); + n = -n; + return printNumber(n, 10) + t; + } + return printNumber(n, 10); + } else { + return printNumber(n, base); + } +} + +size_t Print::print(unsigned long n, int base) +{ + if (base == 0) return write(n); + else return printNumber(n, base); +} + +size_t Print::print(double n, int digits) +{ + return printFloat(n, digits); +} + +size_t Print::println(const __FlashStringHelper *ifsh) +{ + size_t n = print(ifsh); + n += println(); + return n; +} + +size_t Print::print(const Printable& x) +{ + return x.printTo(*this); +} + +size_t Print::println(void) +{ + return write("\r\n"); +} + +size_t Print::println(const String &s) +{ + size_t n = print(s); + n += println(); + return n; +} + +size_t Print::println(const char c[]) +{ + size_t n = print(c); + n += println(); + return n; +} + +size_t Print::println(char c) +{ + size_t n = print(c); + n += println(); + return n; +} + +size_t Print::println(unsigned char b, int base) +{ + size_t n = print(b, base); + n += println(); + return n; +} + +size_t Print::println(int num, int base) +{ + size_t n = print(num, base); + n += println(); + return n; +} + +size_t Print::println(unsigned int num, int base) +{ + size_t n = print(num, base); + n += println(); + return n; +} + +size_t Print::println(long num, int base) +{ + size_t n = print(num, base); + n += println(); + return n; +} + +size_t Print::println(unsigned long num, int base) +{ + size_t n = print(num, base); + n += println(); + return n; +} + +size_t Print::println(double num, int digits) +{ + size_t n = print(num, digits); + n += println(); + return n; +} + +size_t Print::println(const Printable& x) +{ + size_t n = print(x); + n += println(); + return n; +} + +// Private Methods ///////////////////////////////////////////////////////////// + +size_t Print::printNumber(unsigned long n, uint8_t base) +{ + char buf[8 * sizeof(long) + 1]; // Assumes 8-bit chars plus zero byte. + char *str = &buf[sizeof(buf) - 1]; + + *str = '\0'; + + // prevent crash if called with base == 1 + if (base < 2) base = 10; + + do { + char c = n % base; + n /= base; + + *--str = c < 10 ? c + '0' : c + 'A' - 10; + } while(n); + + return write(str); +} + +size_t Print::printFloat(double number, uint8_t digits) +{ + size_t n = 0; + + if (isnan(number)) return print("nan"); + if (isinf(number)) return print("inf"); + if (number > 4294967040.0) return print ("ovf"); // constant determined empirically + if (number <-4294967040.0) return print ("ovf"); // constant determined empirically + + // Handle negative numbers + if (number < 0.0) + { + n += print('-'); + number = -number; + } + + // Round correctly so that print(1.999, 2) prints as "2.00" + double rounding = 0.5; + for (uint8_t i=0; i 0) { + n += print('.'); + } + + // Extract digits from the remainder one at a time + while (digits-- > 0) + { + remainder *= 10.0; + unsigned int toPrint = (unsigned int)(remainder); + n += print(toPrint); + remainder -= toPrint; + } + + return n; +} diff --git a/sparkfun/samd/cores/arduino51/Print.h b/sparkfun/samd/cores/arduino51/Print.h new file mode 100644 index 00000000..dfb645cb --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Print.h @@ -0,0 +1,92 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef Print_h +#define Print_h + +#include +#include // for size_t + +#include "WString.h" +#include "Printable.h" + +#define DEC 10 +#define HEX 16 +#define OCT 8 +#ifdef BIN // Prevent warnings if BIN is previously defined in "iotnx4.h" or similar +#undef BIN +#endif +#define BIN 2 + +class Print +{ + private: + int write_error; + size_t printNumber(unsigned long, uint8_t); + size_t printFloat(double, uint8_t); + protected: + void setWriteError(int err = 1) { write_error = err; } + public: + Print() : write_error(0) {} + + int getWriteError() { return write_error; } + void clearWriteError() { setWriteError(0); } + + virtual size_t write(uint8_t) = 0; + size_t write(const char *str) { + if (str == NULL) return 0; + return write((const uint8_t *)str, strlen(str)); + } + virtual size_t write(const uint8_t *buffer, size_t size); + size_t write(const char *buffer, size_t size) { + return write((const uint8_t *)buffer, size); + } + + // default to zero, meaning "a single write may block" + // should be overriden by subclasses with buffering + virtual int availableForWrite() { return 0; } + + size_t print(const __FlashStringHelper *); + size_t print(const String &); + size_t print(const char[]); + size_t print(char); + size_t print(unsigned char, int = DEC); + size_t print(int, int = DEC); + size_t print(unsigned int, int = DEC); + size_t print(long, int = DEC); + size_t print(unsigned long, int = DEC); + size_t print(double, int = 2); + size_t print(const Printable&); + + size_t println(const __FlashStringHelper *); + size_t println(const String &s); + size_t println(const char[]); + size_t println(char); + size_t println(unsigned char, int = DEC); + size_t println(int, int = DEC); + size_t println(unsigned int, int = DEC); + size_t println(long, int = DEC); + size_t println(unsigned long, int = DEC); + size_t println(double, int = 2); + size_t println(const Printable&); + size_t println(void); + + virtual void flush() { /* Empty implementation for backward compatibility */ } +}; + +#endif diff --git a/sparkfun/samd/cores/arduino51/Printable.h b/sparkfun/samd/cores/arduino51/Printable.h new file mode 100644 index 00000000..34ad5b4d --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Printable.h @@ -0,0 +1,39 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef Printable_h +#define Printable_h + +#include + +class Print; + +/** The Printable class provides a way for new classes to allow themselves to be printed. + By deriving from Printable and implementing the printTo method, it will then be possible + for users to print out instances of this class by passing them into the usual + Print::print and Print::println methods. +*/ + +class Printable +{ + public: + virtual size_t printTo(Print& p) const = 0; +}; + +#endif + diff --git a/sparkfun/samd/cores/arduino51/Reset.cpp b/sparkfun/samd/cores/arduino51/Reset.cpp new file mode 100644 index 00000000..a16a7296 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Reset.cpp @@ -0,0 +1,122 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include "Reset.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define NVM_MEMORY ((volatile uint16_t *)0x000000) + +#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10610) + +extern const uint32_t __text_start__; +#define APP_START ((volatile uint32_t)(&__text_start__) + 4) + +#else + +#if defined(__SAMD51__) +#define APP_START 0x00004004 +#else +#define APP_START 0x00002004 +#endif + +#endif + +static inline bool nvmReady(void) { +#if defined(__SAMD51__) + return NVMCTRL->STATUS.reg & NVMCTRL_STATUS_READY; +#else + return NVMCTRL->INTFLAG.reg & NVMCTRL_INTFLAG_READY; +#endif +} + +__attribute__ ((long_call, section (".ramfunc"))) +static void banzai() { + // Disable all interrupts + __disable_irq(); + +#if defined(__SAMD51__) + //THESE MUST MATCH THE BOOTLOADER + #define DOUBLE_TAP_MAGIC 0xf01669efUL + #define BOOT_DOUBLE_TAP_ADDRESS (HSRAM_ADDR + HSRAM_SIZE - 4) + + unsigned long *a = (unsigned long *)BOOT_DOUBLE_TAP_ADDRESS; + *a = DOUBLE_TAP_MAGIC; + //NVMCTRL->ADDR.reg = APP_START; + //NVMCTRL->CTRLB.reg = NVMCTRL_CTRLB_CMD_EB | NVMCTRL_CTRLB_CMDEX_KEY; + + // Reset the device + NVIC_SystemReset() ; + + while (true); +#else + + // Avoid erasing the application if APP_START is < than the minimum bootloader size + // This could happen if without_bootloader linker script was chosen + // Minimum bootloader size in SAMD21 family is 512bytes (RM section 22.6.5) + + if (APP_START < (0x200 + 4)) { + goto reset; + } + + + // Erase application + while (!nvmReady()) + ; + + NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; + NVMCTRL->ADDR.reg = (uintptr_t)&NVM_MEMORY[APP_START / 4]; + NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_ER | NVMCTRL_CTRLA_CMDEX_KEY; + + while (!nvmReady()) + ; + +reset: + // Reset the device + NVIC_SystemReset() ; + + while (true); +#endif + +} + +static int ticks = -1; + +void initiateReset(int _ticks) { + ticks = _ticks; +} + +void cancelReset() { + ticks = -1; +} + +void tickReset() { + if (ticks == -1) + return; + ticks--; + if (ticks == 0) + banzai(); +} + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/Reset.h b/sparkfun/samd/cores/arduino51/Reset.h new file mode 100644 index 00000000..1ddefbf0 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Reset.h @@ -0,0 +1,31 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +void initiateReset(int ms); +void tickReset(); +void cancelReset(); + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/RingBuffer.h b/sparkfun/samd/cores/arduino51/RingBuffer.h new file mode 100644 index 00000000..75dad40c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/RingBuffer.h @@ -0,0 +1,142 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifdef __cplusplus + +#ifndef _RING_BUFFER_ +#define _RING_BUFFER_ + +#include + +// Define constants and variables for buffering incoming serial data. We're +// using a ring buffer (I think), in which head is the index of the location +// to which to write the next incoming character and tail is the index of the +// location from which to read. +#define SERIAL_BUFFER_SIZE 164 + +template +class RingBufferN +{ + public: + uint8_t _aucBuffer[N] ; + volatile int _iHead ; + volatile int _iTail ; + + public: + RingBufferN( void ) ; + void store_char( uint8_t c ) ; + void clear(); + int read_char(); + int available(); + int availableForStore(); + int peek(); + bool isFull(); + + private: + int nextIndex(int index); +}; + +typedef RingBufferN RingBuffer; + + +template +RingBufferN::RingBufferN( void ) +{ + memset( _aucBuffer, 0, N ) ; + clear(); +} + +template +void RingBufferN::store_char( uint8_t c ) +{ + int i = nextIndex(_iHead); + + // if we should be storing the received character into the location + // just before the tail (meaning that the head would advance to the + // current location of the tail), we're about to overflow the buffer + // and so we don't write the character or advance the head. + if ( i != _iTail ) + { + _aucBuffer[_iHead] = c ; + _iHead = i ; + } +} + +template +void RingBufferN::clear() +{ + _iHead = 0; + _iTail = 0; +} + +template +int RingBufferN::read_char() +{ + if(_iTail == _iHead) + return -1; + + uint8_t value = _aucBuffer[_iTail]; + _iTail = nextIndex(_iTail); + + return value; +} + +template +int RingBufferN::available() +{ + int delta = _iHead - _iTail; + + if(delta < 0) + return N + delta; + else + return delta; +} + +template +int RingBufferN::availableForStore() +{ + if (_iHead >= _iTail) + return N - 1 - _iHead + _iTail; + else + return _iTail - _iHead - 1; +} + +template +int RingBufferN::peek() +{ + if(_iTail == _iHead) + return -1; + + return _aucBuffer[_iTail]; +} + +template +int RingBufferN::nextIndex(int index) +{ + return (uint32_t)(index + 1) % N; +} + +template +bool RingBufferN::isFull() +{ + return (nextIndex(_iHead) == _iTail); +} + +#endif /* _RING_BUFFER_ */ + +#endif /* __cplusplus */ diff --git a/sparkfun/samd/cores/arduino51/SERCOM.cpp b/sparkfun/samd/cores/arduino51/SERCOM.cpp new file mode 100644 index 00000000..61650a67 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/SERCOM.cpp @@ -0,0 +1,912 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "SERCOM.h" +#include "variant.h" +#include "Arduino.h" + +#ifndef WIRE_RISE_TIME_NANOSECONDS +// Default rise time in nanoseconds, based on 4.7K ohm pull up resistors +// you can override this value in your variant if needed +#define WIRE_RISE_TIME_NANOSECONDS 125 +#endif + +SERCOM::SERCOM(Sercom* s) +{ + sercom = s; +} + +/* ========================= + * ===== Sercom UART + * ========================= +*/ +void SERCOM::initUART(SercomUartMode mode, SercomUartSampleRate sampleRate, uint32_t baudrate) +{ + initClockNVIC(); + resetUART(); + + //Setting the CTRLA register + sercom->USART.CTRLA.reg = SERCOM_USART_CTRLA_MODE(mode) | + SERCOM_USART_CTRLA_SAMPR(sampleRate); + + //Setting the Interrupt register + sercom->USART.INTENSET.reg = SERCOM_USART_INTENSET_RXC | //Received complete + SERCOM_USART_INTENSET_ERROR; //All others errors + + if ( mode == UART_INT_CLOCK ) + { + uint16_t sampleRateValue; + + if (sampleRate == SAMPLE_RATE_x16) { + sampleRateValue = 16; + } else { + sampleRateValue = 8; + } + + // Asynchronous fractional mode (Table 24-2 in datasheet) + // BAUD = fref / (sampleRateValue * fbaud) + // (multiply by 8, to calculate fractional piece) +#if defined(__SAMD51__) + uint32_t baudTimes8 = (SERCOM_FREQ_REF * 8) / (sampleRateValue * baudrate); +#else + uint32_t baudTimes8 = (SystemCoreClock * 8) / (sampleRateValue * baudrate); +#endif + + sercom->USART.BAUD.FRAC.FP = (baudTimes8 % 8); + sercom->USART.BAUD.FRAC.BAUD = (baudTimes8 / 8); + } +} +void SERCOM::initFrame(SercomUartCharSize charSize, SercomDataOrder dataOrder, SercomParityMode parityMode, SercomNumberStopBit nbStopBits) +{ + //Setting the CTRLA register + sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_FORM( (parityMode == SERCOM_NO_PARITY ? 0 : 1) ) | + dataOrder << SERCOM_USART_CTRLA_DORD_Pos; + + //Setting the CTRLB register + sercom->USART.CTRLB.reg |= SERCOM_USART_CTRLB_CHSIZE(charSize) | + nbStopBits << SERCOM_USART_CTRLB_SBMODE_Pos | + (parityMode == SERCOM_NO_PARITY ? 0 : parityMode) << SERCOM_USART_CTRLB_PMODE_Pos; //If no parity use default value +} + +void SERCOM::initPads(SercomUartTXPad txPad, SercomRXPad rxPad) +{ + //Setting the CTRLA register + sercom->USART.CTRLA.reg |= SERCOM_USART_CTRLA_TXPO(txPad) | + SERCOM_USART_CTRLA_RXPO(rxPad); + + // Enable Transceiver and Receiver + sercom->USART.CTRLB.reg |= SERCOM_USART_CTRLB_TXEN | SERCOM_USART_CTRLB_RXEN ; +} + +void SERCOM::resetUART() +{ + // Start the Software Reset + sercom->USART.CTRLA.bit.SWRST = 1 ; + + while ( sercom->USART.CTRLA.bit.SWRST || sercom->USART.SYNCBUSY.bit.SWRST ) + { + // Wait for both bits Software Reset from CTRLA and SYNCBUSY coming back to 0 + } +} + +void SERCOM::enableUART() +{ + //Setting the enable bit to 1 + sercom->USART.CTRLA.bit.ENABLE = 0x1u; + + //Wait for then enable bit from SYNCBUSY is equal to 0; + while(sercom->USART.SYNCBUSY.bit.ENABLE); +} + +void SERCOM::flushUART() +{ + // Skip checking transmission completion if data register is empty + if(isDataRegisterEmptyUART()) + return; + + // Wait for transmission to complete + while(!sercom->USART.INTFLAG.bit.TXC); +} + +void SERCOM::clearStatusUART() +{ + //Reset (with 0) the STATUS register + sercom->USART.STATUS.reg = SERCOM_USART_STATUS_RESETVALUE; +} + +bool SERCOM::availableDataUART() +{ + //RXC : Receive Complete + return sercom->USART.INTFLAG.bit.RXC; +} + +bool SERCOM::isUARTError() +{ + return sercom->USART.INTFLAG.bit.ERROR; +} + +void SERCOM::acknowledgeUARTError() +{ + sercom->USART.INTFLAG.bit.ERROR = 1; +} + +bool SERCOM::isBufferOverflowErrorUART() +{ + //BUFOVF : Buffer Overflow + return sercom->USART.STATUS.bit.BUFOVF; +} + +bool SERCOM::isFrameErrorUART() +{ + //FERR : Frame Error + return sercom->USART.STATUS.bit.FERR; +} + +void SERCOM::clearFrameErrorUART() +{ + // clear FERR bit writing 1 status bit + sercom->USART.STATUS.bit.FERR = 1; +} + +bool SERCOM::isParityErrorUART() +{ + //PERR : Parity Error + return sercom->USART.STATUS.bit.PERR; +} + +bool SERCOM::isDataRegisterEmptyUART() +{ + //DRE : Data Register Empty + return sercom->USART.INTFLAG.bit.DRE; +} + +uint8_t SERCOM::readDataUART() +{ + return sercom->USART.DATA.bit.DATA; +} + +int SERCOM::writeDataUART(uint8_t data) +{ + // Wait for data register to be empty + while(!isDataRegisterEmptyUART()); + + //Put data into DATA register + sercom->USART.DATA.reg = (uint16_t)data; + return 1; +} + +void SERCOM::enableDataRegisterEmptyInterruptUART() +{ + sercom->USART.INTENSET.reg = SERCOM_USART_INTENSET_DRE; +} + +void SERCOM::disableDataRegisterEmptyInterruptUART() +{ + sercom->USART.INTENCLR.reg = SERCOM_USART_INTENCLR_DRE; +} + +/* ========================= + * ===== Sercom SPI + * ========================= +*/ +void SERCOM::initSPI(SercomSpiTXPad mosi, SercomRXPad miso, SercomSpiCharSize charSize, SercomDataOrder dataOrder) +{ + resetSPI(); + initClockNVIC(); + +#if defined(__SAMD51__) + sercom->SPI.CTRLA.reg = SERCOM_SPI_CTRLA_MODE(0x3) | //master mode + SERCOM_SPI_CTRLA_DOPO(mosi) | + SERCOM_SPI_CTRLA_DIPO(miso) | + dataOrder << SERCOM_SPI_CTRLA_DORD_Pos; +#else + //Setting the CTRLA register + sercom->SPI.CTRLA.reg = SERCOM_SPI_CTRLA_MODE_SPI_MASTER | + SERCOM_SPI_CTRLA_DOPO(mosi) | + SERCOM_SPI_CTRLA_DIPO(miso) | + dataOrder << SERCOM_SPI_CTRLA_DORD_Pos; +#endif + + //Setting the CTRLB register + sercom->SPI.CTRLB.reg = SERCOM_SPI_CTRLB_CHSIZE(charSize) | + SERCOM_SPI_CTRLB_RXEN; //Active the SPI receiver. + + while( sercom->SPI.SYNCBUSY.bit.CTRLB == 1 ); + +} + +void SERCOM::initSPIClock(SercomSpiClockMode clockMode, uint32_t baudrate) +{ + //Extract data from clockMode + int cpha, cpol; + + if((clockMode & (0x1ul)) == 0 ) + cpha = 0; + else + cpha = 1; + + if((clockMode & (0x2ul)) == 0) + cpol = 0; + else + cpol = 1; + + //Setting the CTRLA register + sercom->SPI.CTRLA.reg |= ( cpha << SERCOM_SPI_CTRLA_CPHA_Pos ) | + ( cpol << SERCOM_SPI_CTRLA_CPOL_Pos ); + + //Synchronous arithmetic + sercom->SPI.BAUD.reg = calculateBaudrateSynchronous(baudrate); +} + +void SERCOM::resetSPI() +{ + //Setting the Software Reset bit to 1 + sercom->SPI.CTRLA.bit.SWRST = 1; + + //Wait both bits Software Reset from CTRLA and SYNCBUSY are equal to 0 + while(sercom->SPI.CTRLA.bit.SWRST || sercom->SPI.SYNCBUSY.bit.SWRST); +} + +void SERCOM::enableSPI() +{ + //Setting the enable bit to 1 + sercom->SPI.CTRLA.bit.ENABLE = 1; + + while(sercom->SPI.SYNCBUSY.bit.ENABLE) + { + //Waiting then enable bit from SYNCBUSY is equal to 0; + } +} + +void SERCOM::disableSPI() +{ + while(sercom->SPI.SYNCBUSY.bit.ENABLE) + { + //Waiting then enable bit from SYNCBUSY is equal to 0; + } + + //Setting the enable bit to 0 + sercom->SPI.CTRLA.bit.ENABLE = 0; +} + +void SERCOM::setDataOrderSPI(SercomDataOrder dataOrder) +{ + //Register enable-protected + disableSPI(); + + sercom->SPI.CTRLA.bit.DORD = dataOrder; + + enableSPI(); +} + +SercomDataOrder SERCOM::getDataOrderSPI() +{ + return (sercom->SPI.CTRLA.bit.DORD ? LSB_FIRST : MSB_FIRST); +} + +void SERCOM::setBaudrateSPI(uint8_t divider) +{ + //Can't divide by 0 + if(divider == 0) + return; + + //Register enable-protected + disableSPI(); + + sercom->SPI.BAUD.reg = calculateBaudrateSynchronous( SERCOM_FREQ_REF / divider ); + + enableSPI(); +} + +void SERCOM::setClockModeSPI(SercomSpiClockMode clockMode) +{ + int cpha, cpol; + if((clockMode & (0x1ul)) == 0) + cpha = 0; + else + cpha = 1; + + if((clockMode & (0x2ul)) == 0) + cpol = 0; + else + cpol = 1; + + //Register enable-protected + disableSPI(); + + sercom->SPI.CTRLA.bit.CPOL = cpol; + sercom->SPI.CTRLA.bit.CPHA = cpha; + + enableSPI(); +} + +uint8_t SERCOM::transferDataSPI(uint8_t data) +{ + sercom->SPI.DATA.bit.DATA = data; // Writing data into Data register + + while( sercom->SPI.INTFLAG.bit.RXC == 0 ) + { + // Waiting Complete Reception + } + + return sercom->SPI.DATA.bit.DATA; // Reading data +} + +bool SERCOM::isBufferOverflowErrorSPI() +{ + return sercom->SPI.STATUS.bit.BUFOVF; +} + +bool SERCOM::isDataRegisterEmptySPI() +{ + //DRE : Data Register Empty + return sercom->SPI.INTFLAG.bit.DRE; +} + +//bool SERCOM::isTransmitCompleteSPI() +//{ +// //TXC : Transmit complete +// return sercom->SPI.INTFLAG.bit.TXC; +//} +// +//bool SERCOM::isReceiveCompleteSPI() +//{ +// //RXC : Receive complete +// return sercom->SPI.INTFLAG.bit.RXC; +//} + +uint8_t SERCOM::calculateBaudrateSynchronous(uint32_t baudrate) +{ + return SERCOM_FREQ_REF / (2 * baudrate) - 1; +} + + +/* ========================= + * ===== Sercom WIRE + * ========================= + */ +void SERCOM::resetWIRE() +{ + //I2CM OR I2CS, no matter SWRST is the same bit. + + //Setting the Software bit to 1 + sercom->I2CM.CTRLA.bit.SWRST = 1; + + //Wait both bits Software Reset from CTRLA and SYNCBUSY are equal to 0 + while(sercom->I2CM.CTRLA.bit.SWRST || sercom->I2CM.SYNCBUSY.bit.SWRST); +} + +void SERCOM::enableWIRE() +{ + // I2C Master and Slave modes share the ENABLE bit function. + + // Enable the I2C master mode + sercom->I2CM.CTRLA.bit.ENABLE = 1 ; + + while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) + { + // Waiting the enable bit from SYNCBUSY is equal to 0; + } + + // Setting bus idle mode + sercom->I2CM.STATUS.bit.BUSSTATE = 1 ; + + while ( sercom->I2CM.SYNCBUSY.bit.SYSOP != 0 ) + { + // Wait the SYSOP bit from SYNCBUSY coming back to 0 + } +} + +void SERCOM::disableWIRE() +{ + // I2C Master and Slave modes share the ENABLE bit function. + + // Enable the I2C master mode + sercom->I2CM.CTRLA.bit.ENABLE = 0 ; + + while ( sercom->I2CM.SYNCBUSY.bit.ENABLE != 0 ) + { + // Waiting the enable bit from SYNCBUSY is equal to 0; + } +} + +void SERCOM::initSlaveWIRE( uint8_t ucAddress, bool enableGeneralCall ) +{ + // Initialize the peripheral clock and interruption + initClockNVIC() ; + resetWIRE() ; + + // Set slave mode + sercom->I2CS.CTRLA.bit.MODE = I2C_SLAVE_OPERATION; + + sercom->I2CS.ADDR.reg = SERCOM_I2CS_ADDR_ADDR( ucAddress & 0x7Ful ) | // 0x7F, select only 7 bits + SERCOM_I2CS_ADDR_ADDRMASK( 0x00ul ); // 0x00, only match exact address + if (enableGeneralCall) { + sercom->I2CS.ADDR.reg |= SERCOM_I2CS_ADDR_GENCEN; // enable general call (address 0x00) + } + + // Set the interrupt register + sercom->I2CS.INTENSET.reg = SERCOM_I2CS_INTENSET_PREC | // Stop + SERCOM_I2CS_INTENSET_AMATCH | // Address Match + SERCOM_I2CS_INTENSET_DRDY ; // Data Ready + + while ( sercom->I2CM.SYNCBUSY.bit.SYSOP != 0 ) + { + // Wait the SYSOP bit from SYNCBUSY to come back to 0 + } +} + +void SERCOM::initMasterWIRE( uint32_t baudrate ) +{ + // Initialize the peripheral clock and interruption + initClockNVIC() ; + + resetWIRE() ; + + // Set master mode and enable SCL Clock Stretch mode (stretch after ACK bit) + sercom->I2CM.CTRLA.reg = SERCOM_I2CM_CTRLA_MODE( I2C_MASTER_OPERATION )/* | + SERCOM_I2CM_CTRLA_SCLSM*/ ; + + // Enable Smart mode and Quick Command + //sercom->I2CM.CTRLB.reg = SERCOM_I2CM_CTRLB_SMEN /*| SERCOM_I2CM_CTRLB_QCEN*/ ; + + + // Enable all interrupts +// sercom->I2CM.INTENSET.reg = SERCOM_I2CM_INTENSET_MB | SERCOM_I2CM_INTENSET_SB | SERCOM_I2CM_INTENSET_ERROR ; + + // Synchronous arithmetic baudrate +#if defined(__SAMD51__) + sercom->I2CM.BAUD.bit.BAUD = SERCOM_FREQ_REF / ( 2 * baudrate) - 1 ; +#else + sercom->I2CM.BAUD.bit.BAUD = SystemCoreClock / ( 2 * baudrate) - 5 - (((SystemCoreClock / 1000000) * WIRE_RISE_TIME_NANOSECONDS) / (2 * 1000)); +#endif +} + +void SERCOM::prepareNackBitWIRE( void ) +{ + if(isMasterWIRE()) { + // Send a NACK + sercom->I2CM.CTRLB.bit.ACKACT = 1; + } else { + sercom->I2CS.CTRLB.bit.ACKACT = 1; + } +} + +void SERCOM::prepareAckBitWIRE( void ) +{ + if(isMasterWIRE()) { + // Send an ACK + sercom->I2CM.CTRLB.bit.ACKACT = 0; + } else { + sercom->I2CS.CTRLB.bit.ACKACT = 0; + } +} + +void SERCOM::prepareCommandBitsWire(uint8_t cmd) +{ + if(isMasterWIRE()) { + sercom->I2CM.CTRLB.bit.CMD = cmd; + + while(sercom->I2CM.SYNCBUSY.bit.SYSOP) + { + // Waiting for synchronization + } + } else { + sercom->I2CS.CTRLB.bit.CMD = cmd; + } +} + +bool SERCOM::startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag) +{ + // 7-bits address + 1-bits R/W + address = (address << 0x1ul) | flag; + + // Wait idle or owner bus mode + while ( !isBusIdleWIRE() && !isBusOwnerWIRE() ); + + // Send start and address + sercom->I2CM.ADDR.bit.ADDR = address; + + // Address Transmitted + if ( flag == WIRE_WRITE_FLAG ) // Write mode + { + while( !sercom->I2CM.INTFLAG.bit.MB ) + { + // Wait transmission complete + } + } + else // Read mode + { + while( !sercom->I2CM.INTFLAG.bit.SB ) + { + // If the slave NACKS the address, the MB bit will be set. + // In that case, send a stop condition and return false. + if (sercom->I2CM.INTFLAG.bit.MB) { + sercom->I2CM.CTRLB.bit.CMD = 3; // Stop condition + return false; + } + // Wait transmission complete + } + + // Clean the 'Slave on Bus' flag, for further usage. + //sercom->I2CM.INTFLAG.bit.SB = 0x1ul; + } + + + //ACK received (0: ACK, 1: NACK) + if(sercom->I2CM.STATUS.bit.RXNACK) + { + return false; + } + else + { + return true; + } +} + +bool SERCOM::sendDataMasterWIRE(uint8_t data) +{ + //Send data + sercom->I2CM.DATA.bit.DATA = data; + + //Wait transmission successful + while(!sercom->I2CM.INTFLAG.bit.MB) { + + // If a bus error occurs, the MB bit may never be set. + // Check the bus error bit and bail if it's set. + if (sercom->I2CM.STATUS.bit.BUSERR) { + return false; + } + } + + //Problems on line? nack received? + if(sercom->I2CM.STATUS.bit.RXNACK) + return false; + else + return true; +} + +bool SERCOM::sendDataSlaveWIRE(uint8_t data) +{ + //Send data + sercom->I2CS.DATA.bit.DATA = data; + + //Problems on line? nack received? + if(!sercom->I2CS.INTFLAG.bit.DRDY || sercom->I2CS.STATUS.bit.RXNACK) + return false; + else + return true; +} + +bool SERCOM::isMasterWIRE( void ) +{ + return sercom->I2CS.CTRLA.bit.MODE == I2C_MASTER_OPERATION; +} + +bool SERCOM::isSlaveWIRE( void ) +{ + return sercom->I2CS.CTRLA.bit.MODE == I2C_SLAVE_OPERATION; +} + +bool SERCOM::isBusIdleWIRE( void ) +{ + return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_IDLE_STATE; +} + +bool SERCOM::isBusOwnerWIRE( void ) +{ + return sercom->I2CM.STATUS.bit.BUSSTATE == WIRE_OWNER_STATE; +} + +bool SERCOM::isDataReadyWIRE( void ) +{ + return sercom->I2CS.INTFLAG.bit.DRDY; +} + +bool SERCOM::isStopDetectedWIRE( void ) +{ + return sercom->I2CS.INTFLAG.bit.PREC; +} + +bool SERCOM::isRestartDetectedWIRE( void ) +{ + return sercom->I2CS.STATUS.bit.SR; +} + +bool SERCOM::isAddressMatch( void ) +{ + return sercom->I2CS.INTFLAG.bit.AMATCH; +} + +bool SERCOM::isMasterReadOperationWIRE( void ) +{ + return sercom->I2CS.STATUS.bit.DIR; +} + +bool SERCOM::isRXNackReceivedWIRE( void ) +{ + return sercom->I2CM.STATUS.bit.RXNACK; +} + +int SERCOM::availableWIRE( void ) +{ + if(isMasterWIRE()) + return sercom->I2CM.INTFLAG.bit.SB; + else + return sercom->I2CS.INTFLAG.bit.DRDY; +} + +uint8_t SERCOM::readDataWIRE( void ) +{ + if(isMasterWIRE()) + { + while( sercom->I2CM.INTFLAG.bit.SB == 0 ) + { + // Waiting complete receive + } + + return sercom->I2CM.DATA.bit.DATA ; + } + else + { + return sercom->I2CS.DATA.reg ; + } +} + + +void SERCOM::initClockNVIC( void ) +{ + +#if defined(__SAMD51__) + uint32_t clk_core; + uint32_t clk_slow; + + if(sercom == SERCOM0) + { + clk_core = SERCOM0_GCLK_ID_CORE; + clk_slow = SERCOM0_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM0_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM0_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM0_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM0_3_IRQn); + + NVIC_SetPriority (SERCOM0_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM0_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM0_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM0_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM0_0_IRQn); + NVIC_EnableIRQ(SERCOM0_1_IRQn); + NVIC_EnableIRQ(SERCOM0_2_IRQn); + NVIC_EnableIRQ(SERCOM0_3_IRQn); + } + else if(sercom == SERCOM1) + { + clk_core = SERCOM1_GCLK_ID_CORE; + clk_slow = SERCOM1_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM1_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM1_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM1_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM1_3_IRQn); + + NVIC_SetPriority (SERCOM1_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM1_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM1_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM1_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM1_0_IRQn); + NVIC_EnableIRQ(SERCOM1_1_IRQn); + NVIC_EnableIRQ(SERCOM1_2_IRQn); + NVIC_EnableIRQ(SERCOM1_3_IRQn); + } + else if(sercom == SERCOM2) + { + clk_core = SERCOM2_GCLK_ID_CORE; + clk_slow = SERCOM2_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM2_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM2_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM2_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM2_3_IRQn); + + NVIC_SetPriority (SERCOM2_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM2_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM2_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM2_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM2_0_IRQn); + NVIC_EnableIRQ(SERCOM2_1_IRQn); + NVIC_EnableIRQ(SERCOM2_2_IRQn); + NVIC_EnableIRQ(SERCOM2_3_IRQn); + } + else if(sercom == SERCOM3) + { + clk_core = SERCOM3_GCLK_ID_CORE; + clk_slow = SERCOM3_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM3_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM3_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM3_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM3_3_IRQn); + + NVIC_SetPriority (SERCOM3_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM3_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM3_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM3_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM3_0_IRQn); + NVIC_EnableIRQ(SERCOM3_1_IRQn); + NVIC_EnableIRQ(SERCOM3_2_IRQn); + NVIC_EnableIRQ(SERCOM3_3_IRQn); + } + else if(sercom == SERCOM4) + { + clk_core = SERCOM4_GCLK_ID_CORE; + clk_slow = SERCOM4_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM4_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM4_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM4_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM4_3_IRQn); + + NVIC_SetPriority (SERCOM4_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM4_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM4_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM4_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM4_0_IRQn); + NVIC_EnableIRQ(SERCOM4_1_IRQn); + NVIC_EnableIRQ(SERCOM4_2_IRQn); + NVIC_EnableIRQ(SERCOM4_3_IRQn); + } + else if(sercom == SERCOM5) + { + clk_core = SERCOM5_GCLK_ID_CORE; + clk_slow = SERCOM5_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM5_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM5_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM5_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM5_3_IRQn); + + NVIC_SetPriority (SERCOM5_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM5_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM5_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM5_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM5_0_IRQn); + NVIC_EnableIRQ(SERCOM5_1_IRQn); + NVIC_EnableIRQ(SERCOM5_2_IRQn); + NVIC_EnableIRQ(SERCOM5_3_IRQn); + } +#if defined SERCOM6 + else if(sercom == SERCOM6) + { + clk_core = SERCOM6_GCLK_ID_CORE; + clk_slow = SERCOM6_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM6_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM6_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM6_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM6_3_IRQn); + + NVIC_SetPriority (SERCOM6_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM6_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM6_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM6_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM6_0_IRQn); + NVIC_EnableIRQ(SERCOM6_1_IRQn); + NVIC_EnableIRQ(SERCOM6_2_IRQn); + NVIC_EnableIRQ(SERCOM6_3_IRQn); + } +#endif + +#if defined SERCOM7 + else if(sercom == SERCOM7) + { + clk_core = SERCOM7_GCLK_ID_CORE; + clk_slow = SERCOM7_GCLK_ID_SLOW; + + NVIC_ClearPendingIRQ(SERCOM7_0_IRQn); + NVIC_ClearPendingIRQ(SERCOM7_1_IRQn); + NVIC_ClearPendingIRQ(SERCOM7_2_IRQn); + NVIC_ClearPendingIRQ(SERCOM7_3_IRQn); + + NVIC_SetPriority (SERCOM7_0_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_SetPriority (SERCOM7_1_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM7_2_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + NVIC_SetPriority (SERCOM7_3_IRQn, (1<<__NVIC_PRIO_BITS) - 1); + + NVIC_EnableIRQ(SERCOM7_0_IRQn); + NVIC_EnableIRQ(SERCOM7_1_IRQn); + NVIC_EnableIRQ(SERCOM7_2_IRQn); + NVIC_EnableIRQ(SERCOM7_3_IRQn); + } +#endif +#else + + IRQn_Type IdNvic=PendSV_IRQn ; // Dummy init to intercept potential error later + + uint8_t clockId = 0; + if(sercom == SERCOM0) + { + clockId = GCM_SERCOM0_CORE; + IdNvic = SERCOM0_IRQn; + } + else if(sercom == SERCOM1) + { + clockId = GCM_SERCOM1_CORE; + IdNvic = SERCOM1_IRQn; + } + else if(sercom == SERCOM2) + { + clockId = GCM_SERCOM2_CORE; + IdNvic = SERCOM2_IRQn; + } + else if(sercom == SERCOM3) + { + clockId = GCM_SERCOM3_CORE; + IdNvic = SERCOM3_IRQn; + } +#if defined(SERCOM4) + else if(sercom == SERCOM4) + { + clockId = GCM_SERCOM4_CORE; + IdNvic = SERCOM4_IRQn; + } +#endif +#if defined(SERCOM5) + else if(sercom == SERCOM5) + { + clockId = GCM_SERCOM5_CORE; + IdNvic = SERCOM5_IRQn; + } +#endif + + if ( IdNvic == PendSV_IRQn ) + { + // We got a problem here + return ; + } +#endif + +#if defined(__SAMD51__) + GCLK->PCHCTRL[clk_core].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); + GCLK->PCHCTRL[clk_slow].reg = GCLK_PCHCTRL_GEN_GCLK3_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); + +#else + // Setting NVIC + NVIC_ClearPendingIRQ(IdNvic); + NVIC_SetPriority (IdNvic, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority */ + NVIC_EnableIRQ(IdNvic); + + //Setting clock + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID( clockId ) | // Generic Clock 0 (SERCOMx) + GCLK_CLKCTRL_GEN_GCLK0 | // Generic Clock Generator 0 is source + GCLK_CLKCTRL_CLKEN ; + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } +#endif +} diff --git a/sparkfun/samd/cores/arduino51/SERCOM.h b/sparkfun/samd/cores/arduino51/SERCOM.h new file mode 100644 index 00000000..e4d397d3 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/SERCOM.h @@ -0,0 +1,221 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _SERCOM_CLASS_ +#define _SERCOM_CLASS_ + +#include "sam.h" + +#define SERCOM_FREQ_REF 48000000ul +#define SERCOM_NVIC_PRIORITY ((1<<__NVIC_PRIO_BITS) - 1) + +typedef enum +{ + UART_EXT_CLOCK = 0, + UART_INT_CLOCK = 0x1u +} SercomUartMode; + +typedef enum +{ + SPI_SLAVE_OPERATION = 0x2u, + SPI_MASTER_OPERATION = 0x3u +} SercomSpiMode; + +typedef enum +{ + I2C_SLAVE_OPERATION = 0x4u, + I2C_MASTER_OPERATION = 0x5u +} SercomI2CMode; + +typedef enum +{ + SERCOM_EVEN_PARITY = 0, + SERCOM_ODD_PARITY, + SERCOM_NO_PARITY +} SercomParityMode; + +typedef enum +{ + SERCOM_STOP_BIT_1 = 0, + SERCOM_STOP_BITS_2 +} SercomNumberStopBit; + +typedef enum +{ + MSB_FIRST = 0, + LSB_FIRST +} SercomDataOrder; + +typedef enum +{ + UART_CHAR_SIZE_8_BITS = 0, + UART_CHAR_SIZE_9_BITS, + UART_CHAR_SIZE_5_BITS = 0x5u, + UART_CHAR_SIZE_6_BITS, + UART_CHAR_SIZE_7_BITS +} SercomUartCharSize; + +typedef enum +{ + SERCOM_RX_PAD_0 = 0, + SERCOM_RX_PAD_1, + SERCOM_RX_PAD_2, + SERCOM_RX_PAD_3 +} SercomRXPad; + +typedef enum +{ + UART_TX_PAD_0 = 0x0ul, // Only for UART + UART_TX_PAD_2 = 0x1ul, // Only for UART + UART_TX_RTS_CTS_PAD_0_2_3 = 0x2ul, // Only for UART with TX on PAD0, RTS on PAD2 and CTS on PAD3 +} SercomUartTXPad; + +typedef enum +{ + SAMPLE_RATE_x16 = 0x1, //Fractional + SAMPLE_RATE_x8 = 0x3, //Fractional +} SercomUartSampleRate; + +typedef enum +{ + SERCOM_SPI_MODE_0 = 0, // CPOL : 0 | CPHA : 0 + SERCOM_SPI_MODE_1, // CPOL : 0 | CPHA : 1 + SERCOM_SPI_MODE_2, // CPOL : 1 | CPHA : 0 + SERCOM_SPI_MODE_3 // CPOL : 1 | CPHA : 1 +} SercomSpiClockMode; + +typedef enum +{ + SPI_PAD_0_SCK_1 = 0, + SPI_PAD_2_SCK_3, + SPI_PAD_3_SCK_1, + SPI_PAD_0_SCK_3 +} SercomSpiTXPad; + +typedef enum +{ + SPI_CHAR_SIZE_8_BITS = 0x0ul, + SPI_CHAR_SIZE_9_BITS +} SercomSpiCharSize; + +typedef enum +{ + WIRE_UNKNOWN_STATE = 0x0ul, + WIRE_IDLE_STATE, + WIRE_OWNER_STATE, + WIRE_BUSY_STATE +} SercomWireBusState; + +typedef enum +{ + WIRE_WRITE_FLAG = 0x0ul, + WIRE_READ_FLAG +} SercomWireReadWriteFlag; + +typedef enum +{ + WIRE_MASTER_ACT_NO_ACTION = 0, + WIRE_MASTER_ACT_REPEAT_START, + WIRE_MASTER_ACT_READ, + WIRE_MASTER_ACT_STOP +} SercomMasterCommandWire; + +typedef enum +{ + WIRE_MASTER_ACK_ACTION = 0, + WIRE_MASTER_NACK_ACTION +} SercomMasterAckActionWire; + +class SERCOM +{ + public: + SERCOM(Sercom* s) ; + + /* ========== UART ========== */ + void initUART(SercomUartMode mode, SercomUartSampleRate sampleRate, uint32_t baudrate=0) ; + void initFrame(SercomUartCharSize charSize, SercomDataOrder dataOrder, SercomParityMode parityMode, SercomNumberStopBit nbStopBits) ; + void initPads(SercomUartTXPad txPad, SercomRXPad rxPad) ; + + void resetUART( void ) ; + void enableUART( void ) ; + void flushUART( void ) ; + void clearStatusUART( void ) ; + bool availableDataUART( void ) ; + bool isBufferOverflowErrorUART( void ) ; + bool isFrameErrorUART( void ) ; + void clearFrameErrorUART( void ) ; + bool isParityErrorUART( void ) ; + bool isDataRegisterEmptyUART( void ) ; + uint8_t readDataUART( void ) ; + int writeDataUART(uint8_t data) ; + bool isUARTError() ; + void acknowledgeUARTError() ; + void enableDataRegisterEmptyInterruptUART(); + void disableDataRegisterEmptyInterruptUART(); + + /* ========== SPI ========== */ + void initSPI(SercomSpiTXPad mosi, SercomRXPad miso, SercomSpiCharSize charSize, SercomDataOrder dataOrder) ; + void initSPIClock(SercomSpiClockMode clockMode, uint32_t baudrate) ; + + void resetSPI( void ) ; + void enableSPI( void ) ; + void disableSPI( void ) ; + void setDataOrderSPI(SercomDataOrder dataOrder) ; + SercomDataOrder getDataOrderSPI( void ) ; + void setBaudrateSPI(uint8_t divider) ; + void setClockModeSPI(SercomSpiClockMode clockMode) ; + uint8_t transferDataSPI(uint8_t data) ; + bool isBufferOverflowErrorSPI( void ) ; + bool isDataRegisterEmptySPI( void ) ; + bool isTransmitCompleteSPI( void ) ; + bool isReceiveCompleteSPI( void ) ; + + /* ========== WIRE ========== */ + void initSlaveWIRE(uint8_t address, bool enableGeneralCall = false) ; + void initMasterWIRE(uint32_t baudrate) ; + + void resetWIRE( void ) ; + void enableWIRE( void ) ; + void disableWIRE( void ); + void prepareNackBitWIRE( void ) ; + void prepareAckBitWIRE( void ) ; + void prepareCommandBitsWire(uint8_t cmd); + bool startTransmissionWIRE(uint8_t address, SercomWireReadWriteFlag flag) ; + bool sendDataMasterWIRE(uint8_t data) ; + bool sendDataSlaveWIRE(uint8_t data) ; + bool isMasterWIRE( void ) ; + bool isSlaveWIRE( void ) ; + bool isBusIdleWIRE( void ) ; + bool isBusOwnerWIRE( void ) ; + bool isDataReadyWIRE( void ) ; + bool isStopDetectedWIRE( void ) ; + bool isRestartDetectedWIRE( void ) ; + bool isAddressMatch( void ) ; + bool isMasterReadOperationWIRE( void ) ; + bool isRXNackReceivedWIRE( void ) ; + int availableWIRE( void ) ; + uint8_t readDataWIRE( void ) ; + + private: + Sercom* sercom; + uint8_t calculateBaudrateSynchronous(uint32_t baudrate) ; + uint32_t division(uint32_t dividend, uint32_t divisor) ; + void initClockNVIC( void ) ; +}; + +#endif diff --git a/sparkfun/esp8266/cores/esp8266/stdlib_noniso.h b/sparkfun/samd/cores/arduino51/Server.h similarity index 52% rename from sparkfun/esp8266/cores/esp8266/stdlib_noniso.h rename to sparkfun/samd/cores/arduino51/Server.h index 2e8930fb..69e3e39f 100644 --- a/sparkfun/esp8266/cores/esp8266/stdlib_noniso.h +++ b/sparkfun/samd/cores/arduino51/Server.h @@ -1,9 +1,7 @@ -/* - stdlib_noniso.h - nonstandard (but usefull) conversion functions +/* + Server.h - Base class that provides Server + Copyright (c) 2011 Adrian McEwen. All right reserved. - Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -19,32 +17,14 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef STDLIB_NONISO_H -#define STDLIB_NONISO_H +#ifndef server_h +#define server_h -#ifdef __cplusplus -extern "C"{ -#endif - -int atoi(const char *s); - -long atol(const char* s); - -double atof(const char* s); - -char* itoa (int val, char *s, int radix); - -char* ltoa (long val, char *s, int radix); - -char* utoa (unsigned int val, char *s, int radix); - -char* ultoa (unsigned long val, char *s, int radix); - -char* dtostrf (double val, signed char width, unsigned char prec, char *s); - -#ifdef __cplusplus -} // extern "C" -#endif +#include "Print.h" +class Server : public Print { +public: + virtual void begin() =0; +}; #endif diff --git a/sparkfun/samd/cores/arduino51/Stream.cpp b/sparkfun/samd/cores/arduino51/Stream.cpp new file mode 100644 index 00000000..d2846316 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Stream.cpp @@ -0,0 +1,319 @@ +/* + Stream.cpp - adds parsing methods to Stream class + Copyright (c) 2008 David A. Mellis. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + Created July 2011 + parsing functions based on TextFinder library by Michael Margolis + + findMulti/findUntil routines written by Jim Leonard/Xuth + */ + +#include "Arduino.h" +#include "Stream.h" + +#define PARSE_TIMEOUT 1000 // default number of milli-seconds to wait + +// protected method to read stream with timeout +int Stream::timedRead() +{ + int c; + _startMillis = millis(); + do { + c = read(); + if (c >= 0) return c; + } while(millis() - _startMillis < _timeout); + return -1; // -1 indicates timeout +} + +// protected method to peek stream with timeout +int Stream::timedPeek() +{ + int c; + _startMillis = millis(); + do { + c = peek(); + if (c >= 0) return c; + } while(millis() - _startMillis < _timeout); + return -1; // -1 indicates timeout +} + +// returns peek of the next digit in the stream or -1 if timeout +// discards non-numeric characters +int Stream::peekNextDigit(LookaheadMode lookahead, bool detectDecimal) +{ + int c; + while (1) { + c = timedPeek(); + + if( c < 0 || + c == '-' || + (c >= '0' && c <= '9') || + (detectDecimal && c == '.')) return c; + + switch( lookahead ){ + case SKIP_NONE: return -1; // Fail code. + case SKIP_WHITESPACE: + switch( c ){ + case ' ': + case '\t': + case '\r': + case '\n': break; + default: return -1; // Fail code. + } + case SKIP_ALL: + break; + } + read(); // discard non-numeric + } +} + +// Public Methods +////////////////////////////////////////////////////////////// + +void Stream::setTimeout(unsigned long timeout) // sets the maximum number of milliseconds to wait +{ + _timeout = timeout; +} + + // find returns true if the target string is found +bool Stream::find(char *target) +{ + return findUntil(target, strlen(target), NULL, 0); +} + +// reads data from the stream until the target string of given length is found +// returns true if target string is found, false if timed out +bool Stream::find(char *target, size_t length) +{ + return findUntil(target, length, NULL, 0); +} + +// as find but search ends if the terminator string is found +bool Stream::findUntil(char *target, char *terminator) +{ + return findUntil(target, strlen(target), terminator, strlen(terminator)); +} + +// reads data from the stream until the target string of the given length is found +// search terminated if the terminator string is found +// returns true if target string is found, false if terminated or timed out +bool Stream::findUntil(char *target, size_t targetLen, char *terminator, size_t termLen) +{ + if (terminator == NULL) { + MultiTarget t[1] = {{target, targetLen, 0}}; + return findMulti(t, 1) == 0 ? true : false; + } else { + MultiTarget t[2] = {{target, targetLen, 0}, {terminator, termLen, 0}}; + return findMulti(t, 2) == 0 ? true : false; + } +} + +// returns the first valid (long) integer value from the current position. +// lookahead determines how parseInt looks ahead in the stream. +// See LookaheadMode enumeration at the top of the file. +// Lookahead is terminated by the first character that is not a valid part of an integer. +// Once parsing commences, 'ignore' will be skipped in the stream. +long Stream::parseInt(LookaheadMode lookahead, char ignore) +{ + bool isNegative = false; + long value = 0; + int c; + + c = peekNextDigit(lookahead, false); + // ignore non numeric leading characters + if(c < 0) + return 0; // zero returned if timeout + + do{ + if(c == ignore) + ; // ignore this character + else if(c == '-') + isNegative = true; + else if(c >= '0' && c <= '9') // is c a digit? + value = value * 10 + c - '0'; + read(); // consume the character we got with peek + c = timedPeek(); + } + while( (c >= '0' && c <= '9') || c == ignore ); + + if(isNegative) + value = -value; + return value; +} + +// as parseInt but returns a floating point value +float Stream::parseFloat(LookaheadMode lookahead, char ignore) +{ + bool isNegative = false; + bool isFraction = false; + long value = 0; + int c; + float fraction = 1.0; + + c = peekNextDigit(lookahead, true); + // ignore non numeric leading characters + if(c < 0) + return 0; // zero returned if timeout + + do{ + if(c == ignore) + ; // ignore + else if(c == '-') + isNegative = true; + else if (c == '.') + isFraction = true; + else if(c >= '0' && c <= '9') { // is c a digit? + value = value * 10 + c - '0'; + if(isFraction) + fraction *= 0.1; + } + read(); // consume the character we got with peek + c = timedPeek(); + } + while( (c >= '0' && c <= '9') || (c == '.' && !isFraction) || c == ignore ); + + if(isNegative) + value = -value; + if(isFraction) + return value * fraction; + else + return value; +} + +// read characters from stream into buffer +// terminates if length characters have been read, or timeout (see setTimeout) +// returns the number of characters placed in the buffer +// the buffer is NOT null terminated. +// +size_t Stream::readBytes(char *buffer, size_t length) +{ + size_t count = 0; + while (count < length) { + int c = timedRead(); + if (c < 0) break; + *buffer++ = (char)c; + count++; + } + return count; +} + + +// as readBytes with terminator character +// terminates if length characters have been read, timeout, or if the terminator character detected +// returns the number of characters placed in the buffer (0 means no valid data found) + +size_t Stream::readBytesUntil(char terminator, char *buffer, size_t length) +{ + if (length < 1) return 0; + size_t index = 0; + while (index < length) { + int c = timedRead(); + if (c < 0 || c == terminator) break; + *buffer++ = (char)c; + index++; + } + return index; // return number of characters, not including null terminator +} + +String Stream::readString() +{ + String ret; + int c = timedRead(); + while (c >= 0) + { + ret += (char)c; + c = timedRead(); + } + return ret; +} + +String Stream::readStringUntil(char terminator) +{ + String ret; + int c = timedRead(); + while (c >= 0 && c != terminator) + { + ret += (char)c; + c = timedRead(); + } + return ret; +} + +int Stream::findMulti( struct Stream::MultiTarget *targets, int tCount) { + // any zero length target string automatically matches and would make + // a mess of the rest of the algorithm. + for (struct MultiTarget *t = targets; t < targets+tCount; ++t) { + if (t->len <= 0) + return t - targets; + } + + while (1) { + int c = timedRead(); + if (c < 0) + return -1; + + for (struct MultiTarget *t = targets; t < targets+tCount; ++t) { + // the simple case is if we match, deal with that first. + if (c == t->str[t->index]) { + if (++t->index == t->len) + return t - targets; + else + continue; + } + + // if not we need to walk back and see if we could have matched further + // down the stream (ie '1112' doesn't match the first position in '11112' + // but it will match the second position so we can't just reset the current + // index to 0 when we find a mismatch. + if (t->index == 0) + continue; + + int origIndex = t->index; + do { + --t->index; + // first check if current char works against the new current index + if (c != t->str[t->index]) + continue; + + // if it's the only char then we're good, nothing more to check + if (t->index == 0) { + t->index++; + break; + } + + // otherwise we need to check the rest of the found string + int diff = origIndex - t->index; + size_t i; + for (i = 0; i < t->index; ++i) { + if (t->str[i] != t->str[i + diff]) + break; + } + + // if we successfully got through the previous loop then our current + // index is good. + if (i == t->index) { + t->index++; + break; + } + + // otherwise we just try the next index + } while (t->index); + } + } + // unreachable + return -1; +} diff --git a/sparkfun/samd/cores/arduino51/Stream.h b/sparkfun/samd/cores/arduino51/Stream.h new file mode 100644 index 00000000..c3311c3c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Stream.h @@ -0,0 +1,129 @@ +/* + Stream.h - base class for character-based streams. + Copyright (c) 2010 David A. Mellis. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + parsing functions based on TextFinder library by Michael Margolis +*/ + +#ifndef Stream_h +#define Stream_h + +#include +#include "Print.h" + +// compatability macros for testing +/* +#define getInt() parseInt() +#define getInt(ignore) parseInt(ignore) +#define getFloat() parseFloat() +#define getFloat(ignore) parseFloat(ignore) +#define getString( pre_string, post_string, buffer, length) +readBytesBetween( pre_string, terminator, buffer, length) +*/ + +// This enumeration provides the lookahead options for parseInt(), parseFloat() +// The rules set out here are used until either the first valid character is found +// or a time out occurs due to lack of input. +enum LookaheadMode{ + SKIP_ALL, // All invalid characters are ignored. + SKIP_NONE, // Nothing is skipped, and the stream is not touched unless the first waiting character is valid. + SKIP_WHITESPACE // Only tabs, spaces, line feeds & carriage returns are skipped. +}; + +#define NO_IGNORE_CHAR '\x01' // a char not found in a valid ASCII numeric field + +class Stream : public Print +{ + protected: + unsigned long _timeout; // number of milliseconds to wait for the next char before aborting timed read + unsigned long _startMillis; // used for timeout measurement + int timedRead(); // read stream with timeout + int timedPeek(); // peek stream with timeout + int peekNextDigit(LookaheadMode lookahead, bool detectDecimal); // returns the next numeric digit in the stream or -1 if timeout + + public: + virtual int available() = 0; + virtual int read() = 0; + virtual int peek() = 0; + + Stream() {_timeout=1000;} + +// parsing methods + + void setTimeout(unsigned long timeout); // sets maximum milliseconds to wait for stream data, default is 1 second + unsigned long getTimeout(void) { return _timeout; } + + bool find(char *target); // reads data from the stream until the target string is found + bool find(uint8_t *target) { return find ((char *)target); } + // returns true if target string is found, false if timed out (see setTimeout) + + bool find(char *target, size_t length); // reads data from the stream until the target string of given length is found + bool find(uint8_t *target, size_t length) { return find ((char *)target, length); } + // returns true if target string is found, false if timed out + + bool find(char target) { return find (&target, 1); } + + bool findUntil(char *target, char *terminator); // as find but search ends if the terminator string is found + bool findUntil(uint8_t *target, char *terminator) { return findUntil((char *)target, terminator); } + + bool findUntil(char *target, size_t targetLen, char *terminate, size_t termLen); // as above but search ends if the terminate string is found + bool findUntil(uint8_t *target, size_t targetLen, char *terminate, size_t termLen) {return findUntil((char *)target, targetLen, terminate, termLen); } + + long parseInt(LookaheadMode lookahead = SKIP_ALL, char ignore = NO_IGNORE_CHAR); + // returns the first valid (long) integer value from the current position. + // lookahead determines how parseInt looks ahead in the stream. + // See LookaheadMode enumeration at the top of the file. + // Lookahead is terminated by the first character that is not a valid part of an integer. + // Once parsing commences, 'ignore' will be skipped in the stream. + + float parseFloat(LookaheadMode lookahead = SKIP_ALL, char ignore = NO_IGNORE_CHAR); + // float version of parseInt + + size_t readBytes( char *buffer, size_t length); // read chars from stream into buffer + size_t readBytes( uint8_t *buffer, size_t length) { return readBytes((char *)buffer, length); } + // terminates if length characters have been read or timeout (see setTimeout) + // returns the number of characters placed in the buffer (0 means no valid data found) + + size_t readBytesUntil( char terminator, char *buffer, size_t length); // as readBytes with terminator character + size_t readBytesUntil( char terminator, uint8_t *buffer, size_t length) { return readBytesUntil(terminator, (char *)buffer, length); } + // terminates if length characters have been read, timeout, or if the terminator character detected + // returns the number of characters placed in the buffer (0 means no valid data found) + + // Arduino String functions to be added here + String readString(); + String readStringUntil(char terminator); + + protected: + long parseInt(char ignore) { return parseInt(SKIP_ALL, ignore); } + float parseFloat(char ignore) { return parseFloat(SKIP_ALL, ignore); } + // These overload exists for compatibility with any class that has derived + // Stream and used parseFloat/Int with a custom ignore character. To keep + // the public API simple, these overload remains protected. + + struct MultiTarget { + const char *str; // string you're searching for + size_t len; // length of string you're searching for + size_t index; // index used by the search routine. + }; + + // This allows you to search for an arbitrary number of strings. + // Returns index of the target that is found first or -1 if timeout occurs. + int findMulti(struct MultiTarget *targets, int tCount); +}; + +#undef NO_IGNORE_CHAR +#endif diff --git a/sparkfun/samd/cores/arduino51/Tone.cpp b/sparkfun/samd/cores/arduino51/Tone.cpp new file mode 100644 index 00000000..fe9a0db8 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Tone.cpp @@ -0,0 +1,214 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Tone.h" +#include "variant.h" + +#if defined(__SAMD51__) +#define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.SYNCBUSY.bit.ENABLE); +#else +#define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY); +#endif + +uint32_t toneMaxFrequency = F_CPU / 2; +uint32_t lastOutputPin = 0xFFFFFFFF; + +volatile uint32_t *portToggleRegister; +volatile uint32_t *portClearRegister; +volatile uint32_t portBitMask; +volatile int64_t toggleCount; +volatile bool toneIsActive = false; +volatile bool firstTimeRunning = false; + +#if defined(__SAMD51__) +#define TONE_TC TC2 +#define TONE_TC_IRQn TC2_IRQn +#define TONE_TC_GCLK_ID TC2_GCLK_ID +#else +#define TONE_TC TC5 +#define TONE_TC_IRQn TC5_IRQn +#endif +#define TONE_TC_TOP 0xFFFF +#define TONE_TC_CHANNEL 0 + +#if defined(__SAMD51__) +void TC2_Handler (void) __attribute__ ((weak, alias("Tone_Handler"))); +#else +void TC5_Handler (void) __attribute__ ((weak, alias("Tone_Handler"))); +#endif + +static inline void resetTC (Tc* TCx) +{ + // Disable TCx + TCx->COUNT16.CTRLA.reg &= ~TC_CTRLA_ENABLE; + WAIT_TC16_REGS_SYNC(TCx) + + // Reset TCx + TCx->COUNT16.CTRLA.reg = TC_CTRLA_SWRST; + WAIT_TC16_REGS_SYNC(TCx) + while (TCx->COUNT16.CTRLA.bit.SWRST); +} + +void toneAccurateClock (uint32_t accurateSystemCoreClockFrequency) +{ + toneMaxFrequency = accurateSystemCoreClockFrequency / 2; +} + +void tone (uint32_t outputPin, uint32_t frequency, uint32_t duration) +{ + // Configure interrupt request + NVIC_DisableIRQ(TONE_TC_IRQn); + NVIC_ClearPendingIRQ(TONE_TC_IRQn); + + if(!firstTimeRunning) + { + firstTimeRunning = true; + + NVIC_SetPriority(TONE_TC_IRQn, 0); + +#if defined(__SAMD51__) + GCLK->PCHCTRL[TONE_TC_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); +#else + // Enable GCLK for TC4 and TC5 (timer counter input clock) + GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(GCM_TC4_TC5)); + while (GCLK->STATUS.bit.SYNCBUSY); +#endif + } + + //if it's a rest, set to 1Hz (below audio range) + frequency = (frequency > 0 ? frequency : 1); + + if (toneIsActive && (outputPin != lastOutputPin)) + noTone(lastOutputPin); + + // + // Calculate best prescaler divider and comparator value for a 16 bit TC peripheral + // + + uint32_t prescalerConfigBits; + uint32_t ccValue; + + ccValue = toneMaxFrequency / frequency - 1; + prescalerConfigBits = TC_CTRLA_PRESCALER_DIV1; + + uint8_t i = 0; + + while(ccValue > TONE_TC_TOP) + { + ccValue = toneMaxFrequency / frequency / (2< 0 ? frequency * duration * 2 / 1000UL : -1); + + resetTC(TONE_TC); + + uint16_t tmpReg = 0; + tmpReg |= TC_CTRLA_MODE_COUNT16; // Set Timer counter Mode to 16 bits + +#if defined(__SAMD51__) + TONE_TC->COUNT16.WAVE.reg = TC_WAVE_WAVEGEN_MFRQ; // Set TONE_TC mode as match frequency +#else + tmpReg |= TC_CTRLA_WAVEGEN_MFRQ; // Set TONE_TC mode as match frequency +#endif + tmpReg |= prescalerConfigBits; + TONE_TC->COUNT16.CTRLA.reg |= tmpReg; + WAIT_TC16_REGS_SYNC(TONE_TC) + + TONE_TC->COUNT16.CC[TONE_TC_CHANNEL].reg = (uint16_t) ccValue; + WAIT_TC16_REGS_SYNC(TONE_TC) + + portToggleRegister = &(PORT->Group[g_APinDescription[outputPin].ulPort].OUTTGL.reg); + portClearRegister = &(PORT->Group[g_APinDescription[outputPin].ulPort].OUTCLR.reg); + portBitMask = (1ul << g_APinDescription[outputPin].ulPin); + + // Enable the TONE_TC interrupt request + TONE_TC->COUNT16.INTENSET.bit.MC0 = 1; + + if (outputPin != lastOutputPin) + { + lastOutputPin = outputPin; + digitalWrite(outputPin, LOW); + pinMode(outputPin, OUTPUT); + toneIsActive = true; + } + + // Enable TONE_TC + TONE_TC->COUNT16.CTRLA.reg |= TC_CTRLA_ENABLE; + WAIT_TC16_REGS_SYNC(TONE_TC) + + NVIC_EnableIRQ(TONE_TC_IRQn); +} + +void noTone (uint32_t outputPin) +{ + resetTC(TONE_TC); + digitalWrite(outputPin, LOW); + toneIsActive = false; +} + +#ifdef __cplusplus +extern "C" { +#endif + +void Tone_Handler (void) +{ + if (toggleCount != 0) + { + // Toggle the ouput pin + *portToggleRegister = portBitMask; + + if (toggleCount > 0) + --toggleCount; + + // Clear the interrupt + TONE_TC->COUNT16.INTFLAG.bit.MC0 = 1; + } + else + { + resetTC(TONE_TC); + *portClearRegister = portBitMask; + toneIsActive = false; + } +} + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/Tone.h b/sparkfun/samd/cores/arduino51/Tone.h new file mode 100644 index 00000000..cf270516 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Tone.h @@ -0,0 +1,28 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#ifdef __cplusplus + +#include "Arduino.h" + +void tone(uint32_t _pin, uint32_t frequency, uint32_t duration = 0); +void noTone(uint32_t _pin); + +#endif diff --git a/sparkfun/samd/cores/arduino51/USB/CDC.cpp b/sparkfun/samd/cores/arduino51/USB/CDC.cpp new file mode 100644 index 00000000..ffae21b8 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/CDC.cpp @@ -0,0 +1,261 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include // Needed for auto-reset with 1200bps port touch + +#include +#include +#include + +#ifdef CDC_ENABLED + +#define CDC_SERIAL_BUFFER_SIZE 256 + +/* For information purpose only since RTS is not always handled by the terminal application */ +#define CDC_LINESTATE_DTR 0x01 // Data Terminal Ready +#define CDC_LINESTATE_RTS 0x02 // Ready to Send + +#define CDC_LINESTATE_READY (CDC_LINESTATE_RTS | CDC_LINESTATE_DTR) + +typedef struct { + uint32_t dwDTERate; + uint8_t bCharFormat; + uint8_t bParityType; + uint8_t bDataBits; + uint8_t lineState; +} LineInfo; + +_Pragma("pack(1)") +static volatile LineInfo _usbLineInfo = { + 115200, // dWDTERate + 0x00, // bCharFormat + 0x00, // bParityType + 0x08, // bDataBits + 0x00 // lineState +}; + +static volatile int32_t breakValue = -1; + +static CDCDescriptor _cdcInterface = { + D_IAD(0, 2, CDC_COMMUNICATION_INTERFACE_CLASS, CDC_ABSTRACT_CONTROL_MODEL, 0), + + // CDC communication interface + D_INTERFACE(CDC_ACM_INTERFACE, 1, CDC_COMMUNICATION_INTERFACE_CLASS, CDC_ABSTRACT_CONTROL_MODEL, 0), + D_CDCCS(CDC_HEADER, CDC_V1_10 & 0xFF, (CDC_V1_10>>8) & 0x0FF), // Header (1.10 bcd) + + D_CDCCS4(CDC_ABSTRACT_CONTROL_MANAGEMENT, 6), // SET_LINE_CODING, GET_LINE_CODING, SET_CONTROL_LINE_STATE supported + D_CDCCS(CDC_UNION, CDC_ACM_INTERFACE, CDC_DATA_INTERFACE), // Communication interface is master, data interface is slave 0 + D_CDCCS(CDC_CALL_MANAGEMENT, 1, 1), // Device handles call management (not) + D_ENDPOINT(USB_ENDPOINT_IN(CDC_ENDPOINT_ACM), USB_ENDPOINT_TYPE_INTERRUPT, 0x10, 0x10), + + // CDC data interface + D_INTERFACE(CDC_DATA_INTERFACE, 2, CDC_DATA_INTERFACE_CLASS, 0, 0), + D_ENDPOINT(USB_ENDPOINT_OUT(CDC_ENDPOINT_OUT), USB_ENDPOINT_TYPE_BULK, EPX_SIZE, 0), + D_ENDPOINT(USB_ENDPOINT_IN (CDC_ENDPOINT_IN ), USB_ENDPOINT_TYPE_BULK, EPX_SIZE, 0) +}; +_Pragma("pack()") + +const void* _CDC_GetInterface(void) +{ + return &_cdcInterface; +} + +uint32_t _CDC_GetInterfaceLength(void) +{ + return sizeof(_cdcInterface); +} + +int CDC_GetInterface(uint8_t* interfaceNum) +{ + interfaceNum[0] += 2; // uses 2 + return USBDevice.sendControl(&_cdcInterface,sizeof(_cdcInterface)); +} + +bool CDC_Setup(USBSetup& setup) +{ + uint8_t requestType = setup.bmRequestType; + uint8_t r = setup.bRequest; + + if (requestType == REQUEST_DEVICETOHOST_CLASS_INTERFACE) + { + if (r == CDC_GET_LINE_CODING) + { + USBDevice.sendControl((void*)&_usbLineInfo, 7); + return true; + } + } + + if (requestType == REQUEST_HOSTTODEVICE_CLASS_INTERFACE) + { + if (r == CDC_SET_LINE_CODING) + { + USBDevice.recvControl((void*)&_usbLineInfo, 7); + } + + if (r == CDC_SET_CONTROL_LINE_STATE) + { + _usbLineInfo.lineState = setup.wValueL; + } + + if (r == CDC_SET_LINE_CODING || r == CDC_SET_CONTROL_LINE_STATE) + { + // auto-reset into the bootloader is triggered when the port, already + // open at 1200 bps, is closed. We check DTR state to determine if host + // port is open (bit 0 of lineState). + if (_usbLineInfo.dwDTERate == 1200 && (_usbLineInfo.lineState & 0x01) == 0) + { + initiateReset(250); + } + else + { + cancelReset(); + } + return false; + } + + if (CDC_SEND_BREAK == r) + { + breakValue = ((uint16_t)setup.wValueH << 8) | setup.wValueL; + return false; + } + } + return false; +} + +void Serial_::begin(uint32_t /* baud_count */) +{ + // uart config is ignored in USB-CDC +} + +void Serial_::begin(uint32_t /* baud_count */, uint8_t /* config */) +{ + // uart config is ignored in USB-CDC +} + +void Serial_::end(void) +{ +} + +int Serial_::available(void) +{ + return usb.available(CDC_ENDPOINT_OUT); +} + +int Serial_::availableForWrite(void) +{ + // return the number of bytes left in the current bank, + // always EP size - 1, because bank is flushed on every write + return (EPX_SIZE - 1); +} + +int _serialPeek = -1; + +int Serial_::peek(void) +{ + if (_serialPeek != -1) + return _serialPeek; + _serialPeek = read(); + return _serialPeek; +} + +int Serial_::read(void) +{ + if (_serialPeek != -1) { + int res = _serialPeek; + _serialPeek = -1; + return res; + } + return usb.recv(CDC_ENDPOINT_OUT); +} + +size_t Serial_::readBytes(char *buffer, size_t length) +{ + size_t count = 0; + _startMillis = millis(); + while (count < length) + { + uint32_t n = usb.recv(CDC_ENDPOINT_OUT, buffer+count, length-count); + if (n == 0 && (millis() - _startMillis) >= _timeout) + break; + count += n; + } + return count; +} + +void Serial_::flush(void) +{ + usb.flush(CDC_ENDPOINT_IN); +} + +size_t Serial_::write(const uint8_t *buffer, size_t size) +{ + /* only try to send bytes if the high-level CDC connection itself + is open (not just the pipe) - the OS should set lineState when the port + is opened and clear lineState when the port is closed. + bytes sent before the user opens the connection or after + the connection is closed are lost - just like with a UART. */ + + // TODO - ZE - check behavior on different OSes and test what happens if an + // open connection isn't broken cleanly (cable is yanked out, host dies + // or locks up, or host virtual serial port hangs) + uint32_t r = 0; + if (_usbLineInfo.lineState > 0) // Problem with Windows(R) + { + r = usb.send(CDC_ENDPOINT_IN, buffer, size); + } + + if (r > 0) { + return r; + } else { + setWriteError(); + return 0; + } +} + +size_t Serial_::write(uint8_t c) { + return write(&c, 1); +} + +// This operator is a convenient way for a sketch to check whether the +// port has actually been configured and opened by the host (as opposed +// to just being connected to the host). It can be used, for example, in +// setup() before printing to ensure that an application on the host is +// actually ready to receive and display the data. +// We add a short delay before returning to fix a bug observed by Federico +// where the port is configured (lineState != 0) but not quite opened. +Serial_::operator bool() +{ + // this is here to avoid spurious opening after upload + if (millis() < 500) + return false; + + bool result = false; + + if (_usbLineInfo.lineState > 0) + { + result = true; + } + + delay(10); + return result; +} + +Serial_ Serial(USBDevice); + +#endif diff --git a/sparkfun/samd/cores/arduino51/USB/PluggableUSB.cpp b/sparkfun/samd/cores/arduino51/USB/PluggableUSB.cpp new file mode 100644 index 00000000..4c52c1fa --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/PluggableUSB.cpp @@ -0,0 +1,116 @@ +/* + PluggableUSB.cpp + Copyright (c) 2015 Arduino LLC + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "USBAPI.h" +#include "USBDesc.h" +#include "USBCore.h" +#include "PluggableUSB.h" + +#if defined(USBCON) +#ifdef PLUGGABLE_USB_ENABLED + +extern uint32_t EndPoints[]; + +int PluggableUSB_::getInterface(uint8_t* interfaceCount) +{ + int sent = 0; + PluggableUSBModule* node; + for (node = rootNode; node; node = node->next) { + int res = node->getInterface(interfaceCount); + if (res < 0) + return -1; + sent += res; + } + return sent; +} + +int PluggableUSB_::getDescriptor(USBSetup& setup) +{ + PluggableUSBModule* node; + for (node = rootNode; node; node = node->next) { + int ret = node->getDescriptor(setup); + // ret!=0 -> request has been processed + if (ret) + return ret; + } + return 0; +} + +void PluggableUSB_::getShortName(char *iSerialNum) +{ + PluggableUSBModule* node; + for (node = rootNode; node; node = node->next) { + iSerialNum += node->getShortName(iSerialNum); + } + *iSerialNum = 0; +} + +bool PluggableUSB_::setup(USBSetup& setup) +{ + PluggableUSBModule* node; + for (node = rootNode; node; node = node->next) { + if (node->setup(setup)) { + return true; + } + } + return false; +} + +bool PluggableUSB_::plug(PluggableUSBModule *node) +{ + if ((lastEp + node->numEndpoints) > USB_ENDPOINTS) { + return false; + } + + if (!rootNode) { + rootNode = node; + } else { + PluggableUSBModule *current = rootNode; + while (current->next) { + current = current->next; + } + current->next = node; + } + + node->pluggedInterface = lastIf; + node->pluggedEndpoint = lastEp; + lastIf += node->numInterfaces; + for (uint8_t i = 0; i < node->numEndpoints; i++) { + EndPoints[lastEp] = node->endpointType[i]; + lastEp++; + } + return true; + // restart USB layer??? +} + +PluggableUSB_& PluggableUSB() +{ + static PluggableUSB_ obj; + return obj; +} + +PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT), + lastEp(CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT), + rootNode(NULL) +{ + // Empty +} + +#endif +#endif \ No newline at end of file diff --git a/sparkfun/samd/cores/arduino51/USB/PluggableUSB.h b/sparkfun/samd/cores/arduino51/USB/PluggableUSB.h new file mode 100644 index 00000000..4e08e5df --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/PluggableUSB.h @@ -0,0 +1,74 @@ +/* + PluggableUSB.h + Copyright (c) 2015 Arduino LLC + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef PUSB_h +#define PUSB_h + +#include "USBAPI.h" +#include + +#if defined(USBCON) + +class PluggableUSBModule { +public: + PluggableUSBModule(uint8_t numEps, uint8_t numIfs, uint32_t *epType) : + numEndpoints(numEps), numInterfaces(numIfs), endpointType(epType) + { } + +protected: + virtual bool setup(USBSetup& setup) = 0; + virtual int getInterface(uint8_t* interfaceCount) = 0; + virtual int getDescriptor(USBSetup& setup) = 0; + virtual uint8_t getShortName(char *name) { name[0] = 'A'+pluggedInterface; return 1; } + + uint8_t pluggedInterface; + uint8_t pluggedEndpoint; + + const uint8_t numEndpoints; + const uint8_t numInterfaces; + const uint32_t *endpointType; + + PluggableUSBModule *next = NULL; + + friend class PluggableUSB_; +}; + +class PluggableUSB_ { +public: + PluggableUSB_(); + bool plug(PluggableUSBModule *node); + int getInterface(uint8_t* interfaceCount); + int getDescriptor(USBSetup& setup); + bool setup(USBSetup& setup); + void getShortName(char *iSerialNum); + +private: + uint8_t lastIf; + uint8_t lastEp; + PluggableUSBModule* rootNode; +}; + +// Replacement for global singleton. +// This function prevents static-initialization-order-fiasco +// https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use +PluggableUSB_& PluggableUSB(); + +#endif + +#endif diff --git a/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.cpp b/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.cpp new file mode 100644 index 00000000..49248d99 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.cpp @@ -0,0 +1,38 @@ +/* + * SAMD21_USBDevice.cpp + * + * Created on: Feb 21, 2018 + * Author: deanm + */ + + +#include "SAMD21_USBDevice.h" + +void USBDevice_SAMD21G18x::reset() { + usb.CTRLA.bit.SWRST = 1; + memset(EP, 0, sizeof(EP)); + while (usb.SYNCBUSY.bit.SWRST || usb.SYNCBUSY.bit.ENABLE) {} + usb.DESCADD.reg = (uint32_t)(&EP); +} + +void USBDevice_SAMD21G18x::calibrate() { + // Load Pad Calibration data from non-volatile memory + uint32_t *pad_transn_p = (uint32_t *) USB_FUSES_TRANSN_ADDR; + uint32_t *pad_transp_p = (uint32_t *) USB_FUSES_TRANSP_ADDR; + uint32_t *pad_trim_p = (uint32_t *) USB_FUSES_TRIM_ADDR; + + uint32_t pad_transn = (*pad_transn_p & USB_FUSES_TRANSN_Msk) >> USB_FUSES_TRANSN_Pos; + uint32_t pad_transp = (*pad_transp_p & USB_FUSES_TRANSP_Msk) >> USB_FUSES_TRANSP_Pos; + uint32_t pad_trim = (*pad_trim_p & USB_FUSES_TRIM_Msk ) >> USB_FUSES_TRIM_Pos; + + if (pad_transn == 0x1F) // maximum value (31) + pad_transn = 5; + if (pad_transp == 0x1F) // maximum value (31) + pad_transp = 29; + if (pad_trim == 0x7) // maximum value (7) + pad_trim = 3; + + usb.PADCAL.bit.TRANSN = pad_transn; + usb.PADCAL.bit.TRANSP = pad_transp; + usb.PADCAL.bit.TRIM = pad_trim; +} diff --git a/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.h b/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.h new file mode 100644 index 00000000..6658b583 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/SAMD21_USBDevice.h @@ -0,0 +1,388 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +#include +#include +#include + +typedef uint8_t ep_t; + +class USBDevice_SAMD21G18x { +public: + USBDevice_SAMD21G18x() : usb(USB->DEVICE) { + // Empty + } + + // USB Device function mapping + // --------------------------- + + // Reset USB Device + void reset(); + + // Enable + inline void enable() { + usb.CTRLA.bit.ENABLE = 1; +#if defined(__SAMD51__) + while( usb.SYNCBUSY.reg & USB_SYNCBUSY_ENABLE ); //wait for sync +#endif + } + inline void disable() { + usb.CTRLA.bit.ENABLE = 0; +#if defined(__SAMD51__) + while( usb.SYNCBUSY.reg & USB_SYNCBUSY_ENABLE ); //wait for sync +#endif + } + + // USB mode (device/host) + inline void setUSBDeviceMode() { usb.CTRLA.bit.MODE = USB_CTRLA_MODE_DEVICE_Val; } + inline void setUSBHostMode() { usb.CTRLA.bit.MODE = USB_CTRLA_MODE_HOST_Val; } + + inline void runInStandby() { usb.CTRLA.bit.RUNSTDBY = 1; } + inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; } + inline void wakeupHost() { usb.CTRLB.bit.UPRSM = 1; } + + // USB speed + inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; } + inline void setLowSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_LS_Val; } + inline void setHiSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_HS_Val; } + inline void setHiSpeedTestMode() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_HSTM_Val; } + + // Authorize attach if Vbus is present + inline void attach() { usb.CTRLB.bit.DETACH = 0; } + inline void detach() { usb.CTRLB.bit.DETACH = 1; } + + // USB Interrupts + inline bool isEndOfResetInterrupt() { return usb.INTFLAG.bit.EORST; } + inline void ackEndOfResetInterrupt() { usb.INTFLAG.reg = USB_DEVICE_INTFLAG_EORST; } + inline void enableEndOfResetInterrupt() { usb.INTENSET.bit.EORST = 1; } + inline void disableEndOfResetInterrupt() { usb.INTENCLR.bit.EORST = 1; } + + inline bool isStartOfFrameInterrupt() { return usb.INTFLAG.bit.SOF; } + inline void ackStartOfFrameInterrupt() { usb.INTFLAG.reg = USB_DEVICE_INTFLAG_SOF; } + inline void enableStartOfFrameInterrupt() { usb.INTENSET.bit.SOF = 1; } + inline void disableStartOfFrameInterrupt() { usb.INTENCLR.bit.SOF = 1; } + + // USB Address + inline void setAddress(uint32_t addr) { usb.DADD.bit.DADD = addr; usb.DADD.bit.ADDEN = 1; } + inline void unsetAddress() { usb.DADD.bit.DADD = 0; usb.DADD.bit.ADDEN = 0; } + + // Frame number + inline uint16_t frameNumber() { return usb.FNUM.bit.FNUM; } + + // Load calibration values + void calibrate(); + + // USB Device Endpoints function mapping + // ------------------------------------- + + // Config + inline void epBank0SetType(ep_t ep, uint8_t type) { usb.DeviceEndpoint[ep].EPCFG.bit.EPTYPE0 = type; } + inline void epBank1SetType(ep_t ep, uint8_t type) { usb.DeviceEndpoint[ep].EPCFG.bit.EPTYPE1 = type; } + + // Interrupts + inline uint16_t epInterruptSummary() { return usb.EPINTSMRY.reg; } + + inline bool epBank0IsSetupReceived(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.RXSTP; } + inline bool epBank0IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL0; } + inline bool epBank1IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL1; } + inline bool epBank0IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT0; } + inline bool epBank1IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT1; } + + inline void epBank0AckSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_RXSTP; } + inline void epBank0AckStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL(1); } + inline void epBank1AckStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL(2); } + inline void epBank0AckTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT(1); } + inline void epBank1AckTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT(2); } + + inline void epBank0EnableSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.RXSTP = 1; } + inline void epBank0EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL0 = 1; } + inline void epBank1EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL1 = 1; } + inline void epBank0EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT0 = 1; } + inline void epBank1EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT1 = 1; } + + inline void epBank0DisableSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.RXSTP = 1; } + inline void epBank0DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL0 = 1; } + inline void epBank1DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL1 = 1; } + inline void epBank0DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT0 = 1; } + inline void epBank1DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT1 = 1; } + + // Status + inline bool epBank0IsReady(ep_t ep) { return usb.DeviceEndpoint[ep].EPSTATUS.bit.BK0RDY; } + inline bool epBank1IsReady(ep_t ep) { return usb.DeviceEndpoint[ep].EPSTATUS.bit.BK1RDY; } + inline void epBank0SetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.BK0RDY = 1; } + inline void epBank1SetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.BK1RDY = 1; } + inline void epBank0ResetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.BK0RDY = 1; } + inline void epBank1ResetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.BK1RDY = 1; } + + inline void epBank0SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ0 = 1; } + inline void epBank1SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ1 = 1; } + inline void epBank0ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ0 = 1; } + inline void epBank1ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ1 = 1; } + + // Packet + inline uint16_t epBank0ByteCount(ep_t ep) { return EP[ep].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT; } + inline uint16_t epBank1ByteCount(ep_t ep) { return EP[ep].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT; } + inline void epBank0SetByteCount(ep_t ep, uint16_t bc) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT = bc; } + inline void epBank1SetByteCount(ep_t ep, uint16_t bc) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT = bc; } + inline void epBank0SetMultiPacketSize(ep_t ep, uint16_t s) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = s; } + inline void epBank1SetMultiPacketSize(ep_t ep, uint16_t s) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.MULTI_PACKET_SIZE = s; } + + inline void epBank0SetAddress(ep_t ep, void *addr) { EP[ep].DeviceDescBank[0].ADDR.reg = (uint32_t)addr; } + inline void epBank1SetAddress(ep_t ep, void *addr) { EP[ep].DeviceDescBank[1].ADDR.reg = (uint32_t)addr; } + inline void epBank0SetSize(ep_t ep, uint16_t size) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.SIZE = EP_PCKSIZE_SIZE(size); } + inline void epBank1SetSize(ep_t ep, uint16_t size) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.SIZE = EP_PCKSIZE_SIZE(size); } + inline uint8_t EP_PCKSIZE_SIZE(uint16_t size) { + switch (size) { + case 8: return 0; + case 16: return 1; + case 32: return 2; + case 64: return 3; + case 128: return 4; + case 256: return 5; + case 512: return 6; + case 1023: return 7; + default: return 0; + } + } + + inline void epBank0DisableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.AUTO_ZLP = 0; } + inline void epBank1DisableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.AUTO_ZLP = 0; } + inline void epBank0EnableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.AUTO_ZLP = 1; } + inline void epBank1EnableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.AUTO_ZLP = 1; } + +private: + // USB Device registers + UsbDevice &usb; + + // Endpoints descriptors table + __attribute__((__aligned__(4))) UsbDeviceDescriptor EP[USB_EPT_NUM]; +}; + +/* + * Synchronization primitives. + * TODO: Move into a separate header file and make an API out of it + */ + +class __Guard { +public: + __Guard() : primask(__get_PRIMASK()), loops(1) { + __disable_irq(); + } + ~__Guard() { + if (primask == 0) { + __enable_irq(); + // http://infocenter.arm.com/help/topic/com.arm.doc.dai0321a/BIHBFEIB.html + __ISB(); + } + } + uint32_t enter() { return loops--; } +private: + uint32_t primask; + uint32_t loops; +}; + +#define synchronized for (__Guard __guard; __guard.enter(); ) + +/* + * USB EP generic handlers. + */ + +class EPHandler { +public: + virtual void handleEndpoint() = 0; + virtual uint32_t recv(void *_data, uint32_t len) = 0; + virtual uint32_t available() const = 0; + + virtual void init() = 0; +}; + +class DoubleBufferedEPOutHandler : public EPHandler { +public: + DoubleBufferedEPOutHandler(USBDevice_SAMD21G18x &usbDev, uint32_t endPoint, uint32_t bufferSize) : + usbd(usbDev), + ep(endPoint), size(bufferSize), + current(0), incoming(0), + first0(0), last0(0), ready0(false), + first1(0), last1(0), ready1(false), + notify(false) + { + data0 = reinterpret_cast(malloc(size)); + data1 = reinterpret_cast(malloc(size)); + + usbd.epBank0SetSize(ep, 64); + usbd.epBank0SetType(ep, 3); // BULK OUT + + usbd.epBank0SetAddress(ep, const_cast(data0)); + + release(); + } + + ~DoubleBufferedEPOutHandler() { + free((void*)data0); + free((void*)data1); + } + void init() {}; + + virtual uint32_t recv(void *_data, uint32_t len) + { + uint8_t *data = reinterpret_cast(_data); + + // R/W: current, first0/1, ready0/1, notify + // R : last0/1, data0/1 + if (current == 0) { + synchronized { + if (!ready0) { + return 0; + } + } + // when ready0==true the buffer is not being filled and last0 is constant + uint32_t i; + for (i=0; i(data1)); + synchronized { + ready0 = true; + if (ready1) { + notify = true; + return; + } + notify = false; + } + } + } else { + last1 = usbd.epBank0ByteCount(ep); + if (last1 != 0) { + incoming = 0; + usbd.epBank0SetAddress(ep, const_cast(data0)); + synchronized { + ready1 = true; + if (ready0) { + notify = true; + return; + } + notify = false; + } + } + } + release(); + } + } + + // Returns how many bytes are stored in the buffers + virtual uint32_t available() const { + if (current == 0) { + bool ready = false; + synchronized { + ready = ready0; + } + return ready ? (last0 - first0) : 0; + } else { + bool ready = false; + synchronized { + ready = ready1; + } + return ready ? (last1 - first1) : 0; + } + } + + void release() { + // Release OUT EP + usbd.epBank0EnableTransferComplete(ep); + usbd.epBank0SetMultiPacketSize(ep, size); + usbd.epBank0SetByteCount(ep, 0); + usbd.epBank0ResetReady(ep); + } + +private: + USBDevice_SAMD21G18x &usbd; + + const uint32_t ep; + const uint32_t size; + uint32_t current, incoming; + + volatile uint8_t *data0; + uint32_t first0; + volatile uint32_t last0; + volatile bool ready0; + + volatile uint8_t *data1; + uint32_t first1; + volatile uint32_t last1; + volatile bool ready1; + + volatile bool notify; +}; diff --git a/sparkfun/samd/cores/arduino51/USB/SAMR21_USBDevice.h b/sparkfun/samd/cores/arduino51/USB/SAMR21_USBDevice.h new file mode 100644 index 00000000..1da5579a --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/SAMR21_USBDevice.h @@ -0,0 +1,197 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +#include +#include +#include + +typedef uint8_t ep_t; + +class USBDevice_SAMR21G18x { +public: + USBDevice_SAMR21G18x() : usb(USB->DEVICE) { + // Empty + } + + // USB Device function mapping + // --------------------------- + + // Reset USB Device + void reset(); + + // Enable + inline void enable() { usb.CTRLA.bit.ENABLE = 1; } + inline void disable() { usb.CTRLA.bit.ENABLE = 0; } + + // USB mode (device/host) + inline void setUSBDeviceMode() { usb.CTRLA.bit.MODE = USB_CTRLA_MODE_DEVICE_Val; } + inline void setUSBHostMode() { usb.CTRLA.bit.MODE = USB_CTRLA_MODE_HOST_Val; } + + inline void runInStandby() { usb.CTRLA.bit.RUNSTDBY = 1; } + inline void noRunInStandby() { usb.CTRLA.bit.RUNSTDBY = 0; } + + // USB speed + inline void setFullSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_FS_Val; } + inline void setLowSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_LS_Val; } + inline void setHiSpeed() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_HS_Val; } + inline void setHiSpeedTestMode() { usb.CTRLB.bit.SPDCONF = USB_DEVICE_CTRLB_SPDCONF_HSTM_Val; } + + // Authorize attach if Vbus is present + inline void attach() { usb.CTRLB.bit.DETACH = 0; } + inline void detach() { usb.CTRLB.bit.DETACH = 1; } + + // USB Interrupts + inline bool isEndOfResetInterrupt() { return usb.INTFLAG.bit.EORST; } + inline void ackEndOfResetInterrupt() { usb.INTFLAG.reg = USB_DEVICE_INTFLAG_EORST; } + inline void enableEndOfResetInterrupt() { usb.INTENSET.bit.EORST = 1; } + inline void disableEndOfResetInterrupt() { usb.INTENCLR.bit.EORST = 1; } + + inline bool isStartOfFrameInterrupt() { return usb.INTFLAG.bit.SOF; } + inline void ackStartOfFrameInterrupt() { usb.INTFLAG.reg = USB_DEVICE_INTFLAG_SOF; } + inline void enableStartOfFrameInterrupt() { usb.INTENSET.bit.SOF = 1; } + inline void disableStartOfFrameInterrupt() { usb.INTENCLR.bit.SOF = 1; } + + // USB Address + inline void setAddress(uint32_t addr) { usb.DADD.bit.DADD = addr; usb.DADD.bit.ADDEN = 1; } + inline void unsetAddress() { usb.DADD.bit.DADD = 0; usb.DADD.bit.ADDEN = 0; } + + // Frame number + inline uint16_t frameNumber() { return usb.FNUM.bit.FNUM; } + + // Load calibration values + void calibrate(); + + // USB Device Endpoints function mapping + // ------------------------------------- + + // Config + inline void epBank0SetType(ep_t ep, uint8_t type) { usb.DeviceEndpoint[ep].EPCFG.bit.EPTYPE0 = type; } + inline void epBank1SetType(ep_t ep, uint8_t type) { usb.DeviceEndpoint[ep].EPCFG.bit.EPTYPE1 = type; } + + // Interrupts + inline uint16_t epInterruptSummary() { return usb.EPINTSMRY.reg; } + + inline bool epBank0IsSetupReceived(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.RXSTP; } + inline bool epBank0IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL0; } + inline bool epBank1IsStalled(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.STALL1; } + inline bool epBank0IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT0; } + inline bool epBank1IsTransferComplete(ep_t ep) { return usb.DeviceEndpoint[ep].EPINTFLAG.bit.TRCPT1; } + + inline void epBank0AckSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_RXSTP; } + inline void epBank0AckStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL(1); } + inline void epBank1AckStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_STALL(2); } + inline void epBank0AckTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT(1); } + inline void epBank1AckTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTFLAG.reg = USB_DEVICE_EPINTFLAG_TRCPT(2); } + + inline void epBank0EnableSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.RXSTP = 1; } + inline void epBank0EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL0 = 1; } + inline void epBank1EnableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.STALL1 = 1; } + inline void epBank0EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT0 = 1; } + inline void epBank1EnableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENSET.bit.TRCPT1 = 1; } + + inline void epBank0DisableSetupReceived(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.RXSTP = 1; } + inline void epBank0DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL0 = 1; } + inline void epBank1DisableStalled(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.STALL1 = 1; } + inline void epBank0DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT0 = 1; } + inline void epBank1DisableTransferComplete(ep_t ep) { usb.DeviceEndpoint[ep].EPINTENCLR.bit.TRCPT1 = 1; } + + // Status + inline bool epBank0IsReady(ep_t ep) { return usb.DeviceEndpoint[ep].EPSTATUS.bit.BK0RDY; } + inline bool epBank1IsReady(ep_t ep) { return usb.DeviceEndpoint[ep].EPSTATUS.bit.BK1RDY; } + inline void epBank0SetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.BK0RDY = 1; } + inline void epBank1SetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.BK1RDY = 1; } + inline void epBank0ResetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.BK0RDY = 1; } + inline void epBank1ResetReady(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.BK1RDY = 1; } + + inline void epBank0SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ0 = 1; } + inline void epBank1SetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSSET.bit.STALLRQ1 = 1; } + inline void epBank0ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ0 = 1; } + inline void epBank1ResetStallReq(ep_t ep) { usb.DeviceEndpoint[ep].EPSTATUSCLR.bit.STALLRQ1 = 1; } + + // Packet + inline uint16_t epBank0ByteCount(ep_t ep) { return EP[ep].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT; } + inline uint16_t epBank1ByteCount(ep_t ep) { return EP[ep].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT; } + inline void epBank0SetByteCount(ep_t ep, uint16_t bc) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.BYTE_COUNT = bc; } + inline void epBank1SetByteCount(ep_t ep, uint16_t bc) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.BYTE_COUNT = bc; } + inline void epBank0SetMultiPacketSize(ep_t ep, uint16_t s) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = s; } + inline void epBank1SetMultiPacketSize(ep_t ep, uint16_t s) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.MULTI_PACKET_SIZE = s; } + + inline void epBank0SetAddress(ep_t ep, void *addr) { EP[ep].DeviceDescBank[0].ADDR.reg = (uint32_t)addr; } + inline void epBank1SetAddress(ep_t ep, void *addr) { EP[ep].DeviceDescBank[1].ADDR.reg = (uint32_t)addr; } + inline void epBank0SetSize(ep_t ep, uint16_t size) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.SIZE = EP_PCKSIZE_SIZE(size); } + inline void epBank1SetSize(ep_t ep, uint16_t size) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.SIZE = EP_PCKSIZE_SIZE(size); } + inline uint8_t EP_PCKSIZE_SIZE(uint16_t size) { + switch (size) { + case 8: return 0; + case 16: return 1; + case 32: return 2; + case 64: return 3; + case 128: return 4; + case 256: return 5; + case 512: return 6; + case 1023: return 7; + default: return 0; + } + } + + inline void epBank0DisableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.AUTO_ZLP = 0; } + inline void epBank1DisableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.AUTO_ZLP = 0; } + inline void epBank0EnableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[0].PCKSIZE.bit.AUTO_ZLP = 1; } + inline void epBank1EnableAutoZLP(ep_t ep) { EP[ep].DeviceDescBank[1].PCKSIZE.bit.AUTO_ZLP = 1; } + +private: + // USB Device registers + UsbDevice &usb; + + // Endpoints descriptors table + __attribute__((__aligned__(4))) UsbDeviceDescriptor EP[USB_EPT_NUM]; +}; + +void USBDevice_SAMR21G18x::reset() { + usb.CTRLA.bit.SWRST = 1; + memset(EP, 0, sizeof(EP)); + while (usb.SYNCBUSY.bit.SWRST) {} + usb.DESCADD.reg = (uint32_t)(&EP); +} + +void USBDevice_SAMR21G18x::calibrate() { + // Load Pad Calibration data from non-volatile memory + uint32_t *pad_transn_p = (uint32_t *) USB_FUSES_TRANSN_ADDR; + uint32_t *pad_transp_p = (uint32_t *) USB_FUSES_TRANSP_ADDR; + uint32_t *pad_trim_p = (uint32_t *) USB_FUSES_TRIM_ADDR; + + uint32_t pad_transn = (*pad_transn_p & USB_FUSES_TRANSN_Msk) >> USB_FUSES_TRANSN_Pos; + uint32_t pad_transp = (*pad_transp_p & USB_FUSES_TRANSP_Msk) >> USB_FUSES_TRANSP_Pos; + uint32_t pad_trim = (*pad_trim_p & USB_FUSES_TRIM_Msk ) >> USB_FUSES_TRIM_Pos; + + if (pad_transn == 0x1F) // maximum value (31) + pad_transn = 5; + if (pad_transp == 0x1F) // maximum value (31) + pad_transp = 29; + if (pad_trim == 0x7) // maximum value (7) + pad_trim = 3; + + usb.PADCAL.bit.TRANSN = pad_transn; + usb.PADCAL.bit.TRANSP = pad_transp; + usb.PADCAL.bit.TRIM = pad_trim; +} + diff --git a/sparkfun/samd/cores/arduino51/USB/USBAPI.h b/sparkfun/samd/cores/arduino51/USB/USBAPI.h new file mode 100644 index 00000000..86f833d9 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/USBAPI.h @@ -0,0 +1,210 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#define HSTPIPCFG_PTYPE_BLK 1 +#define HSTPIPCFG_PTOKEN_IN 2 +#define HSTPIPCFG_PTOKEN_OUT 3 +#define HSTPIPCFG_PBK_1_BANK 4 +#define HSTPIPCFG_PTYPE_INTRPT 5 + +#define EP0 0 +#define EPX_SIZE 64 // 64 for Full Speed, EPT size max is 1024 + +#if defined __cplusplus + +#include "Stream.h" +#include "RingBuffer.h" +#ifdef __SAMR21G18A__ +#include "SAMR21_USBDevice.h" +#else +#include "SAMD21_USBDevice.h" +#endif + +//================================================================================ +// USB + +class EPHandler; + +// Low level API +typedef struct { + union { + uint8_t bmRequestType; + struct { + uint8_t direction : 5; + uint8_t type : 2; + uint8_t transferDirection : 1; + }; + }; + uint8_t bRequest; + uint8_t wValueL; + uint8_t wValueH; + uint16_t wIndex; + uint16_t wLength; +} USBSetup; + +class USBDeviceClass { +public: + USBDeviceClass() {}; + + // USB Device API + void init(); + bool attach(); + bool detach(); + void setAddress(uint32_t addr); + + bool configured(); + bool connected(); + + void standby(); + + // Setup API + bool handleClassInterfaceSetup(USBSetup &setup); + bool handleStandardSetup(USBSetup &setup); + bool sendDescriptor(USBSetup &setup); + + // Control EndPoint API + uint32_t sendControl(const void *data, uint32_t len); + uint32_t sendControl(int /* ep */, const void *data, uint32_t len) { return sendControl(data, len); } + uint32_t recvControl(void *data, uint32_t len); + uint32_t sendConfiguration(uint32_t maxlen); + bool sendStringDescriptor(const uint8_t *string, uint8_t maxlen); + void initControl(int end); + uint8_t SendInterfaces(uint32_t* total); + void packMessages(bool val); + + // Generic EndPoint API + void initEndpoints(void); + void initEP(uint32_t ep, uint32_t type); + void setHandler(uint32_t ep, EPHandler *handler); + void handleEndpoint(uint8_t ep); + + uint32_t send(uint32_t ep, const void *data, uint32_t len); + void sendZlp(uint32_t ep); + uint32_t recv(uint32_t ep, void *data, uint32_t len); + int recv(uint32_t ep); + uint32_t available(uint32_t ep); + void flush(uint32_t ep); + void stall(uint32_t ep); + + // private? + uint32_t armSend(uint32_t ep, const void *data, uint32_t len); + uint8_t armRecv(uint32_t ep); + uint8_t armRecvCtrlOUT(uint32_t ep); + + void ISRHandler(); + +private: + bool initialized; +}; + +extern USBDeviceClass USBDevice; + +//================================================================================ +// Serial over CDC (Serial1 is the physical port) + +class Serial_ : public Stream +{ +public: + Serial_(USBDeviceClass &_usb) : usb(_usb), stalled(false) { } + void begin(uint32_t baud_count); + void begin(unsigned long, uint8_t); + void end(void); + + virtual int available(void); + virtual int availableForWrite(void); + virtual int peek(void); + virtual int read(void); + virtual void flush(void); + virtual size_t write(uint8_t); + virtual size_t write(const uint8_t *buffer, size_t size); + using Print::write; // pull in write(str) from Print + operator bool(); + + size_t readBytes(char *buffer, size_t length); + + // This method allows processing "SEND_BREAK" requests sent by + // the USB host. Those requests indicate that the host wants to + // send a BREAK signal and are accompanied by a single uint16_t + // value, specifying the duration of the break. The value 0 + // means to end any current break, while the value 0xffff means + // to start an indefinite break. + // readBreak() will return the value of the most recent break + // request, but will return it at most once, returning -1 when + // readBreak() is called again (until another break request is + // received, which is again returned once). + // This also mean that if two break requests are received + // without readBreak() being called in between, the value of the + // first request is lost. + // Note that the value returned is a long, so it can return + // 0-0xffff as well as -1. + int32_t readBreak(); + + // These return the settings specified by the USB host for the + // serial port. These aren't really used, but are offered here + // in case a sketch wants to act on these settings. + uint32_t baud(); + uint8_t stopbits(); + uint8_t paritytype(); + uint8_t numbits(); + bool dtr(); + bool rts(); + enum { + ONE_STOP_BIT = 0, + ONE_AND_HALF_STOP_BIT = 1, + TWO_STOP_BITS = 2, + }; + enum { + NO_PARITY = 0, + ODD_PARITY = 1, + EVEN_PARITY = 2, + MARK_PARITY = 3, + SPACE_PARITY = 4, + }; + +private: + int availableForStore(void); + + USBDeviceClass &usb; + RingBuffer *_cdc_rx_buffer; + bool stalled; +}; +extern Serial_ Serial; + +//================================================================================ +//================================================================================ +// MSC 'Driver' + +uint32_t MSC_GetInterface(uint8_t* interfaceNum); +uint32_t MSC_GetDescriptor(uint32_t i); +bool MSC_Setup(USBSetup& setup); +bool MSC_Data(uint8_t rx,uint8_t tx); + +//================================================================================ +//================================================================================ +// CDC 'Driver' + +int CDC_GetInterface(uint8_t* interfaceNum); +const void* _CDC_GetInterface(void); +uint32_t _CDC_GetInterfaceLength(void); +uint32_t CDC_GetOtherInterface(uint8_t* interfaceNum); +uint32_t CDC_GetDescriptor(uint32_t i); +bool CDC_Setup(USBSetup& setup); + +#endif // __cplusplus diff --git a/sparkfun/samd/cores/arduino51/USB/USBCore.cpp b/sparkfun/samd/cores/arduino51/USB/USBCore.cpp new file mode 100644 index 00000000..301460d4 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/USBCore.cpp @@ -0,0 +1,1034 @@ +/* + Copyright (c) 2016 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#if defined(USBCON) + +#include + +// there are ~slight~ CMSIS differences :/ +#ifdef __SAMR21G18A__ + #include "SAMR21_USBDevice.h" +#else + #include "SAMD21_USBDevice.h" +#endif + +#include "PluggableUSB.h" + +#include +#include +#include +#include + +#ifdef __SAMR21G18A__ +USBDevice_SAMR21G18x usbd; +#else +USBDevice_SAMD21G18x usbd; +#endif + + +/** Pulse generation counters to keep track of the number of milliseconds remaining for each pulse type */ +#define TX_RX_LED_PULSE_MS 100 +#ifdef PIN_LED_TXL +static volatile uint8_t txLEDPulse; /**< Milliseconds remaining for data Tx LED pulse */ +#endif +#ifdef PIN_LED_RXL +static volatile uint8_t rxLEDPulse; /**< Milliseconds remaining for data Rx LED pulse */ +#endif +static char isRemoteWakeUpEnabled = 0; +static char isEndpointHalt = 0; + +extern void (*gpf_isr)(void); + +// USB_Handler ISR +extern "C" void UDD_Handler(void) { + USBDevice.ISRHandler(); +} + +const uint16_t STRING_LANGUAGE[2] = { + (3<<8) | (2+2), + 0x0409 // English +}; + +#ifndef USB_PRODUCT +// If no product is provided, use USB IO Board +#define USB_PRODUCT "USB IO Board" +#endif + +const uint8_t STRING_PRODUCT[] = USB_PRODUCT; + +#if USB_VID == 0x2341 +# if defined(USB_MANUFACTURER) +# undef USB_MANUFACTURER +# endif +# define USB_MANUFACTURER "Arduino LLC" +#elif !defined(USB_MANUFACTURER) +// Fall through to unknown if no manufacturer name was provided in a macro +# define USB_MANUFACTURER "Unknown" +#endif + +const uint8_t STRING_MANUFACTURER[] = USB_MANUFACTURER; + + +// DEVICE DESCRIPTOR +const DeviceDescriptor USB_DeviceDescriptorB = D_DEVICE(0xEF, 0x02, 0x01, 64, USB_VID, USB_PID, 0x100, IMANUFACTURER, IPRODUCT, ISERIAL, 1); +const DeviceDescriptor USB_DeviceDescriptor = D_DEVICE(0x00, 0x00, 0x00, 64, USB_VID, USB_PID, 0x100, IMANUFACTURER, IPRODUCT, ISERIAL, 1); + +//================================================================== + +volatile uint32_t _usbConfiguration = 0; +volatile uint32_t _usbSetInterface = 0; + +static __attribute__((__aligned__(4))) //__attribute__((__section__(".bss_hram0"))) +uint8_t udd_ep_out_cache_buffer[7][64]; + +static __attribute__((__aligned__(4))) //__attribute__((__section__(".bss_hram0"))) +uint8_t udd_ep_in_cache_buffer[7][64]; + +// Some EP are handled using EPHanlders. +// Possibly all the sparse EP handling subroutines will be +// converted into reusable EPHandlers in the future. +static EPHandler *epHandlers[7] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL}; + +//================================================================== + +// Send a USB descriptor string. The string is stored as a +// plain ASCII string but is sent out as UTF-16 with the +// correct 2-byte prefix +bool USBDeviceClass::sendStringDescriptor(const uint8_t *string, uint8_t maxlen) +{ + if (maxlen < 2) + return false; + + uint8_t buffer[maxlen]; + buffer[0] = strlen((const char*)string) * 2 + 2; + buffer[1] = 0x03; + + uint8_t i; + for (i = 2; i < maxlen && *string; i++) { + buffer[i++] = *string++; + if (i == maxlen) break; + buffer[i] = 0; + } + + return USBDevice.sendControl(buffer, i); +} + +bool _dry_run = false; +bool _pack_message = false; +uint16_t _pack_size = 0; +uint8_t _pack_buffer[256]; + +void USBDeviceClass::packMessages(bool val) +{ + if (val) { + _pack_message = true; + _pack_size = 0; + } else { + _pack_message = false; + sendControl(_pack_buffer, _pack_size); + } +} + +uint8_t USBDeviceClass::SendInterfaces(uint32_t* total) +{ + uint8_t interfaces = 0; + +#if defined(CDC_ENABLED) + total[0] += CDC_GetInterface(&interfaces); +#endif + +#ifdef PLUGGABLE_USB_ENABLED + total[0] += PluggableUSB().getInterface(&interfaces); +#endif + + return interfaces; +} + +// Construct a dynamic configuration descriptor +// This really needs dynamic endpoint allocation etc +uint32_t USBDeviceClass::sendConfiguration(uint32_t maxlen) +{ + uint32_t total = 0; + // Count and measure interfaces + _dry_run = true; + uint8_t interfaces = SendInterfaces(&total); + + _Pragma("pack(1)") + ConfigDescriptor config = D_CONFIG((uint16_t)(total + sizeof(ConfigDescriptor)), interfaces); + _Pragma("pack()") + + // Now send them + _dry_run = false; + + if (maxlen == sizeof(ConfigDescriptor)) { + sendControl(&config, sizeof(ConfigDescriptor)); + return true; + } + + total = 0; + + packMessages(true); + sendControl(&config, sizeof(ConfigDescriptor)); + SendInterfaces(&total); + packMessages(false); + + return true; +} + +static void utox8(uint32_t val, char* s) { + for (int i = 0; i < 8; i++) { + int d = val & 0XF; + val = (val >> 4); + + s[7 - i] = d > 9 ? 'A' + d - 10 : '0' + d; + } +} + +bool USBDeviceClass::sendDescriptor(USBSetup &setup) +{ + uint8_t t = setup.wValueH; + uint8_t desc_length = 0; + bool _cdcComposite; + int ret; + const uint8_t *desc_addr = 0; + + if (t == USB_CONFIGURATION_DESCRIPTOR_TYPE) + { + return USBDevice.sendConfiguration(setup.wLength); + } + +#ifdef PLUGGABLE_USB_ENABLED + ret = PluggableUSB().getDescriptor(setup); + if (ret != 0) { + return (ret > 0 ? true : false); + } +#endif + + if (t == USB_DEVICE_DESCRIPTOR_TYPE) + { + if (setup.wLength == 8) + _cdcComposite = 1; + + desc_addr = _cdcComposite ? (const uint8_t*)&USB_DeviceDescriptorB : (const uint8_t*)&USB_DeviceDescriptor; + + if (*desc_addr > setup.wLength) { + desc_length = setup.wLength; + } + } + else if (USB_STRING_DESCRIPTOR_TYPE == t) + { + if (setup.wValueL == 0) { + desc_addr = (const uint8_t*)&STRING_LANGUAGE; + } + else if (setup.wValueL == IPRODUCT) { + return sendStringDescriptor(STRING_PRODUCT, setup.wLength); + } + else if (setup.wValueL == IMANUFACTURER) { + return sendStringDescriptor(STRING_MANUFACTURER, setup.wLength); + } + else if (setup.wValueL == ISERIAL) { +#ifdef PLUGGABLE_USB_ENABLED +#if defined(__SAMD51__) + char name[ISERIAL_MAX_LEN]; + PluggableUSB().getShortName(name); + return sendStringDescriptor((uint8_t*)name, setup.wLength); +#else + // from section 9.3.3 of the datasheet + #define SERIAL_NUMBER_WORD_0 *(volatile uint32_t*)(0x0080A00C) + #define SERIAL_NUMBER_WORD_1 *(volatile uint32_t*)(0x0080A040) + #define SERIAL_NUMBER_WORD_2 *(volatile uint32_t*)(0x0080A044) + #define SERIAL_NUMBER_WORD_3 *(volatile uint32_t*)(0x0080A048) + + char name[ISERIAL_MAX_LEN]; + utox8(SERIAL_NUMBER_WORD_0, &name[0]); + utox8(SERIAL_NUMBER_WORD_1, &name[8]); + utox8(SERIAL_NUMBER_WORD_2, &name[16]); + utox8(SERIAL_NUMBER_WORD_3, &name[24]); + + PluggableUSB().getShortName(&name[32]); + return sendStringDescriptor((uint8_t*)name, setup.wLength); +#endif +#endif + } + else { + return false; + } + if (*desc_addr > setup.wLength) { + desc_length = setup.wLength; + } + } + else + { + } + + if (desc_addr == 0) { + return false; + } + + if (desc_length == 0) { + desc_length = *desc_addr; + } + + sendControl(desc_addr, desc_length); + + return true; +} + +void USBDeviceClass::standby() { + usbd.noRunInStandby(); +} + + +void USBDeviceClass::handleEndpoint(uint8_t ep) +{ +#if defined(CDC_ENABLED) + if (ep == CDC_ENDPOINT_IN) + { + // NAK on endpoint IN, the bank is not yet filled in. + usbd.epBank1ResetReady(CDC_ENDPOINT_IN); + usbd.epBank1AckTransferComplete(CDC_ENDPOINT_IN); + } + if (ep == CDC_ENDPOINT_ACM) + { + // NAK on endpoint IN, the bank is not yet filled in. + usbd.epBank1ResetReady(CDC_ENDPOINT_ACM); + usbd.epBank1AckTransferComplete(CDC_ENDPOINT_ACM); + } +#endif + +#if defined(PLUGGABLE_USB_ENABLED) + // Empty +#endif +} + +void USBDeviceClass::init() +{ +#ifdef PIN_LED_TXL + txLEDPulse = 0; + pinMode(PIN_LED_TXL, OUTPUT); + digitalWrite(PIN_LED_TXL, HIGH); +#endif + +#ifdef PIN_LED_RXL + rxLEDPulse = 0; + pinMode(PIN_LED_RXL, OUTPUT); + digitalWrite(PIN_LED_RXL, HIGH); +#endif + + /* Enable USB clock */ +#if defined(__SAMD51__) + MCLK->APBBMASK.reg |= MCLK_APBBMASK_USB; + MCLK->AHBMASK.reg |= MCLK_AHBMASK_USB; + + // Set up the USB DP/DN pins + PORT->Group[0].PINCFG[PIN_PA24H_USB_DM].bit.PMUXEN = 1; + PORT->Group[0].PMUX[PIN_PA24H_USB_DM/2].reg &= ~(0xF << (4 * (PIN_PA24H_USB_DM & 0x01u))); + PORT->Group[0].PMUX[PIN_PA24H_USB_DM/2].reg |= MUX_PA24H_USB_DM << (4 * (PIN_PA24H_USB_DM & 0x01u)); + PORT->Group[0].PINCFG[PIN_PA25H_USB_DP].bit.PMUXEN = 1; + PORT->Group[0].PMUX[PIN_PA25H_USB_DP/2].reg &= ~(0xF << (4 * (PIN_PA25H_USB_DP & 0x01u))); + PORT->Group[0].PMUX[PIN_PA25H_USB_DP/2].reg |= MUX_PA25H_USB_DP << (4 * (PIN_PA25H_USB_DP & 0x01u)); + + + GCLK->PCHCTRL[USB_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); +#else + PM->APBBMASK.reg |= PM_APBBMASK_USB; + + // Set up the USB DP/DN pins + PORT->Group[0].PINCFG[PIN_PA24G_USB_DM].bit.PMUXEN = 1; + PORT->Group[0].PMUX[PIN_PA24G_USB_DM/2].reg &= ~(0xF << (4 * (PIN_PA24G_USB_DM & 0x01u))); + PORT->Group[0].PMUX[PIN_PA24G_USB_DM/2].reg |= MUX_PA24G_USB_DM << (4 * (PIN_PA24G_USB_DM & 0x01u)); + PORT->Group[0].PINCFG[PIN_PA25G_USB_DP].bit.PMUXEN = 1; + PORT->Group[0].PMUX[PIN_PA25G_USB_DP/2].reg &= ~(0xF << (4 * (PIN_PA25G_USB_DP & 0x01u))); + PORT->Group[0].PMUX[PIN_PA25G_USB_DP/2].reg |= MUX_PA25G_USB_DP << (4 * (PIN_PA25G_USB_DP & 0x01u)); + + // Put Generic Clock Generator 0 as source for Generic Clock Multiplexer 6 (USB reference) + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(6) | // Generic Clock Multiplexer 6 + GCLK_CLKCTRL_GEN_GCLK0 | // Generic Clock Generator 0 is source + GCLK_CLKCTRL_CLKEN; + while (GCLK->STATUS.bit.SYNCBUSY) + ; +#endif + + USB_SetHandler(&UDD_Handler); + + // Reset USB Device + usbd.reset(); + + usbd.calibrate(); + usbd.setUSBDeviceMode(); + usbd.runInStandby(); + usbd.setFullSpeed(); + + // Configure interrupts +#if defined(__SAMD51__) + /* Attach to the USB host */ + NVIC_SetPriority(USB_0_IRQn, 0UL); + NVIC_SetPriority(USB_1_IRQn, 0UL); + NVIC_SetPriority(USB_2_IRQn, 0UL); + NVIC_SetPriority(USB_3_IRQn, 0UL); + NVIC_EnableIRQ(USB_0_IRQn); + NVIC_EnableIRQ(USB_1_IRQn); + NVIC_EnableIRQ(USB_2_IRQn); + NVIC_EnableIRQ(USB_3_IRQn); +#else + NVIC_SetPriority((IRQn_Type) USB_IRQn, 0UL); + NVIC_EnableIRQ((IRQn_Type) USB_IRQn); +#endif + + usbd.enable(); + + initialized = true; +} + +bool USBDeviceClass::attach() +{ + if (!initialized) + return false; + + usbd.attach(); + + usbd.enableEndOfResetInterrupt(); + usbd.enableStartOfFrameInterrupt(); + + _usbConfiguration = 0; + return true; +} + +void USBDeviceClass::setAddress(uint32_t addr) +{ + usbd.epBank1SetByteCount(0, 0); + usbd.epBank1AckTransferComplete(0); + + // RAM buffer is full, we can send data (IN) + usbd.epBank1SetReady(0); + + // Wait for transfer to complete + while (!usbd.epBank1IsTransferComplete(0)) {} + + // Set USB address to addr + USB->DEVICE.DADD.bit.DADD = addr; // Address + USB->DEVICE.DADD.bit.ADDEN = 1; // Enable +} + +bool USBDeviceClass::detach() +{ + if (!initialized) + return false; + usbd.detach(); + return true; +} + +bool USBDeviceClass::configured() +{ + return _usbConfiguration != 0; +} + +bool USBDeviceClass::handleClassInterfaceSetup(USBSetup& setup) +{ + uint8_t i = setup.wIndex; + + #if defined(CDC_ENABLED) + if (CDC_ACM_INTERFACE == i) + { + if (CDC_Setup(setup) == false) { + sendZlp(0); + } + return true; + } + #endif + + #if defined(PLUGGABLE_USB_ENABLED) + bool ret = PluggableUSB().setup(setup); + if ( ret == false) { + sendZlp(0); + } + return ret; + #endif + + return false; +} + +uint32_t EndPoints[] = +{ + USB_ENDPOINT_TYPE_CONTROL, + +#ifdef CDC_ENABLED + USB_ENDPOINT_TYPE_INTERRUPT | USB_ENDPOINT_IN(0), // CDC_ENDPOINT_ACM + USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_OUT(0), // CDC_ENDPOINT_OUT + USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_IN(0), // CDC_ENDPOINT_IN +#endif + +#ifdef PLUGGABLE_USB_ENABLED + //allocate 6 endpoints and remove const so they can be changed by the user + 0, + 0, + 0, + 0, + 0, + 0, +#endif +}; + +void USBDeviceClass::initEndpoints() { + for (uint8_t i = 1; i < sizeof(EndPoints) && EndPoints[i] != 0; i++) { + initEP(i, EndPoints[i]); + } +} + +void USBDeviceClass::initEP(uint32_t ep, uint32_t config) +{ + if (config == (USB_ENDPOINT_TYPE_INTERRUPT | USB_ENDPOINT_IN(0))) + { + usbd.epBank1SetSize(ep, 64); + usbd.epBank1SetAddress(ep, &udd_ep_in_cache_buffer[ep]); + usbd.epBank1SetType(ep, 4); // INTERRUPT IN + } + else if (config == (USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_OUT(0))) + { + if (epHandlers[ep] != NULL) { + delete (DoubleBufferedEPOutHandler*)epHandlers[ep]; + } + epHandlers[ep] = new DoubleBufferedEPOutHandler(usbd, ep, 256); + } + else if (config == (USB_ENDPOINT_TYPE_INTERRUPT | USB_ENDPOINT_OUT(0))) + { + if(epHandlers[ep]){ + epHandlers[ep]->init(); + } + } + else if (config == (USB_ENDPOINT_TYPE_BULK | USB_ENDPOINT_IN(0))) + { + usbd.epBank1SetSize(ep, 64); + usbd.epBank1SetAddress(ep, &udd_ep_in_cache_buffer[ep]); + + // NAK on endpoint IN, the bank is not yet filled in. + usbd.epBank1ResetReady(ep); + + usbd.epBank1SetType(ep, 3); // BULK IN + } + else if (config == USB_ENDPOINT_TYPE_CONTROL) + { + // Setup Control OUT + usbd.epBank0SetSize(ep, 64); + usbd.epBank0SetAddress(ep, &udd_ep_out_cache_buffer[ep]); + usbd.epBank0SetType(ep, 1); // CONTROL OUT / SETUP + + // Setup Control IN + usbd.epBank1SetSize(ep, 64); + usbd.epBank1SetAddress(ep, &udd_ep_in_cache_buffer[0]); + usbd.epBank1SetType(ep, 1); // CONTROL IN + + // Release OUT EP + usbd.epBank0SetMultiPacketSize(ep, 64); + usbd.epBank0SetByteCount(ep, 0); + + // NAK on endpoint OUT, the bank is full. + usbd.epBank0SetReady(ep); + } +} + +void USBDeviceClass::setHandler(uint32_t ep, EPHandler *handler) { + epHandlers[ep] = handler; +} + +void USBDeviceClass::flush(uint32_t ep) +{ + if (available(ep)) { + // RAM buffer is full, we can send data (IN) + usbd.epBank1SetReady(ep); + + // Clear the transfer complete flag + usbd.epBank1AckTransferComplete(ep); + } +} + +void USBDeviceClass::stall(uint32_t ep) +{ + // TODO: test + // TODO: use .bit. notation + + // Stall endpoint + USB->DEVICE.DeviceEndpoint[ep].EPSTATUSSET.reg = USB_DEVICE_EPSTATUSSET_STALLRQ(2); +} + +bool USBDeviceClass::connected() +{ + // Count frame numbers + uint8_t f = USB->DEVICE.FNUM.bit.FNUM; + //delay(3); + return f != USB->DEVICE.FNUM.bit.FNUM; +} + + +uint32_t USBDeviceClass::recvControl(void *_data, uint32_t len) +{ + uint8_t *data = reinterpret_cast(_data); + + // The RAM Buffer is empty: we can receive data + usbd.epBank0ResetReady(0); + + //usbd.epBank0AckSetupReceived(0); + uint32_t read = armRecvCtrlOUT(0); + if (read > len) + read = len; + //while (!usbd.epBank0AckTransferComplete(0)) {} + uint8_t *buffer = udd_ep_out_cache_buffer[0]; + for (uint32_t i=0; iavailable(); + } else { + return usbd.epBank0ByteCount(ep); + } +} + +// Non Blocking receive +// Return number of bytes read +uint32_t USBDeviceClass::recv(uint32_t ep, void *_data, uint32_t len) +{ + if (!_usbConfiguration) + return -1; + +#ifdef PIN_LED_RXL + if (rxLEDPulse == 0) + digitalWrite(PIN_LED_RXL, LOW); + + rxLEDPulse = TX_RX_LED_PULSE_MS; +#endif + + if (epHandlers[ep]) { + return epHandlers[ep]->recv(_data, len); + } + + if (available(ep) < len) + len = available(ep); + + armRecv(ep); + + usbd.epBank0DisableTransferComplete(ep); + + memcpy(_data, udd_ep_out_cache_buffer[ep], len); + + // release empty buffer + if (len && !available(ep)) { + // The RAM Buffer is empty: we can receive data + usbd.epBank0ResetReady(ep); + + // Clear Transfer complete 0 flag + usbd.epBank0AckTransferComplete(ep); + + // Enable Transfer complete 0 interrupt + usbd.epBank0EnableTransferComplete(ep); + } + + return len; +} + +// Recv 1 byte if ready +int USBDeviceClass::recv(uint32_t ep) +{ + uint8_t c; + if (recv(ep, &c, 1) != 1) { + return -1; + } else { + return c; + } +} + +uint8_t USBDeviceClass::armRecvCtrlOUT(uint32_t ep) +{ + // Get endpoint configuration from setting register + usbd.epBank0SetAddress(ep, &udd_ep_out_cache_buffer[ep]); + usbd.epBank0SetMultiPacketSize(ep, 8); + usbd.epBank0SetByteCount(ep, 0); + + usbd.epBank0ResetReady(ep); + + // Wait OUT + while (!usbd.epBank0IsReady(ep)) {} + while (!usbd.epBank0IsTransferComplete(ep)) {} + return usbd.epBank0ByteCount(ep); +} + +uint8_t USBDeviceClass::armRecv(uint32_t ep) +{ + uint16_t count = usbd.epBank0ByteCount(ep); + if (count >= 64) { + usbd.epBank0SetByteCount(ep, count - 64); + } else { + usbd.epBank0SetByteCount(ep, 0); + } + return usbd.epBank0ByteCount(ep); +} + +// Timeout for sends +#define TX_TIMEOUT_MS 70 + +static char LastTransmitTimedOut[7] = { + 0, + 0, + 0, + 0, + 0, + 0, + 0 +}; + +// Blocking Send of data to an endpoint +uint32_t USBDeviceClass::send(uint32_t ep, const void *data, uint32_t len) +{ + uint32_t written = 0; + uint32_t length = 0; + + if (!_usbConfiguration) + return -1; + if (len > 16384) + return -1; + +#ifdef PIN_LED_TXL + if (txLEDPulse == 0) + digitalWrite(PIN_LED_TXL, LOW); + + txLEDPulse = TX_RX_LED_PULSE_MS; +#endif + + // Flash area + while (len != 0) + { + if (usbd.epBank1IsReady(ep)) { + // previous transfer is still not complete + + // convert the timeout from microseconds to a number of times through + // the wait loop; it takes (roughly) 23 clock cycles per iteration. + uint32_t timeout = microsecondsToClockCycles(TX_TIMEOUT_MS * 1000) / 23; + + // Wait for (previous) transfer to complete + // inspired by Paul Stoffregen's work on Teensy + while (!usbd.epBank1IsTransferComplete(ep)) { + if (LastTransmitTimedOut[ep] || timeout-- == 0) { + LastTransmitTimedOut[ep] = 1; + + // set byte count to zero, so that ZLP is sent + // instead of stale data + usbd.epBank1SetByteCount(ep, 0); + return -1; + } + } + } + + LastTransmitTimedOut[ep] = 0; + + if (len > EPX_SIZE) { + length = EPX_SIZE; + } else { + length = len; + } + + /* memcopy could be safer in multi threaded environment */ + memcpy(&udd_ep_in_cache_buffer[ep], data, length); + + usbd.epBank1SetAddress(ep, &udd_ep_in_cache_buffer[ep]); + usbd.epBank1SetByteCount(ep, length); + + // Clear the transfer complete flag + usbd.epBank1AckTransferComplete(ep); + + // RAM buffer is full, we can send data (IN) + usbd.epBank1SetReady(ep); + + written += length; + len -= length; + data = (char *)data + length; + } + return written; +} + +uint32_t USBDeviceClass::armSend(uint32_t ep, const void* data, uint32_t len) +{ + memcpy(&udd_ep_in_cache_buffer[ep], data, len); + + // Get endpoint configuration from setting register + usbd.epBank1SetAddress(ep, &udd_ep_in_cache_buffer[ep]); + usbd.epBank1SetMultiPacketSize(ep, 0); + usbd.epBank1SetByteCount(ep, len); + + return len; +} + +uint32_t USBDeviceClass::sendControl(const void* _data, uint32_t len) +{ + const uint8_t *data = reinterpret_cast(_data); + uint32_t length = len; + uint32_t sent = 0; + uint32_t pos = 0; + + if (_dry_run == true) + return length; + + if (_pack_message == true) { + memcpy(&_pack_buffer[_pack_size], data, len); + _pack_size += len; + return length; + } + + while (len > 0) + { + sent = armSend(EP0, data + pos, len); + pos += sent; + len -= sent; + } + + return length; +} + +void USBDeviceClass::sendZlp(uint32_t ep) +{ + // Set the byte count as zero + usbd.epBank1SetByteCount(ep, 0); +} + +bool USBDeviceClass::handleStandardSetup(USBSetup &setup) +{ + switch (setup.bRequest) { + case GET_STATUS: + if (setup.bmRequestType == 0) // device + { + // Send the device status + // TODO: Check current configuration for power mode (if device is configured) + // TODO: Check if remote wake-up is enabled + uint8_t buff[] = { 0, 0 }; + armSend(0, buff, 2); + return true; + } + // if( setup.bmRequestType == 2 ) // Endpoint: + else + { + // Send the endpoint status + // Check if the endpoint if currently halted + uint8_t buff[] = { 0, 0 }; + if (isEndpointHalt == 1) + buff[0] = 1; + armSend(0, buff, 2); + return true; + } + + case CLEAR_FEATURE: + // Check which is the selected feature + if (setup.wValueL == 1) // DEVICEREMOTEWAKEUP + { + // Enable remote wake-up and send a ZLP + uint8_t buff[] = { 0, 0 }; + if (isRemoteWakeUpEnabled == 1) + buff[0] = 1; + armSend(0, buff, 2); + return true; + } + else // if( setup.wValueL == 0) // ENDPOINTHALT + { + isEndpointHalt = 0; + sendZlp(0); + return true; + } + + case SET_FEATURE: + // Check which is the selected feature + if (setup.wValueL == 1) // DEVICEREMOTEWAKEUP + { + // Enable remote wake-up and send a ZLP + isRemoteWakeUpEnabled = 1; + uint8_t buff[] = { 0 }; + armSend(0, buff, 1); + return true; + } + if (setup.wValueL == 0) // ENDPOINTHALT + { + // Halt endpoint + isEndpointHalt = 1; + sendZlp(0); + return true; + } + + case SET_ADDRESS: + setAddress(setup.wValueL); + return true; + + case GET_DESCRIPTOR: + return sendDescriptor(setup); + + case SET_DESCRIPTOR: + return false; + + case GET_CONFIGURATION: + armSend(0, (void*)&_usbConfiguration, 1); + return true; + + case SET_CONFIGURATION: + if (REQUEST_DEVICE == (setup.bmRequestType & REQUEST_RECIPIENT)) { + + initEndpoints(); + _usbConfiguration = setup.wValueL; + + #if defined(CDC_ENABLED) + // Enable interrupt for CDC reception from host (OUT packet) + usbd.epBank1EnableTransferComplete(CDC_ENDPOINT_ACM); + usbd.epBank0EnableTransferComplete(CDC_ENDPOINT_OUT); + #endif + + sendZlp(0); + return true; + } else { + return false; + } + + case GET_INTERFACE: + armSend(0, (void*)&_usbSetInterface, 1); + return true; + + case SET_INTERFACE: + _usbSetInterface = setup.wValueL; + sendZlp(0); + return true; + + default: + return true; + } +} + +void USBDeviceClass::ISRHandler() +{ + + if (_pack_message == true) { + return; + } + // End-Of-Reset + if (usbd.isEndOfResetInterrupt()) + { + // Configure EP 0 + initEP(0, USB_ENDPOINT_TYPE_CONTROL); + + // Enable Setup-Received interrupt + usbd.epBank0EnableSetupReceived(0); + + _usbConfiguration = 0; + + usbd.ackEndOfResetInterrupt(); + } + + // Start-Of-Frame + if (usbd.isStartOfFrameInterrupt()) + { + usbd.ackStartOfFrameInterrupt(); + + // check whether the one-shot period has elapsed. if so, turn off the LED +#ifdef PIN_LED_TXL + if (txLEDPulse > 0) { + txLEDPulse--; + if (txLEDPulse == 0) + digitalWrite(PIN_LED_TXL, HIGH); + } +#endif + +#ifdef PIN_LED_RXL + if (rxLEDPulse > 0) { + rxLEDPulse--; + if (rxLEDPulse == 0) + digitalWrite(PIN_LED_RXL, HIGH); + } +#endif + } + + // Endpoint 0 Received Setup interrupt + if (usbd.epBank0IsSetupReceived(0)) + { + usbd.epBank0AckSetupReceived(0); + + USBSetup *setup = reinterpret_cast(udd_ep_out_cache_buffer[0]); + + /* Clear the Bank 0 ready flag on Control OUT */ + // The RAM Buffer is empty: we can receive data + usbd.epBank0ResetReady(0); + + bool ok; + if (REQUEST_STANDARD == (setup->bmRequestType & REQUEST_TYPE)) { + // Standard Requests + ok = handleStandardSetup(*setup); + } else { + // Class Interface Requests + ok = handleClassInterfaceSetup(*setup); + } + + if (ok) { + usbd.epBank1SetReady(0); + } else { + stall(0); + } + + if (usbd.epBank1IsStalled(0)) + { + usbd.epBank1AckStalled(0); + + // Remove stall request + usbd.epBank1DisableStalled(0); + } + + } // end Received Setup handler + + uint8_t i=0; + uint8_t ept_int = usbd.epInterruptSummary() & 0xFE; // Remove endpoint number 0 (setup) + while (ept_int != 0) + { + // Check if endpoint has a pending interrupt + if ((ept_int & (1 << i)) != 0) + { + + // Endpoint Transfer Complete (0/1) Interrupt + if (usbd.epBank0IsTransferComplete(i) || + usbd.epBank1IsTransferComplete(i)) + { + if (epHandlers[i]) { + epHandlers[i]->handleEndpoint(); + } else { + handleEndpoint(i); + } + } + ept_int &= ~(1 << i); + } + i++; + if (i > USB_EPT_NUM) + break; // fire exit + } +} + +/* + * USB Device instance + * ------------------- + */ + +// USBDevice class instance +USBDeviceClass USBDevice; + +#endif diff --git a/sparkfun/samd/cores/arduino51/USB/USBCore.h b/sparkfun/samd/cores/arduino51/USB/USBCore.h new file mode 100644 index 00000000..89fe8db6 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/USBCore.h @@ -0,0 +1,291 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __USBCORE_H__ +#define __USBCORE_H__ + +// Standard requests +#define GET_STATUS 0 +#define CLEAR_FEATURE 1 +#define SET_FEATURE 3 +#define SET_ADDRESS 5 +#define GET_DESCRIPTOR 6 +#define SET_DESCRIPTOR 7 +#define GET_CONFIGURATION 8 +#define SET_CONFIGURATION 9 +#define GET_INTERFACE 10 +#define SET_INTERFACE 11 + +// bEndpointAddress in Endpoint Descriptor +#define USB_ENDPOINT_DIRECTION_MASK 0x80 +#define USB_ENDPOINT_OUT(addr) ((addr) | 0x00) +#define USB_ENDPOINT_IN(addr) ((addr) | 0x80) + +#define USB_ENDPOINTS 7 + +#define USB_ENDPOINT_TYPE_MASK 0x03 +#define USB_ENDPOINT_TYPE_CONTROL 0x00 +#define USB_ENDPOINT_TYPE_ISOCHRONOUS 0x01 +#define USB_ENDPOINT_TYPE_BULK 0x02 +#define USB_ENDPOINT_TYPE_INTERRUPT 0x03 + +// bmRequestType +#define REQUEST_HOSTTODEVICE 0x00 +#define REQUEST_DEVICETOHOST 0x80 +#define REQUEST_DIRECTION 0x80 + +#define REQUEST_STANDARD 0x00 +#define REQUEST_CLASS 0x20 +#define REQUEST_VENDOR 0x40 +#define REQUEST_TYPE 0x60 + +#define REQUEST_DEVICE 0x00 +#define REQUEST_INTERFACE 0x01 +#define REQUEST_ENDPOINT 0x02 +#define REQUEST_OTHER 0x03 +#define REQUEST_RECIPIENT 0x1F + +#define REQUEST_DEVICETOHOST_CLASS_INTERFACE (REQUEST_DEVICETOHOST | REQUEST_CLASS | REQUEST_INTERFACE) +#define REQUEST_HOSTTODEVICE_CLASS_INTERFACE (REQUEST_HOSTTODEVICE | REQUEST_CLASS | REQUEST_INTERFACE) +#define REQUEST_DEVICETOHOST_STANDARD_INTERFACE (REQUEST_DEVICETOHOST | REQUEST_STANDARD | REQUEST_INTERFACE) +// Class requests + +#define CDC_SET_LINE_CODING 0x20 +#define CDC_GET_LINE_CODING 0x21 +#define CDC_SET_CONTROL_LINE_STATE 0x22 +#define CDC_SEND_BREAK 0x23 + +#define MSC_RESET 0xFF +#define MSC_GET_MAX_LUN 0xFE + +// Descriptors + +// #define USB_DEVICE_DESC_SIZE 18 +// #define USB_CONFIGUARTION_DESC_SIZE 9 +// #define USB_INTERFACE_DESC_SIZE 9 +// #define USB_ENDPOINT_DESC_SIZE 7 + +#define USB_DEVICE_DESCRIPTOR_TYPE 1 +#define USB_CONFIGURATION_DESCRIPTOR_TYPE 2 +#define USB_STRING_DESCRIPTOR_TYPE 3 +#define USB_INTERFACE_DESCRIPTOR_TYPE 4 +#define USB_ENDPOINT_DESCRIPTOR_TYPE 5 +#define USB_DEVICE_QUALIFIER 6 +#define USB_OTHER_SPEED_CONFIGURATION 7 + +#define USB_DEVICE_CLASS_COMMUNICATIONS 0x02 +#define USB_DEVICE_CLASS_HUMAN_INTERFACE 0x03 +#define USB_DEVICE_CLASS_STORAGE 0x08 +#define USB_DEVICE_CLASS_VENDOR_SPECIFIC 0xFF + +#define USB_CONFIG_POWERED_MASK 0x40 +#define USB_CONFIG_BUS_POWERED 0x80 +#define USB_CONFIG_SELF_POWERED 0xC0 +#define USB_CONFIG_REMOTE_WAKEUP 0x20 + +// bMaxPower in Configuration Descriptor +#define USB_CONFIG_POWER_MA(mA) ((mA)/2) +#ifndef USB_CONFIG_POWER + #define USB_CONFIG_POWER (100) +#endif + +#define CDC_V1_10 0x0110 +#define CDC_COMMUNICATION_INTERFACE_CLASS 0x02 + +#define CDC_CALL_MANAGEMENT 0x01 +#define CDC_ABSTRACT_CONTROL_MODEL 0x02 +#define CDC_HEADER 0x00 +#define CDC_ABSTRACT_CONTROL_MANAGEMENT 0x02 +#define CDC_UNION 0x06 +#define CDC_CS_INTERFACE 0x24 +#define CDC_CS_ENDPOINT 0x25 +#define CDC_DATA_INTERFACE_CLASS 0x0A + +#define MSC_SUBCLASS_SCSI 0x06 +#define MSC_PROTOCOL_BULK_ONLY 0x50 + +_Pragma("pack(1)") + +// Device +typedef struct { + uint8_t len; // 18 + uint8_t dtype; // 1 USB_DEVICE_DESCRIPTOR_TYPE + uint16_t usbVersion; // 0x200 + uint8_t deviceClass; + uint8_t deviceSubClass; + uint8_t deviceProtocol; + uint8_t packetSize0; // Packet 0 + uint16_t idVendor; + uint16_t idProduct; + uint16_t deviceVersion; // 0x100 + uint8_t iManufacturer; + uint8_t iProduct; + uint8_t iSerialNumber; + uint8_t bNumConfigurations; +} DeviceDescriptor; + +// Config +typedef struct { + uint8_t len; // 9 + uint8_t dtype; // 2 + uint16_t clen; // total length + uint8_t numInterfaces; + uint8_t config; + uint8_t iconfig; + uint8_t attributes; + uint8_t maxPower; +} ConfigDescriptor; + +// String + +// Interface +typedef struct +{ + uint8_t len; // 9 + uint8_t dtype; // 4 + uint8_t number; + uint8_t alternate; + uint8_t numEndpoints; + uint8_t interfaceClass; + uint8_t interfaceSubClass; + uint8_t protocol; + uint8_t iInterface; +} InterfaceDescriptor; + +// Endpoint +typedef struct +{ + uint8_t len; // 7 + uint8_t dtype; // 5 + uint8_t addr; + uint8_t attr; + uint16_t packetSize; + uint8_t interval; +} EndpointDescriptor; + +// Interface Association Descriptor +// Used to bind 2 interfaces together in CDC compostite device +typedef struct +{ + uint8_t len; // 8 + uint8_t dtype; // 11 + uint8_t firstInterface; + uint8_t interfaceCount; + uint8_t functionClass; + uint8_t funtionSubClass; + uint8_t functionProtocol; + uint8_t iInterface; +} IADDescriptor; + +// CDC CS interface descriptor +typedef struct +{ + uint8_t len; // 5 + uint8_t dtype; // 0x24 + uint8_t subtype; + uint8_t d0; + uint8_t d1; +} CDCCSInterfaceDescriptor; + +typedef struct +{ + uint8_t len; // 4 + uint8_t dtype; // 0x24 + uint8_t subtype; + uint8_t d0; +} CDCCSInterfaceDescriptor4; + +typedef struct +{ + uint8_t len; + uint8_t dtype; // 0x24 + uint8_t subtype; // 1 + uint8_t bmCapabilities; + uint8_t bDataInterface; +} CMFunctionalDescriptor; + +typedef struct +{ + uint8_t len; + uint8_t dtype; // 0x24 + uint8_t subtype; // 1 + uint8_t bmCapabilities; +} ACMFunctionalDescriptor; + +typedef struct +{ + // IAD + IADDescriptor iad; // Only needed on compound device + // Control + InterfaceDescriptor cif; + CDCCSInterfaceDescriptor header; + ACMFunctionalDescriptor controlManagement; // ACM + CDCCSInterfaceDescriptor functionalDescriptor; // CDC_UNION + CMFunctionalDescriptor callManagement; // Call Management + EndpointDescriptor cifin; + + // Data + InterfaceDescriptor dif; + EndpointDescriptor in; + EndpointDescriptor out; +} CDCDescriptor; + +typedef struct +{ + InterfaceDescriptor msc; + EndpointDescriptor in; + EndpointDescriptor out; +} MSCDescriptor; + +_Pragma("pack()") + +#define D_DEVICE(_class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs) \ + { 18, 1, 0x200, _class,_subClass,_proto,_packetSize0,_vid,_pid,_version,_im,_ip,_is,_configs } +/* Table 9-8. Standard Device Descriptor + * bLength, bDescriptorType, bcdUSB, bDeviceClass, bDeviceSubClass, bDeviceProtocol, bMaxPacketSize0, + * idVendor, idProduct, bcdDevice, iManufacturer, iProduct, iSerialNumber, bNumConfigurations */ + +#define D_CONFIG(_totalLength,_interfaces) \ + { 9, 2, _totalLength,_interfaces, 1, 0, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(USB_CONFIG_POWER) } +/* Table 9-10. Standard Configuration Descriptor + * bLength, bDescriptorType, wTotalLength, bNumInterfaces, bConfigurationValue, iConfiguration + * bmAttributes, bMaxPower */ + +#define D_INTERFACE(_n,_numEndpoints,_class,_subClass,_protocol) \ + { 9, 4, _n, 0, _numEndpoints, _class,_subClass, _protocol, 0 } +/* Table 9-12. Standard Interface Descriptor + * bLength, bDescriptorType, bInterfaceNumber, bAlternateSetting, bNumEndpoints, bInterfaceClass, + * bInterfaceSubClass, bInterfaceProtocol, iInterface */ + +#define D_ENDPOINT(_addr,_attr,_packetSize, _interval) \ + { 7, 5, _addr,_attr,_packetSize, _interval } +/* Table 9-13. Standard Endpoint Descriptor + * bLength, bDescriptorType, bEndpointAddress, bmAttributes, wMaxPacketSize, bInterval */ + +#define D_IAD(_firstInterface, _count, _class, _subClass, _protocol) \ + { 8, 11, _firstInterface, _count, _class, _subClass, _protocol, 0 } +/* iadclasscode_r10.pdf, Table 9\96Z. Standard Interface Association Descriptor + * bLength, bDescriptorType, bFirstInterface, bInterfaceCount, bFunctionClass, bFunctionSubClass, bFunctionProtocol, iFunction */ + +// Functional Descriptor General Format +#define D_CDCCS(_subtype,_d0,_d1) { 5, 0x24, _subtype, _d0, _d1 } +#define D_CDCCS4(_subtype,_d0) { 4, 0x24, _subtype, _d0 } +/* bFunctionLength, bDescriptorType, bDescriptorSubtype, function specific data0, functional specific data N-1 + * CS_INTERFACE 24h */ + +#endif diff --git a/sparkfun/samd/cores/arduino51/USB/USBDesc.h b/sparkfun/samd/cores/arduino51/USB/USBDesc.h new file mode 100644 index 00000000..1962be3d --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/USBDesc.h @@ -0,0 +1,54 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef __USBDESC_H__ +#define __USBDESC_H__ + +// CDC or HID can be enabled together. +#define CDC_ENABLED +#define PLUGGABLE_USB_ENABLED + +#ifdef CDC_ENABLED +#define CDC_INTERFACE_COUNT 2 +#define CDC_ENPOINT_COUNT 3 +#else +#define CDC_INTERFACE_COUNT 0 +#define CDC_ENPOINT_COUNT 0 +#endif + +// CDC +#define CDC_ACM_INTERFACE 0 // CDC ACM +#define CDC_DATA_INTERFACE 1 // CDC Data +#define CDC_FIRST_ENDPOINT 1 +#define CDC_ENDPOINT_ACM 1 +#define CDC_ENDPOINT_OUT 2 +#define CDC_ENDPOINT_IN 3 + +#ifdef CDC_ENABLED +#define CDC_RX CDC_ENDPOINT_OUT +#define CDC_TX CDC_ENDPOINT_IN +#endif + +#define ISERIAL_MAX_LEN 65 + +// Defined string description +#define IMANUFACTURER 1 +#define IPRODUCT 2 +#define ISERIAL 3 + +#endif /* __USBDESC_H__ */ diff --git a/sparkfun/samd/cores/arduino51/USB/USB_host.h b/sparkfun/samd/cores/arduino51/USB/USB_host.h new file mode 100644 index 00000000..319dffea --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/USB_host.h @@ -0,0 +1,66 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef USB_HOST_H_INCLUDED +#define USB_HOST_H_INCLUDED + +#include +#include "samd21_host.h" +#ifdef __cplusplus +extern "C" { +#endif + +#define tokSETUP USB_HOST_PCFG_PTOKEN_SETUP +#define tokIN USB_HOST_PCFG_PTOKEN_IN +#define tokOUT USB_HOST_PCFG_PTOKEN_OUT +#define tokINHS USB_HOST_PCFG_PTOKEN_IN +#define tokOUTHS USB_HOST_PCFG_PTOKEN_OUT + +//! \brief Device speed +/*typedef enum { + UHD_SPEED_LOW = 0, + UHD_SPEED_FULL = 1, + UHD_SPEED_HIGH = 2, +} uhd_speed_t;*/ + +//! States of USBB interface +typedef enum { + UHD_STATE_NO_VBUS = 0, + UHD_STATE_DISCONNECTED = 1, + UHD_STATE_CONNECTED = 2, + UHD_STATE_ERROR = 3, +} uhd_vbus_state_t; + +extern void UHD_Init(void); +extern void UHD_Handler(void); +extern void USB_SetHandler(void (*pf_isr)(void)); +extern uhd_vbus_state_t UHD_GetVBUSState(void); +extern uint32_t UHD_Pipe0_Alloc(uint32_t ul_add, uint32_t ul_ep_size); +extern uint32_t UHD_Pipe_Alloc(uint32_t ul_dev_addr, uint32_t ul_dev_ep, uint32_t ul_type, uint32_t ul_dir, uint32_t ul_maxsize, uint32_t ul_interval, uint32_t ul_nb_bank); +extern void UHD_Pipe_CountZero(uint32_t ul_pipe); +extern void UHD_Pipe_Free(uint32_t ul_pipe); +extern uint32_t UHD_Pipe_Read(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data); +extern void UHD_Pipe_Write(uint32_t ul_pipe, uint32_t ul_size, uint8_t* data); +extern void UHD_Pipe_Send(uint32_t ul_pipe, uint32_t ul_token_type); +extern uint32_t UHD_Pipe_Is_Transfer_Complete(uint32_t ul_pipe, uint32_t ul_token_type); + +#ifdef __cplusplus +} +#endif + +#endif /* USB_HOST_H_INCLUDED */ diff --git a/sparkfun/samd/cores/arduino51/USB/samd21_host.c b/sparkfun/samd/cores/arduino51/USB/samd21_host.c new file mode 100644 index 00000000..3b5d2548 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/samd21_host.c @@ -0,0 +1,559 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +#include +#include +#include + +#include "../Arduino.h" +#include "variant.h" +#include "USB_host.h" +#include "samd21_host.h" +#include "sam.h" +#include "wiring_digital.h" +#include "wiring_private.h" + +#define HOST_DEFINED +#ifdef HOST_DEFINED + +//#define TRACE_UOTGHS_HOST(x) x +#define TRACE_UOTGHS_HOST(x) + +// Handle UOTGHS Host driver state +static uhd_vbus_state_t uhd_state = UHD_STATE_NO_VBUS; + +__attribute__((__aligned__(4))) volatile UsbHostDescriptor usb_pipe_table[USB_EPT_NUM]; + +extern void (*gpf_isr)(void); + + +// NVM Software Calibration Area Mapping +// USB TRANSN calibration value. Should be written to the USB PADCAL register. +#define NVM_USB_PAD_TRANSN_POS 45 +#define NVM_USB_PAD_TRANSN_SIZE 5 +// USB TRANSP calibration value. Should be written to the USB PADCAL register. +#define NVM_USB_PAD_TRANSP_POS 50 +#define NVM_USB_PAD_TRANSP_SIZE 5 +// USB TRIM calibration value. Should be written to the USB PADCAL register. +#define NVM_USB_PAD_TRIM_POS 55 +#define NVM_USB_PAD_TRIM_SIZE 3 + +/** + * \brief Initialize the SAMD21 host driver. + */ +void UHD_Init(void) +{ + uint32_t pad_transn; + uint32_t pad_transp; + uint32_t pad_trim; + uint32_t i; + + USB_SetHandler(&UHD_Handler); + + /* Enable USB clock */ +#if defined(__SAMD51__) + MCLK->APBBMASK.reg |= MCLK_APBBMASK_USB; +#else + PM->APBBMASK.reg |= PM_APBBMASK_USB; +#endif + + /* Set up the USB DP/DM pins */ + pinPeripheral( PIN_USB_DM, PIO_COM ); + pinPeripheral( PIN_USB_DP, PIO_COM ); +// PORT->Group[0].PINCFG[PIN_PA24G_USB_DM].bit.PMUXEN = 1; +// PORT->Group[0].PMUX[PIN_PA24G_USB_DM/2].reg &= ~(0xF << (4 * (PIN_PA24G_USB_DM & 0x01u))); +// PORT->Group[0].PMUX[PIN_PA24G_USB_DM/2].reg |= MUX_PA24G_USB_DM << (4 * (PIN_PA24G_USB_DM & 0x01u)); +// PORT->Group[0].PINCFG[PIN_PA25G_USB_DP].bit.PMUXEN = 1; +// PORT->Group[0].PMUX[PIN_PA25G_USB_DP/2].reg &= ~(0xF << (4 * (PIN_PA25G_USB_DP & 0x01u))); +// PORT->Group[0].PMUX[PIN_PA25G_USB_DP/2].reg |= MUX_PA25G_USB_DP << (4 * (PIN_PA25G_USB_DP & 0x01u)); + + + /* ---------------------------------------------------------------------------------------------- + * Put Generic Clock Generator 0 as source for Generic Clock Multiplexer 6 (USB reference) + */ + +#if defined(__SAMD51__) + GCLK->PCHCTRL[USB_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); +#else + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID(6) | // Generic Clock Multiplexer 6 + GCLK_CLKCTRL_GEN_GCLK0 | // Generic Clock Generator 0 is source + GCLK_CLKCTRL_CLKEN; + + while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) + { + /* Wait for synchronization */ + } +#endif + + /* Reset */ + USB->HOST.CTRLA.bit.SWRST = 1; + while (USB->HOST.SYNCBUSY.bit.SWRST) + { + /* Sync wait */ + } + + // uhd_enable(); + USB->DEVICE.CTRLA.reg |= USB_CTRLA_ENABLE | USB_CTRLA_MODE; + uhd_force_host_mode(); + while (USB->HOST.SYNCBUSY.reg == USB_SYNCBUSY_ENABLE); + + + /* Load Pad Calibration */ +#if defined(__SAMD51__) + pad_transn = (*((uint32_t *)(NVMCTRL_SW0) // Non-Volatile Memory Controller +#else + pad_transn = (*((uint32_t *)(NVMCTRL_OTP4) // Non-Volatile Memory Controller +#endif + + + (NVM_USB_PAD_TRANSN_POS / 32)) + >> (NVM_USB_PAD_TRANSN_POS % 32)) + & ((1 << NVM_USB_PAD_TRANSN_SIZE) - 1); + + if (pad_transn == 0x1F) // maximum value (31) + { + pad_transn = 5; + } + + USB->HOST.PADCAL.bit.TRANSN = pad_transn; + +#if defined(__SAMD51__) + pad_transp = (*((uint32_t *)(NVMCTRL_SW0) +#else + pad_transp = (*((uint32_t *)(NVMCTRL_OTP4) +#endif + + (NVM_USB_PAD_TRANSP_POS / 32)) + >> (NVM_USB_PAD_TRANSP_POS % 32)) + & ((1 << NVM_USB_PAD_TRANSP_SIZE) - 1); + + if (pad_transp == 0x1F) // maximum value (31) + { + pad_transp = 29; + } + + USB->HOST.PADCAL.bit.TRANSP = pad_transp; + +#if defined(__SAMD51__) + pad_trim = (*((uint32_t *)(NVMCTRL_SW0) +#else + pad_trim = (*((uint32_t *)(NVMCTRL_OTP4) +#endif + + (NVM_USB_PAD_TRIM_POS / 32)) + >> (NVM_USB_PAD_TRIM_POS % 32)) + & ((1 << NVM_USB_PAD_TRIM_SIZE) - 1); + + if (pad_trim == 0x7) // maximum value (7) + { + pad_trim = 3; + } + + USB->HOST.PADCAL.bit.TRIM = pad_trim; + + + /* Set the configuration */ + uhd_run_in_standby(); + // Set address of USB SRAM + USB->HOST.DESCADD.reg = (uint32_t)(&usb_pipe_table[0]); + // For USB_SPEED_FULL + uhd_force_full_speed(); + for (i = 0; i < sizeof(usb_pipe_table); i++) + { + (*(uint32_t *)(&usb_pipe_table[0] + i)) = 0; + } + + uhd_state = UHD_STATE_NO_VBUS; + + // Put VBUS on USB port + pinMode( PIN_USB_HOST_ENABLE, OUTPUT ); + digitalWrite( PIN_USB_HOST_ENABLE, HIGH ); + + uhd_enable_connection_int(); + + USB->HOST.INTENSET.reg = USB_HOST_INTENSET_DCONN; + USB->HOST.INTENSET.reg = USB_HOST_INTENSET_WAKEUP; + USB->HOST.INTENSET.reg = USB_HOST_INTENSET_DDISC; + + USB->HOST.CTRLB.bit.VBUSOK = 1; + + // Configure interrupts +#if defined(__SAMD51__) + NVIC_SetPriority((IRQn_Type)USB_0_IRQn, 0UL); + NVIC_SetPriority((IRQn_Type)USB_1_IRQn, 0UL); + NVIC_SetPriority((IRQn_Type)USB_2_IRQn, 0UL); + NVIC_SetPriority((IRQn_Type)USB_3_IRQn, 0UL); + + NVIC_EnableIRQ((IRQn_Type)USB_0_IRQn); + NVIC_EnableIRQ((IRQn_Type)USB_1_IRQn); + NVIC_EnableIRQ((IRQn_Type)USB_2_IRQn); + NVIC_EnableIRQ((IRQn_Type)USB_3_IRQn); +#else + NVIC_SetPriority((IRQn_Type)USB_IRQn, 0UL); + NVIC_EnableIRQ((IRQn_Type)USB_IRQn); +#endif +} + + +/** + * \brief Interrupt sub routine for USB Host state machine management. + */ +void UHD_Handler(void) +{ + uint16_t flags; + + if (USB->HOST.CTRLA.bit.MODE) { + /*host mode ISR */ + + /* get interrupt flags */ + flags = USB->HOST.INTFLAG.reg; + + /* host SOF interrupt */ + if (flags & USB_HOST_INTFLAG_HSOF) + { + /* clear the flag */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_HSOF; + uhd_state = UHD_STATE_CONNECTED; + return; + } + + /* host reset interrupt */ + if (flags & USB_HOST_INTFLAG_RST) + { + /* clear the flag */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_RST; + uhd_state = UHD_STATE_DISCONNECTED; //UHD_STATE_ERROR; + return; + } + + /* host upstream resume interrupts */ + if (flags & USB_HOST_INTFLAG_UPRSM) + { + /* clear the flags */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_UPRSM; + uhd_state = UHD_STATE_DISCONNECTED; //UHD_STATE_ERROR; + return; + } + + /* host downstream resume interrupts */ + if (flags & USB_HOST_INTFLAG_DNRSM) + { + /* clear the flags */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_DNRSM; + uhd_state = UHD_STATE_DISCONNECTED; //UHD_STATE_ERROR; + return; + } + + /* host wakeup interrupts */ + if (flags & USB_HOST_INTFLAG_WAKEUP) + { + /* clear the flags */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_WAKEUP; + uhd_state = UHD_STATE_CONNECTED; //UHD_STATE_ERROR; + return; + } + + /* host ram access interrupt */ + if (flags & USB_HOST_INTFLAG_RAMACER) + { + /* clear the flag */ + USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_RAMACER; + uhd_state = UHD_STATE_DISCONNECTED; //UHD_STATE_ERROR; + return; + } + + /* host connect interrupt */ + if (flags & USB_HOST_INTFLAG_DCONN) + { + TRACE_UOTGHS_HOST(printf(">>> UHD_ISR : Connection INT\r\n"); + ) + /* clear the flag */ + uhd_ack_connection(); + uhd_disable_connection_int(); + uhd_ack_disconnection(); + uhd_enable_disconnection_int(); + //uhd_enable_sof(); + uhd_state = UHD_STATE_CONNECTED; + return; + } + + /* host disconnect interrupt */ + if (flags & USB_HOST_INTFLAG_DDISC) + { + TRACE_UOTGHS_HOST(printf(">>> UHD_ISR : Disconnection INT\r\n"); + ) + /* clear the flag */ + uhd_ack_disconnection(); + uhd_disable_disconnection_int(); + // Stop reset signal, in case of disconnection during reset + uhd_stop_reset(); + // Disable wakeup/resumes interrupts, + // in case of disconnection during suspend mode + uhd_ack_connection(); + uhd_enable_connection_int(); + uhd_state = UHD_STATE_DISCONNECTED; + return; + } + } + else { + while(1); + } +} + + + +/** + * \brief Get VBUS state. + * + * \return VBUS status. + */ +uhd_vbus_state_t UHD_GetVBUSState(void) +{ + return uhd_state; +} + + +/** + * \brief Allocate FIFO for pipe 0. + * + * \param ul_add Address of remote device for pipe 0. + * \param ul_ep_size Actual size of the FIFO in bytes. + * + * \retval 0 success. + * \retval 1 error. + */ +uint32_t UHD_Pipe0_Alloc(uint32_t ul_add , uint32_t ul_ep_size) +{ + (void)(ul_add); // Unused argument + + if( USB->HOST.STATUS.reg & USB_HOST_STATUS_SPEED(1) ) + ul_ep_size = USB_PCKSIZE_SIZE_8_BYTES; // Low Speed + else + ul_ep_size = USB_PCKSIZE_SIZE_64_BYTES; // Full Speed + + USB->HOST.HostPipe[0].PCFG.bit.PTYPE = 1; //USB_HOST_PCFG_PTYPE_CTRL; + usb_pipe_table[0].HostDescBank[0].CTRL_PIPE.bit.PEPNUM = 0; + usb_pipe_table[0].HostDescBank[0].PCKSIZE.bit.SIZE = ul_ep_size; + + return 0; +} + + +/** + * \brief Allocate a new pipe. + * + * \note UOTGHS maximum pipe number is limited to 10, meaning that only a limited + * amount of devices can be connected. Unfortunately, using only one pipe shared accross + * various endpoints and devices is not possible because the UOTGHS IP does not allow to + * change the data toggle value through register interface. + * + * \param ul_dev_addr Address of remote device. + * \param ul_dev_ep Targeted endpoint of remote device. + * \param ul_type Pipe type. + * \param ul_dir Pipe direction. + * \param ul_maxsize Pipe size. + * \param ul_interval Polling interval (if applicable to pipe type). + * \param ul_nb_bank Number of banks associated with this pipe. + * + * \return 1. + */ +uint32_t UHD_Pipe_Alloc(uint32_t ul_dev_addr, uint32_t ul_dev_ep, uint32_t ul_type, uint32_t ul_dir, uint32_t ul_maxsize, uint32_t ul_interval, uint32_t ul_nb_bank) +{ + /* set pipe config */ + USB->HOST.HostPipe[ul_dev_ep].PCFG.bit.BK = ul_nb_bank; + // PTYPE: + USB->HOST.HostPipe[ul_dev_ep].PCFG.reg &= ~USB_HOST_PCFG_MASK; // USB->HOST.HostPipe[0].PCFG.bit.PTYPE = 1; //USB_HOST_PCFG_PTYPE_CTRL; + USB->HOST.HostPipe[ul_dev_ep].PCFG.reg |= ul_type; + USB->HOST.HostPipe[ul_dev_ep].BINTERVAL.reg = ul_interval; + + if (ul_dir & USB_EP_DIR_IN) + { + USB->HOST.HostPipe[ul_dev_ep].PCFG.bit.PTOKEN = USB_HOST_PCFG_PTOKEN_IN; + USB->HOST.HostPipe[ul_dev_ep].PSTATUSSET.reg = USB_HOST_PSTATUSSET_BK0RDY; + } + else + { + USB->HOST.HostPipe[ul_dev_ep].PCFG.bit.PTOKEN = USB_HOST_PCFG_PTOKEN_OUT; + USB->HOST.HostPipe[ul_dev_ep].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_BK0RDY; + } + + if( USB->HOST.STATUS.reg & USB_HOST_STATUS_SPEED(1) ) + ul_maxsize = USB_PCKSIZE_SIZE_8_BYTES; // Low Speed + else + ul_maxsize = USB_PCKSIZE_SIZE_64_BYTES; // Full Speed + + memset((uint8_t *)&usb_pipe_table[ul_dev_ep], 0, sizeof(usb_pipe_table[ul_dev_ep])); + + usb_pipe_table[ul_dev_ep].HostDescBank[0].CTRL_PIPE.bit.PDADDR = ul_dev_addr; + usb_pipe_table[ul_dev_ep].HostDescBank[0].CTRL_PIPE.bit.PEPNUM = ul_dev_ep; + usb_pipe_table[ul_dev_ep].HostDescBank[0].PCKSIZE.bit.SIZE = ul_maxsize; + + return 1; +} + + +void UHD_Pipe_CountZero(uint32_t ul_pipe) +{ + usb_pipe_table[ul_pipe].HostDescBank[0].PCKSIZE.bit.BYTE_COUNT = 0; +} + +/** + * \brief Free a pipe. + * + * \param ul_pipe Pipe number to free. + */ +void UHD_Pipe_Free(uint32_t ul_pipe) +{ + // The Pipe is frozen and no additional requests will be sent to the device on this pipe address. + USB->HOST.HostPipe[ul_pipe].PSTATUSSET.reg = USB_HOST_PSTATUSSET_PFREEZE; +} + + +/** + * \brief Read from a pipe. + * + * \param ul_pipe Pipe number. + * \param ul_size Maximum number of data to read. + * \param data Buffer to store the data. + * + * \return number of data read. + */ +uint32_t UHD_Pipe_Read(uint32_t pipe_num, uint32_t buf_size, uint8_t *buf) +{ + if (USB->HOST.HostPipe[pipe_num].PCFG.bit.PTYPE == USB_HOST_PTYPE_DIS) + { + return 0; + } + + /* get pipe config from setting register */ + usb_pipe_table[pipe_num].HostDescBank[0].ADDR.reg = (uint32_t)buf; + usb_pipe_table[pipe_num].HostDescBank[0].PCKSIZE.bit.BYTE_COUNT = 0; + usb_pipe_table[pipe_num].HostDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = buf_size; + USB->HOST.HostPipe[pipe_num].PCFG.bit.PTOKEN = USB_HOST_PCFG_PTOKEN_IN; + + /* Start transfer */ + USB->HOST.HostPipe[pipe_num].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_BK0RDY; + + // Unfreeze pipe + USB->HOST.HostPipe[pipe_num].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_PFREEZE; + + return buf_size; +} + + +/** + * \brief Write into a pipe. + * + * \param ul_pipe Pipe number. + * \param ul_size Maximum number of data to read. + * \param data Buffer containing data to write. + */ +void UHD_Pipe_Write(uint32_t ul_pipe, uint32_t ul_size, uint8_t *buf) +{ + /* get pipe config from setting register */ + usb_pipe_table[ul_pipe].HostDescBank[0].ADDR.reg = (uint32_t)buf; + usb_pipe_table[ul_pipe].HostDescBank[0].PCKSIZE.bit.BYTE_COUNT = ul_size; + usb_pipe_table[ul_pipe].HostDescBank[0].PCKSIZE.bit.MULTI_PACKET_SIZE = 0; +} + +/** + * \brief Send a pipe content. + * + * \param ul_pipe Pipe number. + * \param ul_token_type Token type. + */ +void UHD_Pipe_Send(uint32_t ul_pipe, uint32_t ul_token_type) +{ + USB->HOST.HostPipe[ul_pipe].PCFG.bit.PTOKEN = ul_token_type; + + /* Start transfer */ + if(ul_token_type == USB_HOST_PCFG_PTOKEN_SETUP ) + { + USB->HOST.HostPipe[ul_pipe].PINTFLAG.reg = USB_HOST_PINTFLAG_TXSTP; + USB->HOST.HostPipe[ul_pipe].PSTATUSSET.reg = USB_HOST_PSTATUSSET_BK0RDY; + } + else if(ul_token_type == USB_HOST_PCFG_PTOKEN_IN ) + { + USB->HOST.HostPipe[ul_pipe].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_BK0RDY; + } + else + { + USB->HOST.HostPipe[ul_pipe].PINTFLAG.reg = USB_HOST_PINTFLAG_TRCPT(1); // Transfer Complete 0 + USB->HOST.HostPipe[ul_pipe].PSTATUSSET.reg = USB_HOST_PSTATUSSET_BK0RDY; + } + + // Unfreeze pipe + uhd_unfreeze_pipe(ul_pipe); +} + +/** + * \brief Check for pipe transfer completion. + * + * \param ul_pipe Pipe number. + * \param ul_token_type Token type. + * + * \retval 0 transfer is not complete. + * \retval 1 transfer is complete. + */ +uint32_t UHD_Pipe_Is_Transfer_Complete(uint32_t ul_pipe, uint32_t ul_token_type) +{ + // Check for transfer completion depending on token type + switch (ul_token_type) + { + case USB_HOST_PCFG_PTOKEN_SETUP: + if (Is_uhd_setup_ready(ul_pipe)) + { + uhd_ack_setup_ready(ul_pipe); + uhd_freeze_pipe(ul_pipe); + return 1; + } + break; + + case USB_HOST_PCFG_PTOKEN_IN: + if (Is_uhd_in_received(ul_pipe)) + { + // IN packet received + uhd_ack_in_received(ul_pipe); + // Freeze will stop after the transfer + uhd_freeze_pipe(ul_pipe); + return 1; + } + break; + + case USB_HOST_PCFG_PTOKEN_OUT: + if (Is_uhd_out_ready(ul_pipe)) + { + // OUT packet sent + uhd_ack_out_ready(ul_pipe); + uhd_freeze_pipe(ul_pipe); + return 1; + } + break; + } + + return 0; +} + + + + +// USB_Handler ISR +// void USB_Handler(void) { +// UHD_Handler(); +// } + +#endif // HOST_DEFINED diff --git a/sparkfun/samd/cores/arduino51/USB/samd21_host.h b/sparkfun/samd/cores/arduino51/USB/samd21_host.h new file mode 100644 index 00000000..d2d9c9e0 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/USB/samd21_host.h @@ -0,0 +1,129 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef SAMD21_HOST_H_INCLUDED +#define SAMD21_HOST_H_INCLUDED + +#ifdef __cplusplus +extern "C" { +#endif + +extern __attribute__((__aligned__(4))) volatile UsbHostDescriptor usb_pipe_table[USB_EPT_NUM]; + +#define USB_EP_DIR_IN 0x80 // USB_SETUP_DEVICE_TO_HOST +#define USB_EP_DIR_OUT 0x00 // USB_SETUP_HOST_TO_DEVICE + +#define USB_HOST_PTYPE_DIS USB_HOST_PCFG_PTYPE(0x0) // Pipe is disabled +#define USB_HOST_PTYPE_CTRL USB_HOST_PCFG_PTYPE(0x1) // Pipe is enabled and configured as CONTROL +#define USB_HOST_PTYPE_ISO USB_HOST_PCFG_PTYPE(0x2) // Pipe is enabled and configured as ISO +#define USB_HOST_PTYPE_BULK USB_HOST_PCFG_PTYPE(0x3) // Pipe is enabled and configured as BULK +#define USB_HOST_PTYPE_INT USB_HOST_PCFG_PTYPE(0x4) // Pipe is enabled and configured as INTERRUPT +#define USB_HOST_PTYPE_EXT USB_HOST_PCFG_PTYPE(0x5) // Pipe is enabled and configured as EXTENDED + +#define USB_HOST_NB_BK_1 1 + +#define USB_HOST_PCFG_PTOKEN_SETUP USB_HOST_PCFG_PTOKEN(0x0) +#define USB_HOST_PCFG_PTOKEN_IN USB_HOST_PCFG_PTOKEN(0x1) +#define USB_HOST_PCFG_PTOKEN_OUT USB_HOST_PCFG_PTOKEN(0x2) + +#define USB_ERRORFLOW USB_HOST_STATUS_BK_ERRORFLOW +#define USB_ERRORTIMEOUT USB_HOST_STATUS_PIPE_TOUTER +#define USB_ERROR_DATATOGGLE USB_HOST_STATUS_PIPE_DTGLER + +#define USB_PCKSIZE_SIZE_8_BYTES 0 +#define USB_PCKSIZE_SIZE_16_BYTES 1 +#define USB_PCKSIZE_SIZE_32_BYTES 2 +#define USB_PCKSIZE_SIZE_64_BYTES 3 +#define USB_PCKSIZE_SIZE_128_BYTES 4 +#define USB_PCKSIZE_SIZE_256_BYTES 5 +#define USB_PCKSIZE_SIZE_512_BYTES 6 +#define USB_PCKSIZE_SIZE_1023_BYTES_FS 7 +#define USB_PCKSIZE_SIZE_1024_BYTES_HS 7 + +#define USB_HOST_DTGL(p) (USB->HOST.HostPipe[p].PSTATUS.reg & USB_HOST_PSTATUS_DTGL)>>USB_HOST_PSTATUS_DTGL_Pos + +// USB host connection/disconnection monitoring +#define uhd_enable_connection_int() USB->HOST.INTENSET.reg = USB_HOST_INTENSET_DCONN +#define uhd_disable_connection_int() USB->HOST.INTENCLR.reg = USB_HOST_INTENCLR_DCONN +#define uhd_ack_connection() USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_DCONN + +#define uhd_enable_disconnection_int() USB->HOST.INTENSET.reg = USB_HOST_INTENSET_DDISC +#define uhd_disable_disconnection_int() USB->HOST.INTENCLR.reg = USB_HOST_INTENCLR_DDISC +#define uhd_ack_disconnection() USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_DDISC + +// Initiates a USB register reset +#define uhd_start_USB_reg_reset() USB->HOST.CTRLA.bit.SWRST = 1; + +// Bus Reset +#define Is_uhd_starting_reset() (USB->HOST.CTRLB.bit.BUSRESET == 1) +#define UHD_BusReset() USB->HOST.CTRLB.bit.BUSRESET = 1 +#define uhd_stop_reset() // nothing to do + +#define uhd_ack_reset_sent() USB->HOST.INTFLAG.reg = USB_HOST_INTFLAG_RST +#define Is_uhd_reset_sent() (USB->HOST.INTFLAG.reg & USB_HOST_INTFLAG_RST) + +// Initiates a SOF events +#define uhd_enable_sof() USB->HOST.CTRLB.bit.SOFE = 1 +#define uhd_disable_sof() USB->HOST.CTRLB.bit.SOFE = 0 +#define Is_uhd_sof_enabled() (USB->HOST.CTRLB & USB_HOST_CTRLB_SOFE) +#define Is_uhd_sof() (USB->HOST.INTFLAG.reg & USB_HOST_INTFLAG_HSOF) + +// USB address of pipes +#define uhd_configure_address(pipe_num, addr) usb_pipe_table[pipe_num].HostDescBank[0].CTRL_PIPE.bit.PDADDR = addr +#define uhd_get_configured_address(pipe_num) usb_pipe_table[pipe_num].HostDescBank[0].CTRL_PIPE.bit.PDADDR + +// Pipes +#define uhd_freeze_pipe(p) USB->HOST.HostPipe[p].PSTATUSSET.reg = USB_HOST_PSTATUSSET_PFREEZE +#define uhd_unfreeze_pipe(p) USB->HOST.HostPipe[p].PSTATUSCLR.reg = USB_HOST_PSTATUSCLR_PFREEZE +#define Is_uhd_pipe_frozen(p) ((USB->HOST.HostPipe[p].PSTATUS.reg&USB_HOST_PSTATUS_PFREEZE)==USB_HOST_PSTATUS_PFREEZE) + +// Pipe configuration +#define uhd_configure_pipe_token(p, token) USB->HOST.HostPipe[p].PCFG.bit.PTOKEN = token + +// Pipe data management +#define uhd_byte_count(p) usb_pipe_table[p].HostDescBank[0].PCKSIZE.bit.BYTE_COUNT +#define uhd_ack_setup_ready(p) USB->HOST.HostPipe[p].PINTFLAG.reg = USB_HOST_PINTFLAG_TXSTP +#define Is_uhd_setup_ready(p) ((USB->HOST.HostPipe[p].PINTFLAG.reg&USB_HOST_PINTFLAG_TXSTP) == USB_HOST_PINTFLAG_TXSTP) +#define uhd_ack_in_received(p) USB->HOST.HostPipe[p].PINTFLAG.reg = USB_HOST_PINTFLAG_TRCPT(1) +#define Is_uhd_in_received(p) ((USB->HOST.HostPipe[p].PINTFLAG.reg&USB_HOST_PINTFLAG_TRCPT(1)) == USB_HOST_PINTFLAG_TRCPT(1)) +#define uhd_ack_out_ready(p) USB->HOST.HostPipe[p].PINTFLAG.reg = USB_HOST_PINTFLAG_TRCPT(1) +#define Is_uhd_out_ready(p) ((USB->HOST.HostPipe[p].PINTFLAG.reg&USB_HOST_PINTFLAG_TRCPT(1)) == USB_HOST_PINTFLAG_TRCPT(1)) +#define uhd_ack_nak_received(p) usb_pipe_table[p].HostDescBank[1].STATUS_BK.reg &= ~USB_HOST_STATUS_BK_ERRORFLOW +#define Is_uhd_nak_received(p) (usb_pipe_table[p].HostDescBank[1].STATUS_BK.reg & USB_HOST_STATUS_BK_ERRORFLOW) + +// Endpoint Interrupt Summary +#define uhd_endpoint_interrupt() USB->HOST.PINTSMRY.reg + +// Run in Standby +#define uhd_run_in_standby() USB->HOST.CTRLA.reg |= USB_CTRLA_RUNSTDBY +// Force host mode +#define uhd_force_host_mode() USB->HOST.CTRLA.reg |= USB_CTRLA_MODE + +// Enable USB macro +#define uhd_enable() USB->HOST.CTRLA.reg |= USB_CTRLA_ENABLE +// Disable USB macro +#define uhd_disable() USB->HOST.CTRLA.reg &= ~USB_CTRLA_ENABLE + +// Force full speed mode +#define uhd_force_full_speed() USB->HOST.CTRLB.reg &= ~USB_HOST_CTRLB_SPDCONF_Msk + +#ifdef __cplusplus +} +#endif + +#endif /* SAMD21_HOST_H_INCLUDED */ diff --git a/sparkfun/samd/cores/arduino51/Uart.cpp b/sparkfun/samd/cores/arduino51/Uart.cpp new file mode 100644 index 00000000..dd797da4 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Uart.cpp @@ -0,0 +1,240 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Uart.h" +#include "Arduino.h" +#include "wiring_private.h" + +#define NO_RTS_PIN 255 +#define NO_CTS_PIN 255 +#define RTS_RX_THRESHOLD 10 + +Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX) : + Uart(_s, _pinRX, _pinTX, _padRX, _padTX, NO_RTS_PIN, NO_CTS_PIN) +{ +} + +Uart::Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX, uint8_t _pinRTS, uint8_t _pinCTS) +{ + sercom = _s; + uc_pinRX = _pinRX; + uc_pinTX = _pinTX; + uc_padRX = _padRX ; + uc_padTX = _padTX; + uc_pinRTS = _pinRTS; + uc_pinCTS = _pinCTS; +} + +void Uart::begin(unsigned long baudrate) +{ + begin(baudrate, SERIAL_8N1); +} + +void Uart::begin(unsigned long baudrate, uint16_t config) +{ + pinPeripheral(uc_pinRX, g_APinDescription[uc_pinRX].ulPinType); + pinPeripheral(uc_pinTX, g_APinDescription[uc_pinTX].ulPinType); + + if (uc_padTX == UART_TX_RTS_CTS_PAD_0_2_3) { + if (uc_pinCTS != NO_CTS_PIN) { + pinPeripheral(uc_pinCTS, g_APinDescription[uc_pinCTS].ulPinType); + } + } + + if (uc_pinRTS != NO_RTS_PIN) { + pinMode(uc_pinRTS, OUTPUT); + + EPortType rtsPort = g_APinDescription[uc_pinRTS].ulPort; + pul_outsetRTS = &PORT->Group[rtsPort].OUTSET.reg; + pul_outclrRTS = &PORT->Group[rtsPort].OUTCLR.reg; + ul_pinMaskRTS = (1ul << g_APinDescription[uc_pinRTS].ulPin); + + *pul_outclrRTS = ul_pinMaskRTS; + } + + sercom->initUART(UART_INT_CLOCK, SAMPLE_RATE_x16, baudrate); + sercom->initFrame(extractCharSize(config), LSB_FIRST, extractParity(config), extractNbStopBit(config)); + sercom->initPads(uc_padTX, uc_padRX); + + sercom->enableUART(); +} + +void Uart::end() +{ + sercom->resetUART(); + rxBuffer.clear(); + txBuffer.clear(); +} + +void Uart::flush() +{ + while(txBuffer.available()); // wait until TX buffer is empty + + sercom->flushUART(); +} + +void Uart::IrqHandler() +{ + if (sercom->isFrameErrorUART()) { + // frame error, next byte is invalid so read and discard it + sercom->readDataUART(); + + sercom->clearFrameErrorUART(); + } + + if (sercom->availableDataUART()) { + rxBuffer.store_char(sercom->readDataUART()); + + if (uc_pinRTS != NO_RTS_PIN) { + // RX buffer space is below the threshold, de-assert RTS + if (rxBuffer.availableForStore() < RTS_RX_THRESHOLD) { + *pul_outsetRTS = ul_pinMaskRTS; + } + } + } + + if (sercom->isDataRegisterEmptyUART()) { + if (txBuffer.available()) { + uint8_t data = txBuffer.read_char(); + + sercom->writeDataUART(data); + } else { + sercom->disableDataRegisterEmptyInterruptUART(); + } + } + + if (sercom->isUARTError()) { + sercom->acknowledgeUARTError(); + // TODO: if (sercom->isBufferOverflowErrorUART()) .... + // TODO: if (sercom->isParityErrorUART()) .... + sercom->clearStatusUART(); + } +} + +int Uart::available() +{ + return rxBuffer.available(); +} + +int Uart::availableForWrite() +{ + return txBuffer.availableForStore(); +} + +int Uart::peek() +{ + return rxBuffer.peek(); +} + +int Uart::read() +{ + int c = rxBuffer.read_char(); + + if (uc_pinRTS != NO_RTS_PIN) { + // if there is enough space in the RX buffer, assert RTS + if (rxBuffer.availableForStore() > RTS_RX_THRESHOLD) { + *pul_outclrRTS = ul_pinMaskRTS; + } + } + + return c; +} + +size_t Uart::write(const uint8_t data) +{ + if (sercom->isDataRegisterEmptyUART() && txBuffer.available() == 0) { + sercom->writeDataUART(data); + } else { + // spin lock until a spot opens up in the buffer + while(txBuffer.isFull()) { + uint8_t interruptsEnabled = ((__get_PRIMASK() & 0x1) == 0); + + if (interruptsEnabled) { + uint32_t exceptionNumber = (SCB->ICSR & SCB_ICSR_VECTACTIVE_Msk); + + if (exceptionNumber == 0 || + NVIC_GetPriority((IRQn_Type)(exceptionNumber - 16)) > SERCOM_NVIC_PRIORITY) { + // no exception or called from an ISR with lower priority, + // wait for free buffer spot via IRQ + continue; + } + } + + // interrupts are disabled or called from ISR with higher or equal priority than the SERCOM IRQ + // manually call the UART IRQ handler when the data register is empty + if (sercom->isDataRegisterEmptyUART()) { + IrqHandler(); + } + } + + txBuffer.store_char(data); + + sercom->enableDataRegisterEmptyInterruptUART(); + } + + return 1; +} + +SercomNumberStopBit Uart::extractNbStopBit(uint16_t config) +{ + switch(config & HARDSER_STOP_BIT_MASK) + { + case HARDSER_STOP_BIT_1: + default: + return SERCOM_STOP_BIT_1; + + case HARDSER_STOP_BIT_2: + return SERCOM_STOP_BITS_2; + } +} + +SercomUartCharSize Uart::extractCharSize(uint16_t config) +{ + switch(config & HARDSER_DATA_MASK) + { + case HARDSER_DATA_5: + return UART_CHAR_SIZE_5_BITS; + + case HARDSER_DATA_6: + return UART_CHAR_SIZE_6_BITS; + + case HARDSER_DATA_7: + return UART_CHAR_SIZE_7_BITS; + + case HARDSER_DATA_8: + default: + return UART_CHAR_SIZE_8_BITS; + + } +} + +SercomParityMode Uart::extractParity(uint16_t config) +{ + switch(config & HARDSER_PARITY_MASK) + { + case HARDSER_PARITY_NONE: + default: + return SERCOM_NO_PARITY; + + case HARDSER_PARITY_EVEN: + return SERCOM_EVEN_PARITY; + + case HARDSER_PARITY_ODD: + return SERCOM_ODD_PARITY; + } +} diff --git a/sparkfun/samd/cores/arduino51/Uart.h b/sparkfun/samd/cores/arduino51/Uart.h new file mode 100644 index 00000000..8f80ea9c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Uart.h @@ -0,0 +1,65 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include "HardwareSerial.h" +#include "SERCOM.h" +#include "RingBuffer.h" + +#include + +class Uart : public HardwareSerial +{ + public: + Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX); + Uart(SERCOM *_s, uint8_t _pinRX, uint8_t _pinTX, SercomRXPad _padRX, SercomUartTXPad _padTX, uint8_t _pinRTS, uint8_t _pinCTS); + void begin(unsigned long baudRate); + void begin(unsigned long baudrate, uint16_t config); + void end(); + int available(); + int availableForWrite(); + int peek(); + int read(); + void flush(); + size_t write(const uint8_t data); + using Print::write; // pull in write(str) and write(buf, size) from Print + + void IrqHandler(); + + operator bool() { return true; } + + private: + SERCOM *sercom; + RingBuffer rxBuffer; + RingBuffer txBuffer; + + uint8_t uc_pinRX; + uint8_t uc_pinTX; + SercomRXPad uc_padRX; + SercomUartTXPad uc_padTX; + uint8_t uc_pinRTS; + volatile uint32_t* pul_outsetRTS; + volatile uint32_t* pul_outclrRTS; + uint32_t ul_pinMaskRTS; + uint8_t uc_pinCTS; + + SercomNumberStopBit extractNbStopBit(uint16_t config); + SercomUartCharSize extractCharSize(uint16_t config); + SercomParityMode extractParity(uint16_t config); +}; diff --git a/sparkfun/samd/cores/arduino51/Udp.h b/sparkfun/samd/cores/arduino51/Udp.h new file mode 100644 index 00000000..89f31c67 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/Udp.h @@ -0,0 +1,89 @@ +/* + * Udp.cpp: Library to send/receive UDP packets. + * + * NOTE: UDP is fast, but has some important limitations (thanks to Warren Gray for mentioning these) + * 1) UDP does not guarantee the order in which assembled UDP packets are received. This + * might not happen often in practice, but in larger network topologies, a UDP + * packet can be received out of sequence. + * 2) UDP does not guard against lost packets - so packets *can* disappear without the sender being + * aware of it. Again, this may not be a concern in practice on small local networks. + * For more information, see http://www.cafeaulait.org/course/week12/35.html + * + * MIT License: + * Copyright (c) 2008 Bjoern Hartmann + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * bjoern@cs.stanford.edu 12/30/2008 + */ + +#ifndef udp_h +#define udp_h + +#include +#include + +class UDP : public Stream { + +public: + virtual uint8_t begin(uint16_t) =0; // initialize, start listening on specified port. Returns 1 if successful, 0 if there are no sockets available to use + virtual uint8_t beginMulticast(IPAddress, uint16_t) { return 0; } // initialize, start listening on specified multicast IP address and port. Returns 1 if successful, 0 on failure + virtual void stop() =0; // Finish with the UDP socket + + // Sending UDP packets + + // Start building up a packet to send to the remote host specific in ip and port + // Returns 1 if successful, 0 if there was a problem with the supplied IP address or port + virtual int beginPacket(IPAddress ip, uint16_t port) =0; + // Start building up a packet to send to the remote host specific in host and port + // Returns 1 if successful, 0 if there was a problem resolving the hostname or port + virtual int beginPacket(const char *host, uint16_t port) =0; + // Finish off this packet and send it + // Returns 1 if the packet was sent successfully, 0 if there was an error + virtual int endPacket() =0; + // Write a single byte into the packet + virtual size_t write(uint8_t) =0; + // Write size bytes from buffer into the packet + virtual size_t write(const uint8_t *buffer, size_t size) =0; + + // Start processing the next available incoming packet + // Returns the size of the packet in bytes, or 0 if no packets are available + virtual int parsePacket() =0; + // Number of bytes remaining in the current packet + virtual int available() =0; + // Read a single byte from the current packet + virtual int read() =0; + // Read up to len bytes from the current packet and place them into buffer + // Returns the number of bytes read, or 0 if none are available + virtual int read(unsigned char* buffer, size_t len) =0; + // Read up to len characters from the current packet and place them into buffer + // Returns the number of characters read, or 0 if none are available + virtual int read(char* buffer, size_t len) =0; + // Return the next byte from the current packet without moving on to the next byte + virtual int peek() =0; + virtual void flush() =0; // Finish reading the current packet + + // Return the IP address of the host who sent the current incoming packet + virtual IPAddress remoteIP() =0; + // Return the port of the host who sent the current incoming packet + virtual uint16_t remotePort() =0; +protected: + uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; +}; + +#endif diff --git a/sparkfun/samd/cores/arduino51/WCharacter.h b/sparkfun/samd/cores/arduino51/WCharacter.h new file mode 100644 index 00000000..c0cbec7a --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WCharacter.h @@ -0,0 +1,179 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef Character_h +#define Character_h + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// WCharacter.h prototypes +#if defined ( __GNUC__ ) +inline boolean isAlphaNumeric(int c) __attribute__((always_inline)); +inline boolean isAlpha(int c) __attribute__((always_inline)); +inline boolean isAscii(int c) __attribute__((always_inline)); +inline boolean isWhitespace(int c) __attribute__((always_inline)); +inline boolean isControl(int c) __attribute__((always_inline)); +inline boolean isDigit(int c) __attribute__((always_inline)); +inline boolean isGraph(int c) __attribute__((always_inline)); +inline boolean isLowerCase(int c) __attribute__((always_inline)); +inline boolean isPrintable(int c) __attribute__((always_inline)); +inline boolean isPunct(int c) __attribute__((always_inline)); +inline boolean isSpace(int c) __attribute__((always_inline)); +inline boolean isUpperCase(int c) __attribute__((always_inline)); +inline boolean isHexadecimalDigit(int c) __attribute__((always_inline)); +inline int toAscii(int c) __attribute__((always_inline)); +inline int toLowerCase(int c) __attribute__((always_inline)); +inline int toUpperCase(int c)__attribute__((always_inline)); +#elif defined ( __ICCARM__ ) +#endif + +// Checks for an alphanumeric character. +// It is equivalent to (isalpha(c) || isdigit(c)). +inline boolean isAlphaNumeric(int c) +{ + return ( isalnum(c) == 0 ? false : true); +} + + +// Checks for an alphabetic character. +// It is equivalent to (isupper(c) || islower(c)). +inline boolean isAlpha(int c) +{ + return ( isalpha(c) == 0 ? false : true); +} + + +// Checks whether c is a 7-bit unsigned char value +// that fits into the ASCII character set. +inline boolean isAscii(int c) +{ +/* return ( isascii(c) == 0 ? false : true); */ + return ( (c & ~0x7f) != 0 ? false : true); +} + + +// Checks for a blank character, that is, a space or a tab. +inline boolean isWhitespace(int c) +{ + return ( isblank (c) == 0 ? false : true); +} + + +// Checks for a control character. +inline boolean isControl(int c) +{ + return ( iscntrl (c) == 0 ? false : true); +} + + +// Checks for a digit (0 through 9). +inline boolean isDigit(int c) +{ + return ( isdigit (c) == 0 ? false : true); +} + + +// Checks for any printable character except space. +inline boolean isGraph(int c) +{ + return ( isgraph (c) == 0 ? false : true); +} + + +// Checks for a lower-case character. +inline boolean isLowerCase(int c) +{ + return (islower (c) == 0 ? false : true); +} + + +// Checks for any printable character including space. +inline boolean isPrintable(int c) +{ + return ( isprint (c) == 0 ? false : true); +} + + +// Checks for any printable character which is not a space +// or an alphanumeric character. +inline boolean isPunct(int c) +{ + return ( ispunct (c) == 0 ? false : true); +} + + +// Checks for white-space characters. For the avr-libc library, +// these are: space, formfeed ('\f'), newline ('\n'), carriage +// return ('\r'), horizontal tab ('\t'), and vertical tab ('\v'). +inline boolean isSpace(int c) +{ + return ( isspace (c) == 0 ? false : true); +} + + +// Checks for an uppercase letter. +inline boolean isUpperCase(int c) +{ + return ( isupper (c) == 0 ? false : true); +} + + +// Checks for a hexadecimal digits, i.e. one of 0 1 2 3 4 5 6 7 +// 8 9 a b c d e f A B C D E F. +inline boolean isHexadecimalDigit(int c) +{ + return ( isxdigit (c) == 0 ? false : true); +} + + +// Converts c to a 7-bit unsigned char value that fits into the +// ASCII character set, by clearing the high-order bits. +inline int toAscii(int c) +{ +/* return toascii (c); */ + return (c & 0x7f); +} + + +// Warning: +// Many people will be unhappy if you use this function. +// This function will convert accented letters into random +// characters. + +// Converts the letter c to lower case, if possible. +inline int toLowerCase(int c) +{ + return tolower (c); +} + + +// Converts the letter c to upper case, if possible. +inline int toUpperCase(int c) +{ + return toupper (c); +} + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sparkfun/samd/cores/arduino51/WInterrupts.c b/sparkfun/samd/cores/arduino51/WInterrupts.c new file mode 100644 index 00000000..e0abc2d7 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WInterrupts.c @@ -0,0 +1,378 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" +#include "wiring_private.h" + +#include + +static voidFuncPtr ISRcallback[EXTERNAL_NUM_INTERRUPTS]; +static uint32_t ISRlist[EXTERNAL_NUM_INTERRUPTS]; +static uint32_t nints; // Stores total number of attached interrupts + + +/* Configure I/O interrupt sources */ +static void __initialize() +{ + memset(ISRlist, 0, sizeof(ISRlist)); + memset(ISRcallback, 0, sizeof(ISRcallback)); + nints = 0; + +#if defined(__SAMD51__) + ///EIC MCLK is enabled by default + for (uint32_t i = 0; i <= 15; i++) // EIC_0_IRQn = 12 ... EIC_15_IRQn = 27 + { + uint8_t irqn = EIC_0_IRQn + i; + NVIC_DisableIRQ(irqn); + NVIC_ClearPendingIRQ(irqn); + NVIC_SetPriority(irqn, 0); + NVIC_EnableIRQ(irqn); + } + + GCLK->PCHCTRL[EIC_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK2_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); +#else + NVIC_DisableIRQ(EIC_IRQn); + NVIC_ClearPendingIRQ(EIC_IRQn); + NVIC_SetPriority(EIC_IRQn, 0); + NVIC_EnableIRQ(EIC_IRQn); + + // Enable GCLK for IEC (External Interrupt Controller) + GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_ID(GCM_EIC)); +#endif + +/* Shall we do that? + // Do a software reset on EIC + EIC->CTRL.SWRST.bit = 1 ; + while ((EIC->CTRL.SWRST.bit == 1) && (EIC->STATUS.SYNCBUSY.bit == 1)) { } +*/ + + // Enable EIC +#if defined(__SAMD51__) + EIC->CTRLA.bit.ENABLE = 1; + while (EIC->SYNCBUSY.bit.ENABLE == 1) { } +#else + EIC->CTRL.bit.ENABLE = 1; + while (EIC->STATUS.bit.SYNCBUSY == 1) { } +#endif +} + +/* + * \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs. + * Replaces any previous function that was attached to the interrupt. + */ +void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode) +{ + static int enabled = 0; + uint32_t config; + uint32_t pos; + + #if ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606 + EExt_Interrupts in = g_APinDescription[pin].ulExtInt; + #else + EExt_Interrupts in = digitalPinToInterrupt(pin); + #endif + if (in == NOT_AN_INTERRUPT) return; + + if (!enabled) { + __initialize(); + enabled = 1; + } + uint32_t inMask = (1UL << in); + // Enable wakeup capability on pin in case being used during sleep + #if defined(__SAMD51__) + //I believe this is done automatically + #else + EIC->WAKEUP.reg |= (1 << in); + #endif + + // Only store when there is really an ISR to call. + // This allow for calling attachInterrupt(pin, NULL, mode), we set up all needed register + // but won't service the interrupt, this way we also don't need to check it inside the ISR. + if (callback) + { + if (in == EXTERNAL_INT_NMI) { + EIC->NMIFLAG.bit.NMI = 1; // Clear flag + switch (mode) { + case LOW: + EIC->NMICTRL.bit.NMISENSE = EIC_NMICTRL_NMISENSE_LOW; + break; + + case HIGH: + EIC->NMICTRL.bit.NMISENSE = EIC_NMICTRL_NMISENSE_HIGH; + break; + + case CHANGE: + EIC->NMICTRL.bit.NMISENSE = EIC_NMICTRL_NMISENSE_BOTH; + break; + + case FALLING: + EIC->NMICTRL.bit.NMISENSE = EIC_NMICTRL_NMISENSE_FALL; + break; + + case RISING: + EIC->NMICTRL.bit.NMISENSE = EIC_NMICTRL_NMISENSE_RISE; + break; + } + + // Assign callback to interrupt + ISRcallback[EXTERNAL_INT_NMI] = callback; + + } else { // Not NMI, is external interrupt + + // Assign pin to EIC + pinPeripheral(pin, PIO_EXTINT); + + // Store interrupts to service in order of when they were attached + // to allow for first come first serve handler + uint32_t current = 0; + + // Check if we already have this interrupt + for (current=0; current EXTERNAL_INT_7) { + config = 1; + pos = (in - 8) << 2; + } else { + config = 0; + pos = in << 2; + } + + #if defined (__SAMD51__) + EIC->CTRLA.bit.ENABLE = 0; + while (EIC->SYNCBUSY.bit.ENABLE == 1) { } + #endif + + EIC->CONFIG[config].reg &=~ (EIC_CONFIG_SENSE0_Msk << pos); // Reset sense mode, important when changing trigger mode during runtime + switch (mode) + { + case LOW: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_LOW_Val << pos; + break; + + case HIGH: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_HIGH_Val << pos; + break; + + case CHANGE: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_BOTH_Val << pos; + break; + + case FALLING: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_FALL_Val << pos; + break; + + case RISING: + EIC->CONFIG[config].reg |= EIC_CONFIG_SENSE0_RISE_Val << pos; + break; + } + } + // Enable the interrupt + EIC->INTENSET.reg = EIC_INTENSET_EXTINT(1 << in); + } + + #if defined (__SAMD51__) + EIC->CTRLA.bit.ENABLE = 1; + while (EIC->SYNCBUSY.bit.ENABLE == 1) { } + #endif +} + +/* + * \brief Turns off the given interrupt. + */ +void detachInterrupt(uint32_t pin) +{ +#if (ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10606) + EExt_Interrupts in = g_APinDescription[pin].ulExtInt; +#else + EExt_Interrupts in = digitalPinToInterrupt(pin); +#endif + if (in == NOT_AN_INTERRUPT) return; + + if(in == EXTERNAL_INT_NMI) { + EIC->NMICTRL.bit.NMISENSE = 0; // Turn off detection + } else { + EIC->INTENCLR.reg = EIC_INTENCLR_EXTINT(1 << in); + + // Disable wakeup capability on pin during sleep +#if defined(__SAMD51__) +//I believe this is done automatically +#else + // Disable wakeup capability on pin during sleep + EIC->WAKEUP.reg &= ~(1 << in); +#endif + } + + // Remove callback from the ISR list + uint32_t current; + for (current=0; currentINTFLAG.reg & ISRlist[i]) != 0) + { + // Call the callback function + ISRcallback[i](); + // Clear the interrupt + EIC->INTFLAG.reg = ISRlist[i]; + } + } +} + +void EIC_0_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_0); +} + +void EIC_1_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_1); +} + +void EIC_2_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_2); +} + +void EIC_3_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_3); +} + +void EIC_4_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_4); +} + +void EIC_5_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_5); +} + +void EIC_6_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_6); +} + +void EIC_7_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_7); +} + +void EIC_8_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_8); +} + +void EIC_9_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_9); +} + +void EIC_10_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_10); +} + +void EIC_11_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_11); +} + +void EIC_12_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_12); +} + +void EIC_13_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_13); +} + +void EIC_14_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_14); +} + +void EIC_15_Handler(void) +{ + InterruptHandler(EXTERNAL_INT_15); +} +#else + +void EIC_Handler(void) +{ + // Calling the routine directly from -here- takes about 1us + // Depending on where you are in the list it will take longer + + // Loop over all enabled interrupts in the list + for (uint32_t i=0; iINTFLAG.reg & ISRlist[i]) != 0) + { + // Call the callback function + ISRcallback[i](); + // Clear the interrupt + EIC->INTFLAG.reg = ISRlist[i]; + } + } +} + +/* + * NMI Interrupt Handler + */ +void NMI_Handler(void) +{ + if (ISRcallback[EXTERNAL_INT_NMI]) ISRcallback[EXTERNAL_INT_NMI](); + EIC->NMIFLAG.bit.NMI = 1; // Clear interrupt +} +#endif diff --git a/sparkfun/samd/cores/arduino51/WInterrupts.h b/sparkfun/samd/cores/arduino51/WInterrupts.h new file mode 100644 index 00000000..5d2b24a0 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WInterrupts.h @@ -0,0 +1,54 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _WIRING_INTERRUPTS_ +#define _WIRING_INTERRUPTS_ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// LOW 0 +// HIGH 1 +#define CHANGE 2 +#define FALLING 3 +#define RISING 4 + +#define DEFAULT 1 +#define EXTERNAL 0 + +typedef void (*voidFuncPtr)(void); + +/* + * \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs. + * Replaces any previous function that was attached to the interrupt. + */ +void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode); + +/* + * \brief Turns off the given interrupt. + */ +void detachInterrupt(uint32_t pin); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/sparkfun/samd/cores/arduino51/WMath.cpp b/sparkfun/samd/cores/arduino51/WMath.cpp new file mode 100644 index 00000000..55caddd6 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WMath.cpp @@ -0,0 +1,68 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +extern "C" { + #include "stdlib.h" + #include "stdint.h" +} +#include "WMath.h" + +extern void randomSeed( uint32_t dwSeed ) +{ + if ( dwSeed != 0 ) + { + srand( dwSeed ) ; + } +} + +extern long random( long howbig ) +{ + if ( howbig == 0 ) + { + return 0 ; + } + + return rand() % howbig; +} + +extern long random( long howsmall, long howbig ) +{ + if (howsmall >= howbig) + { + return howsmall; + } + + long diff = howbig - howsmall; + + return random(diff) + howsmall; +} + +extern long map(long x, long in_min, long in_max, long out_min, long out_max) +{ + return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; +} + +extern uint16_t makeWord( uint16_t w ) +{ + return w ; +} + +extern uint16_t makeWord( uint8_t h, uint8_t l ) +{ + return (h << 8) | l ; +} diff --git a/sparkfun/samd/cores/arduino51/WMath.h b/sparkfun/samd/cores/arduino51/WMath.h new file mode 100644 index 00000000..1893955c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WMath.h @@ -0,0 +1,33 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _WIRING_MATH_ +#define _WIRING_MATH_ + +extern long random( long ) ; +extern long random( long, long ) ; +extern void randomSeed( uint32_t dwSeed ) ; +extern long map( long, long, long, long, long ) ; + +extern uint16_t makeWord( uint16_t w ) ; +extern uint16_t makeWord( uint8_t h, uint8_t l ) ; + +#define word(...) makeWord(__VA_ARGS__) + + +#endif /* _WIRING_MATH_ */ diff --git a/sparkfun/samd/cores/arduino51/WString.cpp b/sparkfun/samd/cores/arduino51/WString.cpp new file mode 100644 index 00000000..71bbc07d --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WString.cpp @@ -0,0 +1,752 @@ +/* + WString.cpp - String library for Wiring & Arduino + ...mostly rewritten by Paul Stoffregen... + Copyright (c) 2009-10 Hernando Barragan. All rights reserved. + Copyright 2011, Paul Stoffregen, paul@pjrc.com + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "WString.h" +#include "itoa.h" +#include "avr/dtostrf.h" + +/*********************************************/ +/* Constructors */ +/*********************************************/ + +String::String(const char *cstr) +{ + init(); + if (cstr) copy(cstr, strlen(cstr)); +} + +String::String(const String &value) +{ + init(); + *this = value; +} + +String::String(const __FlashStringHelper *pstr) +{ + init(); + *this = pstr; +} + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +String::String(String &&rval) +{ + init(); + move(rval); +} +String::String(StringSumHelper &&rval) +{ + init(); + move(rval); +} +#endif + +String::String(char c) +{ + init(); + char buf[2]; + buf[0] = c; + buf[1] = 0; + *this = buf; +} + +String::String(unsigned char value, unsigned char base) +{ + init(); + char buf[1 + 8 * sizeof(unsigned char)]; + utoa(value, buf, base); + *this = buf; +} + +String::String(int value, unsigned char base) +{ + init(); + char buf[2 + 8 * sizeof(int)]; + itoa(value, buf, base); + *this = buf; +} + +String::String(unsigned int value, unsigned char base) +{ + init(); + char buf[1 + 8 * sizeof(unsigned int)]; + utoa(value, buf, base); + *this = buf; +} + +String::String(long value, unsigned char base) +{ + init(); + char buf[2 + 8 * sizeof(long)]; + ltoa(value, buf, base); + *this = buf; +} + +String::String(unsigned long value, unsigned char base) +{ + init(); + char buf[1 + 8 * sizeof(unsigned long)]; + ultoa(value, buf, base); + *this = buf; +} + +String::String(float value, unsigned char decimalPlaces) +{ + init(); + char buf[33]; + *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); +} + +String::String(double value, unsigned char decimalPlaces) +{ + init(); + char buf[33]; + *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); +} + +String::~String() +{ + free(buffer); +} + +/*********************************************/ +/* Memory Management */ +/*********************************************/ + +inline void String::init(void) +{ + buffer = NULL; + capacity = 0; + len = 0; +} + +void String::invalidate(void) +{ + if (buffer) free(buffer); + buffer = NULL; + capacity = len = 0; +} + +unsigned char String::reserve(unsigned int size) +{ + if (buffer && capacity >= size) return 1; + if (changeBuffer(size)) { + if (len == 0) buffer[0] = 0; + return 1; + } + return 0; +} + +unsigned char String::changeBuffer(unsigned int maxStrLen) +{ + char *newbuffer = (char *)realloc(buffer, maxStrLen + 1); + if (newbuffer) { + buffer = newbuffer; + capacity = maxStrLen; + return 1; + } + return 0; +} + +/*********************************************/ +/* Copy and Move */ +/*********************************************/ + +String & String::copy(const char *cstr, unsigned int length) +{ + if (!reserve(length)) { + invalidate(); + return *this; + } + len = length; + strcpy(buffer, cstr); + return *this; +} + +String & String::copy(const __FlashStringHelper *pstr, unsigned int length) +{ + if (!reserve(length)) { + invalidate(); + return *this; + } + len = length; + strcpy_P(buffer, (PGM_P)pstr); + return *this; +} + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +void String::move(String &rhs) +{ + if (buffer) { + if (rhs && capacity >= rhs.len) { + strcpy(buffer, rhs.buffer); + len = rhs.len; + rhs.len = 0; + return; + } else { + free(buffer); + } + } + buffer = rhs.buffer; + capacity = rhs.capacity; + len = rhs.len; + rhs.buffer = NULL; + rhs.capacity = 0; + rhs.len = 0; +} +#endif + +String & String::operator = (const String &rhs) +{ + if (this == &rhs) return *this; + + if (rhs.buffer) copy(rhs.buffer, rhs.len); + else invalidate(); + + return *this; +} + +#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) +String & String::operator = (String &&rval) +{ + if (this != &rval) move(rval); + return *this; +} + +String & String::operator = (StringSumHelper &&rval) +{ + if (this != &rval) move(rval); + return *this; +} +#endif + +String & String::operator = (const char *cstr) +{ + if (cstr) copy(cstr, strlen(cstr)); + else invalidate(); + + return *this; +} + +String & String::operator = (const __FlashStringHelper *pstr) +{ + if (pstr) copy(pstr, strlen_P((PGM_P)pstr)); + else invalidate(); + + return *this; +} + +/*********************************************/ +/* concat */ +/*********************************************/ + +unsigned char String::concat(const String &s) +{ + return concat(s.buffer, s.len); +} + +unsigned char String::concat(const char *cstr, unsigned int length) +{ + unsigned int newlen = len + length; + if (!cstr) return 0; + if (length == 0) return 1; + if (!reserve(newlen)) return 0; + strcpy(buffer + len, cstr); + len = newlen; + return 1; +} + +unsigned char String::concat(const char *cstr) +{ + if (!cstr) return 0; + return concat(cstr, strlen(cstr)); +} + +unsigned char String::concat(char c) +{ + char buf[2]; + buf[0] = c; + buf[1] = 0; + return concat(buf, 1); +} + +unsigned char String::concat(unsigned char num) +{ + char buf[1 + 3 * sizeof(unsigned char)]; + itoa(num, buf, 10); + return concat(buf, strlen(buf)); +} + +unsigned char String::concat(int num) +{ + char buf[2 + 3 * sizeof(int)]; + itoa(num, buf, 10); + return concat(buf, strlen(buf)); +} + +unsigned char String::concat(unsigned int num) +{ + char buf[1 + 3 * sizeof(unsigned int)]; + utoa(num, buf, 10); + return concat(buf, strlen(buf)); +} + +unsigned char String::concat(long num) +{ + char buf[2 + 3 * sizeof(long)]; + ltoa(num, buf, 10); + return concat(buf, strlen(buf)); +} + +unsigned char String::concat(unsigned long num) +{ + char buf[1 + 3 * sizeof(unsigned long)]; + ultoa(num, buf, 10); + return concat(buf, strlen(buf)); +} + +unsigned char String::concat(float num) +{ + char buf[20]; + char* string = dtostrf(num, 4, 2, buf); + return concat(string, strlen(string)); +} + +unsigned char String::concat(double num) +{ + char buf[20]; + char* string = dtostrf(num, 4, 2, buf); + return concat(string, strlen(string)); +} + +unsigned char String::concat(const __FlashStringHelper * str) +{ + if (!str) return 0; + int length = strlen_P((const char *) str); + if (length == 0) return 1; + unsigned int newlen = len + length; + if (!reserve(newlen)) return 0; + strcpy_P(buffer + len, (const char *) str); + len = newlen; + return 1; +} + +/*********************************************/ +/* Concatenate */ +/*********************************************/ + +StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(rhs.buffer, rhs.len)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr) +{ + StringSumHelper &a = const_cast(lhs); + if (!cstr || !a.concat(cstr, strlen(cstr))) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, char c) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(c)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, int num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, long num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, float num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, double num) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(num)) a.invalidate(); + return a; +} + +StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs) +{ + StringSumHelper &a = const_cast(lhs); + if (!a.concat(rhs)) a.invalidate(); + return a; +} + +/*********************************************/ +/* Comparison */ +/*********************************************/ + +int String::compareTo(const String &s) const +{ + if (!buffer || !s.buffer) { + if (s.buffer && s.len > 0) return 0 - *(unsigned char *)s.buffer; + if (buffer && len > 0) return *(unsigned char *)buffer; + return 0; + } + return strcmp(buffer, s.buffer); +} + +unsigned char String::equals(const String &s2) const +{ + return (len == s2.len && compareTo(s2) == 0); +} + +unsigned char String::equals(const char *cstr) const +{ + if (len == 0) return (cstr == NULL || *cstr == 0); + if (cstr == NULL) return buffer[0] == 0; + return strcmp(buffer, cstr) == 0; +} + +unsigned char String::operator<(const String &rhs) const +{ + return compareTo(rhs) < 0; +} + +unsigned char String::operator>(const String &rhs) const +{ + return compareTo(rhs) > 0; +} + +unsigned char String::operator<=(const String &rhs) const +{ + return compareTo(rhs) <= 0; +} + +unsigned char String::operator>=(const String &rhs) const +{ + return compareTo(rhs) >= 0; +} + +unsigned char String::equalsIgnoreCase( const String &s2 ) const +{ + if (this == &s2) return 1; + if (len != s2.len) return 0; + if (len == 0) return 1; + const char *p1 = buffer; + const char *p2 = s2.buffer; + while (*p1) { + if (tolower(*p1++) != tolower(*p2++)) return 0; + } + return 1; +} + +unsigned char String::startsWith( const String &s2 ) const +{ + if (len < s2.len) return 0; + return startsWith(s2, 0); +} + +unsigned char String::startsWith( const String &s2, unsigned int offset ) const +{ + if (offset > len - s2.len || !buffer || !s2.buffer) return 0; + return strncmp( &buffer[offset], s2.buffer, s2.len ) == 0; +} + +unsigned char String::endsWith( const String &s2 ) const +{ + if ( len < s2.len || !buffer || !s2.buffer) return 0; + return strcmp(&buffer[len - s2.len], s2.buffer) == 0; +} + +/*********************************************/ +/* Character Access */ +/*********************************************/ + +char String::charAt(unsigned int loc) const +{ + return operator[](loc); +} + +void String::setCharAt(unsigned int loc, char c) +{ + if (loc < len) buffer[loc] = c; +} + +char & String::operator[](unsigned int index) +{ + static char dummy_writable_char; + if (index >= len || !buffer) { + dummy_writable_char = 0; + return dummy_writable_char; + } + return buffer[index]; +} + +char String::operator[]( unsigned int index ) const +{ + if (index >= len || !buffer) return 0; + return buffer[index]; +} + +void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index) const +{ + if (!bufsize || !buf) return; + if (index >= len) { + buf[0] = 0; + return; + } + unsigned int n = bufsize - 1; + if (n > len - index) n = len - index; + strncpy((char *)buf, buffer + index, n); + buf[n] = 0; +} + +/*********************************************/ +/* Search */ +/*********************************************/ + +int String::indexOf(char c) const +{ + return indexOf(c, 0); +} + +int String::indexOf( char ch, unsigned int fromIndex ) const +{ + if (fromIndex >= len) return -1; + const char* temp = strchr(buffer + fromIndex, ch); + if (temp == NULL) return -1; + return temp - buffer; +} + +int String::indexOf(const String &s2) const +{ + return indexOf(s2, 0); +} + +int String::indexOf(const String &s2, unsigned int fromIndex) const +{ + if (fromIndex >= len) return -1; + const char *found = strstr(buffer + fromIndex, s2.buffer); + if (found == NULL) return -1; + return found - buffer; +} + +int String::lastIndexOf( char theChar ) const +{ + return lastIndexOf(theChar, len - 1); +} + +int String::lastIndexOf(char ch, unsigned int fromIndex) const +{ + if (fromIndex >= len) return -1; + char tempchar = buffer[fromIndex + 1]; + buffer[fromIndex + 1] = '\0'; + char* temp = strrchr( buffer, ch ); + buffer[fromIndex + 1] = tempchar; + if (temp == NULL) return -1; + return temp - buffer; +} + +int String::lastIndexOf(const String &s2) const +{ + return lastIndexOf(s2, len - s2.len); +} + +int String::lastIndexOf(const String &s2, unsigned int fromIndex) const +{ + if (s2.len == 0 || len == 0 || s2.len > len) return -1; + if (fromIndex >= len) fromIndex = len - 1; + int found = -1; + for (char *p = buffer; p <= buffer + fromIndex; p++) { + p = strstr(p, s2.buffer); + if (!p) break; + if ((unsigned int)(p - buffer) <= fromIndex) found = p - buffer; + } + return found; +} + +String String::substring(unsigned int left, unsigned int right) const +{ + if (left > right) { + unsigned int temp = right; + right = left; + left = temp; + } + String out; + if (left >= len) return out; + if (right > len) right = len; + char temp = buffer[right]; // save the replaced character + buffer[right] = '\0'; + out = buffer + left; // pointer arithmetic + buffer[right] = temp; //restore character + return out; +} + +/*********************************************/ +/* Modification */ +/*********************************************/ + +void String::replace(char find, char replace) +{ + if (!buffer) return; + for (char *p = buffer; *p; p++) { + if (*p == find) *p = replace; + } +} + +void String::replace(const String& find, const String& replace) +{ + if (len == 0 || find.len == 0) return; + int diff = replace.len - find.len; + char *readFrom = buffer; + char *foundAt; + if (diff == 0) { + while ((foundAt = strstr(readFrom, find.buffer)) != NULL) { + memcpy(foundAt, replace.buffer, replace.len); + readFrom = foundAt + replace.len; + } + } else if (diff < 0) { + char *writeTo = buffer; + while ((foundAt = strstr(readFrom, find.buffer)) != NULL) { + unsigned int n = foundAt - readFrom; + memcpy(writeTo, readFrom, n); + writeTo += n; + memcpy(writeTo, replace.buffer, replace.len); + writeTo += replace.len; + readFrom = foundAt + find.len; + len += diff; + } + strcpy(writeTo, readFrom); + } else { + unsigned int size = len; // compute size needed for result + while ((foundAt = strstr(readFrom, find.buffer)) != NULL) { + readFrom = foundAt + find.len; + size += diff; + } + if (size == len) return; + if (size > capacity && !changeBuffer(size)) return; // XXX: tell user! + int index = len - 1; + while (index >= 0 && (index = lastIndexOf(find, index)) >= 0) { + readFrom = buffer + index + find.len; + memmove(readFrom + diff, readFrom, len - (readFrom - buffer)); + len += diff; + buffer[len] = 0; + memcpy(buffer + index, replace.buffer, replace.len); + index--; + } + } +} + +void String::remove(unsigned int index){ + // Pass the biggest integer as the count. The remove method + // below will take care of truncating it at the end of the + // string. + remove(index, (unsigned int)-1); +} + +void String::remove(unsigned int index, unsigned int count){ + if (index >= len) { return; } + if (count <= 0) { return; } + if (count > len - index) { count = len - index; } + char *writeTo = buffer + index; + len = len - count; + strncpy(writeTo, buffer + index + count,len - index); + buffer[len] = 0; +} + +void String::toLowerCase(void) +{ + if (!buffer) return; + for (char *p = buffer; *p; p++) { + *p = tolower(*p); + } +} + +void String::toUpperCase(void) +{ + if (!buffer) return; + for (char *p = buffer; *p; p++) { + *p = toupper(*p); + } +} + +void String::trim(void) +{ + if (!buffer || len == 0) return; + char *begin = buffer; + while (isspace(*begin)) begin++; + char *end = buffer + len - 1; + while (isspace(*end) && end >= begin) end--; + len = end + 1 - begin; + if (begin > buffer) memcpy(buffer, begin, len); + buffer[len] = 0; +} + +/*********************************************/ +/* Parsing / Conversion */ +/*********************************************/ + +long String::toInt(void) const +{ + if (buffer) return atol(buffer); + return 0; +} + +float String::toFloat(void) const +{ + return float(toDouble()); +} + +double String::toDouble(void) const +{ + if (buffer) return atof(buffer); + return 0; +} diff --git a/sparkfun/samd/cores/arduino51/WString.h b/sparkfun/samd/cores/arduino51/WString.h new file mode 100644 index 00000000..77709c3b --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WString.h @@ -0,0 +1,229 @@ +/* + WString.h - String library for Wiring & Arduino + ...mostly rewritten by Paul Stoffregen... + Copyright (c) 2009-10 Hernando Barragan. All right reserved. + Copyright 2011, Paul Stoffregen, paul@pjrc.com + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef String_class_h +#define String_class_h +#ifdef __cplusplus + +#include +#include +#include +#include + +// When compiling programs with this class, the following gcc parameters +// dramatically increase performance and memory (RAM) efficiency, typically +// with little or no increase in code size. +// -felide-constructors +// -std=c++0x + +class __FlashStringHelper; +#define F(string_literal) (reinterpret_cast(PSTR(string_literal))) + +// An inherited class for holding the result of a concatenation. These +// result objects are assumed to be writable by subsequent concatenations. +class StringSumHelper; + +// The string class +class String +{ + // use a function pointer to allow for "if (s)" without the + // complications of an operator bool(). for more information, see: + // http://www.artima.com/cppsource/safebool.html + typedef void (String::*StringIfHelperType)() const; + void StringIfHelper() const {} + +public: + // constructors + // creates a copy of the initial value. + // if the initial value is null or invalid, or if memory allocation + // fails, the string will be marked as invalid (i.e. "if (s)" will + // be false). + String(const char *cstr = ""); + String(const String &str); + String(const __FlashStringHelper *str); + #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) + String(String &&rval); + String(StringSumHelper &&rval); + #endif + explicit String(char c); + explicit String(unsigned char, unsigned char base=10); + explicit String(int, unsigned char base=10); + explicit String(unsigned int, unsigned char base=10); + explicit String(long, unsigned char base=10); + explicit String(unsigned long, unsigned char base=10); + explicit String(float, unsigned char decimalPlaces=2); + explicit String(double, unsigned char decimalPlaces=2); + ~String(void); + + // memory management + // return true on success, false on failure (in which case, the string + // is left unchanged). reserve(0), if successful, will validate an + // invalid string (i.e., "if (s)" will be true afterwards) + unsigned char reserve(unsigned int size); + inline unsigned int length(void) const {return len;} + + // creates a copy of the assigned value. if the value is null or + // invalid, or if the memory allocation fails, the string will be + // marked as invalid ("if (s)" will be false). + String & operator = (const String &rhs); + String & operator = (const char *cstr); + String & operator = (const __FlashStringHelper *str); + #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) + String & operator = (String &&rval); + String & operator = (StringSumHelper &&rval); + #endif + + // concatenate (works w/ built-in types) + + // returns true on success, false on failure (in which case, the string + // is left unchanged). if the argument is null or invalid, the + // concatenation is considered unsucessful. + unsigned char concat(const String &str); + unsigned char concat(const char *cstr); + unsigned char concat(char c); + unsigned char concat(unsigned char c); + unsigned char concat(int num); + unsigned char concat(unsigned int num); + unsigned char concat(long num); + unsigned char concat(unsigned long num); + unsigned char concat(float num); + unsigned char concat(double num); + unsigned char concat(const __FlashStringHelper * str); + + // if there's not enough memory for the concatenated value, the string + // will be left unchanged (but this isn't signalled in any way) + String & operator += (const String &rhs) {concat(rhs); return (*this);} + String & operator += (const char *cstr) {concat(cstr); return (*this);} + String & operator += (char c) {concat(c); return (*this);} + String & operator += (unsigned char num) {concat(num); return (*this);} + String & operator += (int num) {concat(num); return (*this);} + String & operator += (unsigned int num) {concat(num); return (*this);} + String & operator += (long num) {concat(num); return (*this);} + String & operator += (unsigned long num) {concat(num); return (*this);} + String & operator += (float num) {concat(num); return (*this);} + String & operator += (double num) {concat(num); return (*this);} + String & operator += (const __FlashStringHelper *str){concat(str); return (*this);} + + friend StringSumHelper & operator + (const StringSumHelper &lhs, const String &rhs); + friend StringSumHelper & operator + (const StringSumHelper &lhs, const char *cstr); + friend StringSumHelper & operator + (const StringSumHelper &lhs, char c); + friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned char num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, int num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned int num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, long num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, unsigned long num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, float num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, double num); + friend StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs); + + // comparison (only works w/ Strings and "strings") + operator StringIfHelperType() const { return buffer ? &String::StringIfHelper : 0; } + int compareTo(const String &s) const; + unsigned char equals(const String &s) const; + unsigned char equals(const char *cstr) const; + unsigned char operator == (const String &rhs) const {return equals(rhs);} + unsigned char operator == (const char *cstr) const {return equals(cstr);} + unsigned char operator != (const String &rhs) const {return !equals(rhs);} + unsigned char operator != (const char *cstr) const {return !equals(cstr);} + unsigned char operator < (const String &rhs) const; + unsigned char operator > (const String &rhs) const; + unsigned char operator <= (const String &rhs) const; + unsigned char operator >= (const String &rhs) const; + unsigned char equalsIgnoreCase(const String &s) const; + unsigned char startsWith( const String &prefix) const; + unsigned char startsWith(const String &prefix, unsigned int offset) const; + unsigned char endsWith(const String &suffix) const; + + // character acccess + char charAt(unsigned int index) const; + void setCharAt(unsigned int index, char c); + char operator [] (unsigned int index) const; + char& operator [] (unsigned int index); + void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const; + void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const + { getBytes((unsigned char *)buf, bufsize, index); } + const char* c_str() const { return buffer; } + char* begin() { return buffer; } + char* end() { return buffer + length(); } + const char* begin() const { return c_str(); } + const char* end() const { return c_str() + length(); } + + // search + int indexOf( char ch ) const; + int indexOf( char ch, unsigned int fromIndex ) const; + int indexOf( const String &str ) const; + int indexOf( const String &str, unsigned int fromIndex ) const; + int lastIndexOf( char ch ) const; + int lastIndexOf( char ch, unsigned int fromIndex ) const; + int lastIndexOf( const String &str ) const; + int lastIndexOf( const String &str, unsigned int fromIndex ) const; + String substring( unsigned int beginIndex ) const { return substring(beginIndex, len); }; + String substring( unsigned int beginIndex, unsigned int endIndex ) const; + + // modification + void replace(char find, char replace); + void replace(const String& find, const String& replace); + void remove(unsigned int index); + void remove(unsigned int index, unsigned int count); + void toLowerCase(void); + void toUpperCase(void); + void trim(void); + + // parsing/conversion + long toInt(void) const; + float toFloat(void) const; + double toDouble(void) const; + +protected: + char *buffer; // the actual char array + unsigned int capacity; // the array length minus one (for the '\0') + unsigned int len; // the String length (not counting the '\0') +protected: + void init(void); + void invalidate(void); + unsigned char changeBuffer(unsigned int maxStrLen); + unsigned char concat(const char *cstr, unsigned int length); + + // copy and move + String & copy(const char *cstr, unsigned int length); + String & copy(const __FlashStringHelper *pstr, unsigned int length); + #if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) + void move(String &rhs); + #endif +}; + +class StringSumHelper : public String +{ +public: + StringSumHelper(const String &s) : String(s) {} + StringSumHelper(const char *p) : String(p) {} + StringSumHelper(char c) : String(c) {} + StringSumHelper(unsigned char num) : String(num) {} + StringSumHelper(int num) : String(num) {} + StringSumHelper(unsigned int num) : String(num) {} + StringSumHelper(long num) : String(num) {} + StringSumHelper(unsigned long num) : String(num) {} + StringSumHelper(float num) : String(num) {} + StringSumHelper(double num) : String(num) {} +}; + +#endif // __cplusplus +#endif // String_class_h diff --git a/sparkfun/samd/cores/arduino51/WVariant.h b/sparkfun/samd/cores/arduino51/WVariant.h new file mode 100644 index 00000000..618c8600 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/WVariant.h @@ -0,0 +1,396 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include "sam.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* Definitions and types for pins */ +typedef enum _EAnalogChannel +{ + No_ADC_Channel=-1, + ADC_Channel0=0, + ADC_Channel1=1, + ADC_Channel2=2, + ADC_Channel3=3, + ADC_Channel4=4, + ADC_Channel5=5, + ADC_Channel6=6, + ADC_Channel7=7, +#if defined __SAMD21J18A__ || defined(__SAMD51__) + ADC_Channel8=8, + ADC_Channel9=9, +#endif // __SAMD21J18A__ + ADC_Channel10=10, + ADC_Channel11=11, +#if defined __SAMD21J18A__ || defined(__SAMD51__) + ADC_Channel12=12, + ADC_Channel13=13, + ADC_Channel14=14, + ADC_Channel15=15, +#endif // __SAMD21J18A__ + ADC_Channel16=16, + ADC_Channel17=17, + ADC_Channel18=18, + ADC_Channel19=19, + DAC_Channel0, + DAC_Channel1, +} EAnalogChannel ; + +#if defined(__SAMD51__) + +#if defined(__SAMD51G19A__) + +typedef enum _ETCChannel +{ + NOT_ON_TIMER=-1, + TCC0_CH0 = (0<<8)|(0), + TCC0_CH1 = (0<<8)|(1), + TCC0_CH2 = (0<<8)|(2), + TCC0_CH3 = (0<<8)|(3), + TCC0_CH4 = (0<<8)|(4), + TCC0_CH5 = (0<<8)|(5), + TCC1_CH0 = (1<<8)|(0), + TCC1_CH1 = (1<<8)|(1), + TCC1_CH2 = (1<<8)|(2), + TCC1_CH3 = (1<<8)|(3), + TCC2_CH0 = (2<<8)|(0), + TCC2_CH1 = (2<<8)|(1), + TCC2_CH2 = (2<<8)|(2), + TC0_CH0 = (3<<8)|(0), + TC0_CH1 = (3<<8)|(1), + TC1_CH0 = (4<<8)|(0), + TC1_CH1 = (4<<8)|(1), + TC2_CH0 = (5<<8)|(0), + TC2_CH1 = (5<<8)|(1), + TC3_CH0 = (6<<8)|(0), + TC3_CH1 = (6<<8)|(1), +} ETCChannel ; +#elif defined(__SAMD51J19A__) || defined(__SAMD51J20A__) + +typedef enum _ETCChannel +{ + NOT_ON_TIMER=-1, + TCC0_CH0 = (0<<8)|(0), + TCC0_CH1 = (0<<8)|(1), + TCC0_CH2 = (0<<8)|(2), + TCC0_CH3 = (0<<8)|(3), + TCC0_CH4 = (0<<8)|(4), + TCC0_CH5 = (0<<8)|(5), + TCC1_CH0 = (1<<8)|(0), + TCC1_CH1 = (1<<8)|(1), + TCC1_CH2 = (1<<8)|(2), + TCC1_CH3 = (1<<8)|(3), + TCC2_CH0 = (2<<8)|(0), + TCC2_CH1 = (2<<8)|(1), + TCC2_CH2 = (2<<8)|(2), + TCC3_CH0 = (3<<8)|(0), + TCC3_CH1 = (3<<8)|(1), + TCC4_CH0 = (4<<8)|(0), + TCC4_CH1 = (4<<8)|(1), + TC0_CH0 = (5<<8)|(0), + TC0_CH1 = (5<<8)|(1), + TC1_CH0 = (6<<8)|(0), + TC1_CH1 = (6<<8)|(1), + TC2_CH0 = (7<<8)|(0), + TC2_CH1 = (7<<8)|(1), + TC3_CH0 = (8<<8)|(0), + TC3_CH1 = (8<<8)|(1), + TC4_CH0 = (9<<8)|(0), + TC4_CH1 = (9<<8)|(1), + TC5_CH0 = (10<<8)|(0), + TC5_CH1 = (10<<8)|(1), + TC6_CH0 = (11<<8)|(0), + TC6_CH1 = (11<<8)|(1), + TC7_CH0 = (12<<8)|(0), + TC7_CH1 = (12<<8)|(1), +} ETCChannel ; + +#elif defined(__SAMD51P19A__) || defined(__SAMD51P20A__) + +typedef enum _ETCChannel +{ + NOT_ON_TIMER=-1, + TCC0_CH0 = (0<<8)|(0), + TCC0_CH1 = (0<<8)|(1), + TCC0_CH2 = (0<<8)|(2), + TCC0_CH3 = (0<<8)|(3), + TCC0_CH4 = (0<<8)|(4), + TCC0_CH5 = (0<<8)|(5), + TCC1_CH0 = (1<<8)|(0), + TCC1_CH1 = (1<<8)|(1), + TCC1_CH2 = (1<<8)|(2), + TCC1_CH3 = (1<<8)|(3), + TCC2_CH0 = (2<<8)|(0), + TCC2_CH1 = (2<<8)|(1), + TCC2_CH2 = (2<<8)|(2), + TCC3_CH0 = (3<<8)|(0), + TCC3_CH1 = (3<<8)|(1), + TCC4_CH0 = (4<<8)|(0), + TCC4_CH1 = (4<<8)|(1), + TC0_CH0 = (5<<8)|(0), + TC0_CH1 = (5<<8)|(1), + TC1_CH0 = (6<<8)|(0), + TC1_CH1 = (6<<8)|(1), + TC2_CH0 = (7<<8)|(0), + TC2_CH1 = (7<<8)|(1), + TC3_CH0 = (8<<8)|(0), + TC3_CH1 = (8<<8)|(1), + TC4_CH0 = (9<<8)|(0), + TC4_CH1 = (9<<8)|(1), + TC5_CH0 = (10<<8)|(0), + TC5_CH1 = (10<<8)|(1), + TC6_CH0 = (11<<8)|(0), + TC6_CH1 = (11<<8)|(1), + TC7_CH0 = (12<<8)|(0), + TC7_CH1 = (12<<8)|(1), +} ETCChannel ; + +#endif + +typedef ETCChannel EPWMChannel; +extern const uint32_t GCLK_CLKCTRL_IDs[TCC_INST_NUM+TC_INST_NUM]; + +#define NOT_ON_PWM NOT_ON_TIMER + +#else +// Definitions for TC channels +typedef enum _ETCChannel +{ + NOT_ON_TIMER=-1, + TCC0_CH0 = (0<<8)|(0), + TCC0_CH1 = (0<<8)|(1), + TCC0_CH2 = (0<<8)|(2), + TCC0_CH3 = (0<<8)|(3), + TCC0_CH4 = (0<<8)|(0), // Channel 4 is 0! + TCC0_CH5 = (0<<8)|(1), // Channel 5 is 1! + TCC0_CH6 = (0<<8)|(2), // Channel 6 is 2! + TCC0_CH7 = (0<<8)|(3), // Channel 7 is 3! + TCC1_CH0 = (1<<8)|(0), + TCC1_CH1 = (1<<8)|(1), + TCC1_CH2 = (1<<8)|(0), // Channel 2 is 0! + TCC1_CH3 = (1<<8)|(1), // Channel 3 is 1! + TCC2_CH0 = (2<<8)|(0), + TCC2_CH1 = (2<<8)|(1), + TCC2_CH2 = (2<<8)|(0), // Channel 2 is 0! + TCC2_CH3 = (2<<8)|(1), // Channel 3 is 1! + TC3_CH0 = (3<<8)|(0), + TC3_CH1 = (3<<8)|(1), + TC4_CH0 = (4<<8)|(0), + TC4_CH1 = (4<<8)|(1), + TC5_CH0 = (5<<8)|(0), + TC5_CH1 = (5<<8)|(1), +} ETCChannel ; + +// Definitions for PWM channels +typedef enum _EPWMChannel +{ + NOT_ON_PWM=-1, + PWM0_CH0=TCC0_CH0, + PWM0_CH1=TCC0_CH1, + PWM0_CH2=TCC0_CH2, + PWM0_CH3=TCC0_CH3, + PWM0_CH4=TCC0_CH4, + PWM0_CH5=TCC0_CH5, + PWM0_CH6=TCC0_CH6, + PWM0_CH7=TCC0_CH7, + PWM1_CH0=TCC1_CH0, + PWM1_CH1=TCC1_CH1, + PWM1_CH2=TCC1_CH2, + PWM1_CH3=TCC1_CH3, + PWM2_CH0=TCC2_CH0, + PWM2_CH1=TCC2_CH1, + PWM2_CH2=TCC2_CH2, + PWM2_CH3=TCC2_CH3, + PWM3_CH0=TC3_CH0, + PWM3_CH1=TC3_CH1, + PWM4_CH0=TC4_CH0, + PWM4_CH1=TC4_CH1, + PWM5_CH0=TC5_CH0, + PWM5_CH1=TC5_CH1, +#if defined(__SAMD21J18A__) + PWM6_CH0=TC6_CH0, + PWM6_CH1=TC6_CH1, + PWM7_CH0=TC7_CH0, + PWM7_CH1=TC7_CH1, +#endif // __SAMD21J18A__ +} EPWMChannel ; + +#endif + +extern const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM] ; + +#define GetTCNumber( x ) ( (x) >> 8 ) +#define GetTCChannelNumber( x ) ( (x) & 0xff ) +#define GetTC( x ) ( g_apTCInstances[(x) >> 8] ) + +typedef enum _EPortType +{ + NOT_A_PORT=-1, + PORTA=0, + PORTB=1, + PORTC=2, + PORTD=3, +} EPortType ; + +#define PIN_NOT_A_PIN (UINT_MAX) + +typedef enum +{ + EXTERNAL_INT_0 = 0, + EXTERNAL_INT_1, + EXTERNAL_INT_2, + EXTERNAL_INT_3, + EXTERNAL_INT_4, + EXTERNAL_INT_5, + EXTERNAL_INT_6, + EXTERNAL_INT_7, + EXTERNAL_INT_8, + EXTERNAL_INT_9, + EXTERNAL_INT_10, + EXTERNAL_INT_11, + EXTERNAL_INT_12, + EXTERNAL_INT_13, + EXTERNAL_INT_14, + EXTERNAL_INT_15, + EXTERNAL_INT_NMI, + EXTERNAL_NUM_INTERRUPTS, + NOT_AN_INTERRUPT = -1, + EXTERNAL_INT_NONE = NOT_AN_INTERRUPT, +} EExt_Interrupts ; + +//A B C D E F G H +//EIC REF ADC AC PTC DAC SERCOM SERCOM_ALT TC/TCC TCC COM AC/GCLK + +typedef enum _EPioType +{ + PIO_NOT_A_PIN=-1, /* Not under control of a peripheral. */ + PIO_EXTINT=0, /* The pin is controlled by the associated signal of peripheral A. */ + PIO_ANALOG, /* The pin is controlled by the associated signal of peripheral B. */ + PIO_SERCOM, /* The pin is controlled by the associated signal of peripheral C. */ + PIO_SERCOM_ALT, /* The pin is controlled by the associated signal of peripheral D. */ + PIO_TIMER, /* The pin is controlled by the associated signal of peripheral E. */ + PIO_TIMER_ALT, /* The pin is controlled by the associated signal of peripheral F. */ +#if defined(__SAMD51__) + PIO_TCC_PDEC, /* The pin is controlled by the associated signal of peripheral G. */ + PIO_COM, /* The pin is controlled by the associated signal of peripheral H. */ + PIO_SDHC, /* The pin is controlled by the associated signal of peripheral I. */ + PIO_I2S, /* The pin is controlled by the associated signal of peripheral J. */ + PIO_PCC, /* The pin is controlled by the associated signal of peripheral K. */ + PIO_GMAC, /* The pin is controlled by the associated signal of peripheral L. */ + PIO_AC_CLK, /* The pin is controlled by the associated signal of peripheral M. */ + PIO_CCL, /* The pin is controlled by the associated signal of peripheral N. */ +#else + PIO_COM, /* The pin is controlled by the associated signal of peripheral G. */ + PIO_AC_CLK, /* The pin is controlled by the associated signal of peripheral H. */ +#endif + PIO_DIGITAL, /* The pin is controlled by PORT. */ + PIO_INPUT, /* The pin is controlled by PORT and is an input. */ + PIO_INPUT_PULLUP, /* The pin is controlled by PORT and is an input with internal pull-up resistor enabled. */ + PIO_OUTPUT, /* The pin is controlled by PORT and is an output. */ + + PIO_PWM=PIO_TIMER, + PIO_PWM_ALT=PIO_TIMER_ALT, +} EPioType ; + +/** + * Pin Attributes to be OR-ed + */ +#define PIN_ATTR_NONE (0UL<<0) +#define PIN_ATTR_COMBO (1UL<<0) +#define PIN_ATTR_ANALOG (1UL<<1) +#define PIN_ATTR_DIGITAL (1UL<<2) +#define PIN_ATTR_TIMER (1UL<<4) +#define PIN_ATTR_TIMER_ALT (1UL<<5) +#define PIN_ATTR_EXTINT (1UL<<6) +#define PIN_ATTR_ANALOG_ALT (1UL<<7) + +#if defined(__SAMD51__) +// these correspond to the mux table +#define PIN_ATTR_PWM_E (1UL<<3) +#define PIN_ATTR_PWM_F (1UL<<8) +#define PIN_ATTR_PWM_G (1UL<<9) +#else +#define PIN_ATTR_PWM (1UL<<3) +#endif + +/* Types used for the table below */ +typedef struct _PinDescription +{ + EPortType ulPort ; + uint32_t ulPin ; + EPioType ulPinType ; + uint32_t ulPinAttribute ; + EAnalogChannel ulADCChannelNumber ; /* ADC Channel number in the SAM device */ + EPWMChannel ulPWMChannel ; + ETCChannel ulTCChannel ; + EExt_Interrupts ulExtInt ; +} PinDescription ; + +/* Pins table to be instantiated into variant.cpp */ +extern const PinDescription g_APinDescription[] ; + +/* Generic Clock Multiplexer IDs */ +#define GCM_DFLL48M_REF (0x00U) +#define GCM_FDPLL96M_INPUT (0x01U) +#define GCM_FDPLL96M_32K (0x02U) +#define GCM_WDT (0x03U) +#define GCM_RTC (0x04U) +#define GCM_EIC (0x05U) +#define GCM_USB (0x06U) +#define GCM_EVSYS_CHANNEL_0 (0x07U) +#define GCM_EVSYS_CHANNEL_1 (0x08U) +#define GCM_EVSYS_CHANNEL_2 (0x09U) +#define GCM_EVSYS_CHANNEL_3 (0x0AU) +#define GCM_EVSYS_CHANNEL_4 (0x0BU) +#define GCM_EVSYS_CHANNEL_5 (0x0CU) +#define GCM_EVSYS_CHANNEL_6 (0x0DU) +#define GCM_EVSYS_CHANNEL_7 (0x0EU) +#define GCM_EVSYS_CHANNEL_8 (0x0FU) +#define GCM_EVSYS_CHANNEL_9 (0x10U) +#define GCM_EVSYS_CHANNEL_10 (0x11U) +#define GCM_EVSYS_CHANNEL_11 (0x12U) +#define GCM_SERCOMx_SLOW (0x13U) +#define GCM_SERCOM0_CORE (0x14U) +#define GCM_SERCOM1_CORE (0x15U) +#define GCM_SERCOM2_CORE (0x16U) +#define GCM_SERCOM3_CORE (0x17U) +#define GCM_SERCOM4_CORE (0x18U) +#define GCM_SERCOM5_CORE (0x19U) +#define GCM_TCC0_TCC1 (0x1AU) +#define GCM_TCC2_TC3 (0x1BU) +#define GCM_TC4_TC5 (0x1CU) +#define GCM_TC6_TC7 (0x1DU) +#define GCM_ADC (0x1EU) +#define GCM_AC_DIG (0x1FU) +#define GCM_AC_ANA (0x20U) +#define GCM_DAC (0x21U) +#define GCM_PTC (0x22U) +#define GCM_I2S_0 (0x23U) +#define GCM_I2S_1 (0x24U) + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sparkfun/samd/cores/arduino51/abi.cpp b/sparkfun/samd/cores/arduino51/abi.cpp new file mode 100644 index 00000000..bd2f43ad --- /dev/null +++ b/sparkfun/samd/cores/arduino51/abi.cpp @@ -0,0 +1,37 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); +extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); + +void __cxa_pure_virtual(void) { + // We might want to write some diagnostics to uart in this case + //std::terminate(); + while (1) + ; +} + +void __cxa_deleted_virtual(void) { + // We might want to write some diagnostics to uart in this case + //std::terminate(); + while (1) + ; +} + diff --git a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pulse.c b/sparkfun/samd/cores/arduino51/avr/dtostrf.c similarity index 54% rename from sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pulse.c rename to sparkfun/samd/cores/arduino51/avr/dtostrf.c index 16b2ccc0..de164277 100644 --- a/sparkfun/esp8266/cores/esp8266/core_esp8266_wiring_pulse.c +++ b/sparkfun/samd/cores/arduino51/avr/dtostrf.c @@ -1,9 +1,7 @@ -/* - pulse.c - wiring pulseIn implementation for esp8266 +/* + dtostrf - Emulation for dtostrf function from avr-libc + Copyright (c) 2015 Arduino LLC. All rights reserved. - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -18,15 +16,15 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "wiring_private.h" -#include "pins_arduino.h" -unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) { - pinMode(pin, INPUT); - uint32_t start = micros(); - while(digitalRead(pin) == state && (micros() - start) < timeout); - while(digitalRead(pin) != state && (micros() - start) < timeout); - start = micros(); - while(digitalRead(pin) == state && (micros() - start) < timeout); - return micros() - start; +#include + +char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { + asm(".global _printf_float"); + + char fmt[20]; + sprintf(fmt, "%%%d.%df", width, prec); + sprintf(sout, fmt, val); + return sout; } + diff --git a/sparkfun/esp8266/cores/esp8266/twi.h b/sparkfun/samd/cores/arduino51/avr/dtostrf.h similarity index 58% rename from sparkfun/esp8266/cores/esp8266/twi.h rename to sparkfun/samd/cores/arduino51/avr/dtostrf.h index 9e661e88..762a8864 100644 --- a/sparkfun/esp8266/cores/esp8266/twi.h +++ b/sparkfun/samd/cores/arduino51/avr/dtostrf.h @@ -1,9 +1,7 @@ -/* - twi.h - Software I2C library for esp8266 +/* + dtostrf - Emulation for dtostrf function from avr-libc + Copyright (c) 2015 Arduino LLC. All rights reserved. - Copyright (c) 2015 Hristo Gochkov. All rights reserved. - This file is part of the esp8266 core for Arduino environment. - This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either @@ -18,22 +16,15 @@ License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef SI2C_h -#define SI2C_h -#include "Arduino.h" + +#pragma once #ifdef __cplusplus extern "C" { #endif -void twi_init(unsigned char sda, unsigned char scl); -void twi_stop(void); -void twi_setClock(unsigned int freq); -uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); -uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); +char *dtostrf(double val, signed char width, unsigned char prec, char *sout); #ifdef __cplusplus } #endif - -#endif \ No newline at end of file diff --git a/sparkfun/samd/cores/arduino51/avr/interrupt.h b/sparkfun/samd/cores/arduino51/avr/interrupt.h new file mode 100644 index 00000000..950509dd --- /dev/null +++ b/sparkfun/samd/cores/arduino51/avr/interrupt.h @@ -0,0 +1,23 @@ +/* + Copyright (c) 2015 Arduino LCC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* + Empty file. + This file is here to allow compatibility with sketches (made for AVR) + that includes +*/ diff --git a/sparkfun/samd/cores/arduino51/avr/io.h b/sparkfun/samd/cores/arduino51/avr/io.h new file mode 100644 index 00000000..33d20cdd --- /dev/null +++ b/sparkfun/samd/cores/arduino51/avr/io.h @@ -0,0 +1,32 @@ +/* + io.h - Definitions for compatibility with AVR io macros + + Copyright (c) 2016 Arduino 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 _IO_H_ +#define _IO_H_ + +#define RAMSTART (HMCRAMC0_ADDR) +#define RAMSIZE (HMCRAMC0_SIZE) +#define RAMEND (RAMSTART + RAMSIZE - 1) + +#endif diff --git a/sparkfun/samd/cores/arduino51/avr/pgmspace.h b/sparkfun/samd/cores/arduino51/avr/pgmspace.h new file mode 100644 index 00000000..de92051a --- /dev/null +++ b/sparkfun/samd/cores/arduino51/avr/pgmspace.h @@ -0,0 +1,122 @@ +/* + pgmspace.h - Definitions for compatibility with AVR pgmspace macros + + Copyright (c) 2015 Arduino LLC + + Based on work of Paul Stoffregen on Teensy 3 (http://pjrc.com) + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE +*/ + +#ifndef __PGMSPACE_H_ +#define __PGMSPACE_H_ 1 + +#include + +#define PROGMEM +#define PGM_P const char * +#define PSTR(str) (str) + +#define _SFR_BYTE(n) (n) + +typedef void prog_void; +typedef char prog_char; +typedef unsigned char prog_uchar; +typedef int8_t prog_int8_t; +typedef uint8_t prog_uint8_t; +typedef int16_t prog_int16_t; +typedef uint16_t prog_uint16_t; +typedef int32_t prog_int32_t; +typedef uint32_t prog_uint32_t; +typedef int64_t prog_int64_t; +typedef uint64_t prog_uint64_t; + +typedef const void* int_farptr_t; +typedef const void* uint_farptr_t; + +#define memchr_P(s, c, n) memchr((s), (c), (n)) +#define memcmp_P(s1, s2, n) memcmp((s1), (s2), (n)) +#define memccpy_P(dest, src, c, n) memccpy((dest), (src), (c), (n)) +#define memcpy_P(dest, src, n) memcpy((dest), (src), (n)) +#define memmem_P(haystack, haystacklen, needle, needlelen) memmem((haystack), (haystacklen), (needle), (needlelen)) +#define memrchr_P(s, c, n) memrchr((s), (c), (n)) +#define strcat_P(dest, src) strcat((dest), (src)) +#define strchr_P(s, c) strchr((s), (c)) +#define strchrnul_P(s, c) strchrnul((s), (c)) +#define strcmp_P(a, b) strcmp((a), (b)) +#define strcpy_P(dest, src) strcpy((dest), (src)) +#define strcasecmp_P(s1, s2) strcasecmp((s1), (s2)) +#define strcasestr_P(haystack, needle) strcasestr((haystack), (needle)) +#define strcspn_P(s, accept) strcspn((s), (accept)) +#define strlcat_P(s1, s2, n) strlcat((s1), (s2), (n)) +#define strlcpy_P(s1, s2, n) strlcpy((s1), (s2), (n)) +#define strlen_P(a) strlen((a)) +#define strnlen_P(s, n) strnlen((s), (n)) +#define strncmp_P(s1, s2, n) strncmp((s1), (s2), (n)) +#define strncasecmp_P(s1, s2, n) strncasecmp((s1), (s2), (n)) +#define strncat_P(s1, s2, n) strncat((s1), (s2), (n)) +#define strncpy_P(s1, s2, n) strncpy((s1), (s2), (n)) +#define strpbrk_P(s, accept) strpbrk((s), (accept)) +#define strrchr_P(s, c) strrchr((s), (c)) +#define strsep_P(sp, delim) strsep((sp), (delim)) +#define strspn_P(s, accept) strspn((s), (accept)) +#define strstr_P(a, b) strstr((a), (b)) +#define strtok_P(s, delim) strtok((s), (delim)) +#define strtok_rP(s, delim, last) strtok((s), (delim), (last)) + +#define strlen_PF(a) strlen((a)) +#define strnlen_PF(src, len) strnlen((src), (len)) +#define memcpy_PF(dest, src, len) memcpy((dest), (src), (len)) +#define strcpy_PF(dest, src) strcpy((dest), (src)) +#define strncpy_PF(dest, src, len) strncpy((dest), (src), (len)) +#define strcat_PF(dest, src) strcat((dest), (src)) +#define strlcat_PF(dest, src, len) strlcat((dest), (src), (len)) +#define strncat_PF(dest, src, len) strncat((dest), (src), (len)) +#define strcmp_PF(s1, s2) strcmp((s1), (s2)) +#define strncmp_PF(s1, s2, n) strncmp((s1), (s2), (n)) +#define strcasecmp_PF(s1, s2) strcasecmp((s1), (s2)) +#define strncasecmp_PF(s1, s2, n) strncasecmp((s1), (s2), (n)) +#define strstr_PF(s1, s2) strstr((s1), (s2)) +#define strlcpy_PF(dest, src, n) strlcpy((dest), (src), (n)) +#define memcmp_PF(s1, s2, n) memcmp((s1), (s2), (n)) + +#define sprintf_P(s, f, ...) sprintf((s), (f), __VA_ARGS__) +#define snprintf_P(s, f, ...) snprintf((s), (f), __VA_ARGS__) + +#define pgm_read_byte(addr) (*(const unsigned char *)(addr)) +#define pgm_read_word(addr) (*(const unsigned short *)(addr)) +#define pgm_read_dword(addr) (*(const unsigned long *)(addr)) +#define pgm_read_float(addr) (*(const float *)(addr)) +#define pgm_read_ptr(addr) (*(const void **)(addr)) + +#define pgm_read_byte_near(addr) pgm_read_byte(addr) +#define pgm_read_word_near(addr) pgm_read_word(addr) +#define pgm_read_dword_near(addr) pgm_read_dword(addr) +#define pgm_read_float_near(addr) pgm_read_float(addr) +#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) + +#define pgm_read_byte_far(addr) pgm_read_byte(addr) +#define pgm_read_word_far(addr) pgm_read_word(addr) +#define pgm_read_dword_far(addr) pgm_read_dword(addr) +#define pgm_read_float_far(addr) pgm_read_float(addr) +#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) + +#define pgm_get_far_address(addr) (&(addr)) + +#endif diff --git a/sparkfun/esp8266/cores/esp8266/binary.h b/sparkfun/samd/cores/arduino51/binary.h similarity index 92% rename from sparkfun/esp8266/cores/esp8266/binary.h rename to sparkfun/samd/cores/arduino51/binary.h index c2f189da..aec4c733 100644 --- a/sparkfun/esp8266/cores/esp8266/binary.h +++ b/sparkfun/samd/cores/arduino51/binary.h @@ -1,21 +1,21 @@ /* - binary.h - Definitions for binary constants - Copyright (c) 2006 David A. Mellis. All right reserved. + binary.h - Definitions for binary constants + Copyright (c) 2006 David A. Mellis. All right reserved. - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ #ifndef Binary_h #define Binary_h diff --git a/sparkfun/samd/cores/arduino51/cortex_handlers.c b/sparkfun/samd/cores/arduino51/cortex_handlers.c new file mode 100644 index 00000000..f47ddee3 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/cortex_handlers.c @@ -0,0 +1,543 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include +#include + +/* RTOS Hooks */ +extern void svcHook(void); +extern void pendSVHook(void); +extern int sysTickHook(void); + +/* Default empty handler */ +void Dummy_Handler(void) +{ +#if defined DEBUG + __BKPT(3); +#endif + for (;;) { } +} + +#if defined(__SAMD51__) + +/* Cortex-M4 processor handlers */ +void Reset_Handler ( void ); +void NMI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void HardFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void MemManage_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void BusFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void UsageFault_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SVC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DebugMon_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PendSV_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SysTick_Handler ( void ); + +/* Peripherals handlers */ +void PM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void MCLK_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSCCTRL_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void OSC32KCTRL_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SUPC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SUPC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void WDT_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void RTC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_8_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_9_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_10_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_11_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_12_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_13_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_14_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_15_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void FREQM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void NVMCTRL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void NVMCTRL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void EVSYS_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PAC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TAL_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TAL_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void RAMECC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM6_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM6_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM6_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM6_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM7_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM7_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM7_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM7_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void USB_0_Handler ( void ) __attribute__ ((weak)); +void USB_1_Handler ( void ) __attribute__ ((weak)); +void USB_2_Handler ( void ) __attribute__ ((weak)); +void USB_3_Handler ( void ) __attribute__ ((weak)); +void TCC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC3_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC3_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC3_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC4_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC4_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC4_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC2_Handler ( void ) __attribute__ ((weak)); //used in Tone.cpp +void TC3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC5_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC6_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC7_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDEC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDEC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PDEC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC0_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC0_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC1_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC1_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void AC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_2_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_3_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_4_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void I2S_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void AES_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void TRNG_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void ICM_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void PUKCC_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void QSPI_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SDHC0_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); +void SDHC1_Handler ( void ) __attribute__ ((weak, alias("Dummy_Handler"))); + +/* Initialize segments */ +extern uint32_t __etext; +extern uint32_t __data_start__; +extern uint32_t __data_end__; +extern uint32_t __bss_start__; +extern uint32_t __bss_end__; +extern uint32_t __StackTop; + +/* Exception Table */ +__attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table = +{ + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (void*) (&__StackTop), + + /* Cortex-M handlers */ + (void*) Reset_Handler, + (void*) NMI_Handler, + (void*) HardFault_Handler, + (void*) MemManage_Handler, + (void*) BusFault_Handler, + (void*) UsageFault_Handler, + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) SVC_Handler, + (void*) DebugMon_Handler, + (void*) (0UL), /* Reserved */ + (void*) PendSV_Handler, + (void*) SysTick_Handler, + + /* Peripheral handlers */ + (void*) PM_Handler, /* 0 Power Manager */ + (void*) MCLK_Handler, /* 1 Main Clock */ + (void*) OSCCTRL_0_Handler, /* 2 Oscillators Control IRQ 0 */ + (void*) OSCCTRL_1_Handler, /* 3 Oscillators Control IRQ 1 */ + (void*) OSCCTRL_2_Handler, /* 4 Oscillators Control IRQ 2 */ + (void*) OSCCTRL_3_Handler, /* 5 Oscillators Control IRQ 3 */ + (void*) OSCCTRL_4_Handler, /* 6 Oscillators Control IRQ 4 */ + (void*) OSC32KCTRL_Handler, /* 7 32kHz Oscillators Control */ + (void*) SUPC_0_Handler, /* 8 Supply Controller IRQ 0 */ + (void*) SUPC_1_Handler, /* 9 Supply Controller IRQ 1 */ + (void*) WDT_Handler, /* 10 Watchdog Timer */ + (void*) RTC_Handler, /* 11 Real-Time Counter */ + (void*) EIC_0_Handler, /* 12 External Interrupt Controller IRQ 0 */ + (void*) EIC_1_Handler, /* 13 External Interrupt Controller IRQ 1 */ + (void*) EIC_2_Handler, /* 14 External Interrupt Controller IRQ 2 */ + (void*) EIC_3_Handler, /* 15 External Interrupt Controller IRQ 3 */ + (void*) EIC_4_Handler, /* 16 External Interrupt Controller IRQ 4 */ + (void*) EIC_5_Handler, /* 17 External Interrupt Controller IRQ 5 */ + (void*) EIC_6_Handler, /* 18 External Interrupt Controller IRQ 6 */ + (void*) EIC_7_Handler, /* 19 External Interrupt Controller IRQ 7 */ + (void*) EIC_8_Handler, /* 20 External Interrupt Controller IRQ 8 */ + (void*) EIC_9_Handler, /* 21 External Interrupt Controller IRQ 9 */ + (void*) EIC_10_Handler, /* 22 External Interrupt Controller IRQ 10 */ + (void*) EIC_11_Handler, /* 23 External Interrupt Controller IRQ 11 */ + (void*) EIC_12_Handler, /* 24 External Interrupt Controller IRQ 12 */ + (void*) EIC_13_Handler, /* 25 External Interrupt Controller IRQ 13 */ + (void*) EIC_14_Handler, /* 26 External Interrupt Controller IRQ 14 */ + (void*) EIC_15_Handler, /* 27 External Interrupt Controller IRQ 15 */ + (void*) FREQM_Handler, /* 28 Frequency Meter */ + (void*) NVMCTRL_0_Handler, /* 29 Non-Volatile Memory Controller IRQ 0 */ + (void*) NVMCTRL_1_Handler, /* 30 Non-Volatile Memory Controller IRQ 1 */ + (void*) DMAC_0_Handler, /* 31 Direct Memory Access Controller IRQ 0 */ + (void*) DMAC_1_Handler, /* 32 Direct Memory Access Controller IRQ 1 */ + (void*) DMAC_2_Handler, /* 33 Direct Memory Access Controller IRQ 2 */ + (void*) DMAC_3_Handler, /* 34 Direct Memory Access Controller IRQ 3 */ + (void*) DMAC_4_Handler, /* 35 Direct Memory Access Controller IRQ 4 */ + (void*) EVSYS_0_Handler, /* 36 Event System Interface IRQ 0 */ + (void*) EVSYS_1_Handler, /* 37 Event System Interface IRQ 1 */ + (void*) EVSYS_2_Handler, /* 38 Event System Interface IRQ 2 */ + (void*) EVSYS_3_Handler, /* 39 Event System Interface IRQ 3 */ + (void*) EVSYS_4_Handler, /* 40 Event System Interface IRQ 4 */ + (void*) PAC_Handler, /* 41 Peripheral Access Controller */ + (void*) TAL_0_Handler, /* 42 Trigger Allocator IRQ 0 */ + (void*) TAL_1_Handler, /* 43 Trigger Allocator IRQ 1 */ + (void*) (0UL), + (void*) RAMECC_Handler, /* 45 RAM ECC */ + (void*) SERCOM0_0_Handler, /* 46 Serial Communication Interface 0 IRQ 0 */ + (void*) SERCOM0_1_Handler, /* 47 Serial Communication Interface 0 IRQ 1 */ + (void*) SERCOM0_2_Handler, /* 48 Serial Communication Interface 0 IRQ 2 */ + (void*) SERCOM0_3_Handler, /* 49 Serial Communication Interface 0 IRQ 3 */ + (void*) SERCOM1_0_Handler, /* 50 Serial Communication Interface 1 IRQ 0 */ + (void*) SERCOM1_1_Handler, /* 51 Serial Communication Interface 1 IRQ 1 */ + (void*) SERCOM1_2_Handler, /* 52 Serial Communication Interface 1 IRQ 2 */ + (void*) SERCOM1_3_Handler, /* 53 Serial Communication Interface 1 IRQ 3 */ + (void*) SERCOM2_0_Handler, /* 54 Serial Communication Interface 2 IRQ 0 */ + (void*) SERCOM2_1_Handler, /* 55 Serial Communication Interface 2 IRQ 1 */ + (void*) SERCOM2_2_Handler, /* 56 Serial Communication Interface 2 IRQ 2 */ + (void*) SERCOM2_3_Handler, /* 57 Serial Communication Interface 2 IRQ 3 */ + (void*) SERCOM3_0_Handler, /* 58 Serial Communication Interface 3 IRQ 0 */ + (void*) SERCOM3_1_Handler, /* 59 Serial Communication Interface 3 IRQ 1 */ + (void*) SERCOM3_2_Handler, /* 60 Serial Communication Interface 3 IRQ 2 */ + (void*) SERCOM3_3_Handler, /* 61 Serial Communication Interface 3 IRQ 3 */ + (void*) SERCOM4_0_Handler, /* 62 Serial Communication Interface 4 IRQ 0 */ + (void*) SERCOM4_1_Handler, /* 63 Serial Communication Interface 4 IRQ 1 */ + (void*) SERCOM4_2_Handler, /* 64 Serial Communication Interface 4 IRQ 2 */ + (void*) SERCOM4_3_Handler, /* 65 Serial Communication Interface 4 IRQ 3 */ + (void*) SERCOM5_0_Handler, /* 66 Serial Communication Interface 5 IRQ 0 */ + (void*) SERCOM5_1_Handler, /* 67 Serial Communication Interface 5 IRQ 1 */ + (void*) SERCOM5_2_Handler, /* 68 Serial Communication Interface 5 IRQ 2 */ + (void*) SERCOM5_3_Handler, /* 69 Serial Communication Interface 5 IRQ 3 */ + (void*) SERCOM6_0_Handler, /* 70 Serial Communication Interface 6 IRQ 0 */ + (void*) SERCOM6_1_Handler, /* 71 Serial Communication Interface 6 IRQ 1 */ + (void*) SERCOM6_2_Handler, /* 72 Serial Communication Interface 6 IRQ 2 */ + (void*) SERCOM6_3_Handler, /* 73 Serial Communication Interface 6 IRQ 3 */ + (void*) SERCOM7_0_Handler, /* 74 Serial Communication Interface 7 IRQ 0 */ + (void*) SERCOM7_1_Handler, /* 75 Serial Communication Interface 7 IRQ 1 */ + (void*) SERCOM7_2_Handler, /* 76 Serial Communication Interface 7 IRQ 2 */ + (void*) SERCOM7_3_Handler, /* 77 Serial Communication Interface 7 IRQ 3 */ + (void*) (0UL), + (void*) (0UL), + (void*) USB_0_Handler, /* 80 Universal Serial Bus IRQ 0 */ + (void*) USB_1_Handler, /* 81 Universal Serial Bus IRQ 1 */ + (void*) USB_2_Handler, /* 82 Universal Serial Bus IRQ 2 */ + (void*) USB_3_Handler, /* 83 Universal Serial Bus IRQ 3 */ + (void*) (0UL), + (void*) TCC0_0_Handler, /* 85 Timer Counter Control 0 IRQ 0 */ + (void*) TCC0_1_Handler, /* 86 Timer Counter Control 0 IRQ 1 */ + (void*) TCC0_2_Handler, /* 87 Timer Counter Control 0 IRQ 2 */ + (void*) TCC0_3_Handler, /* 88 Timer Counter Control 0 IRQ 3 */ + (void*) TCC0_4_Handler, /* 89 Timer Counter Control 0 IRQ 4 */ + (void*) TCC0_5_Handler, /* 90 Timer Counter Control 0 IRQ 5 */ + (void*) TCC0_6_Handler, /* 91 Timer Counter Control 0 IRQ 6 */ + (void*) TCC1_0_Handler, /* 92 Timer Counter Control 1 IRQ 0 */ + (void*) TCC1_1_Handler, /* 93 Timer Counter Control 1 IRQ 1 */ + (void*) TCC1_2_Handler, /* 94 Timer Counter Control 1 IRQ 2 */ + (void*) TCC1_3_Handler, /* 95 Timer Counter Control 1 IRQ 3 */ + (void*) TCC1_4_Handler, /* 96 Timer Counter Control 1 IRQ 4 */ + (void*) TCC2_0_Handler, /* 97 Timer Counter Control 2 IRQ 0 */ + (void*) TCC2_1_Handler, /* 98 Timer Counter Control 2 IRQ 1 */ + (void*) TCC2_2_Handler, /* 99 Timer Counter Control 2 IRQ 2 */ + (void*) TCC2_3_Handler, /* 100 Timer Counter Control 2 IRQ 3 */ + (void*) TCC3_0_Handler, /* 101 Timer Counter Control 3 IRQ 0 */ + (void*) TCC3_1_Handler, /* 102 Timer Counter Control 3 IRQ 1 */ + (void*) TCC3_2_Handler, /* 103 Timer Counter Control 3 IRQ 2 */ + (void*) TCC4_0_Handler, /* 104 Timer Counter Control 4 IRQ 0 */ + (void*) TCC4_1_Handler, /* 105 Timer Counter Control 4 IRQ 1 */ + (void*) TCC4_2_Handler, /* 106 Timer Counter Control 4 IRQ 2 */ + (void*) TC0_Handler, /* 107 Basic Timer Counter 0 */ + (void*) TC1_Handler, /* 108 Basic Timer Counter 1 */ + (void*) TC2_Handler, /* 109 Basic Timer Counter 2 */ + (void*) TC3_Handler, /* 110 Basic Timer Counter 3 */ + (void*) TC4_Handler, /* 111 Basic Timer Counter 4 */ + (void*) TC5_Handler, /* 112 Basic Timer Counter 5 */ + (void*) TC6_Handler, /* 113 Basic Timer Counter 6 */ + (void*) TC7_Handler, /* 114 Basic Timer Counter 7 */ + (void*) PDEC_0_Handler, /* 115 Quadrature Decodeur IRQ 0 */ + (void*) PDEC_1_Handler, /* 116 Quadrature Decodeur IRQ 1 */ + (void*) PDEC_2_Handler, /* 117 Quadrature Decodeur IRQ 2 */ + (void*) ADC0_0_Handler, /* 118 Analog Digital Converter 0 IRQ 0 */ + (void*) ADC0_1_Handler, /* 119 Analog Digital Converter 0 IRQ 1 */ + (void*) ADC1_0_Handler, /* 120 Analog Digital Converter 1 IRQ 0 */ + (void*) ADC1_1_Handler, /* 121 Analog Digital Converter 1 IRQ 1 */ + (void*) AC_Handler, /* 122 Analog Comparators */ + (void*) DAC_0_Handler, /* 123 Digital-to-Analog Converter IRQ 0 */ + (void*) DAC_1_Handler, /* 124 Digital-to-Analog Converter IRQ 1 */ + (void*) DAC_2_Handler, /* 125 Digital-to-Analog Converter IRQ 2 */ + (void*) DAC_3_Handler, /* 126 Digital-to-Analog Converter IRQ 3 */ + (void*) DAC_4_Handler, /* 127 Digital-to-Analog Converter IRQ 4 */ + (void*) I2S_Handler, /* 128 Inter-IC Sound Interface */ + (void*) PCC_Handler, /* 129 Parallel Capture Controller */ + (void*) AES_Handler, /* 130 Advanced Encryption Standard */ + (void*) TRNG_Handler, /* 131 True Random Generator */ + (void*) ICM_Handler, /* 132 Integrity Check Monitor */ + (void*) PUKCC_Handler, /* 133 PUblic-Key Cryptography Controller */ + (void*) QSPI_Handler, /* 134 Quad SPI interface */ + (void*) SDHC0_Handler, /* 135 SD/MMC Host Controller 0 */ + (void*) SDHC1_Handler, /* 136 SD/MMC Host Controller 1 */ +}; + +#else + +/* Cortex-M0+ core handlers */ +void HardFault_Handler(void) __attribute__ ((weak, alias("Dummy_Handler"))); +void Reset_Handler (void); +void NMI_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SVC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PendSV_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SysTick_Handler (void); + +/* Peripherals handlers */ +void PM_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SYSCTRL_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void WDT_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void RTC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void EIC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void NVMCTRL_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void DMAC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void USB_Handler (void) __attribute__ ((weak)); +void EVSYS_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM0_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM1_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM2_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM3_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM4_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void SERCOM5_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC0_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC1_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TCC2_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC3_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC4_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC5_Handler (void) __attribute__ ((weak)); // Used in Tone.cpp +void TC6_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void TC7_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void ADC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void AC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void DAC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void PTC_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); +void I2S_Handler (void) __attribute__ ((weak, alias("Dummy_Handler"))); + +/* Initialize segments */ +extern uint32_t __etext; +extern uint32_t __data_start__; +extern uint32_t __data_end__; +extern uint32_t __bss_start__; +extern uint32_t __bss_end__; +extern uint32_t __StackTop; + +/* Exception Table */ +__attribute__ ((section(".isr_vector"))) const DeviceVectors exception_table = +{ + /* Configure Initial Stack Pointer, using linker-generated symbols */ + (void*) (&__StackTop), + + (void*) Reset_Handler, + (void*) NMI_Handler, + (void*) HardFault_Handler, + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) SVC_Handler, + (void*) (0UL), /* Reserved */ + (void*) (0UL), /* Reserved */ + (void*) PendSV_Handler, + (void*) SysTick_Handler, + + /* Configurable interrupts */ + (void*) PM_Handler, /* 0 Power Manager */ + (void*) SYSCTRL_Handler, /* 1 System Control */ + (void*) WDT_Handler, /* 2 Watchdog Timer */ + (void*) RTC_Handler, /* 3 Real-Time Counter */ + (void*) EIC_Handler, /* 4 External Interrupt Controller */ + (void*) NVMCTRL_Handler, /* 5 Non-Volatile Memory Controller */ + (void*) DMAC_Handler, /* 6 Direct Memory Access Controller */ + (void*) USB_Handler, /* 7 Universal Serial Bus */ + (void*) EVSYS_Handler, /* 8 Event System Interface */ + (void*) SERCOM0_Handler, /* 9 Serial Communication Interface 0 */ + (void*) SERCOM1_Handler, /* 10 Serial Communication Interface 1 */ + (void*) SERCOM2_Handler, /* 11 Serial Communication Interface 2 */ + (void*) SERCOM3_Handler, /* 12 Serial Communication Interface 3 */ + (void*) SERCOM4_Handler, /* 13 Serial Communication Interface 4 */ + (void*) SERCOM5_Handler, /* 14 Serial Communication Interface 5 */ + (void*) TCC0_Handler, /* 15 Timer Counter Control 0 */ + (void*) TCC1_Handler, /* 16 Timer Counter Control 1 */ + (void*) TCC2_Handler, /* 17 Timer Counter Control 2 */ + (void*) TC3_Handler, /* 18 Basic Timer Counter 0 */ + (void*) TC4_Handler, /* 19 Basic Timer Counter 1 */ + (void*) TC5_Handler, /* 20 Basic Timer Counter 2 */ + (void*) TC6_Handler, /* 21 Basic Timer Counter 3 */ + (void*) TC7_Handler, /* 22 Basic Timer Counter 4 */ + (void*) ADC_Handler, /* 23 Analog Digital Converter */ + (void*) AC_Handler, /* 24 Analog Comparators */ + (void*) DAC_Handler, /* 25 Digital Analog Converter */ + (void*) PTC_Handler, /* 26 Peripheral Touch Controller */ + (void*) I2S_Handler, /* 27 Inter-IC Sound Interface */ + (void*) (0UL), /* Reserved */ +}; + +#endif + +extern int main(void); + +/* This is called on processor reset to initialize the device and call main() */ +void Reset_Handler(void) +{ + uint32_t *pSrc, *pDest; + + /* Initialize the initialized data section */ + pSrc = &__etext; + pDest = &__data_start__; + + if ((&__data_start__ != &__data_end__) && (pSrc != pDest)) { + for (; pDest < &__data_end__; pDest++, pSrc++) + *pDest = *pSrc; + } + + /* Clear the zero section */ + if ((&__data_start__ != &__data_end__) && (pSrc != pDest)) { + for (pDest = &__bss_start__; pDest < &__bss_end__; pDest++) + *pDest = 0; + } + +#if defined(__FPU_USED) && defined(__SAMD51__) + /* Enable FPU */ + SCB->CPACR |= (0xFu << 20); + __DSB(); + __ISB(); +#endif + + SystemInit(); + + main(); + + while (1) + ; +} + +/* Default Arduino systick handler */ +extern void SysTick_DefaultHandler(void); + +void SysTick_Handler(void) +{ + if (sysTickHook()) + return; + SysTick_DefaultHandler(); +} + +static void (*usb_isr)(void) = NULL; + +#if defined(__SAMD51__) +void USB_0_Handler(void) +{ + if (usb_isr) + usb_isr(); +} +void USB_1_Handler(void) +{ + if (usb_isr) + usb_isr(); +} +void USB_2_Handler(void) +{ + if (usb_isr) + usb_isr(); +} +void USB_3_Handler(void) +{ + if (usb_isr) + usb_isr(); +} +#else +void USB_Handler(void) +{ + if (usb_isr) + usb_isr(); +} +#endif + +void USB_SetHandler(void (*new_usb_isr)(void)) +{ + usb_isr = new_usb_isr; +} diff --git a/sparkfun/samd/cores/arduino51/delay.c b/sparkfun/samd/cores/arduino51/delay.c new file mode 100644 index 00000000..d791e4da --- /dev/null +++ b/sparkfun/samd/cores/arduino51/delay.c @@ -0,0 +1,117 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "delay.h" +#include "Arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** Tick Counter united by ms */ +static volatile uint32_t _ulTickCount=0 ; + +unsigned long millis( void ) +{ +// todo: ensure no interrupts + return _ulTickCount ; +} + +// Interrupt-compatible version of micros +// Theory: repeatedly take readings of SysTick counter, millis counter and SysTick interrupt pending flag. +// When it appears that millis counter and pending is stable and SysTick hasn't rolled over, use these +// values to calculate micros. If there is a pending SysTick, add one to the millis counter in the calculation. +unsigned long micros( void ) +{ + uint32_t ticks, ticks2; + uint32_t pend, pend2; + uint32_t count, count2; + + ticks2 = SysTick->VAL; + pend2 = !!(SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) ; + count2 = _ulTickCount ; + + do + { + ticks=ticks2; + pend=pend2; + count=count2; + ticks2 = SysTick->VAL; + pend2 = !!(SCB->ICSR & SCB_ICSR_PENDSTSET_Msk) ; + count2 = _ulTickCount ; + } while ((pend != pend2) || (count != count2) || (ticks < ticks2)); + + return ((count+pend) * 1000) + (((SysTick->LOAD - ticks)*(1048576/(VARIANT_MCK/1000000)))>>20) ; + // this is an optimization to turn a runtime division into two compile-time divisions and + // a runtime multiplication and shift, saving a few cycles +} + +#ifdef __SAMD51__ +/* + * On SAMD51, use the (32bit) cycle count maintained by the DWT unit, + * and count exact number of cycles elapsed, rather than guessing how + * many cycles a loop takes, which is dangerous in the presence of + * cache. The overhead of the call and internal code is "about" 20 + * cycles. (at 120MHz, that's about 1/6 us) + */ +void delayMicroseconds(unsigned int us) +{ + uint32_t start, elapsed; + uint32_t count; + + if (us == 0) + return; + + count = us * (VARIANT_MCK / 1000000) - 20; // convert us to cycles. + start = DWT->CYCCNT; //CYCCNT is 32bits, takes 37s or so to wrap. + while (1) { + elapsed = DWT->CYCCNT - start; + if (elapsed >= count) + return; + } +} +#endif + + +void delay( unsigned long ms ) +{ + if ( ms == 0 ) + { + return ; + } + + uint32_t start = _ulTickCount ; + + do + { + yield() ; + } while ( _ulTickCount - start < ms ) ; +} + +#include "Reset.h" // for tickReset() + +void SysTick_DefaultHandler(void) +{ + // Increment tick count each ms + _ulTickCount++; + tickReset(); +} + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/delay.h b/sparkfun/samd/cores/arduino51/delay.h new file mode 100644 index 00000000..3d3a6d19 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/delay.h @@ -0,0 +1,109 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _DELAY_ +#define _DELAY_ + +#include +#include "variant.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * \brief Returns the number of milliseconds since the Arduino board began running the current program. + * + * This number will overflow (go back to zero), after approximately 50 days. + * + * \return Number of milliseconds since the program started (uint32_t) + */ +extern unsigned long millis( void ) ; + +/** + * \brief Returns the number of microseconds since the Arduino board began running the current program. + * + * This number will overflow (go back to zero), after approximately 70 minutes. On 16 MHz Arduino boards + * (e.g. Duemilanove and Nano), this function has a resolution of four microseconds (i.e. the value returned is + * always a multiple of four). On 8 MHz Arduino boards (e.g. the LilyPad), this function has a resolution + * of eight microseconds. + * + * \note There are 1,000 microseconds in a millisecond and 1,000,000 microseconds in a second. + */ +extern unsigned long micros( void ) ; + +/** + * \brief Pauses the program for the amount of time (in miliseconds) specified as parameter. + * (There are 1000 milliseconds in a second.) + * + * \param dwMs the number of milliseconds to pause (uint32_t) + */ +extern void delay( unsigned long dwMs ) ; + +/** + * \brief Pauses the program for the amount of time (in microseconds) specified as parameter. + * + * \param dwUs the number of microseconds to pause (uint32_t) + */ +#if defined(__SAMD51__) +extern void delayMicroseconds( unsigned int ); +#else +static __inline__ void delayMicroseconds( unsigned int ) __attribute__((always_inline, unused)) ; +static __inline__ void delayMicroseconds( unsigned int usec ) +{ + if ( usec == 0 ) + { + return ; + } + /* + * The following loop: + * + * for (; ul; ul--) { + * __asm__ volatile(""); + * } + * + * produce the following assembly code: + * + * loop: + * subs r3, #1 // 1 Core cycle + * bne.n loop // 1 Core cycle + 1 if branch is taken + */ + + // VARIANT_MCK / 1000000 == cycles needed to delay 1uS + // 3 == cycles used in a loop + uint32_t n = usec * (VARIANT_MCK / 1000000) / 3; + + __asm__ __volatile__( + "1: \n" + " sub %0, #1 \n" // substract 1 from %0 (n) + " bne 1b \n" // if result is not 0 jump to 1 + : "+r" (n) // '%0' is n variable with RW constraints + : // no input + : // no clobber + ); + // https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html + // https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Volatile +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _DELAY_ */ diff --git a/sparkfun/samd/cores/arduino51/hooks.c b/sparkfun/samd/cores/arduino51/hooks.c new file mode 100644 index 00000000..f87c2044 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/hooks.c @@ -0,0 +1,58 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/** + * Empty yield() hook. + * + * This function is intended to be used by library writers to build + * libraries or sketches that supports cooperative threads. + * + * Its defined as a weak symbol and it can be redefined to implement a + * real cooperative scheduler. + */ +static void __empty() { + // Empty +} +void yield(void) __attribute__ ((weak, alias("__empty"))); + +/** + * SysTick hook + * + * This function is called from SysTick handler, before the default + * handler provided by Arduino. + */ +static int __false() { + // Return false + return 0; +} +int sysTickHook(void) __attribute__ ((weak, alias("__false"))); + +/** + * SVC hook + * PendSV hook + * + * These functions are called from SVC handler, and PensSV handler. + * Default action is halting. + */ +static void __halt() { + // Halts + while (1) + ; +} +void svcHook(void) __attribute__ ((weak, alias("__halt"))); +void pendSVHook(void) __attribute__ ((weak, alias("__halt"))); diff --git a/sparkfun/samd/cores/arduino51/itoa.c b/sparkfun/samd/cores/arduino51/itoa.c new file mode 100644 index 00000000..cb30a47c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/itoa.c @@ -0,0 +1,170 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "itoa.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* reverse: reverse string s in place */ +/* +static void reverse( char s[] ) +{ + int i, j ; + char c ; + + for ( i = 0, j = strlen(s)-1 ; i < j ; i++, j-- ) + { + c = s[i] ; + s[i] = s[j] ; + s[j] = c ; + } +} +*/ + +/* itoa: convert n to characters in s */ +/* +extern void itoa( int n, char s[] ) +{ + int i, sign ; + + if ( (sign = n) < 0 ) // record sign + { + n = -n; // make n positive + } + + i = 0; + do + { // generate digits in reverse order + s[i++] = n % 10 + '0'; // get next digit + } while ((n /= 10) > 0) ; // delete it + + if (sign < 0 ) + { + s[i++] = '-'; + } + + s[i] = '\0'; + + reverse( s ) ; +} +*/ + +extern char* itoa( int value, char *string, int radix ) +{ + return ltoa( value, string, radix ) ; +} + +extern char* ltoa( long value, char *string, int radix ) +{ + char tmp[33]; + char *tp = tmp; + long i; + unsigned long v; + int sign; + char *sp; + + if ( string == NULL ) + { + return 0 ; + } + + if (radix > 36 || radix <= 1) + { + return 0 ; + } + + sign = (radix == 10 && value < 0); + if (sign) + { + v = -value; + } + else + { + v = (unsigned long)value; + } + + while (v || tp == tmp) + { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i+'0'; + else + *tp++ = i + 'a' - 10; + } + + sp = string; + + if (sign) + *sp++ = '-'; + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + + return string; +} + +extern char* utoa( unsigned int value, char *string, int radix ) +{ + return ultoa( value, string, radix ) ; +} + +extern char* ultoa( unsigned long value, char *string, int radix ) +{ + char tmp[33]; + char *tp = tmp; + long i; + unsigned long v = value; + char *sp; + + if ( string == NULL ) + { + return 0; + } + + if (radix > 36 || radix <= 1) + { + return 0; + } + + while (v || tp == tmp) + { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i+'0'; + else + *tp++ = i + 'a' - 10; + } + + sp = string; + + + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + + return string; +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sparkfun/samd/cores/arduino51/itoa.h b/sparkfun/samd/cores/arduino51/itoa.h new file mode 100644 index 00000000..1057d11a --- /dev/null +++ b/sparkfun/samd/cores/arduino51/itoa.h @@ -0,0 +1,35 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#ifdef __cplusplus +extern "C"{ +#endif + +//extern void itoa( int n, char s[] ) ; + +extern char* itoa( int value, char *string, int radix ) ; +extern char* ltoa( long value, char *string, int radix ) ; +extern char* utoa( unsigned int value, char *string, int radix ) ; +extern char* ultoa( unsigned long value, char *string, int radix ) ; + +#ifdef __cplusplus +} // extern "C" +#endif + diff --git a/sparkfun/samd/cores/arduino51/main.cpp b/sparkfun/samd/cores/arduino51/main.cpp new file mode 100644 index 00000000..49ebc27f --- /dev/null +++ b/sparkfun/samd/cores/arduino51/main.cpp @@ -0,0 +1,56 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#define ARDUINO_MAIN +#include "Arduino.h" + +// Weak empty variant initialization function. +// May be redefined by variant files. +void initVariant() __attribute__((weak)); +void initVariant() { } + +// Initialize C library +extern "C" void __libc_init_array(void); + +/* + * \brief Main entry point of Arduino application + */ +int main( void ) +{ + init(); + + __libc_init_array(); + + initVariant(); + + delay(1); +#if defined(USBCON) + USBDevice.init(); + USBDevice.attach(); +#endif + + setup(); + + for (;;) + { + loop(); + if (serialEventRun) serialEventRun(); + } + + return 0; +} diff --git a/sparkfun/samd/cores/arduino51/math_helper.c b/sparkfun/samd/cores/arduino51/math_helper.c new file mode 100644 index 00000000..da6d47b0 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/math_helper.c @@ -0,0 +1,457 @@ +/* ---------------------------------------------------------------------- +* Copyright (C) 2010-2012 ARM Limited. All rights reserved. +* +* $Date: 17. January 2013 +* $Revision: V1.4.0 +* +* Project: CMSIS DSP Library +* +* Title: math_helper.c +* +* Description: Definition of all helper functions required. +* +* Target Processor: Cortex-M4/Cortex-M3 +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* - Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* - Neither the name of ARM LIMITED nor the names of its contributors +* may be used to endorse or promote products derived from this +* software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +* -------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- +* Include standard header files +* -------------------------------------------------------------------- */ +#include + +/* ---------------------------------------------------------------------- +* Include project header files +* -------------------------------------------------------------------- */ +#include "math_helper.h" + +/** + * @brief Caluclation of SNR + * @param float* Pointer to the reference buffer + * @param float* Pointer to the test buffer + * @param uint32_t total number of samples + * @return float SNR + * The function Caluclates signal to noise ratio for the reference output + * and test output + */ + +float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize) +{ + float EnergySignal = 0.0, EnergyError = 0.0; + uint32_t i; + float SNR; + int temp; + int *test; + + for (i = 0; i < buffSize; i++) + { + /* Checking for a NAN value in pRef array */ + test = (int *)(&pRef[i]); + temp = *test; + + if(temp == 0x7FC00000) + { + return(0); + } + + /* Checking for a NAN value in pTest array */ + test = (int *)(&pTest[i]); + temp = *test; + + if(temp == 0x7FC00000) + { + return(0); + } + EnergySignal += pRef[i] * pRef[i]; + EnergyError += (pRef[i] - pTest[i]) * (pRef[i] - pTest[i]); + } + + /* Checking for a NAN value in EnergyError */ + test = (int *)(&EnergyError); + temp = *test; + + if(temp == 0x7FC00000) + { + return(0); + } + + + SNR = 10 * log10 (EnergySignal / EnergyError); + + return (SNR); + +} + + +/** + * @brief Provide guard bits for Input buffer + * @param q15_t* Pointer to input buffer + * @param uint32_t blockSize + * @param uint32_t guard_bits + * @return none + * The function Provides the guard bits for the buffer + * to avoid overflow + */ + +void arm_provide_guard_bits_q15 (q15_t * input_buf, uint32_t blockSize, + uint32_t guard_bits) +{ + uint32_t i; + + for (i = 0; i < blockSize; i++) + { + input_buf[i] = input_buf[i] >> guard_bits; + } +} + +/** + * @brief Converts float to fixed in q12.20 format + * @param uint32_t number of samples in the buffer + * @return none + * The function converts floating point values to fixed point(q12.20) values + */ + +void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + /* 1048576.0f corresponds to pow(2, 20) */ + pOut[i] = (q31_t) (pIn[i] * 1048576.0f); + + pOut[i] += pIn[i] > 0 ? 0.5 : -0.5; + + if (pIn[i] == (float) 1.0) + { + pOut[i] = 0x000FFFFF; + } + } +} + +/** + * @brief Compare MATLAB Reference Output and ARM Test output + * @param q15_t* Pointer to Ref buffer + * @param q15_t* Pointer to Test buffer + * @param uint32_t number of samples in the buffer + * @return none + */ + +uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples) +{ + uint32_t i; + int32_t diff, diffCrnt = 0; + uint32_t maxDiff = 0; + + for (i = 0; i < numSamples; i++) + { + diff = pIn[i] - pOut[i]; + diffCrnt = (diff > 0) ? diff : -diff; + + if(diffCrnt > maxDiff) + { + maxDiff = diffCrnt; + } + } + + return(maxDiff); +} + +/** + * @brief Compare MATLAB Reference Output and ARM Test output + * @param q31_t* Pointer to Ref buffer + * @param q31_t* Pointer to Test buffer + * @param uint32_t number of samples in the buffer + * @return none + */ + +uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t * pOut, uint32_t numSamples) +{ + uint32_t i; + int32_t diff, diffCrnt = 0; + uint32_t maxDiff = 0; + + for (i = 0; i < numSamples; i++) + { + diff = pIn[i] - pOut[i]; + diffCrnt = (diff > 0) ? diff : -diff; + + if(diffCrnt > maxDiff) + { + maxDiff = diffCrnt; + } + } + + return(maxDiff); +} + +/** + * @brief Provide guard bits for Input buffer + * @param q31_t* Pointer to input buffer + * @param uint32_t blockSize + * @param uint32_t guard_bits + * @return none + * The function Provides the guard bits for the buffer + * to avoid overflow + */ + +void arm_provide_guard_bits_q31 (q31_t * input_buf, + uint32_t blockSize, + uint32_t guard_bits) +{ + uint32_t i; + + for (i = 0; i < blockSize; i++) + { + input_buf[i] = input_buf[i] >> guard_bits; + } +} + +/** + * @brief Provide guard bits for Input buffer + * @param q31_t* Pointer to input buffer + * @param uint32_t blockSize + * @param uint32_t guard_bits + * @return none + * The function Provides the guard bits for the buffer + * to avoid overflow + */ + +void arm_provide_guard_bits_q7 (q7_t * input_buf, + uint32_t blockSize, + uint32_t guard_bits) +{ + uint32_t i; + + for (i = 0; i < blockSize; i++) + { + input_buf[i] = input_buf[i] >> guard_bits; + } +} + + + +/** + * @brief Caluclates number of guard bits + * @param uint32_t number of additions + * @return none + * The function Caluclates the number of guard bits + * depending on the numtaps + */ + +uint32_t arm_calc_guard_bits (uint32_t num_adds) +{ + uint32_t i = 1, j = 0; + + if (num_adds == 1) + { + return (0); + } + + while (i < num_adds) + { + i = i * 2; + j++; + } + + return (j); +} + +/** + * @brief Converts Q15 to floating-point + * @param uint32_t number of samples in the buffer + * @return none + */ + +void arm_apply_guard_bits (float32_t * pIn, + uint32_t numSamples, + uint32_t guard_bits) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + pIn[i] = pIn[i] * arm_calc_2pow(guard_bits); + } +} + +/** + * @brief Calculates pow(2, numShifts) + * @param uint32_t number of shifts + * @return pow(2, numShifts) + */ +uint32_t arm_calc_2pow(uint32_t numShifts) +{ + + uint32_t i, val = 1; + + for (i = 0; i < numShifts; i++) + { + val = val * 2; + } + + return(val); +} + + + +/** + * @brief Converts float to fixed q14 + * @param uint32_t number of samples in the buffer + * @return none + * The function converts floating point values to fixed point values + */ + +void arm_float_to_q14 (float *pIn, q15_t * pOut, + uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + /* 16384.0f corresponds to pow(2, 14) */ + pOut[i] = (q15_t) (pIn[i] * 16384.0f); + + pOut[i] += pIn[i] > 0 ? 0.5 : -0.5; + + if (pIn[i] == (float) 2.0) + { + pOut[i] = 0x7FFF; + } + + } + +} + + +/** + * @brief Converts float to fixed q30 format + * @param uint32_t number of samples in the buffer + * @return none + * The function converts floating point values to fixed point values + */ + +void arm_float_to_q30 (float *pIn, q31_t * pOut, + uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + /* 1073741824.0f corresponds to pow(2, 30) */ + pOut[i] = (q31_t) (pIn[i] * 1073741824.0f); + + pOut[i] += pIn[i] > 0 ? 0.5 : -0.5; + + if (pIn[i] == (float) 2.0) + { + pOut[i] = 0x7FFFFFFF; + } + } +} + +/** + * @brief Converts float to fixed q30 format + * @param uint32_t number of samples in the buffer + * @return none + * The function converts floating point values to fixed point values + */ + +void arm_float_to_q29 (float *pIn, q31_t * pOut, + uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + /* 1073741824.0f corresponds to pow(2, 30) */ + pOut[i] = (q31_t) (pIn[i] * 536870912.0f); + + pOut[i] += pIn[i] > 0 ? 0.5 : -0.5; + + if (pIn[i] == (float) 4.0) + { + pOut[i] = 0x7FFFFFFF; + } + } +} + + +/** + * @brief Converts float to fixed q28 format + * @param uint32_t number of samples in the buffer + * @return none + * The function converts floating point values to fixed point values + */ + +void arm_float_to_q28 (float *pIn, q31_t * pOut, + uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + /* 268435456.0f corresponds to pow(2, 28) */ + pOut[i] = (q31_t) (pIn[i] * 268435456.0f); + + pOut[i] += pIn[i] > 0 ? 0.5 : -0.5; + + if (pIn[i] == (float) 8.0) + { + pOut[i] = 0x7FFFFFFF; + } + } +} + +/** + * @brief Clip the float values to +/- 1 + * @param pIn input buffer + * @param numSamples number of samples in the buffer + * @return none + * The function converts floating point values to fixed point values + */ + +void arm_clip_f32 (float *pIn, uint32_t numSamples) +{ + uint32_t i; + + for (i = 0; i < numSamples; i++) + { + if(pIn[i] > 1.0f) + { + pIn[i] = 1.0; + } + else if( pIn[i] < -1.0f) + { + pIn[i] = -1.0; + } + + } +} + + + diff --git a/sparkfun/samd/cores/arduino51/math_helper.h b/sparkfun/samd/cores/arduino51/math_helper.h new file mode 100644 index 00000000..866c5537 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/math_helper.h @@ -0,0 +1,63 @@ + +/* ---------------------------------------------------------------------- +* Copyright (C) 2010-2013 ARM Limited. All rights reserved. +* +* $Date: 17. January 2013 +* $Revision: V1.4.0 +* +* Project: CMSIS DSP Library +* +* Title: math_helper.h +* +* Description: Prototypes of all helper functions required. +* +* Target Processor: Cortex-M4/Cortex-M3 +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: +* - Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* - Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in +* the documentation and/or other materials provided with the +* distribution. +* - Neither the name of ARM LIMITED nor the names of its contributors +* may be used to endorse or promote products derived from this +* software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +* POSSIBILITY OF SUCH DAMAGE. +* -------------------------------------------------------------------- */ + + +#include "arm_math.h" + +#ifndef MATH_HELPER_H +#define MATH_HELPER_H + +float arm_snr_f32(float *pRef, float *pTest, uint32_t buffSize); +void arm_float_to_q12_20(float *pIn, q31_t * pOut, uint32_t numSamples); +void arm_provide_guard_bits_q15(q15_t *input_buf, uint32_t blockSize, uint32_t guard_bits); +void arm_provide_guard_bits_q31(q31_t *input_buf, uint32_t blockSize, uint32_t guard_bits); +void arm_float_to_q14(float *pIn, q15_t *pOut, uint32_t numSamples); +void arm_float_to_q29(float *pIn, q31_t *pOut, uint32_t numSamples); +void arm_float_to_q28(float *pIn, q31_t *pOut, uint32_t numSamples); +void arm_float_to_q30(float *pIn, q31_t *pOut, uint32_t numSamples); +void arm_clip_f32(float *pIn, uint32_t numSamples); +uint32_t arm_calc_guard_bits(uint32_t num_adds); +void arm_apply_guard_bits (float32_t * pIn, uint32_t numSamples, uint32_t guard_bits); +uint32_t arm_compare_fixed_q15(q15_t *pIn, q15_t * pOut, uint32_t numSamples); +uint32_t arm_compare_fixed_q31(q31_t *pIn, q31_t *pOut, uint32_t numSamples); +uint32_t arm_calc_2pow(uint32_t guard_bits); +#endif diff --git a/sparkfun/samd/cores/arduino51/new.cpp b/sparkfun/samd/cores/arduino51/new.cpp new file mode 100644 index 00000000..f1897758 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/new.cpp @@ -0,0 +1,36 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +void *operator new(size_t size) { + return malloc(size); +} + +void *operator new[](size_t size) { + return malloc(size); +} + +void operator delete(void * ptr) { + free(ptr); +} + +void operator delete[](void * ptr) { + free(ptr); +} + diff --git a/sparkfun/samd/cores/arduino51/pulse.c b/sparkfun/samd/cores/arduino51/pulse.c new file mode 100644 index 00000000..43592da4 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/pulse.c @@ -0,0 +1,83 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +// See pulse_asm.S +extern unsigned long countPulseASM(const volatile uint32_t *port, uint32_t bit, uint32_t stateMask, unsigned long maxloops); + +/* Measures the length (in microseconds) of a pulse on the pin; state is HIGH + * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds + * to 3 minutes in length, but must be called at least a few dozen microseconds + * before the start of the pulse. */ +uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout) +{ + // cache the port and bit of the pin in order to speed up the + // pulse width measuring loop and achieve finer resolution. calling + // digitalRead() instead yields much coarser resolution. + PinDescription p = g_APinDescription[pin]; + uint32_t bit = 1 << p.ulPin; + uint32_t stateMask = state ? bit : 0; + +#if defined(__SAMD51__) + /* + * The SAMD51 is fast enough to use really obvious code (similar to + * what was used to produce pulse_asm.S, but using micros() for timing. + * No assembly required, no conversion of loop counts to times (which is + * worrisome in the presence of cache.) + */ + volatile uint32_t *port = &(PORT->Group[p.ulPort].IN.reg); + uint32_t usCallStart; // microseconds at start of call, for timeout. + uint32_t usPulseStart; // microseconds at start of measured pulse. + usCallStart = micros(); + // wait for any previous pulse to end + while ((*port & bit) == stateMask) { + if (micros() - usCallStart > timeout) + return -1; + } + // wait for the pulse to start + while ((*port & bit) != stateMask) { + usPulseStart = micros(); + if (usPulseStart - usCallStart > timeout) + return -2; + } + + // wait for the pulse to stop + while ((*port & bit) == stateMask) { + if (micros() - usCallStart > timeout) + return -3; + } + return micros() - usPulseStart; +#else + // convert the timeout from microseconds to a number of times through + // the initial loop; it takes (roughly) 13 clock cycles per iteration. + uint32_t maxloops = microsecondsToClockCycles(timeout) / 13; + + uint32_t width = countPulseASM(&(PORT->Group[p.ulPort].IN.reg), bit, stateMask, maxloops); + + // convert the reading to microseconds. The loop has been determined + // to be 13 clock cycles long and have about 16 clocks between the edge + // and the start of the loop. There will be some error introduced by + // the interrupt handlers. + if (width) + return clockCyclesToMicroseconds(width * 13 + 16); + else + return 0; +#endif // SAMD51 +} + diff --git a/sparkfun/samd/cores/arduino51/pulse.h b/sparkfun/samd/cores/arduino51/pulse.h new file mode 100644 index 00000000..9c620f12 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/pulse.h @@ -0,0 +1,39 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * \brief Measures the length (in microseconds) of a pulse on the pin; state is HIGH + * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds + * to 3 minutes in length, but must be called at least a few dozen microseconds + * before the start of the pulse. + */ +uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout); + +#ifdef __cplusplus +// Provides a version of pulseIn with a default argument (C++ only) +uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout = 1000000L); + +} // extern "C" +#endif + diff --git a/sparkfun/samd/cores/arduino51/pulse_asm.S b/sparkfun/samd/cores/arduino51/pulse_asm.S new file mode 100644 index 00000000..7b94f158 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/pulse_asm.S @@ -0,0 +1,175 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* + +The following function has been compiled to ASM with gcc + + unsigned long countPulseASM(const volatile uint32_t *port, uint32_t bit, uint32_t stateMask, unsigned long maxloops) + { + unsigned long width = 0; + + // wait for any previous pulse to end + while ((*port & bit) == stateMask) + if (--maxloops == 0) + return 0; + + // wait for the pulse to start + while ((*port & bit) != stateMask) + if (--maxloops == 0) + return 0; + + // wait for the pulse to stop + while ((*port & bit) == stateMask) { + if (++width == maxloops) + return 0; + } + return width; + } + +using the command line: + + arm-none-eabi-gcc -mcpu=cortex-m0plus -mthumb -c -Os -W -ffunction-sections -fdata-sections \ + -nostdlib --param max-inline-insns-single=500 -fno-exceptions -MMD \ + -DF_CPU=48000000L -DARDUINO=10602 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD \ + -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x004d -DUSBCON \ + -DUSB_MANUFACTURER="Arduino LLC" -DUSB_PRODUCT="Arduino Zero" \ + -I/Code/arduino/build/linux/work/hardware/tools/CMSIS/CMSIS/Include/ \ + -I/Code/arduino/build/linux/work/hardware/tools/CMSIS/Device/ATMEL/ \ + -I/Code/arduino/build/linux/work/hardware/arduino/samd/cores/arduino \ + -I/Code/arduino/build/linux/work/hardware/arduino/samd/variants/arduino_zero \ + count.c -Wa,-ahlmsd=output.lst -dp -fverbose-asm -S + +The result has been slightly edited to increase readability. + +*/ + + .cpu cortex-m0plus + .fpu softvfp + .eabi_attribute 20, 1 @ Tag_ABI_FP_denormal + .eabi_attribute 21, 1 @ Tag_ABI_FP_exceptions + .eabi_attribute 23, 3 @ Tag_ABI_FP_number_model + .eabi_attribute 24, 1 @ Tag_ABI_align8_needed + .eabi_attribute 25, 1 @ Tag_ABI_align8_preserved + .eabi_attribute 26, 1 @ Tag_ABI_enum_size + .eabi_attribute 30, 4 @ Tag_ABI_optimization_goals + .eabi_attribute 34, 0 @ Tag_CPU_unaligned_access + .eabi_attribute 18, 4 @ Tag_ABI_PCS_wchar_t + .file "count.c" +@ GNU C (GNU Tools for ARM Embedded Processors (Arduino build)) version 4.8.3 20140228 (release) [ARM/embedded-4_8-branch revision 208322] (arm-none-eabi) +@ compiled by GNU C version 4.3.2, GMP version 4.3.2, MPFR version 2.4.2, MPC version 0.8.1 +@ GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 +@ options passed: +@ -I /Code/arduino/build/linux/work/hardware/tools/CMSIS/CMSIS/Include/ +@ -I /Code/arduino/build/linux/work/hardware/tools/CMSIS/Device/ATMEL/ +@ -I /Code/arduino/build/linux/work/hardware/arduino/samd/cores/arduino +@ -I /Code/arduino/build/linux/work/hardware/arduino/samd/variants/arduino_zero +@ -imultilib armv6-m +@ -iprefix /Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../lib/gcc/arm-none-eabi/4.8.3/ +@ -isysroot /Code/arduino/build/linux/work/hardware/tools/gcc-arm-none-eabi-4.8.3-2014q1/bin/../arm-none-eabi +@ -MMD count.d -D__USES_INITFINI__ -D F_CPU=48000000L -D ARDUINO=10602 +@ -D ARDUINO_SAMD_ZERO -D ARDUINO_ARCH_SAMD -D __SAMD21G18A__ +@ -D USB_VID=0x2341 -D USB_PID=0x004d -D USBCON +@ -D USB_MANUFACTURER=Arduino LLC -D USB_PRODUCT=Arduino Zero count.c +@ -mcpu=cortex-m0plus -mthumb -Os -Wextra -ffunction-sections +@ -fdata-sections -fno-exceptions -fverbose-asm +@ --param max-inline-insns-single=500 +@ options enabled: -faggressive-loop-optimizations -fauto-inc-dec +@ -fbranch-count-reg -fcaller-saves -fcombine-stack-adjustments -fcommon +@ -fcompare-elim -fcprop-registers -fcrossjumping -fcse-follow-jumps +@ -fdata-sections -fdefer-pop -fdelete-null-pointer-checks -fdevirtualize +@ -fdwarf2-cfi-asm -fearly-inlining -feliminate-unused-debug-types +@ -fexpensive-optimizations -fforward-propagate -ffunction-cse +@ -ffunction-sections -fgcse -fgcse-lm -fgnu-runtime +@ -fguess-branch-probability -fhoist-adjacent-loads -fident -fif-conversion +@ -fif-conversion2 -findirect-inlining -finline -finline-atomics +@ -finline-functions -finline-functions-called-once +@ -finline-small-functions -fipa-cp -fipa-profile -fipa-pure-const +@ -fipa-reference -fipa-sra -fira-hoist-pressure -fira-share-save-slots +@ -fira-share-spill-slots -fivopts -fkeep-static-consts +@ -fleading-underscore -fmath-errno -fmerge-constants -fmerge-debug-strings +@ -fomit-frame-pointer -foptimize-register-move -foptimize-sibling-calls +@ -fpartial-inlining -fpeephole -fpeephole2 -fprefetch-loop-arrays +@ -freg-struct-return -fregmove -freorder-blocks -freorder-functions +@ -frerun-cse-after-loop -fsched-critical-path-heuristic +@ -fsched-dep-count-heuristic -fsched-group-heuristic -fsched-interblock +@ -fsched-last-insn-heuristic -fsched-pressure -fsched-rank-heuristic +@ -fsched-spec -fsched-spec-insn-heuristic -fsched-stalled-insns-dep +@ -fschedule-insns2 -fsection-anchors -fshow-column -fshrink-wrap +@ -fsigned-zeros -fsplit-ivs-in-unroller -fsplit-wide-types +@ -fstrict-aliasing -fstrict-overflow -fstrict-volatile-bitfields +@ -fsync-libcalls -fthread-jumps -ftoplevel-reorder -ftrapping-math +@ -ftree-bit-ccp -ftree-builtin-call-dce -ftree-ccp -ftree-ch +@ -ftree-coalesce-vars -ftree-copy-prop -ftree-copyrename -ftree-cselim +@ -ftree-dce -ftree-dominator-opts -ftree-dse -ftree-forwprop -ftree-fre +@ -ftree-loop-if-convert -ftree-loop-im -ftree-loop-ivcanon +@ -ftree-loop-optimize -ftree-parallelize-loops= -ftree-phiprop -ftree-pre +@ -ftree-pta -ftree-reassoc -ftree-scev-cprop -ftree-sink +@ -ftree-slp-vectorize -ftree-slsr -ftree-sra -ftree-switch-conversion +@ -ftree-tail-merge -ftree-ter -ftree-vect-loop-version -ftree-vrp +@ -funit-at-a-time -fverbose-asm -fzero-initialized-in-bss -mlittle-endian +@ -mpic-data-is-text-relative -msched-prolog -mthumb +@ -mvectorize-with-neon-quad + + .section .text.countPulseASM,"ax",%progbits + .align 1 + .global countPulseASM + .code 16 + .thumb_func + .type countPulseASM, %function +countPulseASM: + push {r4, r5, lr} @ @ 112 *push_multi [length = 2] +.L2: + ldr r4, [r0] @ D.11539, *port_7(D) @ 22 *thumb1_movsi_insn/7 [length = 2] + and r4, r1 @ D.11539, bit @ 24 *thumb1_andsi3_insn [length = 2] + cmp r4, r2 @ D.11539, stateMask @ 25 cbranchsi4_insn/1 [length = 4] + bne .L5 @, + sub r3, r3, #1 @ maxloops, @ 17 *thumb1_addsi3/2 [length = 2] + cmp r3, #0 @ maxloops, @ 18 cbranchsi4_insn/1 [length = 4] + bne .L2 @, + b .L10 @ @ 127 *thumb_jump [length = 2] +.L6: + sub r3, r3, #1 @ maxloops, @ 30 *thumb1_addsi3/2 [length = 2] + cmp r3, #0 @ maxloops, @ 31 cbranchsi4_insn/1 [length = 4] + beq .L10 @, +.L5: + ldr r4, [r0] @ D.11539, *port_7(D) @ 35 *thumb1_movsi_insn/7 [length = 2] + and r4, r1 @ D.11539, bit @ 37 *thumb1_andsi3_insn [length = 2] + cmp r4, r2 @ D.11539, stateMask @ 38 cbranchsi4_insn/1 [length = 4] + bne .L6 @, + mov r4, #0 @ width, @ 7 *thumb1_movsi_insn/2 [length = 2] +.L7: + ldr r5, [r0] @ D.11539, *port_7(D) @ 48 *thumb1_movsi_insn/7 [length = 2] + and r5, r1 @ D.11539, bit @ 50 *thumb1_andsi3_insn [length = 2] + cmp r5, r2 @ D.11539, stateMask @ 51 cbranchsi4_insn/1 [length = 4] + bne .L13 @, + add r4, r4, #1 @ width, @ 43 *thumb1_addsi3/1 [length = 2] + cmp r4, r3 @ width, maxloops @ 44 cbranchsi4_insn/1 [length = 4] + bne .L7 @, + mov r0, #0 @ D.11539, @ 11 *thumb1_movsi_insn/2 [length = 2] + b .L3 @ @ 130 *thumb_jump [length = 2] +.L13: + mov r0, r4 @ D.11539, width @ 9 *thumb1_movsi_insn/1 [length = 2] + b .L3 @ @ 132 *thumb_jump [length = 2] +.L10: + mov r0, r3 @ D.11539, maxloops @ 8 *thumb1_movsi_insn/1 [length = 2] +.L3: + @ sp needed @ @ 115 force_register_use [length = 0] + pop {r4, r5, pc} + .size countPulseASM, .-countPulseASM + .ident "GCC: (GNU Tools for ARM Embedded Processors (Arduino build)) 4.8.3 20140228 (release) [ARM/embedded-4_8-branch revision 208322]" diff --git a/sparkfun/samd/cores/arduino51/startup.c b/sparkfun/samd/cores/arduino51/startup.c new file mode 100644 index 00000000..63d953e1 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/startup.c @@ -0,0 +1,538 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "sam.h" +#include "variant.h" + +#include + +// Constants for Clock generators +#define GENERIC_CLOCK_GENERATOR_MAIN (0u) + +#if defined(__SAMD51__) +#define GENERIC_CLOCK_GENERATOR_XOSC32K (3u) +#define GENERIC_CLOCK_GENERATOR_48M (1u) +#define GENERIC_CLOCK_GENERATOR_48M_SYNC GCLK_SYNCBUSY_GENCTRL1 +#define GENERIC_CLOCK_GENERATOR_100M (2u) +#define GENERIC_CLOCK_GENERATOR_100M_SYNC GCLK_SYNCBUSY_GENCTRL2 +#define GENERIC_CLOCK_GENERATOR_12M (4u) +#define GENERIC_CLOCK_GENERATOR_12M_SYNC GCLK_SYNCBUSY_GENCTRL4 + +//USE DPLL0 for 120MHZ +#define MAIN_CLOCK_SOURCE GCLK_GENCTRL_SRC_DPLL0 + +#define GENERIC_CLOCK_GENERATOR_1M (5u) +//#define CRYSTALLESS + +#else + +#define GENERIC_CLOCK_GENERATOR_XOSC32K (1u) +#endif + +#define GENERIC_CLOCK_GENERATOR_OSC32K (1u) +#define GENERIC_CLOCK_GENERATOR_OSCULP32K (2u) /* Initialized at reset for WDT */ +#define GENERIC_CLOCK_GENERATOR_OSC8M (3u) +// Constants for Clock multiplexers +#define GENERIC_CLOCK_MULTIPLEXER_DFLL48M (0u) + +void SystemInit( void ) +{ + +//***************** SAMD51 ************************// +#if defined(__SAMD51__) + NVMCTRL->CTRLA.reg |= NVMCTRL_CTRLA_RWS(0); + + #ifndef CRYSTALLESS + /* ---------------------------------------------------------------------------------------------- + * 1) Enable XOSC32K clock (External on-board 32.768Hz oscillator) + */ + + OSC32KCTRL->XOSC32K.reg = OSC32KCTRL_XOSC32K_ENABLE | OSC32KCTRL_XOSC32K_EN32K | OSC32KCTRL_XOSC32K_CGM_XT | OSC32KCTRL_XOSC32K_XTALEN; + + while( (OSC32KCTRL->STATUS.reg & OSC32KCTRL_STATUS_XOSC32KRDY) == 0 ){ + /* Wait for oscillator to be ready */ + } + + #endif //CRYSTALLESS + + //software reset + + GCLK->CTRLA.bit.SWRST = 1; + while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_SWRST ){ + /* wait for reset to complete */ + } + + #ifndef CRYSTALLESS + /* ---------------------------------------------------------------------------------------------- + * 2) Put XOSC32K as source of Generic Clock Generator 3 + */ + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_XOSC32K].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_XOSC32K) | //generic clock gen 3 + GCLK_GENCTRL_GENEN; + #else + /* ---------------------------------------------------------------------------------------------- + * 2) Put OSCULP32K as source of Generic Clock Generator 3 + */ + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_XOSC32K].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_OSCULP32K) | GCLK_GENCTRL_GENEN; //generic clock gen 3 + #endif + + + while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL3 ){ + /* Wait for synchronization */ + } + + /* ---------------------------------------------------------------------------------------------- + * 3) Put OSCULP32K as source for Generic Clock Generator 0 + */ + GCLK->GENCTRL[0].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_OSCULP32K) | GCLK_GENCTRL_GENEN; + + /* ---------------------------------------------------------------------------------------------- + * 4) Enable DFLL48M clock + */ + + while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL0 ){ + /* Wait for synchronization */ + } + + /* DFLL Configuration in Open Loop mode */ + + OSCCTRL->DFLLCTRLA.reg = 0; + //GCLK->PCHCTRL[OSCCTRL_GCLK_ID_DFLL48].reg = (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(GCLK_PCHCTRL_GEN_GCLK3_Val); + + OSCCTRL->DFLLMUL.reg = OSCCTRL_DFLLMUL_CSTEP( 0x1 ) | + OSCCTRL_DFLLMUL_FSTEP( 0x1 ) | + OSCCTRL_DFLLMUL_MUL( 0 ); + + while ( OSCCTRL->DFLLSYNC.reg & OSCCTRL_DFLLSYNC_DFLLMUL ) + { + /* Wait for synchronization */ + } + + OSCCTRL->DFLLCTRLB.reg = 0; + while ( OSCCTRL->DFLLSYNC.reg & OSCCTRL_DFLLSYNC_DFLLCTRLB ) + { + /* Wait for synchronization */ + } + + OSCCTRL->DFLLCTRLA.reg |= OSCCTRL_DFLLCTRLA_ENABLE; + while ( OSCCTRL->DFLLSYNC.reg & OSCCTRL_DFLLSYNC_ENABLE ) + { + /* Wait for synchronization */ + } + + OSCCTRL->DFLLVAL.reg = OSCCTRL->DFLLVAL.reg; + while( OSCCTRL->DFLLSYNC.bit.DFLLVAL ); + + OSCCTRL->DFLLCTRLB.reg = OSCCTRL_DFLLCTRLB_WAITLOCK | + OSCCTRL_DFLLCTRLB_CCDIS | OSCCTRL_DFLLCTRLB_USBCRM ; + + while ( !OSCCTRL->STATUS.bit.DFLLRDY ) + { + /* Wait for synchronization */ + } + + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_1M].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DFLL_Val) | GCLK_GENCTRL_GENEN | GCLK_GENCTRL_DIV(48u); + + while ( GCLK->SYNCBUSY.bit.GENCTRL5 ){ + /* Wait for synchronization */ + } + + + /* ------------------------------------------------------------------------ + * Set up the PLLs + */ + + //PLL0 is 120MHz + GCLK->PCHCTRL[OSCCTRL_GCLK_ID_FDPLL0].reg = (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(GCLK_PCHCTRL_GEN_GCLK5_Val); + + OSCCTRL->Dpll[0].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x00) | OSCCTRL_DPLLRATIO_LDR(119); //120 Mhz + + while(OSCCTRL->Dpll[0].DPLLSYNCBUSY.bit.DPLLRATIO); + + //MUST USE LBYPASS DUE TO BUG IN REV A OF SAMD51 + OSCCTRL->Dpll[0].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK_GCLK | OSCCTRL_DPLLCTRLB_LBYPASS; + + OSCCTRL->Dpll[0].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_ENABLE; + + while( OSCCTRL->Dpll[0].DPLLSTATUS.bit.CLKRDY == 0 || OSCCTRL->Dpll[0].DPLLSTATUS.bit.LOCK == 0 ); + + //PLL1 is 100MHz + GCLK->PCHCTRL[OSCCTRL_GCLK_ID_FDPLL1].reg = (1 << GCLK_PCHCTRL_CHEN_Pos) | GCLK_PCHCTRL_GEN(GCLK_PCHCTRL_GEN_GCLK5_Val); + + OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0x00) | OSCCTRL_DPLLRATIO_LDR(99); //100 Mhz + + while(OSCCTRL->Dpll[1].DPLLSYNCBUSY.bit.DPLLRATIO); + + //MUST USE LBYPASS DUE TO BUG IN REV A OF SAMD51 + OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK_GCLK | OSCCTRL_DPLLCTRLB_LBYPASS; + + OSCCTRL->Dpll[1].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_ENABLE; + + while( OSCCTRL->Dpll[1].DPLLSTATUS.bit.CLKRDY == 0 || OSCCTRL->Dpll[1].DPLLSTATUS.bit.LOCK == 0 ); + + + /* ------------------------------------------------------------------------ + * Set up the peripheral clocks + */ + + //48MHZ CLOCK FOR USB AND STUFF + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_48M].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DFLL_Val) | + GCLK_GENCTRL_IDC | + //GCLK_GENCTRL_OE | + GCLK_GENCTRL_GENEN; + + while ( GCLK->SYNCBUSY.reg & GENERIC_CLOCK_GENERATOR_48M_SYNC) + { + /* Wait for synchronization */ + } + + //100MHZ CLOCK FOR OTHER PERIPHERALS + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_100M].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DPLL1_Val) | + GCLK_GENCTRL_IDC | + //GCLK_GENCTRL_OE | + GCLK_GENCTRL_GENEN; + + while ( GCLK->SYNCBUSY.reg & GENERIC_CLOCK_GENERATOR_100M_SYNC) + { + /* Wait for synchronization */ + } + + //12MHZ CLOCK FOR DAC + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_12M].reg = GCLK_GENCTRL_SRC(GCLK_GENCTRL_SRC_DFLL_Val) | + GCLK_GENCTRL_IDC | + GCLK_GENCTRL_DIV(4) | + //GCLK_GENCTRL_DIVSEL | + //GCLK_GENCTRL_OE | + GCLK_GENCTRL_GENEN; + + while ( GCLK->SYNCBUSY.reg & GENERIC_CLOCK_GENERATOR_12M_SYNC) + { + /* Wait for synchronization */ + } + + /*--------------------------------------------------------------------- + * Set up main clock + */ + + GCLK->GENCTRL[GENERIC_CLOCK_GENERATOR_MAIN].reg = GCLK_GENCTRL_SRC(MAIN_CLOCK_SOURCE) | + GCLK_GENCTRL_IDC | + //GCLK_GENCTRL_OE | + GCLK_GENCTRL_GENEN; + + + while ( GCLK->SYNCBUSY.reg & GCLK_SYNCBUSY_GENCTRL0 ) + { + /* Wait for synchronization */ + } + + MCLK->CPUDIV.reg = MCLK_CPUDIV_DIV_DIV1; + + /* Use the LDO regulator by default */ + SUPC->VREG.bit.SEL = 0; + + + /* If desired, enable cache! */ +#if defined(ENABLE_CACHE) + __disable_irq(); + CMCC->CTRL.reg = 1; + __enable_irq(); +#endif + + /*--------------------------------------------------------------------- + * Start up the "Debug Watchpoint and Trace" unit, so that we can use + * it's 32bit cycle counter for timing. + */ + CoreDebug->DEMCR |= CoreDebug_DEMCR_TRCENA_Msk; + DWT->CTRL |= DWT_CTRL_CYCCNTENA_Msk; + +//*************** END SAMD51 *************************// + +#else +//********************** SAMD21 *********************// + + /** + * \brief SystemInit() configures the needed clocks and according Flash Read Wait States. + * At reset: + * - OSC8M clock source is enabled with a divider by 8 (1MHz). + * - Generic Clock Generator 0 (GCLKMAIN) is using OSC8M as source. + * We need to: + * 1) Enable XOSC32K clock (External on-board 32.768Hz oscillator), will be used as DFLL48M reference. + * 2) Put XOSC32K as source of Generic Clock Generator 1 + * 3) Put Generic Clock Generator 1 as source for Generic Clock Multiplexer 0 (DFLL48M reference) + * 4) Enable DFLL48M clock + * 5) Switch Generic Clock Generator 0 to DFLL48M. CPU will run at 48MHz. + * 6) Modify PRESCaler value of OSCM to have 8MHz + * 7) Put OSC8M as source for Generic Clock Generator 3 + */ + + + /* Set 1 Flash Wait State for 48MHz, cf tables 20.9 and 35.27 in SAMD21 Datasheet */ + NVMCTRL->CTRLB.bit.RWS = NVMCTRL_CTRLB_RWS_HALF_Val ; + + /* Turn on the digital interface clock */ + PM->APBAMASK.reg |= PM_APBAMASK_GCLK ; + + + #if defined(CRYSTALLESS) + + /* ---------------------------------------------------------------------------------------------- + * 1) Enable OSC32K clock (Internal 32.768Hz oscillator) + */ + + uint32_t calib = (*((uint32_t *) FUSES_OSC32K_CAL_ADDR) & FUSES_OSC32K_CAL_Msk) >> FUSES_OSC32K_CAL_Pos; + + SYSCTRL->OSC32K.reg = SYSCTRL_OSC32K_CALIB(calib) | + SYSCTRL_OSC32K_STARTUP( 0x6u ) | // cf table 15.10 of product datasheet in chapter 15.8.6 + SYSCTRL_OSC32K_EN32K | + SYSCTRL_OSC32K_ENABLE; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_OSC32KRDY) == 0 ); // Wait for oscillator stabilization + + #else // has crystal + + /* ---------------------------------------------------------------------------------------------- + * 1) Enable XOSC32K clock (External on-board 32.768Hz oscillator) + */ + SYSCTRL->XOSC32K.reg = SYSCTRL_XOSC32K_STARTUP( 0x6u ) | /* cf table 15.10 of product datasheet in chapter 15.8.6 */ + SYSCTRL_XOSC32K_XTALEN | SYSCTRL_XOSC32K_EN32K ; + SYSCTRL->XOSC32K.bit.ENABLE = 1 ; /* separate call, as described in chapter 15.6.3 */ + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_XOSC32KRDY) == 0 ) + { + /* Wait for oscillator stabilization */ + } + + #endif + + /* Software reset the module to ensure it is re-initialized correctly */ + /* Note: Due to synchronization, there is a delay from writing CTRL.SWRST until the reset is complete. + * CTRL.SWRST and STATUS.SYNCBUSY will both be cleared when the reset is complete, as described in chapter 13.8.1 + */ + GCLK->CTRL.reg = GCLK_CTRL_SWRST ; + + while ( (GCLK->CTRL.reg & GCLK_CTRL_SWRST) && (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY) ) + { + /* Wait for reset to complete */ + } + + /* ---------------------------------------------------------------------------------------------- + * 2) Put XOSC32K as source of Generic Clock Generator 1 + */ + GCLK->GENDIV.reg = GCLK_GENDIV_ID( GENERIC_CLOCK_GENERATOR_XOSC32K ) ; // Generic Clock Generator 1 + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* Write Generic Clock Generator 1 configuration */ + GCLK->GENCTRL.reg = GCLK_GENCTRL_ID( GENERIC_CLOCK_GENERATOR_OSC32K ) | // Generic Clock Generator 1 + #if defined(CRYSTALLESS) + GCLK_GENCTRL_SRC_OSC32K | // Selected source is Internal 32KHz Oscillator + #else + GCLK_GENCTRL_SRC_XOSC32K | // Selected source is External 32KHz Oscillator + #endif + // GCLK_GENCTRL_OE | // Output clock to a pin for tests + GCLK_GENCTRL_GENEN ; + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* ---------------------------------------------------------------------------------------------- + * 3) Put Generic Clock Generator 1 as source for Generic Clock Multiplexer 0 (DFLL48M reference) + */ + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID( GENERIC_CLOCK_MULTIPLEXER_DFLL48M ) | // Generic Clock Multiplexer 0 + GCLK_CLKCTRL_GEN_GCLK1 | // Generic Clock Generator 1 is source + GCLK_CLKCTRL_CLKEN ; + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* ---------------------------------------------------------------------------------------------- + * 4) Enable DFLL48M clock + */ + + /* DFLL Configuration in Closed Loop mode, cf product datasheet chapter 15.6.7.1 - Closed-Loop Operation */ + + /* Remove the OnDemand mode, Bug http://avr32.icgroup.norway.atmel.com/bugzilla/show_bug.cgi?id=9905 */ + SYSCTRL->DFLLCTRL.reg = SYSCTRL_DFLLCTRL_ENABLE; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + SYSCTRL->DFLLMUL.reg = SYSCTRL_DFLLMUL_CSTEP( 31 ) | // Coarse step is 31, half of the max value + SYSCTRL_DFLLMUL_FSTEP( 511 ) | // Fine step is 511, half of the max value + SYSCTRL_DFLLMUL_MUL( (VARIANT_MCK + VARIANT_MAINOSC/2) / VARIANT_MAINOSC ) ; // External 32KHz is the reference + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + #if defined(CRYSTALLESS) + + #define NVM_SW_CALIB_DFLL48M_COARSE_VAL 58 + + // Turn on DFLL + uint32_t coarse =( *((uint32_t *)(NVMCTRL_OTP4) + (NVM_SW_CALIB_DFLL48M_COARSE_VAL / 32)) >> (NVM_SW_CALIB_DFLL48M_COARSE_VAL % 32) ) + & ((1 << 6) - 1); + if (coarse == 0x3f) { + coarse = 0x1f; + } + // TODO(tannewt): Load this value from memory we've written previously. There + // isn't a value from the Atmel factory. + uint32_t fine = 0x1ff; + + SYSCTRL->DFLLVAL.bit.COARSE = coarse; + SYSCTRL->DFLLVAL.bit.FINE = fine; + /* Write full configuration to DFLL control register */ + SYSCTRL->DFLLMUL.reg = SYSCTRL_DFLLMUL_CSTEP( 0x1f / 4 ) | // Coarse step is 31, half of the max value + SYSCTRL_DFLLMUL_FSTEP( 10 ) | + SYSCTRL_DFLLMUL_MUL( (48000) ) ; + + SYSCTRL->DFLLCTRL.reg = 0; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + SYSCTRL->DFLLCTRL.reg = SYSCTRL_DFLLCTRL_MODE | + SYSCTRL_DFLLCTRL_CCDIS | + SYSCTRL_DFLLCTRL_USBCRM | /* USB correction */ + SYSCTRL_DFLLCTRL_BPLCKC; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + /* Enable the DFLL */ + SYSCTRL->DFLLCTRL.reg |= SYSCTRL_DFLLCTRL_ENABLE ; + + #else // has crystal + + /* Write full configuration to DFLL control register */ + SYSCTRL->DFLLCTRL.reg |= SYSCTRL_DFLLCTRL_MODE | /* Enable the closed loop mode */ + SYSCTRL_DFLLCTRL_WAITLOCK | + SYSCTRL_DFLLCTRL_QLDIS ; /* Disable Quick lock */ + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + /* Enable the DFLL */ + SYSCTRL->DFLLCTRL.reg |= SYSCTRL_DFLLCTRL_ENABLE ; + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLLCKC) == 0 || + (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLLCKF) == 0 ) + { + /* Wait for locks flags */ + } + + #endif + + while ( (SYSCTRL->PCLKSR.reg & SYSCTRL_PCLKSR_DFLLRDY) == 0 ) + { + /* Wait for synchronization */ + } + + /* ---------------------------------------------------------------------------------------------- + * 5) Switch Generic Clock Generator 0 to DFLL48M. CPU will run at 48MHz. + */ + GCLK->GENDIV.reg = GCLK_GENDIV_ID( GENERIC_CLOCK_GENERATOR_MAIN ) ; // Generic Clock Generator 0 + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* Write Generic Clock Generator 0 configuration */ + GCLK->GENCTRL.reg = GCLK_GENCTRL_ID( GENERIC_CLOCK_GENERATOR_MAIN ) | // Generic Clock Generator 0 + GCLK_GENCTRL_SRC_DFLL48M | // Selected source is DFLL 48MHz + // GCLK_GENCTRL_OE | // Output clock to a pin for tests + GCLK_GENCTRL_IDC | // Set 50/50 duty cycle + GCLK_GENCTRL_GENEN ; + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* ---------------------------------------------------------------------------------------------- + * 6) Modify PRESCaler value of OSC8M to have 8MHz + */ + SYSCTRL->OSC8M.bit.PRESC = SYSCTRL_OSC8M_PRESC_0_Val ; //CMSIS 4.5 changed the prescaler defines + SYSCTRL->OSC8M.bit.ONDEMAND = 0 ; + + /* ---------------------------------------------------------------------------------------------- + * 7) Put OSC8M as source for Generic Clock Generator 3 + */ + GCLK->GENDIV.reg = GCLK_GENDIV_ID( GENERIC_CLOCK_GENERATOR_OSC8M ) ; // Generic Clock Generator 3 + + /* Write Generic Clock Generator 3 configuration */ + GCLK->GENCTRL.reg = GCLK_GENCTRL_ID( GENERIC_CLOCK_GENERATOR_OSC8M ) | // Generic Clock Generator 3 + GCLK_GENCTRL_SRC_OSC8M | // Selected source is RC OSC 8MHz (already enabled at reset) + // GCLK_GENCTRL_OE | // Output clock to a pin for tests + GCLK_GENCTRL_GENEN ; + + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ) + { + /* Wait for synchronization */ + } + + /* + * Now that all system clocks are configured, we can set CPU and APBx BUS clocks. + * There values are normally the one present after Reset. + */ + PM->CPUSEL.reg = PM_CPUSEL_CPUDIV_DIV1 ; + PM->APBASEL.reg = PM_APBASEL_APBADIV_DIV1_Val ; + PM->APBBSEL.reg = PM_APBBSEL_APBBDIV_DIV1_Val ; + PM->APBCSEL.reg = PM_APBCSEL_APBCDIV_DIV1_Val ; + + SystemCoreClock=VARIANT_MCK ; + + /* ---------------------------------------------------------------------------------------------- + * 8) Load ADC factory calibration values + */ + + // ADC Bias Calibration + uint32_t bias = (*((uint32_t *) ADC_FUSES_BIASCAL_ADDR) & ADC_FUSES_BIASCAL_Msk) >> ADC_FUSES_BIASCAL_Pos; + + // ADC Linearity bits 4:0 + uint32_t linearity = (*((uint32_t *) ADC_FUSES_LINEARITY_0_ADDR) & ADC_FUSES_LINEARITY_0_Msk) >> ADC_FUSES_LINEARITY_0_Pos; + + // ADC Linearity bits 7:5 + linearity |= ((*((uint32_t *) ADC_FUSES_LINEARITY_1_ADDR) & ADC_FUSES_LINEARITY_1_Msk) >> ADC_FUSES_LINEARITY_1_Pos) << 5; + + ADC->CALIB.reg = ADC_CALIB_BIAS_CAL(bias) | ADC_CALIB_LINEARITY_CAL(linearity); + + /* + * 9) Disable automatic NVM write operations + */ + NVMCTRL->CTRLB.bit.MANW = 1; + #endif +} + diff --git a/sparkfun/samd/cores/arduino51/wiring.c b/sparkfun/samd/cores/arduino51/wiring.c new file mode 100644 index 00000000..2c361efe --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring.c @@ -0,0 +1,201 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" + +#ifdef __cplusplus +extern "C" { +#endif + + +#if defined(__SAMD51__) +//CHANGE THIS IF YOU CHANGE THE CLOCK SPEED +uint32_t SystemCoreClock=120000000ul ; +#else +/* + * System Core Clock is at 1MHz (8MHz/8) at Reset. + * It is switched to 48MHz in the Reset Handler (startup.c) + */ +uint32_t SystemCoreClock=1000000ul ; +#endif + +/* +void calibrateADC() +{ + volatile uint32_t valeur = 0; + + for(int i = 0; i < 5; ++i) + { + ADC->SWTRIG.bit.START = 1; + while( ADC->INTFLAG.bit.RESRDY == 0 || ADC->STATUS.bit.SYNCBUSY == 1 ) + { + // Waiting for a complete conversion and complete synchronization + } + + valeur += ADC->RESULT.bit.RESULT; + } + + valeur = valeur/5; +}*/ + +/* + * Arduino Zero board initialization + * + * Good to know: + * - At reset, ResetHandler did the system clock configuration. Core is running at 48MHz. + * - Watchdog is disabled by default, unless someone plays with NVM User page + * - During reset, all PORT lines are configured as inputs with input buffers, output buffers and pull disabled. + */ +void init( void ) +{ + // Set Systick to 1ms interval, common to all Cortex-M variants + if ( SysTick_Config( SystemCoreClock / 1000 ) ) + { + // Capture error + while ( 1 ) ; + } + NVIC_SetPriority (SysTick_IRQn, (1 << __NVIC_PRIO_BITS) - 2); /* set Priority for Systick Interrupt (2nd lowest) */ + + // Clock PORT for Digital I/O +// PM->APBBMASK.reg |= PM_APBBMASK_PORT ; +// +// // Clock EIC for I/O interrupts +// PM->APBAMASK.reg |= PM_APBAMASK_EIC ; + +#if defined(__SAMD51__) + MCLK->APBAMASK.reg |= MCLK_APBAMASK_SERCOM0 | MCLK_APBAMASK_SERCOM1 | MCLK_APBAMASK_TC0 | MCLK_APBAMASK_TC1; + + MCLK->APBBMASK.reg |= MCLK_APBBMASK_SERCOM2 | MCLK_APBBMASK_SERCOM3 | MCLK_APBBMASK_TCC0 | MCLK_APBBMASK_TCC1 | MCLK_APBBMASK_TC3 | MCLK_APBBMASK_TC2; + + MCLK->APBCMASK.reg |= MCLK_APBCMASK_TCC2 | MCLK_APBCMASK_TCC3 | MCLK_APBCMASK_TC4 | MCLK_APBCMASK_TC5; + + MCLK->APBDMASK.reg |= MCLK_APBDMASK_DAC | MCLK_APBDMASK_SERCOM4 | MCLK_APBDMASK_SERCOM5 | MCLK_APBDMASK_ADC0 | MCLK_APBDMASK_ADC1 | MCLK_APBDMASK_TCC4 + | MCLK_APBDMASK_TC6 | MCLK_APBDMASK_TC7 | MCLK_APBDMASK_SERCOM6 | MCLK_APBDMASK_SERCOM7; + +#else + // Clock SERCOM for Serial + PM->APBCMASK.reg |= PM_APBCMASK_SERCOM0 | PM_APBCMASK_SERCOM1 | PM_APBCMASK_SERCOM2 | PM_APBCMASK_SERCOM3 | PM_APBCMASK_SERCOM4 | PM_APBCMASK_SERCOM5 ; + + // Clock TC/TCC for Pulse and Analog + PM->APBCMASK.reg |= PM_APBCMASK_TCC0 | PM_APBCMASK_TCC1 | PM_APBCMASK_TCC2 | PM_APBCMASK_TC3 | PM_APBCMASK_TC4 | PM_APBCMASK_TC5 ; + + // ATSAMR, for example, doesn't have a DAC + #ifdef PM_APBCMASK_DAC + // Clock ADC/DAC for Analog + PM->APBCMASK.reg |= PM_APBCMASK_ADC | PM_APBCMASK_DAC ; + #endif +#endif + + // Setup all pins (digital and analog) in INPUT mode (default is nothing) + for (uint32_t ul = 0 ; ul < NUM_DIGITAL_PINS ; ul++ ) + { + pinMode( ul, INPUT ) ; + } + + // Initialize Analog Controller + // Setting clock +#if defined(__SAMD51__) + //set to 1/(1/(48000000/32) * 6) = 250000 SPS + GCLK->PCHCTRL[ADC0_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); //use clock generator 1 (48Mhz) + GCLK->PCHCTRL[ADC1_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK1_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); //use clock generator 1 (48Mhz) + Adc *adcs[] = {ADC0, ADC1}; + for(int i=0; i<2; i++){ + + adcs[i]->CTRLA.bit.PRESCALER = ADC_CTRLA_PRESCALER_DIV32_Val; + adcs[i]->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_10BIT_Val; + + while( adcs[i]->SYNCBUSY.reg & ADC_SYNCBUSY_CTRLB ); //wait for sync + + adcs[i]->SAMPCTRL.reg = 5; // sampling Time Length + + while( adcs[i]->SYNCBUSY.reg & ADC_SYNCBUSY_SAMPCTRL ); //wait for sync + + adcs[i]->INPUTCTRL.reg = ADC_INPUTCTRL_MUXNEG_GND; // No Negative input (Internal Ground) + + while( adcs[i]->SYNCBUSY.reg & ADC_SYNCBUSY_INPUTCTRL ); //wait for sync + + // Averaging (see datasheet table in AVGCTRL register description) + adcs[i]->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_1 | // 1 sample only (no oversampling nor averaging) + ADC_AVGCTRL_ADJRES(0x0ul); // Adjusting result by 0 + + while( adcs[i]->SYNCBUSY.reg & ADC_SYNCBUSY_AVGCTRL ); //wait for sync + } + + analogReference( AR_DEFAULT ) ; // Analog Reference is AREF pin (3.3v) + + GCLK->PCHCTRL[DAC_GCLK_ID].reg = GCLK_PCHCTRL_GEN_GCLK4_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); //use clock generator 4 (12mhz) + while (GCLK->PCHCTRL[DAC_GCLK_ID].bit.CHEN == 0); + + while ( DAC->SYNCBUSY.bit.SWRST == 1 ); // Wait for synchronization of registers between the clock domains + DAC->CTRLA.bit.SWRST = 1; + while ( DAC->SYNCBUSY.bit.SWRST == 1 ); // Wait for synchronization of registers between the clock domains + + DAC->CTRLB.reg = DAC_CTRLB_REFSEL_VREFPU; // TODO: fix this once silicon bug is fixed + + //set refresh rates + DAC->DACCTRL[0].bit.REFRESH = 2; + DAC->DACCTRL[1].bit.REFRESH = 2; + +#else + //set to 1/(1/(48000000/32) * 6) = 250000 SPS + + while(GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY); + + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID( GCM_ADC ) | // Generic Clock ADC + GCLK_CLKCTRL_GEN_GCLK0 | // Generic Clock Generator 0 is source + GCLK_CLKCTRL_CLKEN ; + + while( ADC->STATUS.bit.SYNCBUSY == 1 ); // Wait for synchronization of registers between the clock domains + + ADC->CTRLB.reg = ADC_CTRLB_PRESCALER_DIV32 | // Divide Clock by 32. + ADC_CTRLB_RESSEL_10BIT; // 10 bits resolution as default + + ADC->SAMPCTRL.reg = 5; // Sampling Time Length + + while( ADC->STATUS.bit.SYNCBUSY == 1 ); // Wait for synchronization of registers between the clock domains + + ADC->INPUTCTRL.reg = ADC_INPUTCTRL_MUXNEG_GND; // No Negative input (Internal Ground) + + // Averaging (see datasheet table in AVGCTRL register description) + ADC->AVGCTRL.reg = ADC_AVGCTRL_SAMPLENUM_1 | // 1 sample only (no oversampling nor averaging) + ADC_AVGCTRL_ADJRES(0x0ul); // Adjusting result by 0 + + analogReference( AR_DEFAULT ) ; // Analog Reference is AREF pin (3.3v) + + // Initialize DAC + // Setting clock + while ( GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY ); + GCLK->CLKCTRL.reg = GCLK_CLKCTRL_ID( GCM_DAC ) | // Generic Clock ADC + GCLK_CLKCTRL_GEN_GCLK0 | // Generic Clock Generator 0 is source + GCLK_CLKCTRL_CLKEN ; + + // ATSAMR, for example, doesn't have a DAC + #ifdef DAC + while ( DAC->STATUS.bit.SYNCBUSY == 1 ); // Wait for synchronization of registers between the clock domains + DAC->CTRLB.reg = DAC_CTRLB_REFSEL_AVCC | // Using the 3.3V reference + DAC_CTRLB_EOEN ; // External Output Enable (Vout) + #endif + + +#endif //SAMD51 +} + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring.h b/sparkfun/samd/cores/arduino51/wiring.h new file mode 100644 index 00000000..55e4e6a8 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring.h @@ -0,0 +1,29 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +extern void init(void); + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring_analog.c b/sparkfun/samd/cores/arduino51/wiring_analog.c new file mode 100644 index 00000000..21ff2d1c --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_analog.c @@ -0,0 +1,688 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" +#include "wiring_private.h" + +#ifdef __cplusplus +extern "C" { +#endif + +static int _readResolution = 10; +static int _ADCResolution = 10; + +#if defined(__SAMD51__) +static int _writeResolution = 12; +static int _dacResolution = 12; +#else +static int _writeResolution = 8; +static int _dacResolution = 10; +#endif + + +#if !defined(__SAMD51__) +// Wait for synchronization of registers between the clock domains +static __inline__ void syncADC() __attribute__((always_inline, unused)); +static void syncADC() { + while (ADC->STATUS.bit.SYNCBUSY == 1) + ; +} + + // ATSAMR, for example, doesn't have a DAC +#ifdef DAC +// Wait for synchronization of registers between the clock domains +static __inline__ void syncDAC() __attribute__((always_inline, unused)); +static void syncDAC() { + while (DAC->STATUS.bit.SYNCBUSY == 1) + ; +} +#endif + +// Wait for synchronization of registers between the clock domains +static __inline__ void syncTC_16(Tc* TCx) __attribute__((always_inline, unused)); +static void syncTC_16(Tc* TCx) { + while (TCx->COUNT16.STATUS.bit.SYNCBUSY); +} + +// Wait for synchronization of registers between the clock domains +static __inline__ void syncTCC(Tcc* TCCx) __attribute__((always_inline, unused)); +static void syncTCC(Tcc* TCCx) { + while (TCCx->SYNCBUSY.reg & TCC_SYNCBUSY_MASK); +} + +#else +static bool dacEnabled[2]; +#endif + +void analogReadResolution(int res) +{ + _readResolution = res; +#if defined(__SAMD51__) + + if (res > 10) { + ADC0->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val; + ADC1->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val; + _ADCResolution = 12; + } else if (res > 8) { + ADC0->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_10BIT_Val; + ADC1->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_10BIT_Val; + _ADCResolution = 10; + } else { + ADC0->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_8BIT_Val; + ADC1->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_8BIT_Val; + _ADCResolution = 8; + } + + + while(ADC0->SYNCBUSY.reg & ADC_SYNCBUSY_CTRLB); //wait for sync + while(ADC1->SYNCBUSY.reg & ADC_SYNCBUSY_CTRLB); //wait for sync +#else + + if (res > 10) { + ADC->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_12BIT_Val; + _ADCResolution = 12; + } else if (res > 8) { + ADC->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_10BIT_Val; + _ADCResolution = 10; + } else { + ADC->CTRLB.bit.RESSEL = ADC_CTRLB_RESSEL_8BIT_Val; + _ADCResolution = 8; + } + + syncADC(); +#endif +} + +void analogWriteResolution(int res) +{ + _writeResolution = res; +} + +static inline uint32_t mapResolution(uint32_t value, uint32_t from, uint32_t to) +{ + if (from == to) { + return value; + } + if (from > to) { + return value >> (from-to); + } + return value << (to-from); +} + +/* + * Internal Reference is at 1.0v + * External Reference should be between 1v and VDDANA-0.6v=2.7v + * + * Warning : On Arduino Zero board the input/output voltage for SAMD21G18 is 3.3 volts maximum + */ +void analogReference(eAnalogReference mode) +{ +#if defined(__SAMD51__) + while(ADC0->SYNCBUSY.reg & ADC_SYNCBUSY_REFCTRL); //wait for sync + while(ADC1->SYNCBUSY.reg & ADC_SYNCBUSY_REFCTRL); //wait for sync + + //TODO: fix gains + switch (mode) + { + case AR_INTERNAL1V0: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_1V0_Val; // select 1.0V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL1V1: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_1V1_Val; // select 1.1V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL1V2: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_1V2_Val; // select 1V2 + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL1V25: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_1V25_Val; // select 1.25V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL2V0: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_2V0_Val; // select 2.0V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL2V2: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_2V2_Val; // select 2.2V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL2V4: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_2V4_Val; // select 2.4V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_INTERNAL2V5: + //ADC0->GAINCORR.reg = ADC_GAINCORR_GAINCORR(); // Gain Factor Selection + SUPC->VREF.bit.SEL = SUPC_VREF_SEL_2V5_Val; // select 2.5V + SUPC->VREF.bit.VREFOE = 1; // Turn on for use with ADC + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // Use SUPC.VREF + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTREF_Val; // + break; + + case AR_EXTERNAL: + //ADC0->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain Factor Selection + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; // AREF is jumpered to VCC, so 3.3V + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; + break; + + case AR_INTERNAL1V65: + //ADC0->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_DIV2_Val; + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC0_Val; // 1/2 VDDANA = 1.65 + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC0_Val; // + break; + + case AR_DEFAULT: + default: + //ADC0->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_DIV2_Val; + ADC0->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC1_Val; // VDDANA = 3V3 + ADC1->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC1_Val; // + break; + } + +#else + syncADC(); + switch (mode) + { + case AR_INTERNAL2V23: + ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain Factor Selection + ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC0_Val; // 1/1.48 VDDANA = 1/1.48* 3V3 = 2.2297 + break; + + case AR_EXTERNAL: + ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain Factor Selection + ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_AREFA_Val; + break; + + case AR_INTERNAL1V0: + ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain Factor Selection + ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INT1V_Val; // 1.0V voltage reference + break; + + case AR_INTERNAL1V65: + ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_1X_Val; // Gain Factor Selection + ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC1_Val; // 1/2 VDDANA = 0.5* 3V3 = 1.65V + break; + + case AR_DEFAULT: + default: + ADC->INPUTCTRL.bit.GAIN = ADC_INPUTCTRL_GAIN_DIV2_Val; + ADC->REFCTRL.bit.REFSEL = ADC_REFCTRL_REFSEL_INTVCC1_Val; // 1/2 VDDANA = 0.5* 3V3 = 1.65V + break; + } +#endif +} + +uint32_t analogRead(uint32_t pin) +{ + uint32_t valueRead = 0; + +#if defined(PIN_A6) + if (pin == 6) { + pin = PIN_A6; + } else +#endif +#if defined(PIN_A7) + if (pin == 7) { + pin = PIN_A7; + } else +#endif + if (pin <= 5) { + pin += A0; + } + + pinPeripheral(pin, PIO_ANALOG); + //ATSAMR, for example, doesn't have a DAC +#ifdef DAC + + #if defined(__SAMD51__) + if (pin == A0 || pin == A1) { // Disable DAC, if analogWrite(A0,dval) used previously the DAC is enabled + uint8_t channel = (pin == PIN_A0 ? 0 : 1); + + if(dacEnabled[channel]){ + dacEnabled[channel] = false; + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->CTRLA.bit.ENABLE = 0; // disable DAC + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->DACCTRL[channel].bit.ENABLE = 0; + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->CTRLA.bit.ENABLE = 1; // enable DAC + } + + while (DAC->SYNCBUSY.bit.ENABLE); + #else + if (pin == A0) { // Disable DAC, if analogWrite(A0,dval) used previously the DAC is enabled + syncDAC(); + + DAC->CTRLA.bit.ENABLE = 0x00; // Disable DAC + //DAC->CTRLB.bit.EOEN = 0x00; // The DAC output is turned off. + syncDAC(); + #endif + } + +#endif + +#if defined(__SAMD51__) + Adc *adc; + if(g_APinDescription[pin].ulPinAttribute & PIN_ATTR_ANALOG) adc = ADC0; + else if(g_APinDescription[pin].ulPinAttribute & PIN_ATTR_ANALOG_ALT) adc = ADC1; + else return 0; + + while( adc->SYNCBUSY.reg & ADC_SYNCBUSY_INPUTCTRL ); //wait for sync + adc->INPUTCTRL.bit.MUXPOS = g_APinDescription[pin].ulADCChannelNumber; // Selection for the positive ADC input + + // Control A + /* + * Bit 1 ENABLE: Enable + * 0: The ADC is disabled. + * 1: The ADC is enabled. + * Due to synchronization, there is a delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The + * value written to CTRL.ENABLE will read back immediately and the Synchronization Busy bit in the Status register + * (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete. + * + * Before enabling the ADC, the asynchronous clock source must be selected and enabled, and the ADC reference must be + * configured. The first conversion after the reference is changed must not be used. + */ + while( adc->SYNCBUSY.reg & ADC_SYNCBUSY_ENABLE ); //wait for sync + adc->CTRLA.bit.ENABLE = 0x01; // Enable ADC + + // Start conversion + while( adc->SYNCBUSY.reg & ADC_SYNCBUSY_ENABLE ); //wait for sync + + adc->SWTRIG.bit.START = 1; + + // Clear the Data Ready flag + adc->INTFLAG.reg = ADC_INTFLAG_RESRDY; + + // Start conversion again, since The first conversion after the reference is changed must not be used. + adc->SWTRIG.bit.START = 1; + + // Store the value + while (adc->INTFLAG.bit.RESRDY == 0); // Waiting for conversion to complete + valueRead = adc->RESULT.reg; + + while( adc->SYNCBUSY.reg & ADC_SYNCBUSY_ENABLE ); //wait for sync + adc->CTRLA.bit.ENABLE = 0x00; // Disable ADC + while( adc->SYNCBUSY.reg & ADC_SYNCBUSY_ENABLE ); //wait for sync + +#else + syncADC(); + ADC->INPUTCTRL.bit.MUXPOS = g_APinDescription[pin].ulADCChannelNumber; // Selection for the positive ADC input + + // Control A + /* + * Bit 1 ENABLE: Enable + * 0: The ADC is disabled. + * 1: The ADC is enabled. + * Due to synchronization, there is a delay from writing CTRLA.ENABLE until the peripheral is enabled/disabled. The + * value written to CTRL.ENABLE will read back immediately and the Synchronization Busy bit in the Status register + * (STATUS.SYNCBUSY) will be set. STATUS.SYNCBUSY will be cleared when the operation is complete. + * + * Before enabling the ADC, the asynchronous clock source must be selected and enabled, and the ADC reference must be + * configured. The first conversion after the reference is changed must not be used. + */ + syncADC(); + ADC->CTRLA.bit.ENABLE = 0x01; // Enable ADC + + // Start conversion + syncADC(); + ADC->SWTRIG.bit.START = 1; + + // Clear the Data Ready flag + ADC->INTFLAG.reg = ADC_INTFLAG_RESRDY; + + // Start conversion again, since The first conversion after the reference is changed must not be used. + syncADC(); + ADC->SWTRIG.bit.START = 1; + + // Store the value + while (ADC->INTFLAG.bit.RESRDY == 0); // Waiting for conversion to complete + valueRead = ADC->RESULT.reg; + + syncADC(); + ADC->CTRLA.bit.ENABLE = 0x00; // Disable ADC + syncADC(); +#endif + + return mapResolution(valueRead, _ADCResolution, _readResolution); +} + + +// Right now, PWM output only works on the pins with +// hardware support. These are defined in the appropriate +// pins_*.c file. For the rest of the pins, we default +// to digital output. +void analogWrite(uint32_t pin, uint32_t value) +{ + PinDescription pinDesc = g_APinDescription[pin]; + uint32_t attr = pinDesc.ulPinAttribute; + + // ATSAMR, for example, doesn't have a DAC +#ifdef DAC + + if ((attr & PIN_ATTR_ANALOG) == PIN_ATTR_ANALOG) + { + // DAC handling code +#if defined(__SAMD51__) + if (pin == PIN_A0 || pin == PIN_A1) { // 2 DACs on A0 (PA02) and A1 (PA05) +#else + if (pin == PIN_A0) { // Only 1 DAC on A0 (PA02) +#endif + +#if defined(__SAMD51__) + + value = mapResolution(value, _writeResolution, _dacResolution); + + + uint8_t channel = (pin == PIN_A0 ? 0 : 1); + + pinPeripheral(pin, PIO_ANALOG); + + if(!dacEnabled[channel]){ + dacEnabled[channel] = true; + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->CTRLA.bit.ENABLE = 0; // disable DAC + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->DACCTRL[channel].bit.ENABLE = 1; + + while (DAC->SYNCBUSY.bit.ENABLE || DAC->SYNCBUSY.bit.SWRST); + DAC->CTRLA.bit.ENABLE = 1; // enable DAC + + if(channel == 0){ + + while ( !DAC->STATUS.bit.READY0 ); + + while (DAC->SYNCBUSY.bit.DATA0); + DAC->DATA[0].reg = value; + } + else if(channel == 1){ + while ( !DAC->STATUS.bit.READY1 ); + + while (DAC->SYNCBUSY.bit.DATA1); + DAC->DATA[1].reg = value; + } + + delayMicroseconds(10000); + } + + //ERROR! + while(!DAC->DACCTRL[channel].bit.ENABLE); + + if(channel == 0){ + + while ( !DAC->STATUS.bit.READY0 ); + + while (DAC->SYNCBUSY.bit.DATA0); + DAC->DATA[0].reg = value; // DAC on 10 bits. + } + else if(channel == 1){ + while ( !DAC->STATUS.bit.READY1 ); + + while (DAC->SYNCBUSY.bit.DATA1); + DAC->DATA[1].reg = value; // DAC on 10 bits. + } + + +#else + syncDAC(); + DAC->DATA.reg = value & 0x3FF; // DAC on 10 bits. + syncDAC(); + DAC->CTRLA.bit.ENABLE = 0x01; // Enable DAC + syncDAC(); +#endif // __SAMD51__ + return; + } + } +#endif // DAC + +#if defined(__SAMD51__) + if(attr & (PIN_ATTR_PWM_E|PIN_ATTR_PWM_F|PIN_ATTR_PWM_G)){ + + uint32_t tcNum = GetTCNumber(pinDesc.ulPWMChannel); + uint8_t tcChannel = GetTCChannelNumber(pinDesc.ulPWMChannel); + static bool tcEnabled[TCC_INST_NUM+TC_INST_NUM]; + + if(attr & PIN_ATTR_PWM_E) + pinPeripheral(pin, PIO_TIMER); + else if(attr & PIN_ATTR_PWM_F) + pinPeripheral(pin, PIO_TIMER_ALT); + else if(attr & PIN_ATTR_PWM_G) + pinPeripheral(pin, PIO_TCC_PDEC); + + if (!tcEnabled[tcNum]) { + tcEnabled[tcNum] = true; + GCLK->PCHCTRL[GCLK_CLKCTRL_IDs[tcNum]].reg = GCLK_PCHCTRL_GEN_GCLK0_Val | (1 << GCLK_PCHCTRL_CHEN_Pos); //use clock generator 0 + + // Set PORT + if (tcNum >= TCC_INST_NUM) { + // -- Configure TC + Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); + + //reset + TCx->COUNT8.CTRLA.bit.SWRST = 1; + while (TCx->COUNT8.SYNCBUSY.bit.SWRST); + + // Disable TCx + TCx->COUNT8.CTRLA.bit.ENABLE = 0; + while (TCx->COUNT8.SYNCBUSY.bit.ENABLE); + // Set Timer counter Mode to 8 bits, normal PWM, prescaler 1/256 + TCx->COUNT8.CTRLA.reg = TC_CTRLA_MODE_COUNT8 | TC_CTRLA_PRESCALER_DIV256; + TCx->COUNT8.WAVE.reg = TC_WAVE_WAVEGEN_NPWM; + + while (TCx->COUNT8.SYNCBUSY.bit.CC0); + // Set the initial value + TCx->COUNT8.CC[tcChannel].reg = (uint8_t) value; + while (TCx->COUNT8.SYNCBUSY.bit.CC0); + // Set PER to maximum counter value (resolution : 0xFF) + TCx->COUNT8.PER.reg = 0xFF; + while (TCx->COUNT8.SYNCBUSY.bit.PER); + // Enable TCx + TCx->COUNT8.CTRLA.bit.ENABLE = 1; + while (TCx->COUNT8.SYNCBUSY.bit.ENABLE); + } else { + // -- Configure TCC + Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); + + TCCx->CTRLA.bit.SWRST = 1; + while (TCCx->SYNCBUSY.bit.SWRST); + + // Disable TCCx + TCCx->CTRLA.bit.ENABLE = 0; + while (TCCx->SYNCBUSY.bit.ENABLE); + // Set prescaler to 1/256 + TCCx->CTRLA.reg = TCC_CTRLA_PRESCALER_DIV256 | TCC_CTRLA_PRESCSYNC_GCLK; + + // Set TCx as normal PWM + TCCx->WAVE.reg = TCC_WAVE_WAVEGEN_NPWM; + while ( TCCx->SYNCBUSY.bit.WAVE ); + + while (TCCx->SYNCBUSY.bit.CC0 || TCCx->SYNCBUSY.bit.CC1); + // Set the initial value + TCCx->CC[tcChannel].reg = (uint32_t) value; + while (TCCx->SYNCBUSY.bit.CC0 || TCCx->SYNCBUSY.bit.CC1); + // Set PER to maximum counter value (resolution : 0xFF) + TCCx->PER.reg = 0xFF; + while (TCCx->SYNCBUSY.bit.PER); + // Enable TCCx + TCCx->CTRLA.bit.ENABLE = 1; + while (TCCx->SYNCBUSY.bit.ENABLE); + } + } + else { + if (tcNum >= TCC_INST_NUM) { + Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); + TCx->COUNT8.CC[tcChannel].reg = (uint8_t) value; + while (TCx->COUNT8.SYNCBUSY.bit.CC0 || TCx->COUNT8.SYNCBUSY.bit.CC1); + } else { + Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); + while (TCCx->SYNCBUSY.bit.CTRLB); + while (TCCx->SYNCBUSY.bit.CC0 || TCCx->SYNCBUSY.bit.CC1); + TCCx->CCBUF[tcChannel].reg = (uint32_t) value; + while (TCCx->SYNCBUSY.bit.CC0 || TCCx->SYNCBUSY.bit.CC1); + TCCx->CTRLBCLR.bit.LUPD = 1; + while (TCCx->SYNCBUSY.bit.CTRLB); + } + } + + return; + } + +#else + + if ((attr & PIN_ATTR_PWM) == PIN_ATTR_PWM) + { + value = mapResolution(value, _writeResolution, 16); + + uint32_t tcNum = GetTCNumber(pinDesc.ulPWMChannel); + uint8_t tcChannel = GetTCChannelNumber(pinDesc.ulPWMChannel); + static bool tcEnabled[TCC_INST_NUM+TC_INST_NUM]; + + if (attr & PIN_ATTR_TIMER) { +#if !(ARDUINO_SAMD_VARIANT_COMPLIANCE >= 10603) + // Compatibility for cores based on SAMD core <=1.6.2 + if (pinDesc.ulPinType == PIO_TIMER_ALT) { + pinPeripheral(pin, PIO_TIMER_ALT); + } else +#endif + { + pinPeripheral(pin, PIO_TIMER); + } + } else if ((attr & PIN_ATTR_TIMER_ALT) == PIN_ATTR_TIMER_ALT){ + //this is on an alt timer + pinPeripheral(pin, PIO_TIMER_ALT); + } + else{ + return; + } + + if (!tcEnabled[tcNum]) { + tcEnabled[tcNum] = true; + uint16_t GCLK_CLKCTRL_IDs[] = { + GCLK_CLKCTRL_ID(GCM_TCC0_TCC1), // TCC0 + GCLK_CLKCTRL_ID(GCM_TCC0_TCC1), // TCC1 + GCLK_CLKCTRL_ID(GCM_TCC2_TC3), // TCC2 + GCLK_CLKCTRL_ID(GCM_TCC2_TC3), // TC3 + GCLK_CLKCTRL_ID(GCM_TC4_TC5), // TC4 + GCLK_CLKCTRL_ID(GCM_TC4_TC5), // TC5 + GCLK_CLKCTRL_ID(GCM_TC6_TC7), // TC6 + GCLK_CLKCTRL_ID(GCM_TC6_TC7), // TC7 + }; + GCLK->CLKCTRL.reg = (uint16_t) (GCLK_CLKCTRL_CLKEN | GCLK_CLKCTRL_GEN_GCLK0 | GCLK_CLKCTRL_IDs[tcNum]); + while (GCLK->STATUS.bit.SYNCBUSY == 1); + + // Set PORT + if (tcNum >= TCC_INST_NUM) { + // -- Configure TC + Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); + // Disable TCx + TCx->COUNT16.CTRLA.bit.ENABLE = 0; + syncTC_16(TCx); + // Set Timer counter Mode to 16 bits, normal PWM + TCx->COUNT16.CTRLA.reg |= TC_CTRLA_MODE_COUNT16 | TC_CTRLA_WAVEGEN_NPWM; + syncTC_16(TCx); + // Set the initial value + TCx->COUNT16.CC[tcChannel].reg = (uint32_t) value; + syncTC_16(TCx); + // Enable TCx + TCx->COUNT16.CTRLA.bit.ENABLE = 1; + syncTC_16(TCx); + } else { + // -- Configure TCC + Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); + // Disable TCCx + TCCx->CTRLA.bit.ENABLE = 0; + syncTCC(TCCx); + // Set TCCx as normal PWM + TCCx->WAVE.reg |= TCC_WAVE_WAVEGEN_NPWM; + syncTCC(TCCx); + // Set the initial value + TCCx->CC[tcChannel].reg = (uint32_t) value; + syncTCC(TCCx); + // Set PER to maximum counter value (resolution : 0xFFFF) + TCCx->PER.reg = 0xFFFF; + syncTCC(TCCx); + // Enable TCCx + TCCx->CTRLA.bit.ENABLE = 1; + syncTCC(TCCx); + } + } else { + if (tcNum >= TCC_INST_NUM) { + Tc* TCx = (Tc*) GetTC(pinDesc.ulPWMChannel); + TCx->COUNT16.CC[tcChannel].reg = (uint32_t) value; + syncTC_16(TCx); + } else { + Tcc* TCCx = (Tcc*) GetTC(pinDesc.ulPWMChannel); + TCCx->CTRLBSET.bit.LUPD = 1; + syncTCC(TCCx); + TCCx->CCB[tcChannel].reg = (uint32_t) value; + syncTCC(TCCx); + TCCx->CTRLBCLR.bit.LUPD = 1; + syncTCC(TCCx); + } + } + return; + } +#endif + + // -- Defaults to digital write + pinMode(pin, OUTPUT); + value = mapResolution(value, _writeResolution, 8); + if (value < 128) { + digitalWrite(pin, LOW); + } else { + digitalWrite(pin, HIGH); + } +} + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring_analog.h b/sparkfun/samd/cores/arduino51/wiring_analog.h new file mode 100644 index 00000000..d8dce733 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_analog.h @@ -0,0 +1,91 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * \brief SAMD products have only one reference for ADC + */ + // add internal voltages for ATSAMD51 SUPC VREF register +typedef enum _eAnalogReference +{ + AR_DEFAULT, + AR_INTERNAL1V0, + AR_INTERNAL1V1, + AR_INTERNAL1V2, + AR_INTERNAL1V25, + AR_INTERNAL2V0, + AR_INTERNAL2V2, + AR_INTERNAL2V23, + AR_INTERNAL2V4, + AR_INTERNAL2V5, + AR_INTERNAL1V65, + AR_EXTERNAL +} eAnalogReference ; + + +/* + * \brief Configures the reference voltage used for analog input (i.e. the value used as the top of the input range). + * This function is kept only for compatibility with existing AVR based API. + * + * \param ulMmode Should be set to AR_DEFAULT. + */ +extern void analogReference( eAnalogReference ulMode ) ; + +/* + * \brief Writes an analog value (PWM wave) to a pin. + * + * \param ulPin + * \param ulValue + */ +extern void analogWrite( uint32_t ulPin, uint32_t ulValue ) ; + +/* + * \brief Reads the value from the specified analog pin. + * + * \param ulPin + * + * \return Read value from selected pin, if no error. + */ +extern uint32_t analogRead( uint32_t ulPin ) ; + +/* + * \brief Set the resolution of analogRead return values. Default is 10 bits (range from 0 to 1023). + * + * \param res + */ +extern void analogReadResolution(int res); + +/* + * \brief Set the resolution of analogWrite parameters. Default is 8 bits (range from 0 to 255). + * + * \param res + */ +extern void analogWriteResolution(int res); + +extern void analogOutputInit( void ) ; + +#ifdef __cplusplus +} +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring_constants.h b/sparkfun/samd/cores/arduino51/wiring_constants.h new file mode 100644 index 00000000..e8573aed --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_constants.h @@ -0,0 +1,63 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _WIRING_CONSTANTS_ +#define _WIRING_CONSTANTS_ + +#ifdef __cplusplus +extern "C"{ +#endif // __cplusplus + +#define LOW (0x0) +#define HIGH (0x1) + +#define INPUT (0x0) +#define OUTPUT (0x1) +#define INPUT_PULLUP (0x2) +#define INPUT_PULLDOWN (0x3) + +#define PI 3.1415926535897932384626433832795 +#define HALF_PI 1.5707963267948966192313216916398 +#define TWO_PI 6.283185307179586476925286766559 +#define DEG_TO_RAD 0.017453292519943295769236907684886 +#define RAD_TO_DEG 57.295779513082320876798154814105 +#define EULER 2.718281828459045235360287471352 + +#define SERIAL 0x0 +#define DISPLAY 0x1 + +enum BitOrder { + LSBFIRST = 0, + MSBFIRST = 1 +}; + +// moved to WInterrupts.h +//// LOW 0 +//// HIGH 1 +//#define CHANGE 2 +//#define FALLING 3 +//#define RISING 4 +// +//#define DEFAULT 1 +//#define EXTERNAL 0 + +#ifdef __cplusplus +} // extern "C" +#endif // __cplusplus + +#endif /* _WIRING_CONSTANTS_ */ diff --git a/sparkfun/samd/cores/arduino51/wiring_digital.c b/sparkfun/samd/cores/arduino51/wiring_digital.c new file mode 100644 index 00000000..026af80d --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_digital.c @@ -0,0 +1,124 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" + +#ifdef __cplusplus + extern "C" { +#endif + +void pinMode( uint32_t ulPin, uint32_t ulMode ) +{ + // Handle the case the pin isn't usable as PIO + if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN ) + { + return ; + } + + // Set pin mode according to chapter '22.6.3 I/O Pin Configuration' + switch ( ulMode ) + { + case INPUT: + // Set pin to input mode + PORT->Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg=(uint8_t)(PORT_PINCFG_INEN) ; + PORT->Group[g_APinDescription[ulPin].ulPort].DIRCLR.reg = (uint32_t)(1<Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg=(uint8_t)(PORT_PINCFG_INEN|PORT_PINCFG_PULLEN) ; + PORT->Group[g_APinDescription[ulPin].ulPort].DIRCLR.reg = (uint32_t)(1<Group[g_APinDescription[ulPin].ulPort].OUTSET.reg = (uint32_t)(1<Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg=(uint8_t)(PORT_PINCFG_INEN|PORT_PINCFG_PULLEN) ; + PORT->Group[g_APinDescription[ulPin].ulPort].DIRCLR.reg = (uint32_t)(1<Group[g_APinDescription[ulPin].ulPort].OUTCLR.reg = (uint32_t)(1<Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg=(uint8_t)(PORT_PINCFG_INEN) ; + + // Set pin to output mode + PORT->Group[g_APinDescription[ulPin].ulPort].DIRSET.reg = (uint32_t)(1<Group[port].DIRSET.reg & pinMask) == 0 ) { + // the pin is not an output, disable pull-up if val is LOW, otherwise enable pull-up + PORT->Group[port].PINCFG[pin].bit.PULLEN = ((ulVal == LOW) ? 0 : 1) ; + } + + switch ( ulVal ) + { + case LOW: + PORT->Group[port].OUTCLR.reg = pinMask; + break ; + + default: + PORT->Group[port].OUTSET.reg = pinMask; + break ; + } + + return ; +} + +int digitalRead( uint32_t ulPin ) +{ + // Handle the case the pin isn't usable as PIO + if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN ) + { + return LOW ; + } + + if ( (PORT->Group[g_APinDescription[ulPin].ulPort].IN.reg & (1ul << g_APinDescription[ulPin].ulPin)) != 0 ) + { + return HIGH ; + } + + return LOW ; +} + +#ifdef __cplusplus +} +#endif + diff --git a/sparkfun/samd/cores/arduino51/wiring_digital.h b/sparkfun/samd/cores/arduino51/wiring_digital.h new file mode 100644 index 00000000..9895390f --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_digital.h @@ -0,0 +1,71 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _WIRING_DIGITAL_ +#define _WIRING_DIGITAL_ + +#ifdef __cplusplus + extern "C" { +#endif + +#include "WVariant.h" + +/** + * \brief Configures the specified pin to behave either as an input or an output. See the description of digital pins for details. + * + * \param ulPin The number of the pin whose mode you wish to set + * \param ulMode Can be INPUT, OUTPUT, INPUT_PULLUP or INPUT_PULLDOWN + */ +extern void pinMode( uint32_t dwPin, uint32_t dwMode ) ; + +/** + * \brief Write a HIGH or a LOW value to a digital pin. + * + * If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the + * corresponding value: 5V (or 3.3V on 3.3V boards) for HIGH, 0V (ground) for LOW. + * + * If the pin is configured as an INPUT, writing a HIGH value with digitalWrite() will enable an internal + * 20K pullup resistor (see the tutorial on digital pins). Writing LOW will disable the pullup. The pullup + * resistor is enough to light an LED dimly, so if LEDs appear to work, but very dimly, this is a likely + * cause. The remedy is to set the pin to an output with the pinMode() function. + * + * \note Digital pin PIN_LED is harder to use as a digital input than the other digital pins because it has an LED + * and resistor attached to it that's soldered to the board on most boards. If you enable its internal 20k pull-up + * resistor, it will hang at around 1.7 V instead of the expected 5V because the onboard LED and series resistor + * pull the voltage level down, meaning it always returns LOW. If you must use pin PIN_LED as a digital input, use an + * external pull down resistor. + * + * \param dwPin the pin number + * \param dwVal HIGH or LOW + */ +extern void digitalWrite( uint32_t dwPin, uint32_t dwVal ) ; + +/** + * \brief Reads the value from a specified digital pin, either HIGH or LOW. + * + * \param ulPin The number of the digital pin you want to read (int) + * + * \return HIGH or LOW + */ +extern int digitalRead( uint32_t ulPin ) ; + +#ifdef __cplusplus +} +#endif + +#endif /* _WIRING_DIGITAL_ */ diff --git a/sparkfun/samd/cores/arduino51/wiring_private.c b/sparkfun/samd/cores/arduino51/wiring_private.c new file mode 100644 index 00000000..954f854a --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_private.c @@ -0,0 +1,130 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + SAMD51 support added by Adafruit - Copyright (c) 2018 Dean Miller for Adafruit Industries + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "Arduino.h" +#include "wiring_private.h" + +int pinPeripheral( uint32_t ulPin, EPioType ulPeripheral ) +{ + // Handle the case the pin isn't usable as PIO + if ( g_APinDescription[ulPin].ulPinType == PIO_NOT_A_PIN ) + { + return -1 ; + } + + switch ( ulPeripheral ) + { + case PIO_DIGITAL: + case PIO_INPUT: + case PIO_INPUT_PULLUP: + case PIO_OUTPUT: + // Disable peripheral muxing, done in pinMode +// PORT->Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].bit.PMUXEN = 0 ; + + // Configure pin mode, if requested + if ( ulPeripheral == PIO_INPUT ) + { + pinMode( ulPin, INPUT ) ; + } + else + { + if ( ulPeripheral == PIO_INPUT_PULLUP ) + { + pinMode( ulPin, INPUT_PULLUP ) ; + } + else + { + if ( ulPeripheral == PIO_OUTPUT ) + { + pinMode( ulPin, OUTPUT ) ; + } + else + { + // PIO_DIGITAL, do we have to do something as all cases are covered? + } + } + } + break ; + + case PIO_ANALOG: + case PIO_SERCOM: + case PIO_SERCOM_ALT: + case PIO_TIMER: + case PIO_TIMER_ALT: + case PIO_EXTINT: +#if defined(__SAMD51__) + case PIO_TCC_PDEC: + case PIO_COM: + case PIO_SDHC: + case PIO_I2S: + case PIO_PCC: + case PIO_GMAC: + case PIO_AC_CLK: + case PIO_CCL: +#else + case PIO_COM: + case PIO_AC_CLK: +#endif +#if 0 + // Is the pio pin in the lower 16 ones? + // The WRCONFIG register allows update of only 16 pin max out of 32 + if ( g_APinDescription[ulPin].ulPin < 16 ) + { + PORT->Group[g_APinDescription[ulPin].ulPort].WRCONFIG.reg = PORT_WRCONFIG_WRPMUX | PORT_WRCONFIG_PMUXEN | PORT_WRCONFIG_PMUX( ulPeripheral ) | + PORT_WRCONFIG_WRPINCFG | + PORT_WRCONFIG_PINMASK( g_APinDescription[ulPin].ulPin ) ; + } + else + { + PORT->Group[g_APinDescription[ulPin].ulPort].WRCONFIG.reg = PORT_WRCONFIG_HWSEL | + PORT_WRCONFIG_WRPMUX | PORT_WRCONFIG_PMUXEN | PORT_WRCONFIG_PMUX( ulPeripheral ) | + PORT_WRCONFIG_WRPINCFG | + PORT_WRCONFIG_PINMASK( g_APinDescription[ulPin].ulPin - 16 ) ; + } +#else + if ( g_APinDescription[ulPin].ulPin & 1 ) // is pin odd? + { + uint32_t temp ; + + // Get whole current setup for both odd and even pins and remove odd one + temp = (PORT->Group[g_APinDescription[ulPin].ulPort].PMUX[g_APinDescription[ulPin].ulPin >> 1].reg) & PORT_PMUX_PMUXE( 0xF ) ; + // Set new muxing + PORT->Group[g_APinDescription[ulPin].ulPort].PMUX[g_APinDescription[ulPin].ulPin >> 1].reg = temp|PORT_PMUX_PMUXO( ulPeripheral ) ; + // Enable port mux + PORT->Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg |= PORT_PINCFG_PMUXEN | PORT_PINCFG_DRVSTR; + } + else // even pin + { + uint32_t temp ; + + temp = (PORT->Group[g_APinDescription[ulPin].ulPort].PMUX[g_APinDescription[ulPin].ulPin >> 1].reg) & PORT_PMUX_PMUXO( 0xF ) ; + PORT->Group[g_APinDescription[ulPin].ulPort].PMUX[g_APinDescription[ulPin].ulPin >> 1].reg = temp|PORT_PMUX_PMUXE( ulPeripheral ) ; + PORT->Group[g_APinDescription[ulPin].ulPort].PINCFG[g_APinDescription[ulPin].ulPin].reg |= PORT_PINCFG_PMUXEN | PORT_PINCFG_DRVSTR ; // Enable port mux + } +#endif + break ; + + case PIO_NOT_A_PIN: + return -1l ; + break ; + } + + return 0l ; +} + diff --git a/sparkfun/samd/cores/arduino51/wiring_private.h b/sparkfun/samd/cores/arduino51/wiring_private.h new file mode 100644 index 00000000..ce64e2de --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_private.h @@ -0,0 +1,41 @@ +/* + Copyright (c) 2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +// Includes Atmel CMSIS +#include "sam.h" + +#include "wiring_constants.h" + +int pinPeripheral( uint32_t ulPin, EPioType ulPeripheral ); + +#ifdef __cplusplus +} // extern "C" + +#include "HardwareSerial.h" + +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring_shift.c b/sparkfun/samd/cores/arduino51/wiring_shift.c new file mode 100644 index 00000000..3260d2b1 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_shift.c @@ -0,0 +1,74 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include "wiring_shift.h" +#include "wiring_digital.h" +#include "wiring_private.h" + +#ifdef __cplusplus +extern "C"{ +#endif + +uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) +{ + uint8_t value = 0 ; + uint8_t i ; + + for ( i=0 ; i < 8 ; ++i ) + { + digitalWrite( ulClockPin, HIGH ) ; + + if ( ulBitOrder == LSBFIRST ) + { + value |= digitalRead( ulDataPin ) << i ; + } + else + { + value |= digitalRead( ulDataPin ) << (7 - i) ; + } + + digitalWrite( ulClockPin, LOW ) ; + } + + return value ; +} + +void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) +{ + uint8_t i ; + + for ( i=0 ; i < 8 ; i++ ) + { + if ( ulBitOrder == LSBFIRST ) + { + digitalWrite( ulDataPin, !!(ulVal & (1 << i)) ) ; + } + else + { + digitalWrite( ulDataPin, !!(ulVal & (1 << (7 - i))) ) ; + } + + digitalWrite( ulClockPin, HIGH ) ; + digitalWrite( ulClockPin, LOW ) ; + } +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/sparkfun/samd/cores/arduino51/wiring_shift.h b/sparkfun/samd/cores/arduino51/wiring_shift.h new file mode 100644 index 00000000..6026bdc6 --- /dev/null +++ b/sparkfun/samd/cores/arduino51/wiring_shift.h @@ -0,0 +1,42 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _WIRING_SHIFT_ +#define _WIRING_SHIFT_ + +#ifdef __cplusplus + extern "C" { +#endif + +/* + * \brief + */ +extern uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) ; + + +/* + * \brief + */ +extern void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) ; + + +#ifdef __cplusplus +} +#endif + +#endif /* _WIRING_SHIFT_ */ diff --git a/sparkfun/samd/drivers/README.md b/sparkfun/samd/drivers/README.md new file mode 100644 index 00000000..07d56abc --- /dev/null +++ b/sparkfun/samd/drivers/README.md @@ -0,0 +1 @@ +Note: If you are using a Windows 7 OS, you will need to install the SAMD drivers using the [SAMD Windows7 Installer](https://github.com/sparkfun/samd_windows7_installer/releases). diff --git a/sparkfun/samd/drivers/sparkfun.inf b/sparkfun/samd/drivers/sparkfun.inf index cb103702..f6e704bf 100644 --- a/sparkfun/samd/drivers/sparkfun.inf +++ b/sparkfun/samd/drivers/sparkfun.inf @@ -38,6 +38,8 @@ samd21IMU.sketch.name="SparkFun 9DoF Razor IMU M0" samd21IMU.bootloader.name="SparkFun 9DoF Razor IMU M0 BL" LilyMini.sketch.name="SparkFun LilyMini" LilyMini.bootloader.name="SparkFun LilyMini BL" +samd21ProRF.sketch.name="SparkFun SAMD21 Pro RF" +samd21ProRF.bootloader.name="SparkFun SAMD21 Pro RF BL" [DefaultInstall] CopyINF=sparkfun.inf @@ -66,6 +68,8 @@ DefaultDestDir=12 %samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E %LilyMini.sketch.name%=DriverInstall, USB\VID_1B4F&PID_0101&MI_00 %LilyMini.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0100 +%samd21ProRF.sketch.name%=DriverInstall, USB\VID_1B4F&PID_214F&MI_00 +%samd21ProRF.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_215F [DeviceList.NTamd64] %samd21Breakout.sketch.name%=DriverInstall, USB\VID_1B4F&PID_8D21&MI_00 @@ -74,6 +78,8 @@ DefaultDestDir=12 %samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E %LilyMini.sketch.name%=DriverInstall, USB\VID_1B4F&PID_0101&MI_00 %LilyMini.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0100 +%samd21ProRF.sketch.name%=DriverInstall, USB\VID_1B4F&PID_214F&MI_00 +%samd21ProRF.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_215F [DeviceList.NTia64] %samd21Breakout.sketch.name%=DriverInstall, USB\VID_1B4F&PID_8D21&MI_00 @@ -82,6 +88,8 @@ DefaultDestDir=12 %samd21IMU.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_9D0E %LilyMini.sketch.name%=DriverInstall, USB\VID_1B4F&PID_0101&MI_00 %LilyMini.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_0100 +%samd21ProRF.sketch.name%=DriverInstall, USB\VID_1B4F&PID_214F&MI_00 +%samd21ProRF.bootloader.name%=DriverInstall, USB\VID_1B4F&PID_215F [DriverInstall] include=mdmcpq.inf,usb.inf diff --git a/sparkfun/samd/keywords.txt b/sparkfun/samd/keywords.txt new file mode 100644 index 00000000..4222b659 --- /dev/null +++ b/sparkfun/samd/keywords.txt @@ -0,0 +1,44 @@ +####################################### +# Syntax Coloring Map For SAMD51 +####################################### + +####################################### +# Constants (LITERAL1) +####################################### + +D0 LITERAL1 +D1 LITERAL1 +D2 LITERAL1 +D3 LITERAL1 +D4 LITERAL1 +D5 LITERAL1 + +G0 LITERAL1 +G1 LITERAL1 +G2 LITERAL1 +G3 LITERAL1 +G4 LITERAL1 +G5 LITERAL1 +G6 LITERAL1 +G7 LITERAL1 +G8 LITERAL1 +G9 LITERAL1 +G11 LITERAL1 + +PWM0 LITERAL1 +PWM1 LITERAL1 + +BATT_VIN LITERAL1 +POWER_CONTROL LITERAL1 + +CS LITERAL1 +CS1 LITERAL1 +I2CINT LITERAL1 + +AUD_OUT LITERAL1 +AUD_IN LITERAL1 +AUD_LRCLK LITERAL1 +AUD_BCLK LITERAL1 +AUD_MCLK LITERAL1 + + diff --git a/sparkfun/samd/libraries/I2S/src/I2S.cpp b/sparkfun/samd/libraries/I2S/src/I2S.cpp index cf8e8683..97690e0f 100644 --- a/sparkfun/samd/libraries/I2S/src/I2S.cpp +++ b/sparkfun/samd/libraries/I2S/src/I2S.cpp @@ -280,7 +280,7 @@ size_t I2SClass::write(const uint8_t *buffer, size_t size) return write((const void*)buffer, size); } -size_t I2SClass::availableForWrite() +int I2SClass::availableForWrite() { if (_state != I2S_STATE_TRANSMITTER) { enableTransmitter(); diff --git a/sparkfun/samd/libraries/I2S/src/I2S.h b/sparkfun/samd/libraries/I2S/src/I2S.h index a4107ef2..855f26b4 100644 --- a/sparkfun/samd/libraries/I2S/src/I2S.h +++ b/sparkfun/samd/libraries/I2S/src/I2S.h @@ -51,7 +51,7 @@ class I2SClass : public Stream virtual size_t write(uint8_t); virtual size_t write(const uint8_t *buffer, size_t size); - virtual size_t availableForWrite(); + virtual int availableForWrite(); int read(void* buffer, size_t size); @@ -107,6 +107,8 @@ class I2SClass : public Stream #if I2S_INTERFACES_COUNT > 0 extern I2SClass I2S; +#else +#error "I2S is not supported on your board!" #endif #endif diff --git a/sparkfun/samd/libraries/SDU/examples/Usage/Usage.ino b/sparkfun/samd/libraries/SDU/examples/Usage/Usage.ino new file mode 100644 index 00000000..443a7542 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/examples/Usage/Usage.ino @@ -0,0 +1,73 @@ +/* + Usage + This example demonstrates how to use the SAMD SDU library to update a + sketch on an Arduino/Genuino Zero, MKRZero or MKR1000 board using an + SD card. It prints out the date and time the sketch was compiled at + to both Serial and Serial1. + + Circuit: + * Arduino MKRZero board with SD card + OR + * Arduino/Genuino Zero or MKR1000 board + * SD shield or breakout connected with CS pin of 4 + * SD card + + Non-Arduino/Genuino Zero, MKRZero or MKR1000 board are NOT supported. + + Steps to update sketch via SD card: + + 1) Upload this sketch or another sketch that includes the SDU library + via #include + + 2) Update the sketch as desired. For this example the sketch prints out + the compiled date and time so no updates are needed. + + 3) In the IDE select: Sketch -> Export compiled Binary + + 4) Copy the .bin file from the sketch's folder to the SD card and rename + the file to UPDATE.bin. Eject the SD card from your PC. + + 5) Insert the SD card into the board, shield or breakout and press the + reset button or power cycle the board. The SDU library will then update + the sketch on the board with the contents of UPDATE.bin + + created 23 March 2017 + by Sandeep Mistry +*/ + +/* + Include the SDU library + + This will add some code to the sketch before setup() is called + to check if an SD card is present and UPDATE.bin exists on the + SD card. + + If UPDATE.bin is present, the file is used to update the sketch + running on the board. After this UPDATE.bin is deleted from the + SD card. +*/ +#include + +String message; + +void setup() { + Serial.begin(9600); + Serial1.begin(9600); + + // wait a bit + delay(1000); + + message += "Sketch compile date and time: "; + message += __DATE__; + message += " "; + message += __TIME__; + + // print out the sketch compile date and time on the serial port + Serial.println(message); + Serial1.println(message); +} + +void loop() { + // add you own code here +} + diff --git a/sparkfun/esp8266/libraries/EEPROM/keywords.txt b/sparkfun/samd/libraries/SDU/keywords.txt similarity index 88% rename from sparkfun/esp8266/libraries/EEPROM/keywords.txt rename to sparkfun/samd/libraries/SDU/keywords.txt index d3218fe2..a9db990e 100644 --- a/sparkfun/esp8266/libraries/EEPROM/keywords.txt +++ b/sparkfun/samd/libraries/SDU/keywords.txt @@ -1,12 +1,12 @@ ####################################### -# Syntax Coloring Map For Ultrasound +# Syntax Coloring Map For SDU ####################################### ####################################### # Datatypes (KEYWORD1) ####################################### -EEPROM KEYWORD1 +SDU KEYWORD1 ####################################### # Methods and Functions (KEYWORD2) @@ -15,4 +15,3 @@ EEPROM KEYWORD1 ####################################### # Constants (LITERAL1) ####################################### - diff --git a/sparkfun/samd/libraries/SDU/library.properties b/sparkfun/samd/libraries/SDU/library.properties new file mode 100644 index 00000000..68113aed --- /dev/null +++ b/sparkfun/samd/libraries/SDU/library.properties @@ -0,0 +1,9 @@ +name=SDU +version=1.0.0 +author=Arduino +maintainer=Arduino +sentence=Update the sketch on your board from an SD card +paragraph=Requires an SD card +category=Other +url=http://www.arduino.cc/en/Reference/SDU +architectures=samd diff --git a/sparkfun/samd/libraries/SDU/src/SDU.cpp b/sparkfun/samd/libraries/SDU/src/SDU.cpp new file mode 100644 index 00000000..2e780a78 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/SDU.cpp @@ -0,0 +1,42 @@ +/* + Copyright (c) 2017 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#include "SDU.h" + +__attribute__ ((section(".sketch_boot"))) +unsigned char sduBoot[0x4000] = { +#if defined(ARDUINO_SAMD_ZERO) + #include "boot/zero.h" +#elif defined(ARDUINO_SAMD_MKR1000) + #include "boot/mkr1000.h" +#elif defined(ARDUINO_SAMD_MKRZERO) + #include "boot/mkrzero.h" +#elif defined(ARDUINO_SAMD_MKRFox1200) + #include "boot/mkrfox1200.h" +#elif defined(ARDUINO_SAMD_MKRGSM1400) + #include "boot/mkrgsm1400.h" +#elif defined(ARDUINO_SAMD_MKRWAN1300) + #include "boot/mkrwan1300.h" +#elif defined(ARDUINO_SAMD_MKRWIFI1010) + #include "boot/mkrwifi1010.h" +#else + #error "Unsupported board!" +#endif +}; diff --git a/sparkfun/samd/libraries/SDU/src/SDU.h b/sparkfun/samd/libraries/SDU/src/SDU.h new file mode 100644 index 00000000..59fcc16f --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/SDU.h @@ -0,0 +1,24 @@ +/* + Copyright (c) 2017 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _SDU_H_INCLUDED +#define _SDU_H_INCLUDED + +// nothing for now + +#endif diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkr1000.h b/sparkfun/samd/libraries/SDU/src/boot/mkr1000.h new file mode 100644 index 00000000..b10087d8 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkr1000.h @@ -0,0 +1,1236 @@ + 0x00, 0x80, 0x00, 0x20, 0x85, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xd9, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xdd, 0x3a, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x44, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x3d, 0xfe, 0x02, 0xf0, + 0x75, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x66, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0xa8, 0x4e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0xbb, 0xfc, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0xd7, 0xfc, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0x9c, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0x68, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x36, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x2e, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0xe0, 0x4e, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x2b, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x0b, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0xc0, 0xf9, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xdc, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xd5, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0x91, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x0a, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x60, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x62, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x30, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0xf8, 0xf8, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0xf0, 0xf8, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x07, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0xe2, 0x4e, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xa8, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0x99, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0x8b, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0xf8, 0x4e, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x88, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x22, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x4b, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x6e, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x08, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x00, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0xf9, 0xfa, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x25, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x0f, 0x4b, 0x10, 0x4a, + 0x10, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x0f, 0x4b, + 0x0f, 0x48, 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x99, 0x71, + 0x08, 0x21, 0x59, 0x71, 0x03, 0x21, 0x5a, 0x72, 0xda, 0x71, 0x19, 0x72, + 0x0a, 0x4b, 0x18, 0x60, 0x1d, 0x20, 0x18, 0x71, 0x1b, 0x20, 0x98, 0x71, + 0x1a, 0x20, 0x5a, 0x72, 0x58, 0x71, 0xda, 0x71, 0x19, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x5c, 0x08, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x60, 0x08, 0x00, 0x20, 0x88, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x66, 0xfd, 0x08, 0xbd, 0xc0, 0x46, + 0x98, 0x07, 0x00, 0x20, 0x13, 0xb5, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x31, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x2d, 0xfb, 0x12, 0x49, + 0x12, 0x48, 0x00, 0xf0, 0x29, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x25, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x21, 0xfb, 0x12, 0x4c, + 0x12, 0x49, 0x20, 0x1c, 0x00, 0xf0, 0x1c, 0xfb, 0x03, 0x23, 0x00, 0x93, + 0x01, 0x23, 0x01, 0x93, 0x21, 0x1c, 0x0d, 0x22, 0x0e, 0x23, 0x0e, 0x48, + 0x00, 0xf0, 0x2c, 0xfd, 0x13, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x58, 0x08, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x5c, 0x08, 0x00, 0x20, + 0x00, 0x10, 0x00, 0x42, 0x60, 0x08, 0x00, 0x20, 0x00, 0x14, 0x00, 0x42, + 0x54, 0x08, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x64, 0x08, 0x00, 0x20, + 0x68, 0x08, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x98, 0x07, 0x00, 0x20, + 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, 0x1b, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, 0x6c, 0x08, 0x00, 0x20, + 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, 0x04, 0xd1, 0x00, 0xf0, + 0x4f, 0xf8, 0xfe, 0xf7, 0xbf, 0xfa, 0x0b, 0xe0, 0x0c, 0x4d, 0x8d, 0x42, + 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, 0xa2, 0x42, 0x04, 0xd2, + 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, 0xfe, 0xe7, 0x90, 0x42, + 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, 0xe7, 0xd2, 0x00, 0x22, + 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, 0xa0, 0x00, 0x00, 0x20, + 0x48, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, 0x50, 0x0d, 0x00, 0x20, + 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x00, 0xf0, + 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0x08, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, 0x08, 0xd0, 0x05, 0x4b, + 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, 0x33, 0x68, 0x5b, 0x1b, + 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, 0x70, 0x08, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, 0x1a, 0x60, 0x00, 0xf0, + 0x61, 0xfa, 0x08, 0xbd, 0x70, 0x08, 0x00, 0x20, 0x70, 0x47, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, 0x1e, 0x21, 0x53, 0x68, + 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, 0x53, 0x60, 0x8b, 0x69, + 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, 0x45, 0x4b, 0x9c, 0x82, + 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, 0xda, 0x68, 0x94, 0x07, + 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, 0x14, 0x78, 0xe5, 0x07, + 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xf7, 0xdb, + 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, + 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, 0x65, 0x80, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, 0x9c, 0x84, 0xdc, 0x68, + 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, 0xe5, 0x62, 0xdd, 0x68, + 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, 0x2e, 0x4e, 0x35, 0x43, + 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, 0x25, 0x06, 0xfc, 0xd5, + 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, 0xdc, 0x68, 0xe5, 0x06, + 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, 0x55, 0x78, 0x1c, 0x4c, + 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, 0x1e, 0x4d, 0x35, 0x40, + 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, 0x1d, 0x62, 0x03, 0x23, + 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, 0x4b, 0x72, 0x8b, 0x72, + 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, 0x16, 0x4b, 0x17, 0x4a, + 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, 0x21, 0x40, 0x11, 0x43, + 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, 0x13, 0x43, 0x12, 0x4a, + 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, 0x43, 0x60, 0x70, 0xbd, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, 0x0c, 0x06, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, 0x01, 0x05, 0x01, 0x00, + 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, + 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, 0x00, 0x6c, 0xdc, 0x02, + 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, 0x20, 0x60, 0x80, 0x00, + 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, 0x18, 0x68, 0x10, 0xb5, + 0x89, 0x00, 0x00, 0xf0, 0xe3, 0xfe, 0x2f, 0x4b, 0x01, 0x38, 0x98, 0x42, + 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, 0x18, 0x6a, 0xc0, 0x21, + 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, 0x19, 0x62, 0x00, 0x24, + 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, 0x80, 0x22, 0x09, 0x02, + 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, 0x25, 0x4b, 0xfc, 0x21, + 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xfc, 0x22, 0x92, 0x01, + 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, 0xd2, 0x02, 0x0a, 0x43, + 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, 0x00, 0x21, 0x01, 0x34, + 0x00, 0xf0, 0x70, 0xf8, 0x16, 0x2c, 0xf8, 0xd1, 0x1a, 0x4c, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, 0x63, 0x80, 0x19, 0x4b, + 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0xe4, 0x22, 0xd2, 0x00, + 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, 0x13, 0x4a, 0xc9, 0x09, + 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, 0x00, 0x20, 0x13, 0x61, + 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, 0x0c, 0x4b, 0xda, 0x79, + 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, 0x5a, 0x70, 0x10, 0xbd, + 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, 0x10, 0xe0, 0x00, 0xe0, + 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, 0x21, 0x40, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, 0x51, 0x7e, 0x13, 0x1c, + 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, 0x04, 0x28, 0x13, 0xd8, + 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, 0x5a, 0x78, 0x0f, 0x21, + 0x8a, 0x43, 0x00, 0xf0, 0x55, 0xfe, 0x03, 0x05, 0x09, 0x07, 0x03, 0x00, + 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, 0x02, 0x21, 0x0a, 0x43, + 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, 0x1b, 0x05, 0x0b, 0x43, + 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, 0x02, 0x21, 0x0b, 0x43, + 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, 0xff, 0xff, 0xff, 0xf0, + 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, 0x50, 0x43, 0x27, 0x4b, + 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, 0x46, 0xd0, 0x03, 0x29, + 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, 0x29, 0xfe, 0x02, 0x33, + 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, 0x1f, 0x48, + 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, + 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, 0x5b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, + 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, 0x10, 0x48, 0x59, 0x18, + 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, 0x40, 0x30, 0x06, 0x24, + 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, 0x0b, 0x49, 0x52, 0x18, + 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, + 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, + 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, 0x10, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, 0x13, 0x18, 0x08, 0x24, + 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, 0x10, 0x4e, 0xd2, 0x01, + 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, 0x86, 0x68, 0xab, 0x40, + 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, 0xbe, 0x41, 0x40, 0x19, + 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, 0x04, 0x26, 0xb4, 0x43, + 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, 0x05, 0x49, 0x52, 0x18, + 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, 0x93, 0x61, 0xf0, 0xbd, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, 0x08, 0x24, 0xaa, 0x18, + 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, 0x48, 0x1c, 0x00, 0x24, + 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xa0, 0xfd, 0x07, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x01, 0x24, + 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, 0x18, 0x1c, 0x00, 0x21, + 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, 0x02, 0x21, 0xff, 0xf7, + 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, 0x31, 0xd1, 0x18, 0x1c, + 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, 0x18, 0x22, 0x53, 0x43, + 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, 0x14, 0x1c, 0x04, 0x40, + 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, 0x12, 0x4c, 0x1b, 0x19, + 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, 0x0f, 0x21, 0x31, 0x40, + 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, + 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, 0x09, 0x4e, 0x0f, 0x27, + 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x9a, 0x18, 0xbe, 0x43, + 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, + 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, 0x06, 0x1c, 0x0d, 0x1c, + 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, 0x9c, 0x42, 0x07, 0xd0, + 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, 0x98, 0x47, 0x01, 0x34, + 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, 0x15, 0x4a, 0x13, 0x68, + 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, 0x00, 0x2b, 0x21, 0xd1, + 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, 0x9a, 0x42, 0x07, 0xd8, + 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, 0xda, 0x60, 0xbf, 0xf3, + 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, 0xc8, 0x07, 0xfb, 0xd5, + 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, 0x52, 0x00, 0x01, 0x43, + 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, 0x1a, 0x7d, 0xd1, 0x07, + 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, 0x70, 0x47, 0xc0, 0x46, + 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, + 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, 0xf7, 0xb5, 0x08, 0xac, + 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, 0x6c, 0x1e, 0xa5, 0x41, + 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, 0x27, 0x06, 0x3a, 0x43, + 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, 0x50, 0x68, 0xb5, 0x01, + 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, 0x01, 0x43, 0x0c, 0x43, + 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, 0xc0, 0x25, 0x1c, 0x68, + 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, 0xc0, 0x24, 0xa4, 0x02, + 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, 0x03, 0x68, 0x5a, 0x68, + 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, + 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, + 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, + 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, + 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, 0xd1, 0x07, + 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0x03, 0x68, + 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x40, 0x07, + 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0xc0, 0x09, 0x70, 0x47, + 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, 0x0a, 0x43, 0x1a, 0x76, + 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, 0x18, 0x40, 0x70, 0x47, + 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, + 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x03, 0x68, + 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, 0x1c, 0x68, 0x6d, 0x07, + 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, 0x04, 0x68, 0x51, 0x00, + 0x03, 0x48, 0x00, 0xf0, 0x79, 0xfc, 0x01, 0x38, 0xc0, 0xb2, 0x20, 0x73, + 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, 0x03, 0x68, 0x01, 0x21, + 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, + 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, + 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0xda, 0x69, + 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, 0x8a, 0x43, 0x1a, 0x60, + 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, 0x52, 0x02, 0x11, 0x43, + 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, 0xfc, 0xd5, 0x98, 0x6a, + 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, 0x30, 0xb5, 0x93, 0x42, + 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, 0x0e, 0x23, 0x19, 0x22, + 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, 0x0a, 0x23, 0x15, 0x22, + 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, 0x0c, 0x23, 0x17, 0x22, + 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, 0x15, 0x49, 0x01, 0x20, + 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, 0x5b, 0x18, 0x03, 0x20, + 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, 0xe0, 0x00, 0xff, 0x24, + 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, 0x85, 0x40, 0x28, 0x1c, + 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, 0x1a, 0x43, 0x0a, 0x4b, + 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, 0xfb, 0xdb, 0x30, 0xbd, + 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, 0x00, 0x10, 0x00, 0x42, + 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, 0x00, 0x1c, 0x00, 0x42, + 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, 0xf8, 0xb5, 0x04, 0x1c, + 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, 0xa3, 0xff, 0x20, 0x1c, + 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, 0x0a, 0x40, 0x69, 0x07, + 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, 0x22, 0x68, 0x84, 0x23, + 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, 0x01, 0x2d, 0x00, 0xd1, + 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, 0xc0, 0x00, 0x00, 0xf0, + 0xcd, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, 0x01, 0x40, 0xd2, 0x04, + 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, 0x23, 0x68, 0x00, 0x04, + 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, 0x10, 0x43, 0x98, 0x81, + 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, 0xf7, 0xb5, 0x01, 0x93, + 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, 0x16, 0x1c, 0xff, 0xf7, + 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, 0xbf, 0x07, 0x0c, 0x22, + 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, 0x16, 0x40, 0xc0, 0x22, + 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, 0x01, 0x99, 0x15, 0x40, + 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, 0x80, 0x21, 0x23, 0x68, + 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, 0x01, 0x20, 0x70, 0x47, + 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, 0x98, 0x47, 0x08, 0xbd, + 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, 0x41, 0xfb, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x3d, 0xfb, 0x10, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x4a, 0xfb, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x43, 0xfb, 0x00, 0x28, 0xf9, 0xd1, 0x20, 0x69, + 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, 0x5c, 0x30, 0x00, 0xf0, + 0x3f, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, 0x14, 0x35, 0x04, 0x1c, + 0x28, 0x1c, 0x00, 0xf0, 0x23, 0xfb, 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, + 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x2e, 0xfb, + 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, 0xb4, 0x34, 0x1b, 0x68, + 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x2a, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x00, 0x69, + 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, 0x5c, 0x35, 0x00, 0x28, + 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x0c, 0xfb, 0x00, 0x28, 0x0c, 0xd0, + 0x28, 0x1c, 0x00, 0xf0, 0x20, 0xfb, 0x00, 0x28, 0xfa, 0xd1, 0x28, 0x1c, + 0x31, 0x1c, 0x00, 0xf0, 0xe4, 0xfa, 0x20, 0x69, 0xff, 0xf7, 0x97, 0xfe, + 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, 0x8b, 0xfe, 0x01, 0x20, + 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x1d, 0x1c, 0x0a, 0xab, + 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, 0x1b, 0x78, 0x16, 0x1c, + 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, 0x02, 0x93, 0x0d, 0xab, + 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, 0xfa, 0x23, 0x9b, 0x00, + 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, 0x14, 0x30, 0x00, 0xf0, + 0xb1, 0xfa, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0xad, 0xfa, 0x00, 0x9a, + 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, 0x01, 0x9a, 0x20, 0x1c, + 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, 0x03, 0x9a, 0x5d, 0x70, + 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x80, 0x58, 0x00, 0x00, + 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, 0x05, 0x78, 0x09, 0xa8, + 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, 0x02, 0x90, 0x03, 0x90, + 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, 0x05, 0xb0, 0x30, 0xbd, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, 0x24, 0xfe, 0x00, 0x28, + 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, 0x25, 0x1c, 0x14, 0x35, + 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xfa, 0x23, 0x1c, 0xa8, 0x33, + 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x9e, 0xfa, + 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, 0xac, 0x33, 0xb4, 0x32, + 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, 0xff, 0xf7, 0x15, 0xfe, + 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, 0x28, 0x1c, 0x00, 0xf0, + 0x85, 0xfa, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x72, 0xfa, + 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, 0x02, 0xe0, 0x20, 0x69, + 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, 0xf3, 0xfd, 0x00, 0x28, + 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, 0x18, 0x40, 0x30, 0x38, + 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, 0x1b, 0x01, 0x19, 0x40, + 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, 0xc0, 0x23, 0x9b, 0x00, + 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, 0x05, 0x20, 0x99, 0x42, + 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, 0x00, 0xe0, 0x06, 0x20, + 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, 0x05, 0xd0, 0x02, 0x39, + 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, 0x00, 0xe0, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, 0x85, 0xb0, 0x03, 0x91, + 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0x15, 0x1c, 0xff, 0xf7, + 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, 0x9b, 0xfc, 0x23, 0x1c, + 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, 0x23, 0x1c, 0xb8, 0x33, + 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, 0x08, 0x21, 0xf7, 0x19, + 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, 0xa8, 0x37, 0x38, 0x78, + 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, 0xf9, 0xfb, 0x3b, 0x78, + 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, 0xdb, 0x01, 0x21, 0x1c, + 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, 0xb6, 0x18, 0x5b, 0x18, + 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, 0x01, 0x21, 0x91, 0x40, + 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, 0x1a, 0x60, 0x01, 0x21, + 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, 0x31, 0xfe, 0x29, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, 0x07, 0x1c, 0x20, 0x1c, + 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, 0x20, 0x1c, 0xff, 0xf7, + 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, 0x20, 0x69, 0x01, 0x22, + 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, 0x19, 0x78, 0x01, 0x3b, + 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, 0x3f, 0x20, 0x70, 0x47, + 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, 0x54, 0x68, + 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, 0x38, 0xb5, 0x0d, 0x1c, + 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, 0x2a, 0x1c, 0x00, 0xf0, + 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, 0x63, 0x60, 0x38, 0xbd, + 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, 0x04, 0xd1, 0x03, 0x68, + 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, 0x18, 0x1c, 0x10, 0xbd, + 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, 0x13, 0x68, 0x59, 0x1c, + 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, 0x18, 0x1c, 0x03, 0xe0, + 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, 0x89, 0x00, 0x99, 0x60, + 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, 0x04, 0x49, 0x5a, 0x60, + 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, 0x74, 0x08, 0x00, 0x20, + 0xb8, 0x58, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x20, 0x08, 0xb5, 0x08, 0x4b, + 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, 0x03, 0x68, 0x9b, 0x68, + 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, 0x49, 0x01, 0x59, 0x18, + 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, 0x18, 0x0c, 0x00, 0x20, + 0x38, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, 0x1b, 0x68, 0x08, 0x31, + 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, 0x43, 0x18, 0x9a, 0x68, + 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, 0x14, 0x1c, 0x9a, 0x68, + 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, 0x92, 0x03, 0x22, 0x43, + 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, 0x9a, 0x60, 0x41, 0x18, + 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, 0x38, 0x0c, 0x00, 0x20, + 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x06, 0x1c, + 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, 0x27, 0x4b, 0x8a, 0x00, + 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, 0x02, 0x99, 0x5b, 0x68, + 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, 0xff, 0xf7, 0x9e, 0xff, + 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x98, 0xff, + 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xbf, 0xff, 0x1c, 0x4f, + 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, 0x03, 0x92, 0x8b, 0x18, + 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x17, 0x49, 0x5a, 0x72, + 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, 0x00, 0xf0, 0xb5, 0xf9, + 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x7a, 0xff, + 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, 0x19, 0x71, 0x01, 0x21, + 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, 0x9a, 0x7a, 0x01, 0x21, + 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, + 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x3c, 0x0d, 0x00, 0x20, + 0x18, 0x0c, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, 0x58, 0x0a, 0x00, 0x20, + 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, 0x01, 0x23, 0xff, 0xf7, + 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, 0x01, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, 0x3a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x60, 0xd0, 0x80, 0x23, + 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, 0x00, 0x92, 0x00, 0x2c, + 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, 0x01, 0x93, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0x9b, 0x79, 0xdb, 0x09, + 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, 0x00, 0xf0, 0xc2, 0xf8, + 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, 0xbd, 0xf8, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0xdb, 0x79, 0x9a, 0x07, + 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, 0x38, 0xd1, 0x42, 0x1e, + 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, 0x24, 0x4b, 0x00, 0x22, + 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, 0x3f, 0x25, 0x22, 0x4a, + 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, 0x2a, 0x1c, 0x03, 0x93, + 0x00, 0xf0, 0x35, 0xf9, 0x18, 0x4a, 0x7b, 0x01, 0xd3, 0x18, 0x03, 0x9a, + 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, 0x92, 0x0b, 0x92, 0x03, + 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, 0x80, 0x22, 0x52, 0x42, + 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, 0x5b, 0x19, 0x52, 0x19, + 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, 0x00, 0x98, 0x0b, 0xe0, + 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, 0x7b, 0x01, 0xed, 0x18, + 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, 0xab, 0x61, 0x40, 0x42, + 0x05, 0xb0, 0xf0, 0xbd, 0x3c, 0x0d, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, + 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, 0x70, 0x11, 0x01, 0x00, + 0x90, 0x08, 0x00, 0x20, 0x98, 0x08, 0x00, 0x20, 0x01, 0x4a, 0x02, 0x4b, + 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, 0x00, 0xf0, 0xf2, 0xf8, + 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, 0x10, 0xbd, 0x02, 0x6c, + 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, 0x44, 0x6c, 0xa3, 0x42, + 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, 0x00, 0x23, 0x03, 0x64, + 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x06, 0xd0, + 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, 0x43, 0x64, 0x10, 0x1c, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, 0x43, 0x6c, + 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, 0x03, 0x6c, 0x40, 0x6c, + 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, 0x01, 0xe0, 0xc0, 0x1a, + 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x01, 0xd0, + 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, + 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, 0xd0, 0x1a, 0x43, 0x42, + 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, 0x02, 0xb4, 0x71, 0x46, + 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc, + 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22, + 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42, + 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7, + 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00, + 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43, + 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43, + 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43, + 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43, + 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7, + 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20, + 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90, + 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0, + 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a, + 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0xb5, 0x0e, 0x4b, + 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, + 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, + 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, + 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, + 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, 0x74, 0x00, 0x00, 0x20, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x98, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x76, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, + 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x08, 0xd0, + 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, 0x24, 0x78, 0xa5, 0x42, + 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, 0x30, 0xbd, 0x10, 0xb5, + 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, 0xc4, 0x54, 0x01, 0x33, + 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, 0x93, 0x42, 0x02, 0xd0, + 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, 0x30, 0xb5, 0x00, 0x29, + 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, + 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, + 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, + 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, + 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, + 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, + 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, + 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, + 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, + 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, + 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, + 0x30, 0xbd, 0xc0, 0x46, 0x44, 0x0d, 0x00, 0x20, 0x70, 0xb5, 0x03, 0x23, + 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, 0x0c, 0x2d, 0x01, 0xd2, + 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, 0x8d, 0x42, 0x3d, 0xd3, + 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, 0x00, 0x29, 0x13, 0xd0, + 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, 0x02, 0xd9, 0x0b, 0x60, + 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, 0x63, 0x68, 0x13, 0x60, + 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, 0x16, 0xe0, 0x0c, 0x1c, + 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, 0x00, 0x28, 0x03, 0xd1, + 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, 0x30, 0x1c, 0x29, 0x1c, + 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, 0xc4, 0x1c, 0x03, 0x23, + 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, 0x20, 0x1c, 0x0b, 0x30, + 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, 0x0b, 0xd0, 0x5a, 0x42, + 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, 0x00, 0xf0, 0x0a, 0xf8, + 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, 0x00, 0x20, 0x70, 0xbd, + 0x44, 0x0d, 0x00, 0x20, 0x40, 0x0d, 0x00, 0x20, 0x38, 0xb5, 0x07, 0x4c, + 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, 0x00, 0xf0, 0x2a, 0xf8, + 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x2b, 0x60, + 0x38, 0xbd, 0xc0, 0x46, 0x4c, 0x0d, 0x00, 0x20, 0xc9, 0xb2, 0x03, 0x78, + 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, 0x01, 0x30, 0xf8, 0xe7, + 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, 0x30, 0xb5, 0x03, 0x1c, + 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, 0x5d, 0x1e, 0x01, 0x3a, + 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, 0x9a, 0x18, 0x93, 0x42, + 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x30, 0xbd, + 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, 0x18, 0x18, 0x69, 0x46, + 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, 0x70, 0x47, 0x05, 0x4b, + 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, 0xf8, 0xe7, 0x03, 0x4b, + 0x13, 0x60, 0xef, 0xe7, 0x48, 0x0d, 0x00, 0x20, 0x4c, 0x0d, 0x00, 0x20, + 0x50, 0x0d, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x2e, 0x42, + 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, 0x33, 0x22, 0x00, 0x00, + 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, 0x61, 0x23, 0x00, 0x00, + 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, 0x3f, 0x2f, 0x5b, 0x5d, + 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, + 0xbd, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x1d, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdf, 0x44, 0x00, 0x00, 0xbd, 0x40, 0x00, 0x00, 0x97, 0x44, 0x00, 0x00, + 0x7f, 0x44, 0x00, 0x00, 0x75, 0x44, 0x00, 0x00, 0xa1, 0x44, 0x00, 0x00, + 0xd5, 0x44, 0x00, 0x00, 0x49, 0x44, 0x00, 0x00, 0x8d, 0x46, 0x00, 0x00, + 0x59, 0x44, 0x00, 0x00, 0x45, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x47, 0x00, 0x00, + 0xb1, 0x47, 0x00, 0x00, 0x81, 0x47, 0x00, 0x00, 0xa5, 0x47, 0x00, 0x00, + 0x99, 0x47, 0x00, 0x00, 0xe9, 0x47, 0x00, 0x00, 0xcd, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x58, 0x00, 0x00, + 0x04, 0x59, 0x00, 0x00, 0x24, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xed, 0x3a, 0x00, 0x00, + 0x0d, 0x48, 0x00, 0x00, 0xb1, 0x4a, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkrfox1200.h b/sparkfun/samd/libraries/SDU/src/boot/mkrfox1200.h new file mode 100644 index 00000000..df9ce324 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkrfox1200.h @@ -0,0 +1,1236 @@ + 0x00, 0x80, 0x00, 0x20, 0x85, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xd9, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xdd, 0x3a, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x44, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x3d, 0xfe, 0x02, 0xf0, + 0x75, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x66, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0xa8, 0x4e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0xbb, 0xfc, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0xd7, 0xfc, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0x9c, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0x68, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x36, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x2e, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0xe0, 0x4e, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x2b, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x0b, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0xc0, 0xf9, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xdc, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xd5, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0x91, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x0a, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x60, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x62, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x30, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0xf8, 0xf8, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0xf0, 0xf8, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x07, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0xe2, 0x4e, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xa8, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0x99, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0x8b, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0xf8, 0x4e, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x88, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x22, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x4b, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x6e, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x08, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x00, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0xf9, 0xfa, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x25, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x0f, 0x4b, 0x10, 0x4a, + 0x10, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x0f, 0x4b, + 0x0f, 0x48, 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x99, 0x71, + 0x08, 0x21, 0x59, 0x71, 0x03, 0x21, 0x5a, 0x72, 0xda, 0x71, 0x19, 0x72, + 0x0a, 0x4b, 0x18, 0x60, 0x1d, 0x20, 0x18, 0x71, 0x1b, 0x20, 0x98, 0x71, + 0x1a, 0x20, 0x5a, 0x72, 0x58, 0x71, 0xda, 0x71, 0x19, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x5c, 0x08, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x60, 0x08, 0x00, 0x20, 0x88, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x66, 0xfd, 0x08, 0xbd, 0xc0, 0x46, + 0x98, 0x07, 0x00, 0x20, 0x13, 0xb5, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x31, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x2d, 0xfb, 0x12, 0x49, + 0x12, 0x48, 0x00, 0xf0, 0x29, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x25, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x21, 0xfb, 0x12, 0x4c, + 0x12, 0x49, 0x20, 0x1c, 0x00, 0xf0, 0x1c, 0xfb, 0x03, 0x23, 0x00, 0x93, + 0x01, 0x23, 0x01, 0x93, 0x21, 0x1c, 0x0d, 0x22, 0x0e, 0x23, 0x0e, 0x48, + 0x00, 0xf0, 0x2c, 0xfd, 0x13, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x58, 0x08, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x5c, 0x08, 0x00, 0x20, + 0x00, 0x10, 0x00, 0x42, 0x60, 0x08, 0x00, 0x20, 0x00, 0x14, 0x00, 0x42, + 0x54, 0x08, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x64, 0x08, 0x00, 0x20, + 0x68, 0x08, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x98, 0x07, 0x00, 0x20, + 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, 0x1b, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, 0x6c, 0x08, 0x00, 0x20, + 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, 0x04, 0xd1, 0x00, 0xf0, + 0x4f, 0xf8, 0xfe, 0xf7, 0xbf, 0xfa, 0x0b, 0xe0, 0x0c, 0x4d, 0x8d, 0x42, + 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, 0xa2, 0x42, 0x04, 0xd2, + 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, 0xfe, 0xe7, 0x90, 0x42, + 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, 0xe7, 0xd2, 0x00, 0x22, + 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, 0xa0, 0x00, 0x00, 0x20, + 0x48, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, 0x50, 0x0d, 0x00, 0x20, + 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x00, 0xf0, + 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0x08, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, 0x08, 0xd0, 0x05, 0x4b, + 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, 0x33, 0x68, 0x5b, 0x1b, + 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, 0x70, 0x08, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, 0x1a, 0x60, 0x00, 0xf0, + 0x61, 0xfa, 0x08, 0xbd, 0x70, 0x08, 0x00, 0x20, 0x70, 0x47, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, 0x1e, 0x21, 0x53, 0x68, + 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, 0x53, 0x60, 0x8b, 0x69, + 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, 0x45, 0x4b, 0x9c, 0x82, + 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, 0xda, 0x68, 0x94, 0x07, + 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, 0x14, 0x78, 0xe5, 0x07, + 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xf7, 0xdb, + 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, + 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, 0x65, 0x80, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, 0x9c, 0x84, 0xdc, 0x68, + 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, 0xe5, 0x62, 0xdd, 0x68, + 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, 0x2e, 0x4e, 0x35, 0x43, + 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, 0x25, 0x06, 0xfc, 0xd5, + 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, 0xdc, 0x68, 0xe5, 0x06, + 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, 0x55, 0x78, 0x1c, 0x4c, + 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, 0x1e, 0x4d, 0x35, 0x40, + 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, 0x1d, 0x62, 0x03, 0x23, + 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, 0x4b, 0x72, 0x8b, 0x72, + 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, 0x16, 0x4b, 0x17, 0x4a, + 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, 0x21, 0x40, 0x11, 0x43, + 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, 0x13, 0x43, 0x12, 0x4a, + 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, 0x43, 0x60, 0x70, 0xbd, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, 0x0c, 0x06, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, 0x01, 0x05, 0x01, 0x00, + 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, + 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, 0x00, 0x6c, 0xdc, 0x02, + 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, 0x20, 0x60, 0x80, 0x00, + 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, 0x18, 0x68, 0x10, 0xb5, + 0x89, 0x00, 0x00, 0xf0, 0xe3, 0xfe, 0x2f, 0x4b, 0x01, 0x38, 0x98, 0x42, + 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, 0x18, 0x6a, 0xc0, 0x21, + 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, 0x19, 0x62, 0x00, 0x24, + 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, 0x80, 0x22, 0x09, 0x02, + 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, 0x25, 0x4b, 0xfc, 0x21, + 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xfc, 0x22, 0x92, 0x01, + 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, 0xd2, 0x02, 0x0a, 0x43, + 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, 0x00, 0x21, 0x01, 0x34, + 0x00, 0xf0, 0x70, 0xf8, 0x0f, 0x2c, 0xf8, 0xd1, 0x1a, 0x4c, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, 0x63, 0x80, 0x19, 0x4b, + 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0xe4, 0x22, 0xd2, 0x00, + 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, 0x13, 0x4a, 0xc9, 0x09, + 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, 0x00, 0x20, 0x13, 0x61, + 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, 0x0c, 0x4b, 0xda, 0x79, + 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, 0x5a, 0x70, 0x10, 0xbd, + 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, 0x10, 0xe0, 0x00, 0xe0, + 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, 0x21, 0x40, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, 0x51, 0x7e, 0x13, 0x1c, + 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, 0x04, 0x28, 0x13, 0xd8, + 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, 0x5a, 0x78, 0x0f, 0x21, + 0x8a, 0x43, 0x00, 0xf0, 0x55, 0xfe, 0x03, 0x05, 0x09, 0x07, 0x03, 0x00, + 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, 0x02, 0x21, 0x0a, 0x43, + 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, 0x1b, 0x05, 0x0b, 0x43, + 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, 0x02, 0x21, 0x0b, 0x43, + 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, 0xff, 0xff, 0xff, 0xf0, + 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, 0x50, 0x43, 0x27, 0x4b, + 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, 0x46, 0xd0, 0x03, 0x29, + 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, 0x29, 0xfe, 0x02, 0x33, + 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, 0x1f, 0x48, + 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, + 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, 0x5b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, + 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, 0x10, 0x48, 0x59, 0x18, + 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, 0x40, 0x30, 0x06, 0x24, + 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, 0x0b, 0x49, 0x52, 0x18, + 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, + 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, + 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, 0x10, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, 0x13, 0x18, 0x08, 0x24, + 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, 0x10, 0x4e, 0xd2, 0x01, + 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, 0x86, 0x68, 0xab, 0x40, + 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, 0xbe, 0x41, 0x40, 0x19, + 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, 0x04, 0x26, 0xb4, 0x43, + 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, 0x05, 0x49, 0x52, 0x18, + 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, 0x93, 0x61, 0xf0, 0xbd, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, 0x08, 0x24, 0xaa, 0x18, + 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, 0x48, 0x1c, 0x00, 0x24, + 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xa0, 0xfd, 0x07, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x01, 0x24, + 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, 0x18, 0x1c, 0x00, 0x21, + 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, 0x02, 0x21, 0xff, 0xf7, + 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, 0x31, 0xd1, 0x18, 0x1c, + 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, 0x18, 0x22, 0x53, 0x43, + 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, 0x14, 0x1c, 0x04, 0x40, + 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, 0x12, 0x4c, 0x1b, 0x19, + 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, 0x0f, 0x21, 0x31, 0x40, + 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, + 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, 0x09, 0x4e, 0x0f, 0x27, + 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x9a, 0x18, 0xbe, 0x43, + 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, + 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, 0x06, 0x1c, 0x0d, 0x1c, + 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, 0x9c, 0x42, 0x07, 0xd0, + 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, 0x98, 0x47, 0x01, 0x34, + 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, 0x15, 0x4a, 0x13, 0x68, + 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, 0x00, 0x2b, 0x21, 0xd1, + 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, 0x9a, 0x42, 0x07, 0xd8, + 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, 0xda, 0x60, 0xbf, 0xf3, + 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, 0xc8, 0x07, 0xfb, 0xd5, + 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, 0x52, 0x00, 0x01, 0x43, + 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, 0x1a, 0x7d, 0xd1, 0x07, + 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, 0x70, 0x47, 0xc0, 0x46, + 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, + 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, 0xf7, 0xb5, 0x08, 0xac, + 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, 0x6c, 0x1e, 0xa5, 0x41, + 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, 0x27, 0x06, 0x3a, 0x43, + 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, 0x50, 0x68, 0xb5, 0x01, + 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, 0x01, 0x43, 0x0c, 0x43, + 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, 0xc0, 0x25, 0x1c, 0x68, + 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, 0xc0, 0x24, 0xa4, 0x02, + 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, 0x03, 0x68, 0x5a, 0x68, + 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, + 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, + 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, + 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, + 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, 0xd1, 0x07, + 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0x03, 0x68, + 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x40, 0x07, + 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0xc0, 0x09, 0x70, 0x47, + 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, 0x0a, 0x43, 0x1a, 0x76, + 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, 0x18, 0x40, 0x70, 0x47, + 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, + 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x03, 0x68, + 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, 0x1c, 0x68, 0x6d, 0x07, + 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, 0x04, 0x68, 0x51, 0x00, + 0x03, 0x48, 0x00, 0xf0, 0x79, 0xfc, 0x01, 0x38, 0xc0, 0xb2, 0x20, 0x73, + 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, 0x03, 0x68, 0x01, 0x21, + 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, + 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, + 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0xda, 0x69, + 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, 0x8a, 0x43, 0x1a, 0x60, + 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, 0x52, 0x02, 0x11, 0x43, + 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, 0xfc, 0xd5, 0x98, 0x6a, + 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, 0x30, 0xb5, 0x93, 0x42, + 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, 0x0e, 0x23, 0x19, 0x22, + 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, 0x0a, 0x23, 0x15, 0x22, + 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, 0x0c, 0x23, 0x17, 0x22, + 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, 0x15, 0x49, 0x01, 0x20, + 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, 0x5b, 0x18, 0x03, 0x20, + 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, 0xe0, 0x00, 0xff, 0x24, + 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, 0x85, 0x40, 0x28, 0x1c, + 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, 0x1a, 0x43, 0x0a, 0x4b, + 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, 0xfb, 0xdb, 0x30, 0xbd, + 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, 0x00, 0x10, 0x00, 0x42, + 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, 0x00, 0x1c, 0x00, 0x42, + 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, 0xf8, 0xb5, 0x04, 0x1c, + 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, 0xa3, 0xff, 0x20, 0x1c, + 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, 0x0a, 0x40, 0x69, 0x07, + 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, 0x22, 0x68, 0x84, 0x23, + 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, 0x01, 0x2d, 0x00, 0xd1, + 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, 0xc0, 0x00, 0x00, 0xf0, + 0xcd, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, 0x01, 0x40, 0xd2, 0x04, + 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, 0x23, 0x68, 0x00, 0x04, + 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, 0x10, 0x43, 0x98, 0x81, + 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, 0xf7, 0xb5, 0x01, 0x93, + 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, 0x16, 0x1c, 0xff, 0xf7, + 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, 0xbf, 0x07, 0x0c, 0x22, + 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, 0x16, 0x40, 0xc0, 0x22, + 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, 0x01, 0x99, 0x15, 0x40, + 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, 0x80, 0x21, 0x23, 0x68, + 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, 0x01, 0x20, 0x70, 0x47, + 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, 0x98, 0x47, 0x08, 0xbd, + 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, 0x41, 0xfb, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x3d, 0xfb, 0x10, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x4a, 0xfb, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x43, 0xfb, 0x00, 0x28, 0xf9, 0xd1, 0x20, 0x69, + 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, 0x5c, 0x30, 0x00, 0xf0, + 0x3f, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, 0x14, 0x35, 0x04, 0x1c, + 0x28, 0x1c, 0x00, 0xf0, 0x23, 0xfb, 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, + 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x2e, 0xfb, + 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, 0xb4, 0x34, 0x1b, 0x68, + 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x2a, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x00, 0x69, + 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, 0x5c, 0x35, 0x00, 0x28, + 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x0c, 0xfb, 0x00, 0x28, 0x0c, 0xd0, + 0x28, 0x1c, 0x00, 0xf0, 0x20, 0xfb, 0x00, 0x28, 0xfa, 0xd1, 0x28, 0x1c, + 0x31, 0x1c, 0x00, 0xf0, 0xe4, 0xfa, 0x20, 0x69, 0xff, 0xf7, 0x97, 0xfe, + 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, 0x8b, 0xfe, 0x01, 0x20, + 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x1d, 0x1c, 0x0a, 0xab, + 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, 0x1b, 0x78, 0x16, 0x1c, + 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, 0x02, 0x93, 0x0d, 0xab, + 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, 0xfa, 0x23, 0x9b, 0x00, + 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, 0x14, 0x30, 0x00, 0xf0, + 0xb1, 0xfa, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0xad, 0xfa, 0x00, 0x9a, + 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, 0x01, 0x9a, 0x20, 0x1c, + 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, 0x03, 0x9a, 0x5d, 0x70, + 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x80, 0x58, 0x00, 0x00, + 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, 0x05, 0x78, 0x09, 0xa8, + 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, 0x02, 0x90, 0x03, 0x90, + 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, 0x05, 0xb0, 0x30, 0xbd, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, 0x24, 0xfe, 0x00, 0x28, + 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, 0x25, 0x1c, 0x14, 0x35, + 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xfa, 0x23, 0x1c, 0xa8, 0x33, + 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x9e, 0xfa, + 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, 0xac, 0x33, 0xb4, 0x32, + 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, 0xff, 0xf7, 0x15, 0xfe, + 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, 0x28, 0x1c, 0x00, 0xf0, + 0x85, 0xfa, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x72, 0xfa, + 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, 0x02, 0xe0, 0x20, 0x69, + 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, 0xf3, 0xfd, 0x00, 0x28, + 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, 0x18, 0x40, 0x30, 0x38, + 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, 0x1b, 0x01, 0x19, 0x40, + 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, 0xc0, 0x23, 0x9b, 0x00, + 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, 0x05, 0x20, 0x99, 0x42, + 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, 0x00, 0xe0, 0x06, 0x20, + 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, 0x05, 0xd0, 0x02, 0x39, + 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, 0x00, 0xe0, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, 0x85, 0xb0, 0x03, 0x91, + 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0x15, 0x1c, 0xff, 0xf7, + 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, 0x9b, 0xfc, 0x23, 0x1c, + 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, 0x23, 0x1c, 0xb8, 0x33, + 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, 0x08, 0x21, 0xf7, 0x19, + 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, 0xa8, 0x37, 0x38, 0x78, + 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, 0xf9, 0xfb, 0x3b, 0x78, + 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, 0xdb, 0x01, 0x21, 0x1c, + 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, 0xb6, 0x18, 0x5b, 0x18, + 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, 0x01, 0x21, 0x91, 0x40, + 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, 0x1a, 0x60, 0x01, 0x21, + 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, 0x31, 0xfe, 0x29, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, 0x07, 0x1c, 0x20, 0x1c, + 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, 0x20, 0x1c, 0xff, 0xf7, + 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, 0x20, 0x69, 0x01, 0x22, + 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, 0x19, 0x78, 0x01, 0x3b, + 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, 0x3f, 0x20, 0x70, 0x47, + 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, 0x54, 0x68, + 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, 0x38, 0xb5, 0x0d, 0x1c, + 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, 0x2a, 0x1c, 0x00, 0xf0, + 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, 0x63, 0x60, 0x38, 0xbd, + 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, 0x04, 0xd1, 0x03, 0x68, + 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, 0x18, 0x1c, 0x10, 0xbd, + 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, 0x13, 0x68, 0x59, 0x1c, + 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, 0x18, 0x1c, 0x03, 0xe0, + 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, 0x89, 0x00, 0x99, 0x60, + 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, 0x04, 0x49, 0x5a, 0x60, + 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, 0x74, 0x08, 0x00, 0x20, + 0xb8, 0x58, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x20, 0x08, 0xb5, 0x08, 0x4b, + 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, 0x03, 0x68, 0x9b, 0x68, + 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, 0x49, 0x01, 0x59, 0x18, + 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, 0x18, 0x0c, 0x00, 0x20, + 0x38, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, 0x1b, 0x68, 0x08, 0x31, + 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, 0x43, 0x18, 0x9a, 0x68, + 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, 0x14, 0x1c, 0x9a, 0x68, + 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, 0x92, 0x03, 0x22, 0x43, + 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, 0x9a, 0x60, 0x41, 0x18, + 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, 0x38, 0x0c, 0x00, 0x20, + 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x06, 0x1c, + 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, 0x27, 0x4b, 0x8a, 0x00, + 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, 0x02, 0x99, 0x5b, 0x68, + 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, 0xff, 0xf7, 0x9e, 0xff, + 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x98, 0xff, + 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xbf, 0xff, 0x1c, 0x4f, + 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, 0x03, 0x92, 0x8b, 0x18, + 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x17, 0x49, 0x5a, 0x72, + 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, 0x00, 0xf0, 0xb5, 0xf9, + 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x7a, 0xff, + 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, 0x19, 0x71, 0x01, 0x21, + 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, 0x9a, 0x7a, 0x01, 0x21, + 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, + 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x3c, 0x0d, 0x00, 0x20, + 0x18, 0x0c, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, 0x58, 0x0a, 0x00, 0x20, + 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, 0x01, 0x23, 0xff, 0xf7, + 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, 0x01, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, 0x3a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x60, 0xd0, 0x80, 0x23, + 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, 0x00, 0x92, 0x00, 0x2c, + 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, 0x01, 0x93, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0x9b, 0x79, 0xdb, 0x09, + 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, 0x00, 0xf0, 0xc2, 0xf8, + 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, 0xbd, 0xf8, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0xdb, 0x79, 0x9a, 0x07, + 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, 0x38, 0xd1, 0x42, 0x1e, + 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, 0x24, 0x4b, 0x00, 0x22, + 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, 0x3f, 0x25, 0x22, 0x4a, + 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, 0x2a, 0x1c, 0x03, 0x93, + 0x00, 0xf0, 0x35, 0xf9, 0x18, 0x4a, 0x7b, 0x01, 0xd3, 0x18, 0x03, 0x9a, + 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, 0x92, 0x0b, 0x92, 0x03, + 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, 0x80, 0x22, 0x52, 0x42, + 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, 0x5b, 0x19, 0x52, 0x19, + 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, 0x00, 0x98, 0x0b, 0xe0, + 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, 0x7b, 0x01, 0xed, 0x18, + 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, 0xab, 0x61, 0x40, 0x42, + 0x05, 0xb0, 0xf0, 0xbd, 0x3c, 0x0d, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, + 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, 0x70, 0x11, 0x01, 0x00, + 0x90, 0x08, 0x00, 0x20, 0x98, 0x08, 0x00, 0x20, 0x01, 0x4a, 0x02, 0x4b, + 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, 0x00, 0xf0, 0xf2, 0xf8, + 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, 0x10, 0xbd, 0x02, 0x6c, + 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, 0x44, 0x6c, 0xa3, 0x42, + 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, 0x00, 0x23, 0x03, 0x64, + 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x06, 0xd0, + 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, 0x43, 0x64, 0x10, 0x1c, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, 0x43, 0x6c, + 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, 0x03, 0x6c, 0x40, 0x6c, + 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, 0x01, 0xe0, 0xc0, 0x1a, + 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x01, 0xd0, + 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, + 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, 0xd0, 0x1a, 0x43, 0x42, + 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, 0x02, 0xb4, 0x71, 0x46, + 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc, + 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22, + 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42, + 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7, + 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00, + 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43, + 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43, + 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43, + 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43, + 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7, + 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20, + 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90, + 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0, + 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a, + 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0xb5, 0x0e, 0x4b, + 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, + 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, + 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, + 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, + 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, 0x74, 0x00, 0x00, 0x20, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x98, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x76, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, + 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x08, 0xd0, + 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, 0x24, 0x78, 0xa5, 0x42, + 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, 0x30, 0xbd, 0x10, 0xb5, + 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, 0xc4, 0x54, 0x01, 0x33, + 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, 0x93, 0x42, 0x02, 0xd0, + 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, 0x30, 0xb5, 0x00, 0x29, + 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, + 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, + 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, + 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, + 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, + 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, + 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, + 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, + 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, + 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, + 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, + 0x30, 0xbd, 0xc0, 0x46, 0x44, 0x0d, 0x00, 0x20, 0x70, 0xb5, 0x03, 0x23, + 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, 0x0c, 0x2d, 0x01, 0xd2, + 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, 0x8d, 0x42, 0x3d, 0xd3, + 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, 0x00, 0x29, 0x13, 0xd0, + 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, 0x02, 0xd9, 0x0b, 0x60, + 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, 0x63, 0x68, 0x13, 0x60, + 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, 0x16, 0xe0, 0x0c, 0x1c, + 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, 0x00, 0x28, 0x03, 0xd1, + 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, 0x30, 0x1c, 0x29, 0x1c, + 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, 0xc4, 0x1c, 0x03, 0x23, + 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, 0x20, 0x1c, 0x0b, 0x30, + 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, 0x0b, 0xd0, 0x5a, 0x42, + 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, 0x00, 0xf0, 0x0a, 0xf8, + 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, 0x00, 0x20, 0x70, 0xbd, + 0x44, 0x0d, 0x00, 0x20, 0x40, 0x0d, 0x00, 0x20, 0x38, 0xb5, 0x07, 0x4c, + 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, 0x00, 0xf0, 0x2a, 0xf8, + 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x2b, 0x60, + 0x38, 0xbd, 0xc0, 0x46, 0x4c, 0x0d, 0x00, 0x20, 0xc9, 0xb2, 0x03, 0x78, + 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, 0x01, 0x30, 0xf8, 0xe7, + 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, 0x30, 0xb5, 0x03, 0x1c, + 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, 0x5d, 0x1e, 0x01, 0x3a, + 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, 0x9a, 0x18, 0x93, 0x42, + 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x30, 0xbd, + 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, 0x18, 0x18, 0x69, 0x46, + 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, 0x70, 0x47, 0x05, 0x4b, + 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, 0xf8, 0xe7, 0x03, 0x4b, + 0x13, 0x60, 0xef, 0xe7, 0x48, 0x0d, 0x00, 0x20, 0x4c, 0x0d, 0x00, 0x20, + 0x50, 0x0d, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x2e, 0x42, + 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, 0x33, 0x22, 0x00, 0x00, + 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, 0x61, 0x23, 0x00, 0x00, + 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, 0x3f, 0x2f, 0x5b, 0x5d, + 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, + 0xbd, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x1d, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdf, 0x44, 0x00, 0x00, 0xbd, 0x40, 0x00, 0x00, 0x97, 0x44, 0x00, 0x00, + 0x7f, 0x44, 0x00, 0x00, 0x75, 0x44, 0x00, 0x00, 0xa1, 0x44, 0x00, 0x00, + 0xd5, 0x44, 0x00, 0x00, 0x49, 0x44, 0x00, 0x00, 0x8d, 0x46, 0x00, 0x00, + 0x59, 0x44, 0x00, 0x00, 0x45, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x47, 0x00, 0x00, + 0xb1, 0x47, 0x00, 0x00, 0x81, 0x47, 0x00, 0x00, 0xa5, 0x47, 0x00, 0x00, + 0x99, 0x47, 0x00, 0x00, 0xe9, 0x47, 0x00, 0x00, 0xcd, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x58, 0x00, 0x00, + 0x04, 0x59, 0x00, 0x00, 0x24, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xed, 0x3a, 0x00, 0x00, + 0x0d, 0x48, 0x00, 0x00, 0xb1, 0x4a, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkrgsm1400.h b/sparkfun/samd/libraries/SDU/src/boot/mkrgsm1400.h new file mode 100644 index 00000000..c8aa7d1b --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkrgsm1400.h @@ -0,0 +1,1236 @@ + 0x00, 0x80, 0x00, 0x20, 0x95, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0xe9, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x81, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0xcd, 0x3a, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0xbd, 0x3a, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, + 0x7d, 0x3b, 0x00, 0x00, 0x7d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x44, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x45, 0xfe, 0x02, 0xf0, + 0x7d, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x6e, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0xb8, 0x4e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0xc3, 0xfc, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0xdf, 0xfc, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0xa4, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0xc8, 0x4e, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0xc8, 0x4e, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0x70, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x10, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x10, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x10, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x3e, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x36, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x10, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0xf0, 0x4e, 0x00, 0x00, 0x10, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x10, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x33, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x13, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0xc8, 0xf9, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xe4, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xdd, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0x99, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x12, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x68, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x6a, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x38, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0x00, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0xf8, 0xf8, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x0f, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0xf2, 0x4e, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xb0, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0xa1, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0x93, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0x08, 0x4f, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x90, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x2a, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x53, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x76, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x10, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x08, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0x01, 0xfb, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x2d, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x09, 0x4b, 0x0a, 0x4a, + 0x0a, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x09, 0x4b, + 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x5a, 0x72, 0x99, 0x71, + 0xda, 0x71, 0x08, 0x21, 0x03, 0x22, 0x59, 0x71, 0x1a, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x08, 0x09, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x7e, 0xfd, + 0x08, 0xbd, 0xc0, 0x46, 0x88, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0x00, 0xf0, 0x76, 0xfd, 0x08, 0xbd, 0xc0, 0x46, 0x44, 0x08, 0x00, 0x20, + 0x7f, 0xb5, 0x19, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x41, 0xfb, 0x19, 0x49, + 0x19, 0x48, 0x00, 0xf0, 0x3d, 0xfb, 0x19, 0x4c, 0x19, 0x49, 0x20, 0x1c, + 0x00, 0xf0, 0x38, 0xfb, 0x18, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x34, 0xfb, + 0x18, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x30, 0xfb, 0x18, 0x4e, 0x19, 0x49, + 0x30, 0x1c, 0x00, 0xf0, 0x2b, 0xfb, 0x01, 0x25, 0x03, 0x23, 0x31, 0x1c, + 0x00, 0x93, 0x01, 0x95, 0x0d, 0x22, 0x0e, 0x23, 0x14, 0x48, 0x00, 0xf0, + 0x3b, 0xfd, 0x02, 0x23, 0x01, 0x93, 0x1c, 0x23, 0x02, 0x93, 0x1d, 0x23, + 0x00, 0x95, 0x03, 0x93, 0x21, 0x1c, 0x1b, 0x22, 0x1a, 0x23, 0x0f, 0x48, + 0x00, 0xf0, 0xfa, 0xfc, 0x7f, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x04, 0x09, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x08, 0x09, 0x00, 0x20, + 0x0c, 0x09, 0x00, 0x20, 0x00, 0x10, 0x00, 0x42, 0x00, 0x14, 0x00, 0x42, + 0x00, 0x09, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x10, 0x09, 0x00, 0x20, + 0x14, 0x09, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x88, 0x07, 0x00, 0x20, + 0x44, 0x08, 0x00, 0x20, 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, + 0x1b, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, + 0x18, 0x09, 0x00, 0x20, 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, + 0x04, 0xd1, 0x00, 0xf0, 0x4f, 0xf8, 0xfe, 0xf7, 0xb7, 0xfa, 0x0b, 0xe0, + 0x0c, 0x4d, 0x8d, 0x42, 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, + 0xa2, 0x42, 0x04, 0xd2, 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, + 0xfe, 0xe7, 0x90, 0x42, 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, + 0xe7, 0xd2, 0x00, 0x22, 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, + 0xa0, 0x00, 0x00, 0x20, 0x48, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, + 0xfc, 0x0d, 0x00, 0x20, 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0xf0, 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, + 0x70, 0x47, 0xc0, 0x46, 0x1c, 0x09, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, + 0x08, 0xd0, 0x05, 0x4b, 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, + 0x33, 0x68, 0x5b, 0x1b, 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, + 0x1c, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, + 0x1a, 0x60, 0x00, 0xf0, 0x61, 0xfa, 0x08, 0xbd, 0x1c, 0x09, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, + 0x1e, 0x21, 0x53, 0x68, 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, + 0x53, 0x60, 0x8b, 0x69, 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, + 0x45, 0x4b, 0x9c, 0x82, 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, + 0xda, 0x68, 0x94, 0x07, 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, + 0x14, 0x78, 0xe5, 0x07, 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xf7, 0xdb, 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xfb, 0xdb, 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, + 0x65, 0x80, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, + 0x9c, 0x84, 0xdc, 0x68, 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, + 0xe5, 0x62, 0xdd, 0x68, 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x2e, 0x4e, 0x35, 0x43, 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, + 0xfb, 0xd5, 0xa5, 0x8c, 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, + 0x25, 0x06, 0xfc, 0xd5, 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, + 0xdc, 0x68, 0xe5, 0x06, 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, + 0x55, 0x78, 0x1c, 0x4c, 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, + 0x1e, 0x4d, 0x35, 0x40, 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, + 0x1d, 0x62, 0x03, 0x23, 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, + 0x4b, 0x72, 0x8b, 0x72, 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, + 0x16, 0x4b, 0x17, 0x4a, 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, + 0x21, 0x40, 0x11, 0x43, 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, + 0x13, 0x43, 0x12, 0x4a, 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, + 0x43, 0x60, 0x70, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, + 0x0c, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x01, 0x05, 0x01, 0x00, 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, + 0x00, 0x07, 0x03, 0x00, 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, + 0x00, 0x6c, 0xdc, 0x02, 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, + 0x20, 0x60, 0x80, 0x00, 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, + 0x18, 0x68, 0x10, 0xb5, 0x89, 0x00, 0x00, 0xf0, 0xe3, 0xfe, 0x2f, 0x4b, + 0x01, 0x38, 0x98, 0x42, 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, + 0x18, 0x6a, 0xc0, 0x21, 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, + 0x19, 0x62, 0x00, 0x24, 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, + 0x80, 0x22, 0x09, 0x02, 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, + 0x25, 0x4b, 0xfc, 0x21, 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, + 0xfc, 0x22, 0x92, 0x01, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, + 0xd2, 0x02, 0x0a, 0x43, 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, + 0x00, 0x21, 0x01, 0x34, 0x00, 0xf0, 0x70, 0xf8, 0x0f, 0x2c, 0xf8, 0xd1, + 0x1a, 0x4c, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, + 0x63, 0x80, 0x19, 0x4b, 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, + 0xe4, 0x22, 0xd2, 0x00, 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, + 0x13, 0x4a, 0xc9, 0x09, 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, + 0x00, 0x20, 0x13, 0x61, 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, + 0x0c, 0x4b, 0xda, 0x79, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, + 0x5a, 0x70, 0x10, 0xbd, 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, + 0x10, 0xe0, 0x00, 0xe0, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, + 0x00, 0x0c, 0x00, 0x40, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, + 0x21, 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, + 0x51, 0x7e, 0x13, 0x1c, 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, + 0x04, 0x28, 0x13, 0xd8, 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, + 0x5a, 0x78, 0x0f, 0x21, 0x8a, 0x43, 0x00, 0xf0, 0x55, 0xfe, 0x03, 0x05, + 0x09, 0x07, 0x03, 0x00, 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, + 0x02, 0x21, 0x0a, 0x43, 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, + 0x1b, 0x05, 0x0b, 0x43, 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, + 0x02, 0x21, 0x0b, 0x43, 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, + 0xff, 0xff, 0xff, 0xf0, 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, + 0x50, 0x43, 0x27, 0x4b, 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, + 0x46, 0xd0, 0x03, 0x29, 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, + 0x29, 0xfe, 0x02, 0x33, 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, + 0xc3, 0x01, 0x1f, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, + 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, + 0x62, 0x43, 0x98, 0x56, 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, + 0x5b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, + 0x91, 0x40, 0x59, 0x60, 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, + 0x10, 0x48, 0x59, 0x18, 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, + 0x40, 0x30, 0x06, 0x24, 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, + 0x0b, 0x49, 0x52, 0x18, 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x9a, 0x18, 0xc3, 0x01, 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, + 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, + 0x13, 0x18, 0x08, 0x24, 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, + 0x10, 0x4e, 0xd2, 0x01, 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, + 0x86, 0x68, 0xab, 0x40, 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, + 0xbe, 0x41, 0x40, 0x19, 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, + 0x04, 0x26, 0xb4, 0x43, 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, + 0x05, 0x49, 0x52, 0x18, 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, + 0x93, 0x61, 0xf0, 0xbd, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, + 0x08, 0x24, 0xaa, 0x18, 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, + 0x48, 0x1c, 0x00, 0x24, 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xa0, 0xfd, + 0x07, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, + 0x0a, 0x00, 0x01, 0x24, 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, + 0x18, 0x1c, 0x00, 0x21, 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, + 0x02, 0x21, 0xff, 0xf7, 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, + 0x31, 0xd1, 0x18, 0x1c, 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, + 0x18, 0x22, 0x53, 0x43, 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, + 0x14, 0x1c, 0x04, 0x40, 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, + 0x12, 0x4c, 0x1b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, + 0x0f, 0x21, 0x31, 0x40, 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, + 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, + 0x09, 0x4e, 0x0f, 0x27, 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, + 0x9a, 0x18, 0xbe, 0x43, 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, + 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, + 0x06, 0x1c, 0x0d, 0x1c, 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, + 0x9c, 0x42, 0x07, 0xd0, 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, + 0x98, 0x47, 0x01, 0x34, 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, + 0x15, 0x4a, 0x13, 0x68, 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, + 0x00, 0x2b, 0x21, 0xd1, 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, + 0x9a, 0x42, 0x07, 0xd8, 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, + 0xda, 0x60, 0xbf, 0xf3, 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, + 0xc8, 0x07, 0xfb, 0xd5, 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, + 0x52, 0x00, 0x01, 0x43, 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, + 0x1a, 0x7d, 0xd1, 0x07, 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, + 0x70, 0x47, 0xc0, 0x46, 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, + 0x03, 0x02, 0x00, 0x00, 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, + 0x00, 0x40, 0x00, 0x41, 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, + 0xf7, 0xb5, 0x08, 0xac, 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, + 0x6c, 0x1e, 0xa5, 0x41, 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, + 0x27, 0x06, 0x3a, 0x43, 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, + 0x50, 0x68, 0xb5, 0x01, 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, + 0x01, 0x43, 0x0c, 0x43, 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, + 0xc0, 0x25, 0x1c, 0x68, 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, + 0xc0, 0x24, 0xa4, 0x02, 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, + 0x03, 0x68, 0x5a, 0x68, 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, + 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, + 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, + 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, + 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, + 0x1a, 0x7e, 0xd1, 0x07, 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, + 0x70, 0x47, 0x03, 0x68, 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, + 0x18, 0x7e, 0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, + 0xc0, 0x09, 0x70, 0x47, 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, + 0x0a, 0x43, 0x1a, 0x76, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, + 0x18, 0x40, 0x70, 0x47, 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, + 0x03, 0x68, 0x1a, 0x7e, 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, + 0x70, 0xb5, 0x03, 0x68, 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, + 0x1c, 0x68, 0x6d, 0x07, 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, + 0x04, 0x68, 0x51, 0x00, 0x03, 0x48, 0x00, 0xf0, 0x79, 0xfc, 0x01, 0x38, + 0xc0, 0xb2, 0x20, 0x73, 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, + 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, + 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, + 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, + 0x03, 0x68, 0xda, 0x69, 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, + 0x8a, 0x43, 0x1a, 0x60, 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, + 0x52, 0x02, 0x11, 0x43, 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, + 0xfc, 0xd5, 0x98, 0x6a, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, + 0x30, 0xb5, 0x93, 0x42, 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x1f, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, + 0x0e, 0x23, 0x19, 0x22, 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, + 0x0a, 0x23, 0x15, 0x22, 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, + 0x0c, 0x23, 0x17, 0x22, 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, + 0x15, 0x49, 0x01, 0x20, 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, + 0x5b, 0x18, 0x03, 0x20, 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, + 0xe0, 0x00, 0xff, 0x24, 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, + 0x85, 0x40, 0x28, 0x1c, 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, + 0x1a, 0x43, 0x0a, 0x4b, 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, + 0xfb, 0xdb, 0x30, 0xbd, 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, + 0x00, 0x10, 0x00, 0x42, 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, + 0x00, 0x1c, 0x00, 0x42, 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, + 0xf8, 0xb5, 0x04, 0x1c, 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, + 0xa3, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, + 0x0a, 0x40, 0x69, 0x07, 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, + 0x22, 0x68, 0x84, 0x23, 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, + 0x01, 0x2d, 0x00, 0xd1, 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, + 0xc0, 0x00, 0x00, 0xf0, 0xcd, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, + 0x01, 0x40, 0xd2, 0x04, 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, + 0x23, 0x68, 0x00, 0x04, 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, + 0x10, 0x43, 0x98, 0x81, 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, + 0xf7, 0xb5, 0x01, 0x93, 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, + 0x16, 0x1c, 0xff, 0xf7, 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, + 0xbf, 0x07, 0x0c, 0x22, 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, + 0x16, 0x40, 0xc0, 0x22, 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, + 0x01, 0x99, 0x15, 0x40, 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, + 0x80, 0x21, 0x23, 0x68, 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, + 0x01, 0x20, 0x70, 0x47, 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, + 0x98, 0x47, 0x08, 0xbd, 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x00, 0x69, 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, + 0x41, 0xfb, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0x3d, 0xfb, 0x10, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0x4a, 0xfb, 0x08, 0xbd, 0x10, 0xb5, + 0x04, 0x1c, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0x43, 0xfb, 0x00, 0x28, + 0xf9, 0xd1, 0x20, 0x69, 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, + 0x5c, 0x30, 0x00, 0xf0, 0x3f, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x14, 0x35, 0x04, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x23, 0xfb, 0x23, 0x1c, + 0xa8, 0x33, 0x1b, 0x78, 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x2e, 0xfb, 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, + 0xb4, 0x34, 0x1b, 0x68, 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0x2a, 0xfb, 0x08, 0xbd, 0x70, 0xb5, + 0x04, 0x1c, 0x00, 0x69, 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, + 0x5c, 0x35, 0x00, 0x28, 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x0c, 0xfb, + 0x00, 0x28, 0x0c, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x20, 0xfb, 0x00, 0x28, + 0xfa, 0xd1, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xe4, 0xfa, 0x20, 0x69, + 0xff, 0xf7, 0x97, 0xfe, 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, + 0x8b, 0xfe, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x1d, 0x1c, 0x0a, 0xab, 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, + 0x1b, 0x78, 0x16, 0x1c, 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, + 0x02, 0x93, 0x0d, 0xab, 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, + 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, + 0x14, 0x30, 0x00, 0xf0, 0xb1, 0xfa, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, + 0xad, 0xfa, 0x00, 0x9a, 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, + 0x01, 0x9a, 0x20, 0x1c, 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, + 0x03, 0x9a, 0x5d, 0x70, 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0x80, 0x58, 0x00, 0x00, 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, + 0x05, 0x78, 0x09, 0xa8, 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, + 0x02, 0x90, 0x03, 0x90, 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, + 0x05, 0xb0, 0x30, 0xbd, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0x24, 0xfe, 0x00, 0x28, 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, + 0x25, 0x1c, 0x14, 0x35, 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xfa, + 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x9e, 0xfa, 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, + 0xac, 0x33, 0xb4, 0x32, 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, + 0xff, 0xf7, 0x15, 0xfe, 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, + 0x28, 0x1c, 0x00, 0xf0, 0x85, 0xfa, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x72, 0xfa, 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, + 0x02, 0xe0, 0x20, 0x69, 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, + 0xf3, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, + 0x18, 0x40, 0x30, 0x38, 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, + 0x1b, 0x01, 0x19, 0x40, 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, + 0xc0, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, + 0x05, 0x20, 0x99, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, + 0x00, 0xe0, 0x06, 0x20, 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, + 0x05, 0xd0, 0x02, 0x39, 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, + 0x00, 0xe0, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, + 0x85, 0xb0, 0x03, 0x91, 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, + 0x15, 0x1c, 0xff, 0xf7, 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, + 0x9b, 0xfc, 0x23, 0x1c, 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, + 0x23, 0x1c, 0xb8, 0x33, 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, + 0x08, 0x21, 0xf7, 0x19, 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, + 0xa8, 0x37, 0x38, 0x78, 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, + 0xf9, 0xfb, 0x3b, 0x78, 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, + 0xdb, 0x01, 0x21, 0x1c, 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, + 0xb6, 0x18, 0x5b, 0x18, 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, + 0x01, 0x21, 0x91, 0x40, 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, + 0x1a, 0x60, 0x01, 0x21, 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, + 0x31, 0xfe, 0x29, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, + 0x07, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, + 0x20, 0x69, 0x01, 0x22, 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, + 0x19, 0x78, 0x01, 0x3b, 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, + 0x3f, 0x20, 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, + 0x07, 0x33, 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, + 0x08, 0xb5, 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, + 0x08, 0xb5, 0x00, 0x69, 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, + 0x38, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, + 0x2a, 0x1c, 0x00, 0xf0, 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x38, 0xbd, 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, + 0x04, 0xd1, 0x03, 0x68, 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, + 0x18, 0x1c, 0x10, 0xbd, 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, + 0x13, 0x68, 0x59, 0x1c, 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, + 0x18, 0x1c, 0x03, 0xe0, 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, + 0x89, 0x00, 0x99, 0x60, 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, + 0x04, 0x49, 0x5a, 0x60, 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, + 0x20, 0x09, 0x00, 0x20, 0xb8, 0x58, 0x00, 0x00, 0xe0, 0x0c, 0x00, 0x20, + 0x08, 0xb5, 0x08, 0x4b, 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, + 0x03, 0x68, 0x9b, 0x68, 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, + 0x49, 0x01, 0x59, 0x18, 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, + 0xc4, 0x0c, 0x00, 0x20, 0xe4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, + 0xff, 0xf7, 0xe6, 0xff, 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, + 0x1b, 0x68, 0x08, 0x31, 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, + 0x5b, 0x42, 0x13, 0x43, 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, + 0xe4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, + 0x43, 0x18, 0x9a, 0x68, 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, + 0x14, 0x1c, 0x9a, 0x68, 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, + 0x92, 0x03, 0x22, 0x43, 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, + 0x9a, 0x60, 0x41, 0x18, 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, + 0xe4, 0x0c, 0x00, 0x20, 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x06, 0x1c, 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, + 0x27, 0x4b, 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, + 0x02, 0x99, 0x5b, 0x68, 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, + 0xff, 0xf7, 0x9e, 0xff, 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, + 0xff, 0xf7, 0x98, 0xff, 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, + 0xbf, 0xff, 0x1c, 0x4f, 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, + 0x03, 0x92, 0x8b, 0x18, 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, + 0x17, 0x49, 0x5a, 0x72, 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, + 0x00, 0xf0, 0xb5, 0xf9, 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, + 0xff, 0xf7, 0x7a, 0xff, 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, + 0x08, 0x33, 0x5b, 0x01, 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, + 0x19, 0x71, 0x01, 0x21, 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, + 0x9a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x00, 0xe0, 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0xe8, 0x0d, 0x00, 0x20, 0xc4, 0x0c, 0x00, 0x20, 0xe4, 0x0c, 0x00, 0x20, + 0x04, 0x0b, 0x00, 0x20, 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, + 0x01, 0x23, 0xff, 0xf7, 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, + 0x3a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, + 0x60, 0xd0, 0x80, 0x23, 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, + 0x00, 0x92, 0x00, 0x2c, 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, + 0x01, 0x93, 0x3b, 0x1c, 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, + 0x9b, 0x79, 0xdb, 0x09, 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, + 0x00, 0xf0, 0xc2, 0xf8, 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, + 0xbd, 0xf8, 0x3b, 0x1c, 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, + 0xdb, 0x79, 0x9a, 0x07, 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, + 0x38, 0xd1, 0x42, 0x1e, 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, + 0x24, 0x4b, 0x00, 0x22, 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, + 0x3f, 0x25, 0x22, 0x4a, 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, + 0x2a, 0x1c, 0x03, 0x93, 0x00, 0xf0, 0x35, 0xf9, 0x18, 0x4a, 0x7b, 0x01, + 0xd3, 0x18, 0x03, 0x9a, 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, + 0x92, 0x0b, 0x92, 0x03, 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, + 0x08, 0x33, 0x5b, 0x01, 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, + 0x80, 0x22, 0x52, 0x42, 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, + 0x5b, 0x19, 0x52, 0x19, 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, + 0x00, 0x98, 0x0b, 0xe0, 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, + 0x7b, 0x01, 0xed, 0x18, 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, + 0xab, 0x61, 0x40, 0x42, 0x05, 0xb0, 0xf0, 0xbd, 0xe8, 0x0d, 0x00, 0x20, + 0xe4, 0x0c, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, + 0x70, 0x11, 0x01, 0x00, 0x3c, 0x09, 0x00, 0x20, 0x44, 0x09, 0x00, 0x20, + 0x01, 0x4a, 0x02, 0x4b, 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, + 0xe4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, + 0x00, 0xf0, 0xf2, 0xf8, 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, + 0x10, 0xbd, 0x02, 0x6c, 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, + 0x44, 0x6c, 0xa3, 0x42, 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, + 0x00, 0x23, 0x03, 0x64, 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, + 0x93, 0x42, 0x06, 0xd0, 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, + 0x43, 0x64, 0x10, 0x1c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, + 0x02, 0x6c, 0x43, 0x6c, 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, + 0x03, 0x6c, 0x40, 0x6c, 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, + 0x01, 0xe0, 0xc0, 0x1a, 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, + 0x93, 0x42, 0x01, 0xd0, 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x02, 0x6c, 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, + 0xd0, 0x1a, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, + 0x02, 0xb4, 0x71, 0x46, 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, + 0x8e, 0x44, 0x02, 0xbc, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, + 0x01, 0x23, 0x00, 0x22, 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, + 0x24, 0x07, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, + 0x1b, 0x01, 0xf8, 0xe7, 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, + 0x02, 0xd2, 0x49, 0x00, 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, + 0x40, 0x1a, 0x1a, 0x43, 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x5c, 0x08, 0x22, 0x43, 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x9c, 0x08, 0x22, 0x43, 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0xdc, 0x08, 0x22, 0x43, 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, + 0x09, 0x09, 0xe3, 0xe7, 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, + 0x01, 0xd0, 0x00, 0x20, 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, + 0x40, 0x18, 0x02, 0x90, 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, + 0x00, 0x29, 0xf0, 0xd0, 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, + 0x42, 0x43, 0x89, 0x1a, 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0xb5, 0x0e, 0x4b, 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, + 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, + 0x01, 0x34, 0xf8, 0xe7, 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, + 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, + 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, + 0x98, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, + 0x00, 0xf0, 0x76, 0xf8, 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, + 0x93, 0x42, 0x08, 0xd0, 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, + 0x24, 0x78, 0xa5, 0x42, 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, + 0x30, 0xbd, 0x10, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, + 0xc4, 0x54, 0x01, 0x33, 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, + 0x93, 0x42, 0x02, 0xd0, 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, + 0x30, 0xb5, 0x00, 0x29, 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, + 0x00, 0xda, 0xc9, 0x18, 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, + 0x02, 0xd1, 0x4b, 0x60, 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, + 0x08, 0x68, 0x0a, 0x18, 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, + 0xc0, 0x18, 0x08, 0x60, 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, + 0x24, 0xe0, 0x8a, 0x42, 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, + 0xf9, 0xd1, 0x1d, 0x68, 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, + 0x69, 0x18, 0x58, 0x18, 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, + 0x52, 0x68, 0x09, 0x19, 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, + 0x02, 0xd9, 0x0c, 0x23, 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, + 0x94, 0x42, 0x03, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, + 0x4a, 0x60, 0x59, 0x60, 0x30, 0xbd, 0xc0, 0x46, 0xf0, 0x0d, 0x00, 0x20, + 0x70, 0xb5, 0x03, 0x23, 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, + 0x0c, 0x2d, 0x01, 0xd2, 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, + 0x8d, 0x42, 0x3d, 0xd3, 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, + 0x00, 0x29, 0x13, 0xd0, 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, + 0x02, 0xd9, 0x0b, 0x60, 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, + 0x63, 0x68, 0x13, 0x60, 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, + 0x16, 0xe0, 0x0c, 0x1c, 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, + 0x00, 0x28, 0x03, 0xd1, 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, + 0x30, 0x1c, 0x29, 0x1c, 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, + 0xc4, 0x1c, 0x03, 0x23, 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, + 0x20, 0x1c, 0x0b, 0x30, 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, + 0x0b, 0xd0, 0x5a, 0x42, 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, + 0x00, 0xf0, 0x0a, 0xf8, 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, + 0x00, 0x20, 0x70, 0xbd, 0xf0, 0x0d, 0x00, 0x20, 0xec, 0x0d, 0x00, 0x20, + 0x38, 0xb5, 0x07, 0x4c, 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, + 0x00, 0xf0, 0x2a, 0xf8, 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x2b, 0x60, 0x38, 0xbd, 0xc0, 0x46, 0xf8, 0x0d, 0x00, 0x20, + 0xc9, 0xb2, 0x03, 0x78, 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, + 0x01, 0x30, 0xf8, 0xe7, 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, + 0x30, 0xb5, 0x03, 0x1c, 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, + 0x5d, 0x1e, 0x01, 0x3a, 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, + 0x9a, 0x18, 0x93, 0x42, 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, + 0xf9, 0xe7, 0x30, 0xbd, 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, + 0x18, 0x18, 0x69, 0x46, 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, + 0x70, 0x47, 0x05, 0x4b, 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, + 0xf8, 0xe7, 0x03, 0x4b, 0x13, 0x60, 0xef, 0xe7, 0xf4, 0x0d, 0x00, 0x20, + 0xf8, 0x0d, 0x00, 0x20, 0xfc, 0x0d, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x2e, 0x42, 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, + 0x33, 0x22, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, + 0x61, 0x23, 0x00, 0x00, 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, + 0x3f, 0x2f, 0x5b, 0x5d, 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x34, 0x00, 0x00, 0xcd, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, + 0x1d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xef, 0x44, 0x00, 0x00, 0xcd, 0x40, 0x00, 0x00, 0xa7, 0x44, 0x00, 0x00, + 0x8f, 0x44, 0x00, 0x00, 0x85, 0x44, 0x00, 0x00, 0xb1, 0x44, 0x00, 0x00, + 0xe5, 0x44, 0x00, 0x00, 0x59, 0x44, 0x00, 0x00, 0x9d, 0x46, 0x00, 0x00, + 0x69, 0x44, 0x00, 0x00, 0x55, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x47, 0x00, 0x00, + 0xc1, 0x47, 0x00, 0x00, 0x91, 0x47, 0x00, 0x00, 0xb5, 0x47, 0x00, 0x00, + 0xa9, 0x47, 0x00, 0x00, 0xf9, 0x47, 0x00, 0x00, 0xdd, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x58, 0x00, 0x00, + 0x04, 0x59, 0x00, 0x00, 0x24, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xdd, 0x3a, 0x00, 0x00, + 0x1d, 0x48, 0x00, 0x00, 0xc1, 0x4a, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkrwan1300.h b/sparkfun/samd/libraries/SDU/src/boot/mkrwan1300.h new file mode 100644 index 00000000..f67c5d32 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkrwan1300.h @@ -0,0 +1,1242 @@ + 0x00, 0x80, 0x00, 0x20, 0xad, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x01, 0x3c, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x99, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0xed, 0x3a, 0x00, 0x00, + 0xdd, 0x3a, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, + 0x95, 0x3b, 0x00, 0x00, 0x95, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x8c, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x8c, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x51, 0xfe, 0x02, 0xf0, + 0x89, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x7a, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0xd0, 0x4e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0xcf, 0xfc, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0xeb, 0xfc, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0xb0, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0xe0, 0x4e, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0xe0, 0x4e, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0x7c, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x28, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x28, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x28, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x4a, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x42, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x28, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0x08, 0x4f, 0x00, 0x00, 0x28, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x28, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x3f, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x1f, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0xd4, 0xf9, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xf0, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xe9, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0xa5, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x1e, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x74, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x76, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x44, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0x0c, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0x04, 0xf9, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x1b, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0x0a, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xbc, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0xad, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0x9f, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x4f, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x9c, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x36, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x5f, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x82, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x1c, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x14, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0x0d, 0xfb, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x39, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x0f, 0x4b, 0x10, 0x4a, + 0x10, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x0f, 0x4b, + 0x0f, 0x48, 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x99, 0x71, + 0x08, 0x21, 0x59, 0x71, 0x03, 0x21, 0x5a, 0x72, 0xda, 0x71, 0x19, 0x72, + 0x0a, 0x4b, 0x18, 0x60, 0x26, 0x20, 0x18, 0x71, 0x25, 0x20, 0x98, 0x71, + 0x24, 0x20, 0x5a, 0x72, 0x58, 0x71, 0xda, 0x71, 0x19, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x18, 0x09, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x1c, 0x09, 0x00, 0x20, 0x88, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x7a, 0xfd, 0x08, 0xbd, 0xc0, 0x46, + 0x98, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x72, 0xfd, + 0x08, 0xbd, 0xc0, 0x46, 0x54, 0x08, 0x00, 0x20, 0x73, 0xb5, 0x17, 0x49, + 0x17, 0x48, 0x00, 0xf0, 0x3d, 0xfb, 0x17, 0x49, 0x17, 0x48, 0x00, 0xf0, + 0x39, 0xfb, 0x17, 0x49, 0x17, 0x48, 0x00, 0xf0, 0x35, 0xfb, 0x17, 0x49, + 0x17, 0x48, 0x00, 0xf0, 0x31, 0xfb, 0x17, 0x4c, 0x17, 0x49, 0x20, 0x1c, + 0x00, 0xf0, 0x2c, 0xfb, 0x16, 0x4e, 0x17, 0x49, 0x30, 0x1c, 0x00, 0xf0, + 0x27, 0xfb, 0x03, 0x25, 0x01, 0x23, 0x31, 0x1c, 0x00, 0x95, 0x01, 0x93, + 0x0d, 0x22, 0x0e, 0x23, 0x12, 0x48, 0x00, 0xf0, 0x37, 0xfd, 0x00, 0x23, + 0x00, 0x95, 0x01, 0x93, 0x21, 0x1c, 0x1d, 0x22, 0x1a, 0x23, 0x0f, 0x48, + 0x00, 0xf0, 0x2e, 0xfd, 0x73, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x14, 0x09, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x18, 0x09, 0x00, 0x20, + 0x00, 0x10, 0x00, 0x42, 0x1c, 0x09, 0x00, 0x20, 0x00, 0x14, 0x00, 0x42, + 0x10, 0x09, 0x00, 0x20, 0x20, 0x09, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, + 0x24, 0x09, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x98, 0x07, 0x00, 0x20, + 0x54, 0x08, 0x00, 0x20, 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, + 0x1b, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, + 0x28, 0x09, 0x00, 0x20, 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, + 0x04, 0xd1, 0x00, 0xf0, 0x4f, 0xf8, 0xfe, 0xf7, 0xab, 0xfa, 0x0b, 0xe0, + 0x0c, 0x4d, 0x8d, 0x42, 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, + 0xa2, 0x42, 0x04, 0xd2, 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, + 0xfe, 0xe7, 0x90, 0x42, 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, + 0xe7, 0xd2, 0x00, 0x22, 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, + 0xa0, 0x00, 0x00, 0x20, 0x90, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, + 0x0c, 0x0e, 0x00, 0x20, 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0xf0, 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, + 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x09, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, + 0x08, 0xd0, 0x05, 0x4b, 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, + 0x33, 0x68, 0x5b, 0x1b, 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, + 0x2c, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, + 0x1a, 0x60, 0x00, 0xf0, 0x61, 0xfa, 0x08, 0xbd, 0x2c, 0x09, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, + 0x1e, 0x21, 0x53, 0x68, 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, + 0x53, 0x60, 0x8b, 0x69, 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, + 0x45, 0x4b, 0x9c, 0x82, 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, + 0xda, 0x68, 0x94, 0x07, 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, + 0x14, 0x78, 0xe5, 0x07, 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xf7, 0xdb, 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xfb, 0xdb, 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, + 0x65, 0x80, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, + 0x9c, 0x84, 0xdc, 0x68, 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, + 0xe5, 0x62, 0xdd, 0x68, 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x2e, 0x4e, 0x35, 0x43, 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, + 0xfb, 0xd5, 0xa5, 0x8c, 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, + 0x25, 0x06, 0xfc, 0xd5, 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, + 0xdc, 0x68, 0xe5, 0x06, 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, + 0x55, 0x78, 0x1c, 0x4c, 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, + 0x1e, 0x4d, 0x35, 0x40, 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, + 0x1d, 0x62, 0x03, 0x23, 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, + 0x4b, 0x72, 0x8b, 0x72, 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, + 0x16, 0x4b, 0x17, 0x4a, 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, + 0x21, 0x40, 0x11, 0x43, 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, + 0x13, 0x43, 0x12, 0x4a, 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, + 0x43, 0x60, 0x70, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, + 0x0c, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x01, 0x05, 0x01, 0x00, 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, + 0x00, 0x07, 0x03, 0x00, 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, + 0x00, 0x6c, 0xdc, 0x02, 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, + 0x20, 0x60, 0x80, 0x00, 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, + 0x18, 0x68, 0x10, 0xb5, 0x89, 0x00, 0x00, 0xf0, 0xe3, 0xfe, 0x2f, 0x4b, + 0x01, 0x38, 0x98, 0x42, 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, + 0x18, 0x6a, 0xc0, 0x21, 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, + 0x19, 0x62, 0x00, 0x24, 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, + 0x80, 0x22, 0x09, 0x02, 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, + 0x25, 0x4b, 0xfc, 0x21, 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, + 0xfc, 0x22, 0x92, 0x01, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, + 0xd2, 0x02, 0x0a, 0x43, 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, + 0x00, 0x21, 0x01, 0x34, 0x00, 0xf0, 0x70, 0xf8, 0x0f, 0x2c, 0xf8, 0xd1, + 0x1a, 0x4c, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, + 0x63, 0x80, 0x19, 0x4b, 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, + 0xe4, 0x22, 0xd2, 0x00, 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, + 0x13, 0x4a, 0xc9, 0x09, 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, + 0x00, 0x20, 0x13, 0x61, 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, + 0x0c, 0x4b, 0xda, 0x79, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, + 0x5a, 0x70, 0x10, 0xbd, 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, + 0x10, 0xe0, 0x00, 0xe0, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, + 0x00, 0x0c, 0x00, 0x40, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, + 0x21, 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, + 0x51, 0x7e, 0x13, 0x1c, 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, + 0x04, 0x28, 0x13, 0xd8, 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, + 0x5a, 0x78, 0x0f, 0x21, 0x8a, 0x43, 0x00, 0xf0, 0x55, 0xfe, 0x03, 0x05, + 0x09, 0x07, 0x03, 0x00, 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, + 0x02, 0x21, 0x0a, 0x43, 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, + 0x1b, 0x05, 0x0b, 0x43, 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, + 0x02, 0x21, 0x0b, 0x43, 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, + 0xff, 0xff, 0xff, 0xf0, 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, + 0x50, 0x43, 0x27, 0x4b, 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, + 0x46, 0xd0, 0x03, 0x29, 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, + 0x29, 0xfe, 0x02, 0x33, 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, + 0xc3, 0x01, 0x1f, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, + 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, + 0x62, 0x43, 0x98, 0x56, 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, + 0x5b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, + 0x91, 0x40, 0x59, 0x60, 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, + 0x10, 0x48, 0x59, 0x18, 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, + 0x40, 0x30, 0x06, 0x24, 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, + 0x0b, 0x49, 0x52, 0x18, 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x9a, 0x18, 0xc3, 0x01, 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, + 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, + 0x13, 0x18, 0x08, 0x24, 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, + 0x10, 0x4e, 0xd2, 0x01, 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, + 0x86, 0x68, 0xab, 0x40, 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, + 0xbe, 0x41, 0x40, 0x19, 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, + 0x04, 0x26, 0xb4, 0x43, 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, + 0x05, 0x49, 0x52, 0x18, 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, + 0x93, 0x61, 0xf0, 0xbd, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, + 0x08, 0x24, 0xaa, 0x18, 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, + 0x48, 0x1c, 0x00, 0x24, 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xa0, 0xfd, + 0x07, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, + 0x0a, 0x00, 0x01, 0x24, 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, + 0x18, 0x1c, 0x00, 0x21, 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, + 0x02, 0x21, 0xff, 0xf7, 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, + 0x31, 0xd1, 0x18, 0x1c, 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, + 0x18, 0x22, 0x53, 0x43, 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, + 0x14, 0x1c, 0x04, 0x40, 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, + 0x12, 0x4c, 0x1b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, + 0x0f, 0x21, 0x31, 0x40, 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, + 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, + 0x09, 0x4e, 0x0f, 0x27, 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, + 0x9a, 0x18, 0xbe, 0x43, 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, + 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, + 0x06, 0x1c, 0x0d, 0x1c, 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, + 0x9c, 0x42, 0x07, 0xd0, 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, + 0x98, 0x47, 0x01, 0x34, 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, + 0x15, 0x4a, 0x13, 0x68, 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, + 0x00, 0x2b, 0x21, 0xd1, 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, + 0x9a, 0x42, 0x07, 0xd8, 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, + 0xda, 0x60, 0xbf, 0xf3, 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, + 0xc8, 0x07, 0xfb, 0xd5, 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, + 0x52, 0x00, 0x01, 0x43, 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, + 0x1a, 0x7d, 0xd1, 0x07, 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, + 0x70, 0x47, 0xc0, 0x46, 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, + 0x03, 0x02, 0x00, 0x00, 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, + 0x00, 0x40, 0x00, 0x41, 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, + 0xf7, 0xb5, 0x08, 0xac, 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, + 0x6c, 0x1e, 0xa5, 0x41, 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, + 0x27, 0x06, 0x3a, 0x43, 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, + 0x50, 0x68, 0xb5, 0x01, 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, + 0x01, 0x43, 0x0c, 0x43, 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, + 0xc0, 0x25, 0x1c, 0x68, 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, + 0xc0, 0x24, 0xa4, 0x02, 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, + 0x03, 0x68, 0x5a, 0x68, 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, + 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, + 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, + 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, + 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, + 0x1a, 0x7e, 0xd1, 0x07, 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, + 0x70, 0x47, 0x03, 0x68, 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, + 0x18, 0x7e, 0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, + 0xc0, 0x09, 0x70, 0x47, 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, + 0x0a, 0x43, 0x1a, 0x76, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, + 0x18, 0x40, 0x70, 0x47, 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, + 0x03, 0x68, 0x1a, 0x7e, 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, + 0x70, 0xb5, 0x03, 0x68, 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, + 0x1c, 0x68, 0x6d, 0x07, 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, + 0x04, 0x68, 0x51, 0x00, 0x03, 0x48, 0x00, 0xf0, 0x79, 0xfc, 0x01, 0x38, + 0xc0, 0xb2, 0x20, 0x73, 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, + 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, + 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, + 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, + 0x03, 0x68, 0xda, 0x69, 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, + 0x8a, 0x43, 0x1a, 0x60, 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, + 0x52, 0x02, 0x11, 0x43, 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, + 0xfc, 0xd5, 0x98, 0x6a, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, + 0x30, 0xb5, 0x93, 0x42, 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x1f, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, + 0x0e, 0x23, 0x19, 0x22, 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, + 0x0a, 0x23, 0x15, 0x22, 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, + 0x0c, 0x23, 0x17, 0x22, 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, + 0x15, 0x49, 0x01, 0x20, 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, + 0x5b, 0x18, 0x03, 0x20, 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, + 0xe0, 0x00, 0xff, 0x24, 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, + 0x85, 0x40, 0x28, 0x1c, 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, + 0x1a, 0x43, 0x0a, 0x4b, 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, + 0xfb, 0xdb, 0x30, 0xbd, 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, + 0x00, 0x10, 0x00, 0x42, 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, + 0x00, 0x1c, 0x00, 0x42, 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, + 0xf8, 0xb5, 0x04, 0x1c, 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, + 0xa3, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, + 0x0a, 0x40, 0x69, 0x07, 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, + 0x22, 0x68, 0x84, 0x23, 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, + 0x01, 0x2d, 0x00, 0xd1, 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, + 0xc0, 0x00, 0x00, 0xf0, 0xcd, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, + 0x01, 0x40, 0xd2, 0x04, 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, + 0x23, 0x68, 0x00, 0x04, 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, + 0x10, 0x43, 0x98, 0x81, 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, + 0xf7, 0xb5, 0x01, 0x93, 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, + 0x16, 0x1c, 0xff, 0xf7, 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, + 0xbf, 0x07, 0x0c, 0x22, 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, + 0x16, 0x40, 0xc0, 0x22, 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, + 0x01, 0x99, 0x15, 0x40, 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, + 0x80, 0x21, 0x23, 0x68, 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, + 0x01, 0x20, 0x70, 0x47, 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, + 0x98, 0x47, 0x08, 0xbd, 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x00, 0x69, 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, + 0x41, 0xfb, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0x3d, 0xfb, 0x10, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0x4a, 0xfb, 0x08, 0xbd, 0x10, 0xb5, + 0x04, 0x1c, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0x43, 0xfb, 0x00, 0x28, + 0xf9, 0xd1, 0x20, 0x69, 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, + 0x5c, 0x30, 0x00, 0xf0, 0x3f, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x14, 0x35, 0x04, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x23, 0xfb, 0x23, 0x1c, + 0xa8, 0x33, 0x1b, 0x78, 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x2e, 0xfb, 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, + 0xb4, 0x34, 0x1b, 0x68, 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0x2a, 0xfb, 0x08, 0xbd, 0x70, 0xb5, + 0x04, 0x1c, 0x00, 0x69, 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, + 0x5c, 0x35, 0x00, 0x28, 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x0c, 0xfb, + 0x00, 0x28, 0x0c, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x20, 0xfb, 0x00, 0x28, + 0xfa, 0xd1, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xe4, 0xfa, 0x20, 0x69, + 0xff, 0xf7, 0x97, 0xfe, 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, + 0x8b, 0xfe, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x1d, 0x1c, 0x0a, 0xab, 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, + 0x1b, 0x78, 0x16, 0x1c, 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, + 0x02, 0x93, 0x0d, 0xab, 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, + 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, + 0x14, 0x30, 0x00, 0xf0, 0xb1, 0xfa, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, + 0xad, 0xfa, 0x00, 0x9a, 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, + 0x01, 0x9a, 0x20, 0x1c, 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, + 0x03, 0x9a, 0x5d, 0x70, 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0xc8, 0x58, 0x00, 0x00, 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, + 0x05, 0x78, 0x09, 0xa8, 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, + 0x02, 0x90, 0x03, 0x90, 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, + 0x05, 0xb0, 0x30, 0xbd, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0x24, 0xfe, 0x00, 0x28, 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, + 0x25, 0x1c, 0x14, 0x35, 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xfa, + 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x9e, 0xfa, 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, + 0xac, 0x33, 0xb4, 0x32, 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, + 0xff, 0xf7, 0x15, 0xfe, 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, + 0x28, 0x1c, 0x00, 0xf0, 0x85, 0xfa, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x72, 0xfa, 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, + 0x02, 0xe0, 0x20, 0x69, 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, + 0xf3, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, + 0x18, 0x40, 0x30, 0x38, 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, + 0x1b, 0x01, 0x19, 0x40, 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, + 0xc0, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, + 0x05, 0x20, 0x99, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, + 0x00, 0xe0, 0x06, 0x20, 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, + 0x05, 0xd0, 0x02, 0x39, 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, + 0x00, 0xe0, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, + 0x85, 0xb0, 0x03, 0x91, 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, + 0x15, 0x1c, 0xff, 0xf7, 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, + 0x9b, 0xfc, 0x23, 0x1c, 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, + 0x23, 0x1c, 0xb8, 0x33, 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, + 0x08, 0x21, 0xf7, 0x19, 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, + 0xa8, 0x37, 0x38, 0x78, 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, + 0xf9, 0xfb, 0x3b, 0x78, 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, + 0xdb, 0x01, 0x21, 0x1c, 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, + 0xb6, 0x18, 0x5b, 0x18, 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, + 0x01, 0x21, 0x91, 0x40, 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, + 0x1a, 0x60, 0x01, 0x21, 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, + 0x31, 0xfe, 0x29, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, + 0x07, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, + 0x20, 0x69, 0x01, 0x22, 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, + 0x19, 0x78, 0x01, 0x3b, 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, + 0x3f, 0x20, 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, + 0x07, 0x33, 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, + 0x08, 0xb5, 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, + 0x08, 0xb5, 0x00, 0x69, 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, + 0x38, 0xb5, 0x0d, 0x1c, 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, + 0x2a, 0x1c, 0x00, 0xf0, 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x38, 0xbd, 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, + 0x04, 0xd1, 0x03, 0x68, 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, + 0x18, 0x1c, 0x10, 0xbd, 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, + 0x13, 0x68, 0x59, 0x1c, 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, + 0x18, 0x1c, 0x03, 0xe0, 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, + 0x89, 0x00, 0x99, 0x60, 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, + 0x04, 0x49, 0x5a, 0x60, 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, + 0x30, 0x09, 0x00, 0x20, 0x00, 0x59, 0x00, 0x00, 0xf0, 0x0c, 0x00, 0x20, + 0x08, 0xb5, 0x08, 0x4b, 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, + 0x03, 0x68, 0x9b, 0x68, 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, + 0x49, 0x01, 0x59, 0x18, 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, + 0xd4, 0x0c, 0x00, 0x20, 0xf4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, + 0xff, 0xf7, 0xe6, 0xff, 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, + 0x1b, 0x68, 0x08, 0x31, 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, + 0x5b, 0x42, 0x13, 0x43, 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, + 0xf4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, + 0x43, 0x18, 0x9a, 0x68, 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, + 0x14, 0x1c, 0x9a, 0x68, 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, + 0x92, 0x03, 0x22, 0x43, 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, + 0x9a, 0x60, 0x41, 0x18, 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, + 0xf4, 0x0c, 0x00, 0x20, 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x06, 0x1c, 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, + 0x27, 0x4b, 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, + 0x02, 0x99, 0x5b, 0x68, 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, + 0xff, 0xf7, 0x9e, 0xff, 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, + 0xff, 0xf7, 0x98, 0xff, 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, + 0xbf, 0xff, 0x1c, 0x4f, 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, + 0x03, 0x92, 0x8b, 0x18, 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, + 0x17, 0x49, 0x5a, 0x72, 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, + 0x00, 0xf0, 0xb5, 0xf9, 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, + 0xff, 0xf7, 0x7a, 0xff, 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, + 0x08, 0x33, 0x5b, 0x01, 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, + 0x19, 0x71, 0x01, 0x21, 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, + 0x9a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x00, 0xe0, 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0xf8, 0x0d, 0x00, 0x20, 0xd4, 0x0c, 0x00, 0x20, 0xf4, 0x0c, 0x00, 0x20, + 0x14, 0x0b, 0x00, 0x20, 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, + 0x01, 0x23, 0xff, 0xf7, 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, + 0x3a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, + 0x60, 0xd0, 0x80, 0x23, 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, + 0x00, 0x92, 0x00, 0x2c, 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, + 0x01, 0x93, 0x3b, 0x1c, 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, + 0x9b, 0x79, 0xdb, 0x09, 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, + 0x00, 0xf0, 0xc2, 0xf8, 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, + 0xbd, 0xf8, 0x3b, 0x1c, 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, + 0xdb, 0x79, 0x9a, 0x07, 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, + 0x38, 0xd1, 0x42, 0x1e, 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, + 0x24, 0x4b, 0x00, 0x22, 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, + 0x3f, 0x25, 0x22, 0x4a, 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, + 0x2a, 0x1c, 0x03, 0x93, 0x00, 0xf0, 0x35, 0xf9, 0x18, 0x4a, 0x7b, 0x01, + 0xd3, 0x18, 0x03, 0x9a, 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, + 0x92, 0x0b, 0x92, 0x03, 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, + 0x08, 0x33, 0x5b, 0x01, 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, + 0x80, 0x22, 0x52, 0x42, 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, + 0x5b, 0x19, 0x52, 0x19, 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, + 0x00, 0x98, 0x0b, 0xe0, 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, + 0x7b, 0x01, 0xed, 0x18, 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, + 0xab, 0x61, 0x40, 0x42, 0x05, 0xb0, 0xf0, 0xbd, 0xf8, 0x0d, 0x00, 0x20, + 0xf4, 0x0c, 0x00, 0x20, 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, + 0x70, 0x11, 0x01, 0x00, 0x4c, 0x09, 0x00, 0x20, 0x54, 0x09, 0x00, 0x20, + 0x01, 0x4a, 0x02, 0x4b, 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, + 0xf4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, + 0x00, 0xf0, 0xf2, 0xf8, 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, + 0x10, 0xbd, 0x02, 0x6c, 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, + 0x44, 0x6c, 0xa3, 0x42, 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, + 0x00, 0x23, 0x03, 0x64, 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, + 0x93, 0x42, 0x06, 0xd0, 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, + 0x43, 0x64, 0x10, 0x1c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, + 0x02, 0x6c, 0x43, 0x6c, 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, + 0x03, 0x6c, 0x40, 0x6c, 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, + 0x01, 0xe0, 0xc0, 0x1a, 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, + 0x93, 0x42, 0x01, 0xd0, 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x02, 0x6c, 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, + 0xd0, 0x1a, 0x43, 0x42, 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, + 0x02, 0xb4, 0x71, 0x46, 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, + 0x8e, 0x44, 0x02, 0xbc, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, + 0x01, 0x23, 0x00, 0x22, 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, + 0x24, 0x07, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, + 0x1b, 0x01, 0xf8, 0xe7, 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, + 0x02, 0xd2, 0x49, 0x00, 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, + 0x40, 0x1a, 0x1a, 0x43, 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x5c, 0x08, 0x22, 0x43, 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x9c, 0x08, 0x22, 0x43, 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0xdc, 0x08, 0x22, 0x43, 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, + 0x09, 0x09, 0xe3, 0xe7, 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, + 0x01, 0xd0, 0x00, 0x20, 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, + 0x40, 0x18, 0x02, 0x90, 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, + 0x00, 0x29, 0xf0, 0xd0, 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, + 0x42, 0x43, 0x89, 0x1a, 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0xb5, 0x0e, 0x4b, 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, + 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, + 0x01, 0x34, 0xf8, 0xe7, 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, + 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, + 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, + 0x98, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, + 0x00, 0xf0, 0x76, 0xf8, 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, + 0x93, 0x42, 0x08, 0xd0, 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, + 0x24, 0x78, 0xa5, 0x42, 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, + 0x30, 0xbd, 0x10, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, + 0xc4, 0x54, 0x01, 0x33, 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, + 0x93, 0x42, 0x02, 0xd0, 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, + 0x30, 0xb5, 0x00, 0x29, 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, + 0x00, 0xda, 0xc9, 0x18, 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, + 0x02, 0xd1, 0x4b, 0x60, 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, + 0x08, 0x68, 0x0a, 0x18, 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, + 0xc0, 0x18, 0x08, 0x60, 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, + 0x24, 0xe0, 0x8a, 0x42, 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, + 0xf9, 0xd1, 0x1d, 0x68, 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, + 0x69, 0x18, 0x58, 0x18, 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, + 0x52, 0x68, 0x09, 0x19, 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, + 0x02, 0xd9, 0x0c, 0x23, 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, + 0x94, 0x42, 0x03, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, + 0x4a, 0x60, 0x59, 0x60, 0x30, 0xbd, 0xc0, 0x46, 0x00, 0x0e, 0x00, 0x20, + 0x70, 0xb5, 0x03, 0x23, 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, + 0x0c, 0x2d, 0x01, 0xd2, 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, + 0x8d, 0x42, 0x3d, 0xd3, 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, + 0x00, 0x29, 0x13, 0xd0, 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, + 0x02, 0xd9, 0x0b, 0x60, 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, + 0x63, 0x68, 0x13, 0x60, 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, + 0x16, 0xe0, 0x0c, 0x1c, 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, + 0x00, 0x28, 0x03, 0xd1, 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, + 0x30, 0x1c, 0x29, 0x1c, 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, + 0xc4, 0x1c, 0x03, 0x23, 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, + 0x20, 0x1c, 0x0b, 0x30, 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, + 0x0b, 0xd0, 0x5a, 0x42, 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, + 0x00, 0xf0, 0x0a, 0xf8, 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, + 0x00, 0x20, 0x70, 0xbd, 0x00, 0x0e, 0x00, 0x20, 0xfc, 0x0d, 0x00, 0x20, + 0x38, 0xb5, 0x07, 0x4c, 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, + 0x00, 0xf0, 0x2a, 0xf8, 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x2b, 0x60, 0x38, 0xbd, 0xc0, 0x46, 0x08, 0x0e, 0x00, 0x20, + 0xc9, 0xb2, 0x03, 0x78, 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, + 0x01, 0x30, 0xf8, 0xe7, 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, + 0x30, 0xb5, 0x03, 0x1c, 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, + 0x5d, 0x1e, 0x01, 0x3a, 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, + 0x9a, 0x18, 0x93, 0x42, 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, + 0xf9, 0xe7, 0x30, 0xbd, 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, + 0x18, 0x18, 0x69, 0x46, 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, + 0x70, 0x47, 0x05, 0x4b, 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, + 0xf8, 0xe7, 0x03, 0x4b, 0x13, 0x60, 0xef, 0xe7, 0x04, 0x0e, 0x00, 0x20, + 0x08, 0x0e, 0x00, 0x20, 0x0c, 0x0e, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x2e, 0x42, 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, + 0x33, 0x22, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, + 0x61, 0x23, 0x00, 0x00, 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, + 0x3f, 0x2f, 0x5b, 0x5d, 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x34, 0x00, 0x00, 0xe5, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, + 0x1d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x07, 0x45, 0x00, 0x00, 0xe5, 0x40, 0x00, 0x00, 0xbf, 0x44, 0x00, 0x00, + 0xa7, 0x44, 0x00, 0x00, 0x9d, 0x44, 0x00, 0x00, 0xc9, 0x44, 0x00, 0x00, + 0xfd, 0x44, 0x00, 0x00, 0x71, 0x44, 0x00, 0x00, 0xb5, 0x46, 0x00, 0x00, + 0x81, 0x44, 0x00, 0x00, 0x6d, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xad, 0x47, 0x00, 0x00, + 0xd9, 0x47, 0x00, 0x00, 0xa9, 0x47, 0x00, 0x00, 0xcd, 0x47, 0x00, 0x00, + 0xc1, 0x47, 0x00, 0x00, 0x11, 0x48, 0x00, 0x00, 0xf5, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x2c, 0x59, 0x00, 0x00, + 0x4c, 0x59, 0x00, 0x00, 0x6c, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x28, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xfd, 0x3a, 0x00, 0x00, + 0x35, 0x48, 0x00, 0x00, 0xd9, 0x4a, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkrwifi1010.h b/sparkfun/samd/libraries/SDU/src/boot/mkrwifi1010.h new file mode 100644 index 00000000..d52b94c7 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkrwifi1010.h @@ -0,0 +1,1236 @@ + 0x00, 0x80, 0x00, 0x20, 0xb9, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0x0d, 0x3c, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa5, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xf1, 0x3a, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xe1, 0x3a, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, + 0xa1, 0x3b, 0x00, 0x00, 0xa1, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x44, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x57, 0xfe, 0x02, 0xf0, + 0xbf, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x80, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0x3c, 0x4f, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0x05, 0xfd, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0x21, 0xfd, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0xe6, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0x48, 0x4f, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0x48, 0x4f, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0xb2, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x90, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x90, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x90, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x80, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x78, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x90, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0x70, 0x4f, 0x00, 0x00, 0x90, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x90, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x45, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x25, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0x0a, 0xfa, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xf6, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xef, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0xab, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x24, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x7a, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x7c, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x4a, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0x12, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0x0a, 0xf9, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x51, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0x72, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xf2, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0xe3, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0xd5, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0x88, 0x4f, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0xa0, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x3a, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x63, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x86, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x22, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x1a, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0x13, 0xfb, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x3d, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x10, 0x4b, 0x11, 0x4a, + 0x11, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x10, 0x4b, + 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x99, 0x71, 0x08, 0x21, + 0x59, 0x71, 0x03, 0x21, 0x5a, 0x72, 0xda, 0x71, 0x19, 0x72, 0x0b, 0x4b, + 0x5a, 0x72, 0x0b, 0x4a, 0xd9, 0x71, 0x1a, 0x60, 0x1b, 0x22, 0x1a, 0x71, + 0x1d, 0x22, 0x9a, 0x71, 0x1a, 0x22, 0x5a, 0x71, 0x01, 0x22, 0x1a, 0x72, + 0x70, 0x47, 0xc0, 0x46, 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, + 0x18, 0x09, 0x00, 0x20, 0x78, 0x07, 0x00, 0x20, 0x88, 0x07, 0x00, 0x20, + 0x1c, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x08, 0xfe, + 0x08, 0xbd, 0xc0, 0x46, 0x98, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0x00, 0xf0, 0x00, 0xfe, 0x08, 0xbd, 0xc0, 0x46, 0x54, 0x08, 0x00, 0x20, + 0x7f, 0xb5, 0x19, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x41, 0xfb, 0x19, 0x49, + 0x19, 0x48, 0x00, 0xf0, 0x3d, 0xfb, 0x19, 0x4c, 0x19, 0x49, 0x20, 0x1c, + 0x00, 0xf0, 0x38, 0xfb, 0x18, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x34, 0xfb, + 0x18, 0x49, 0x19, 0x48, 0x00, 0xf0, 0x30, 0xfb, 0x18, 0x4e, 0x19, 0x49, + 0x30, 0x1c, 0x00, 0xf0, 0x2b, 0xfb, 0x01, 0x25, 0x03, 0x23, 0x31, 0x1c, + 0x00, 0x93, 0x01, 0x95, 0x0d, 0x22, 0x0e, 0x23, 0x14, 0x48, 0x00, 0xf0, + 0xf7, 0xfc, 0x02, 0x23, 0x01, 0x93, 0x1c, 0x23, 0x02, 0x93, 0x1d, 0x23, + 0x00, 0x95, 0x03, 0x93, 0x21, 0x1c, 0x1b, 0x22, 0x1a, 0x23, 0x0f, 0x48, + 0x00, 0xf0, 0xac, 0xfc, 0x7f, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x14, 0x09, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x18, 0x09, 0x00, 0x20, + 0x1c, 0x09, 0x00, 0x20, 0x00, 0x10, 0x00, 0x42, 0x00, 0x14, 0x00, 0x42, + 0x10, 0x09, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x20, 0x09, 0x00, 0x20, + 0x24, 0x09, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x98, 0x07, 0x00, 0x20, + 0x54, 0x08, 0x00, 0x20, 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, + 0x1b, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, + 0x28, 0x09, 0x00, 0x20, 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, + 0x04, 0xd1, 0x00, 0xf0, 0x4f, 0xf8, 0xfe, 0xf7, 0xa5, 0xfa, 0x0b, 0xe0, + 0x0c, 0x4d, 0x8d, 0x42, 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, + 0xa2, 0x42, 0x04, 0xd2, 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, + 0xfe, 0xe7, 0x90, 0x42, 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, + 0xe7, 0xd2, 0x00, 0x22, 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, + 0xa0, 0x00, 0x00, 0x20, 0x48, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, + 0x0c, 0x0e, 0x00, 0x20, 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0xf0, 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, + 0x70, 0x47, 0xc0, 0x46, 0x2c, 0x09, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, + 0x08, 0xd0, 0x05, 0x4b, 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, + 0x33, 0x68, 0x5b, 0x1b, 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, + 0x2c, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, + 0x1a, 0x60, 0x00, 0xf0, 0x61, 0xfa, 0x08, 0xbd, 0x2c, 0x09, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, + 0x1e, 0x21, 0x53, 0x68, 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, + 0x53, 0x60, 0x8b, 0x69, 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, + 0x45, 0x4b, 0x9c, 0x82, 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, + 0xda, 0x68, 0x94, 0x07, 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, + 0x14, 0x78, 0xe5, 0x07, 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xf7, 0xdb, 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xfb, 0xdb, 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, + 0x65, 0x80, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, + 0x9c, 0x84, 0xdc, 0x68, 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, + 0xe5, 0x62, 0xdd, 0x68, 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x2e, 0x4e, 0x35, 0x43, 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, + 0xfb, 0xd5, 0xa5, 0x8c, 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, + 0x25, 0x06, 0xfc, 0xd5, 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, + 0xdc, 0x68, 0xe5, 0x06, 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, + 0x55, 0x78, 0x1c, 0x4c, 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, + 0x1e, 0x4d, 0x35, 0x40, 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, + 0x1d, 0x62, 0x03, 0x23, 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, + 0x4b, 0x72, 0x8b, 0x72, 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, + 0x16, 0x4b, 0x17, 0x4a, 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, + 0x21, 0x40, 0x11, 0x43, 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, + 0x13, 0x43, 0x12, 0x4a, 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, + 0x43, 0x60, 0x70, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, + 0x0c, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x01, 0x05, 0x01, 0x00, 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, + 0x00, 0x07, 0x03, 0x00, 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, + 0x00, 0x6c, 0xdc, 0x02, 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, + 0x20, 0x60, 0x80, 0x00, 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, + 0x18, 0x68, 0x10, 0xb5, 0x89, 0x00, 0x00, 0xf0, 0x13, 0xff, 0x2f, 0x4b, + 0x01, 0x38, 0x98, 0x42, 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, + 0x18, 0x6a, 0xc0, 0x21, 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, + 0x19, 0x62, 0x00, 0x24, 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, + 0x80, 0x22, 0x09, 0x02, 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, + 0x25, 0x4b, 0xfc, 0x21, 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, + 0xfc, 0x22, 0x92, 0x01, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, + 0xd2, 0x02, 0x0a, 0x43, 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, + 0x00, 0x21, 0x01, 0x34, 0x00, 0xf0, 0x70, 0xf8, 0x0f, 0x2c, 0xf8, 0xd1, + 0x1a, 0x4c, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, + 0x63, 0x80, 0x19, 0x4b, 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, + 0xe4, 0x22, 0xd2, 0x00, 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, + 0x13, 0x4a, 0xc9, 0x09, 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, + 0x00, 0x20, 0x13, 0x61, 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, + 0x0c, 0x4b, 0xda, 0x79, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, + 0x5a, 0x70, 0x10, 0xbd, 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, + 0x10, 0xe0, 0x00, 0xe0, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, + 0x00, 0x0c, 0x00, 0x40, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, + 0x21, 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, + 0x51, 0x7e, 0x13, 0x1c, 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, + 0x04, 0x28, 0x13, 0xd8, 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, + 0x5a, 0x78, 0x0f, 0x21, 0x8a, 0x43, 0x00, 0xf0, 0x85, 0xfe, 0x03, 0x05, + 0x09, 0x07, 0x03, 0x00, 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, + 0x02, 0x21, 0x0a, 0x43, 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, + 0x1b, 0x05, 0x0b, 0x43, 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, + 0x02, 0x21, 0x0b, 0x43, 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, + 0xff, 0xff, 0xff, 0xf0, 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, + 0x50, 0x43, 0x27, 0x4b, 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, + 0x46, 0xd0, 0x03, 0x29, 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, + 0x59, 0xfe, 0x02, 0x33, 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, + 0xc3, 0x01, 0x1f, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, + 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, + 0x62, 0x43, 0x98, 0x56, 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, + 0x5b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, + 0x91, 0x40, 0x59, 0x60, 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, + 0x10, 0x48, 0x59, 0x18, 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, + 0x40, 0x30, 0x06, 0x24, 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, + 0x0b, 0x49, 0x52, 0x18, 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x9a, 0x18, 0xc3, 0x01, 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, + 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, + 0x13, 0x18, 0x08, 0x24, 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, + 0x10, 0x4e, 0xd2, 0x01, 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, + 0x86, 0x68, 0xab, 0x40, 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, + 0xbe, 0x41, 0x40, 0x19, 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, + 0x04, 0x26, 0xb4, 0x43, 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, + 0x05, 0x49, 0x52, 0x18, 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, + 0x93, 0x61, 0xf0, 0xbd, 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, + 0x08, 0x24, 0xaa, 0x18, 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, + 0x48, 0x1c, 0x00, 0x24, 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xd0, 0xfd, + 0x07, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, + 0x0a, 0x00, 0x01, 0x24, 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, + 0x18, 0x1c, 0x00, 0x21, 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, + 0x02, 0x21, 0xff, 0xf7, 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, + 0x31, 0xd1, 0x18, 0x1c, 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, + 0x18, 0x22, 0x53, 0x43, 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, + 0x14, 0x1c, 0x04, 0x40, 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, + 0x12, 0x4c, 0x1b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, + 0x0f, 0x21, 0x31, 0x40, 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, + 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, + 0x09, 0x4e, 0x0f, 0x27, 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, + 0x9a, 0x18, 0xbe, 0x43, 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, + 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, + 0x06, 0x1c, 0x0d, 0x1c, 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, + 0x9c, 0x42, 0x07, 0xd0, 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, + 0x98, 0x47, 0x01, 0x34, 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, + 0x15, 0x4a, 0x13, 0x68, 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, + 0x00, 0x2b, 0x21, 0xd1, 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, + 0x9a, 0x42, 0x07, 0xd8, 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, + 0xda, 0x60, 0xbf, 0xf3, 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, + 0xc8, 0x07, 0xfb, 0xd5, 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, + 0x52, 0x00, 0x01, 0x43, 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, + 0x1a, 0x7d, 0xd1, 0x07, 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, + 0x70, 0x47, 0xc0, 0x46, 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, + 0x03, 0x02, 0x00, 0x00, 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, + 0x00, 0x40, 0x00, 0x41, 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, + 0xf7, 0xb5, 0x08, 0xac, 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, + 0x6c, 0x1e, 0xa5, 0x41, 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, + 0x27, 0x06, 0x3a, 0x43, 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, + 0x50, 0x68, 0xb5, 0x01, 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, + 0x01, 0x43, 0x0c, 0x43, 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, + 0xc0, 0x25, 0x1c, 0x68, 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, + 0xc0, 0x24, 0xa4, 0x02, 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, + 0x03, 0x68, 0x5a, 0x68, 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, + 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, + 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, + 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, + 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, + 0x1a, 0x7e, 0xd1, 0x07, 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, + 0x70, 0x47, 0x03, 0x68, 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, + 0x18, 0x7e, 0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, + 0xc0, 0x09, 0x70, 0x47, 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, + 0x0a, 0x43, 0x1a, 0x76, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, + 0x18, 0x40, 0x70, 0x47, 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, + 0x03, 0x68, 0x1a, 0x7e, 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x22, 0x9a, 0x75, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x03, 0x68, + 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, 0x1c, 0x68, 0x6d, 0x07, + 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, 0x04, 0x68, 0x51, 0x00, + 0x03, 0x48, 0x00, 0xf0, 0xab, 0xfc, 0x01, 0x38, 0xc0, 0xb2, 0x20, 0x73, + 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, 0x03, 0x68, 0x01, 0x21, + 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, + 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, + 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0xda, 0x69, + 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, 0x8a, 0x43, 0x1a, 0x60, + 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, 0x52, 0x02, 0x11, 0x43, + 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, 0xfc, 0xd5, 0x98, 0x6a, + 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, 0x30, 0xb5, 0x93, 0x42, + 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, 0x0e, 0x23, 0x19, 0x22, + 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, 0x0a, 0x23, 0x15, 0x22, + 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, 0x0c, 0x23, 0x17, 0x22, + 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, 0x15, 0x49, 0x01, 0x20, + 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, 0x5b, 0x18, 0x03, 0x20, + 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, 0xe0, 0x00, 0xff, 0x24, + 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, 0x85, 0x40, 0x28, 0x1c, + 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, 0x1a, 0x43, 0x0a, 0x4b, + 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, 0xfb, 0xdb, 0x30, 0xbd, + 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, 0x00, 0x10, 0x00, 0x42, + 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, 0x00, 0x1c, 0x00, 0x42, + 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, 0xf8, 0xb5, 0x04, 0x1c, + 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, 0xa3, 0xff, 0x20, 0x1c, + 0xff, 0xf7, 0x0d, 0xff, 0xb1, 0x00, 0x1c, 0x22, 0x0a, 0x40, 0x69, 0x07, + 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, 0x22, 0x68, 0x84, 0x23, + 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, 0x01, 0x2d, 0x00, 0xd1, + 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, 0xc0, 0x00, 0x00, 0xf0, + 0xff, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, 0x01, 0x40, 0xd2, 0x04, + 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, 0x23, 0x68, 0x00, 0x04, + 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, 0x10, 0x43, 0x98, 0x81, + 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, 0xf7, 0xb5, 0x01, 0x93, + 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, 0x16, 0x1c, 0xff, 0xf7, + 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, 0xbf, 0x07, 0x0c, 0x22, + 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, 0x16, 0x40, 0xc0, 0x22, + 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, 0x01, 0x99, 0x15, 0x40, + 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, 0x80, 0x21, 0x23, 0x68, + 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, 0x01, 0x20, 0x70, 0x47, + 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, 0x98, 0x47, 0x08, 0xbd, + 0x13, 0x04, 0x00, 0x00, 0x82, 0x6d, 0x43, 0x6d, 0x9a, 0x42, 0x03, 0xd0, + 0x83, 0x6d, 0xc0, 0x18, 0x00, 0x7d, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, 0xa3, 0xfe, + 0x00, 0x23, 0x22, 0x1c, 0x63, 0x65, 0x9c, 0x32, 0xa3, 0x65, 0xa0, 0x34, + 0x13, 0x60, 0x23, 0x60, 0x10, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x87, 0xb0, + 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x00, 0x25, 0x02, 0x93, 0x0d, 0xab, + 0x1b, 0x78, 0x40, 0x26, 0x03, 0x93, 0x0e, 0xab, 0x1b, 0x78, 0x04, 0x1c, + 0x04, 0x93, 0x0f, 0xab, 0x1b, 0x78, 0x0f, 0x1c, 0x05, 0x93, 0xfa, 0x23, + 0x9b, 0x00, 0x83, 0x60, 0x12, 0x4b, 0x00, 0x92, 0x08, 0x33, 0x03, 0x60, + 0x45, 0x60, 0x29, 0x1c, 0x32, 0x1c, 0x14, 0x30, 0x00, 0xf0, 0x24, 0xfc, + 0x20, 0x1c, 0x65, 0x65, 0x32, 0x1c, 0xa5, 0x65, 0x29, 0x1c, 0x5c, 0x30, + 0x00, 0xf0, 0x1c, 0xfc, 0x00, 0x9a, 0x23, 0x1c, 0x9c, 0x33, 0x1d, 0x60, + 0x5d, 0x60, 0x27, 0x61, 0x1a, 0x72, 0x01, 0x9a, 0x20, 0x1c, 0x5a, 0x72, + 0x02, 0x9a, 0x9a, 0x72, 0x03, 0x9a, 0xda, 0x72, 0x04, 0x9a, 0x1a, 0x73, + 0x05, 0x9a, 0x1a, 0x77, 0x07, 0xb0, 0xf0, 0xbd, 0x80, 0x58, 0x00, 0x00, + 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, 0x05, 0x78, 0x09, 0xa8, + 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, 0x02, 0x90, 0x03, 0x90, + 0x20, 0x1c, 0xff, 0xf7, 0xb3, 0xff, 0x20, 0x1c, 0x05, 0xb0, 0x30, 0xbd, + 0xf0, 0x23, 0x08, 0x1c, 0x18, 0x40, 0x30, 0x38, 0x43, 0x42, 0x58, 0x41, + 0x70, 0x47, 0xf0, 0x23, 0x1b, 0x01, 0x19, 0x40, 0x80, 0x23, 0x9b, 0x00, + 0x99, 0x42, 0x0c, 0xd0, 0xc0, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x06, 0xd0, + 0x80, 0x23, 0x5b, 0x00, 0x05, 0x20, 0x99, 0x42, 0x04, 0xd0, 0x00, 0x20, + 0x02, 0xe0, 0x07, 0x20, 0x00, 0xe0, 0x06, 0x20, 0x70, 0x47, 0x0f, 0x23, + 0x19, 0x40, 0x01, 0x29, 0x05, 0xd0, 0x02, 0x39, 0x4b, 0x42, 0x4b, 0x41, + 0x02, 0x20, 0xc0, 0x1a, 0x00, 0xe0, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, + 0xf0, 0xb5, 0x03, 0x1c, 0x85, 0xb0, 0x03, 0x91, 0xa4, 0x33, 0x04, 0x1c, + 0x18, 0x27, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, 0x34, 0x4e, 0x08, 0x21, + 0xf3, 0x18, 0x59, 0x56, 0x15, 0x1c, 0xff, 0xf7, 0x2d, 0xfd, 0x23, 0x1c, + 0xa5, 0x33, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, 0x08, 0x21, 0xf3, 0x18, + 0x59, 0x56, 0xff, 0xf7, 0x23, 0xfd, 0x23, 0x1c, 0xa7, 0x33, 0x1b, 0x78, + 0x02, 0x2b, 0x0a, 0xd1, 0x23, 0x1c, 0xb8, 0x33, 0x18, 0x78, 0xff, 0x28, + 0x05, 0xd0, 0x47, 0x43, 0x08, 0x21, 0xf7, 0x19, 0x79, 0x56, 0xff, 0xf7, + 0x13, 0xfd, 0x27, 0x1c, 0xa8, 0x37, 0x38, 0x78, 0xff, 0x28, 0x1a, 0xd0, + 0x01, 0x21, 0xff, 0xf7, 0x81, 0xfc, 0x3b, 0x78, 0x18, 0x22, 0x5a, 0x43, + 0xb3, 0x56, 0x1f, 0x4f, 0xdb, 0x01, 0x21, 0x1c, 0xac, 0x31, 0xd8, 0x19, + 0x08, 0x60, 0x1d, 0x49, 0xb6, 0x18, 0x5b, 0x18, 0x21, 0x1c, 0x72, 0x68, + 0xb0, 0x31, 0x0b, 0x60, 0x01, 0x21, 0x91, 0x40, 0x0a, 0x1c, 0x21, 0x1c, + 0xb4, 0x31, 0x0a, 0x60, 0x1a, 0x60, 0x01, 0x21, 0x0a, 0x1c, 0x03, 0x9b, + 0x20, 0x69, 0xff, 0xf7, 0xb7, 0xfe, 0x29, 0x1c, 0x20, 0x1c, 0xff, 0xf7, + 0x88, 0xff, 0x29, 0x1c, 0x07, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x99, 0xff, + 0x29, 0x1c, 0x06, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x77, 0xff, 0x39, 0x1c, + 0x00, 0x90, 0x33, 0x1c, 0x20, 0x69, 0x01, 0x22, 0xff, 0xf7, 0x8a, 0xfd, + 0x23, 0x1c, 0xa7, 0x33, 0x19, 0x78, 0x01, 0x3b, 0x1a, 0x78, 0x20, 0x69, + 0xff, 0xf7, 0x9e, 0xfd, 0x20, 0x69, 0xff, 0xf7, 0xbc, 0xfd, 0x05, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x18, 0x44, 0x00, 0x41, + 0x14, 0x44, 0x00, 0x41, 0x02, 0x6c, 0x43, 0x6c, 0xd0, 0x1a, 0x00, 0xd5, + 0x40, 0x30, 0x70, 0x47, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x1c, 0x5c, 0x30, + 0xff, 0xf7, 0xf4, 0xff, 0x00, 0x28, 0xf9, 0xd1, 0x20, 0x69, 0xff, 0xf7, + 0xac, 0xfd, 0x10, 0xbd, 0x08, 0xb5, 0x14, 0x30, 0xff, 0xf7, 0xea, 0xff, + 0x08, 0xbd, 0x02, 0x6c, 0x43, 0x6c, 0x9a, 0x42, 0x04, 0xdb, 0x03, 0x6c, + 0x40, 0x6c, 0xc0, 0x1a, 0x3f, 0x30, 0x03, 0xe0, 0x42, 0x6c, 0x03, 0x6c, + 0xd0, 0x1a, 0x01, 0x38, 0x70, 0x47, 0x08, 0xb5, 0x5c, 0x30, 0xff, 0xf7, + 0xee, 0xff, 0x08, 0xbd, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0x9a, 0xfd, 0x00, 0x28, 0x1f, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xaa, 0xfd, + 0x63, 0x6d, 0x3f, 0x22, 0x01, 0x33, 0x13, 0x40, 0xa2, 0x6d, 0x93, 0x42, + 0x03, 0xd0, 0x62, 0x6d, 0xa2, 0x18, 0x10, 0x75, 0x63, 0x65, 0x23, 0x1c, + 0xa8, 0x33, 0x1b, 0x78, 0xff, 0x2b, 0x0c, 0xd0, 0x20, 0x1c, 0x14, 0x30, + 0xff, 0xf7, 0xcf, 0xff, 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, + 0xac, 0x33, 0xb4, 0x32, 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, + 0xff, 0xf7, 0x85, 0xfd, 0x00, 0x28, 0x20, 0xd0, 0x25, 0x1c, 0x5c, 0x35, + 0x28, 0x1c, 0xff, 0xf7, 0xa5, 0xff, 0x03, 0x1c, 0x20, 0x69, 0x00, 0x2b, + 0x15, 0xd0, 0x23, 0x1c, 0x22, 0x1c, 0xa0, 0x33, 0x9c, 0x32, 0x19, 0x68, + 0x12, 0x68, 0x91, 0x42, 0x07, 0xd0, 0x1a, 0x68, 0xa9, 0x5c, 0x1a, 0x68, + 0x3f, 0x25, 0x01, 0x32, 0x2a, 0x40, 0x1a, 0x60, 0x01, 0xe0, 0x01, 0x21, + 0x49, 0x42, 0xc9, 0xb2, 0xff, 0xf7, 0x6e, 0xfd, 0x01, 0xe0, 0xff, 0xf7, + 0x76, 0xfd, 0x20, 0x69, 0xff, 0xf7, 0x54, 0xfd, 0x00, 0x28, 0x05, 0xd0, + 0x20, 0x69, 0xff, 0xf7, 0x53, 0xfd, 0x20, 0x69, 0xff, 0xf7, 0x43, 0xfd, + 0x38, 0xbd, 0x00, 0x00, 0x70, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0x0d, 0x1c, + 0xff, 0xf7, 0x4f, 0xfd, 0x00, 0x28, 0x0f, 0xd0, 0x20, 0x1c, 0x5c, 0x30, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0x40, 0xd0, 0x08, 0xe0, 0xef, 0xf3, + 0x10, 0x83, 0xda, 0x07, 0x23, 0xd4, 0x21, 0x4b, 0x5a, 0x68, 0xd2, 0x05, + 0xd2, 0x0d, 0x0b, 0xd1, 0x23, 0x1c, 0x9c, 0x33, 0x21, 0x1c, 0x1e, 0x68, + 0xa0, 0x31, 0x0a, 0x68, 0x01, 0x36, 0x3f, 0x20, 0x06, 0x40, 0x96, 0x42, + 0xeb, 0xd0, 0x1b, 0xe0, 0x10, 0x3a, 0xd2, 0xb2, 0x53, 0xb2, 0x00, 0x2b, + 0x08, 0xda, 0x0f, 0x23, 0x1a, 0x40, 0x08, 0x3a, 0x15, 0x4b, 0x92, 0x08, + 0x92, 0x00, 0xd2, 0x18, 0x53, 0x68, 0x04, 0xe0, 0x9b, 0x08, 0xc0, 0x33, + 0x12, 0x4a, 0x9b, 0x00, 0x9b, 0x58, 0x20, 0x69, 0xff, 0xf7, 0x1b, 0xfd, + 0x00, 0x28, 0xdb, 0xd0, 0x20, 0x1c, 0xff, 0xf7, 0x67, 0xff, 0xd7, 0xe7, + 0x1a, 0x68, 0x09, 0x68, 0x01, 0x32, 0x02, 0x40, 0x8a, 0x42, 0x04, 0xd0, + 0x19, 0x68, 0x20, 0x1c, 0x5c, 0x30, 0x45, 0x54, 0x1a, 0x60, 0x20, 0x69, + 0xff, 0xf7, 0x17, 0xfd, 0x03, 0xe0, 0x20, 0x69, 0x29, 0x1c, 0xff, 0xf7, + 0x0b, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0xc0, 0x46, 0x00, 0xed, 0x00, 0xe0, + 0x18, 0xed, 0x00, 0xe0, 0x00, 0xe1, 0x00, 0xe0, 0x38, 0xb5, 0x82, 0x6d, + 0x43, 0x6d, 0x04, 0x1c, 0x9a, 0x42, 0x08, 0xd0, 0x83, 0x6d, 0x3f, 0x22, + 0xc3, 0x18, 0x1d, 0x7d, 0x83, 0x6d, 0x01, 0x33, 0x13, 0x40, 0x83, 0x65, + 0x01, 0xe0, 0x01, 0x25, 0x6d, 0x42, 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, + 0xff, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x14, 0x30, 0xff, 0xf7, 0x1d, 0xff, + 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, 0xb4, 0x34, 0x1b, 0x68, + 0x22, 0x68, 0x1a, 0x60, 0x28, 0x1c, 0x38, 0xbd, 0x3f, 0x20, 0x70, 0x47, + 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, 0x54, 0x68, + 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, 0x38, 0xb5, 0x0d, 0x1c, + 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, 0x2a, 0x1c, 0x00, 0xf0, + 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, 0x63, 0x60, 0x38, 0xbd, + 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, 0x04, 0xd1, 0x03, 0x68, + 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, 0x18, 0x1c, 0x10, 0xbd, + 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, 0x13, 0x68, 0x59, 0x1c, + 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, 0x18, 0x1c, 0x03, 0xe0, + 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, 0x89, 0x00, 0x99, 0x60, + 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, 0x04, 0x49, 0x5a, 0x60, + 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, 0x30, 0x09, 0x00, 0x20, + 0xb8, 0x58, 0x00, 0x00, 0xf0, 0x0c, 0x00, 0x20, 0x08, 0xb5, 0x08, 0x4b, + 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, 0x03, 0x68, 0x9b, 0x68, + 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, 0x49, 0x01, 0x59, 0x18, + 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, 0xd4, 0x0c, 0x00, 0x20, + 0xf4, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, 0x1b, 0x68, 0x08, 0x31, + 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, 0xf4, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, 0x43, 0x18, 0x9a, 0x68, + 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, 0x14, 0x1c, 0x9a, 0x68, + 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, 0x92, 0x03, 0x22, 0x43, + 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, 0x9a, 0x60, 0x41, 0x18, + 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, 0xf4, 0x0c, 0x00, 0x20, + 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x06, 0x1c, + 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, 0x27, 0x4b, 0x8a, 0x00, + 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, 0x02, 0x99, 0x5b, 0x68, + 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, 0xff, 0xf7, 0x9e, 0xff, + 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x98, 0xff, + 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xbf, 0xff, 0x1c, 0x4f, + 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, 0x03, 0x92, 0x8b, 0x18, + 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x17, 0x49, 0x5a, 0x72, + 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, 0x00, 0xf0, 0x69, 0xf9, + 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x7a, 0xff, + 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, 0x19, 0x71, 0x01, 0x21, + 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, 0x9a, 0x7a, 0x01, 0x21, + 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, + 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xf8, 0x0d, 0x00, 0x20, + 0xd4, 0x0c, 0x00, 0x20, 0xf4, 0x0c, 0x00, 0x20, 0x14, 0x0b, 0x00, 0x20, + 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, 0x01, 0x23, 0xff, 0xf7, + 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, 0x01, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, 0x3a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x60, 0xd0, 0x80, 0x23, + 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, 0x00, 0x92, 0x00, 0x2c, + 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, 0x01, 0x93, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0x9b, 0x79, 0xdb, 0x09, + 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, 0x00, 0xf0, 0x76, 0xf8, + 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, 0x71, 0xf8, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0xdb, 0x79, 0x9a, 0x07, + 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, 0x38, 0xd1, 0x42, 0x1e, + 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, 0x24, 0x4b, 0x00, 0x22, + 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, 0x3f, 0x25, 0x22, 0x4a, + 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, 0x2a, 0x1c, 0x03, 0x93, + 0x00, 0xf0, 0xe9, 0xf8, 0x18, 0x4a, 0x7b, 0x01, 0xd3, 0x18, 0x03, 0x9a, + 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, 0x92, 0x0b, 0x92, 0x03, + 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, 0x80, 0x22, 0x52, 0x42, + 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, 0x5b, 0x19, 0x52, 0x19, + 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, 0x00, 0x98, 0x0b, 0xe0, + 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, 0x7b, 0x01, 0xed, 0x18, + 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, 0xab, 0x61, 0x40, 0x42, + 0x05, 0xb0, 0xf0, 0xbd, 0xf8, 0x0d, 0x00, 0x20, 0xf4, 0x0c, 0x00, 0x20, + 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, 0x70, 0x11, 0x01, 0x00, + 0x4c, 0x09, 0x00, 0x20, 0x54, 0x09, 0x00, 0x20, 0x01, 0x4a, 0x02, 0x4b, + 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, 0xf4, 0x0c, 0x00, 0x20, + 0x02, 0xb4, 0x71, 0x46, 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, + 0x8e, 0x44, 0x02, 0xbc, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, + 0x01, 0x23, 0x00, 0x22, 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, + 0x24, 0x07, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, + 0x1b, 0x01, 0xf8, 0xe7, 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, + 0x02, 0xd2, 0x49, 0x00, 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, + 0x40, 0x1a, 0x1a, 0x43, 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x5c, 0x08, 0x22, 0x43, 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0x9c, 0x08, 0x22, 0x43, 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, + 0xdc, 0x08, 0x22, 0x43, 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, + 0x09, 0x09, 0xe3, 0xe7, 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, + 0x01, 0xd0, 0x00, 0x20, 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, + 0x40, 0x18, 0x02, 0x90, 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, + 0x00, 0x29, 0xf0, 0xd0, 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, + 0x42, 0x43, 0x89, 0x1a, 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0xb5, 0x0e, 0x4b, 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, + 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, + 0x01, 0x34, 0xf8, 0xe7, 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, + 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, + 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, + 0x98, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, + 0x00, 0xf0, 0x76, 0xf8, 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, + 0x93, 0x42, 0x08, 0xd0, 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, + 0x24, 0x78, 0xa5, 0x42, 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, + 0x30, 0xbd, 0x10, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, + 0xc4, 0x54, 0x01, 0x33, 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, + 0x93, 0x42, 0x02, 0xd0, 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, + 0x30, 0xb5, 0x00, 0x29, 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, + 0x00, 0xda, 0xc9, 0x18, 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, + 0x02, 0xd1, 0x4b, 0x60, 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, + 0x08, 0x68, 0x0a, 0x18, 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, + 0xc0, 0x18, 0x08, 0x60, 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, + 0x24, 0xe0, 0x8a, 0x42, 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, + 0xf9, 0xd1, 0x1d, 0x68, 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, + 0x69, 0x18, 0x58, 0x18, 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, + 0x52, 0x68, 0x09, 0x19, 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, + 0x02, 0xd9, 0x0c, 0x23, 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, + 0x94, 0x42, 0x03, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, + 0x4a, 0x60, 0x59, 0x60, 0x30, 0xbd, 0xc0, 0x46, 0x00, 0x0e, 0x00, 0x20, + 0x70, 0xb5, 0x03, 0x23, 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, + 0x0c, 0x2d, 0x01, 0xd2, 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, + 0x8d, 0x42, 0x3d, 0xd3, 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, + 0x00, 0x29, 0x13, 0xd0, 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, + 0x02, 0xd9, 0x0b, 0x60, 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, + 0x63, 0x68, 0x13, 0x60, 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, + 0x16, 0xe0, 0x0c, 0x1c, 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, + 0x00, 0x28, 0x03, 0xd1, 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, + 0x30, 0x1c, 0x29, 0x1c, 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, + 0xc4, 0x1c, 0x03, 0x23, 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, + 0x20, 0x1c, 0x0b, 0x30, 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, + 0x0b, 0xd0, 0x5a, 0x42, 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, + 0x00, 0xf0, 0x0a, 0xf8, 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, + 0x00, 0x20, 0x70, 0xbd, 0x00, 0x0e, 0x00, 0x20, 0xfc, 0x0d, 0x00, 0x20, + 0x38, 0xb5, 0x07, 0x4c, 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, + 0x00, 0xf0, 0x2a, 0xf8, 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x2b, 0x60, 0x38, 0xbd, 0xc0, 0x46, 0x08, 0x0e, 0x00, 0x20, + 0xc9, 0xb2, 0x03, 0x78, 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, + 0x01, 0x30, 0xf8, 0xe7, 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, + 0x30, 0xb5, 0x03, 0x1c, 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, + 0x5d, 0x1e, 0x01, 0x3a, 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, + 0x9a, 0x18, 0x93, 0x42, 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, + 0xf9, 0xe7, 0x30, 0xbd, 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, + 0x18, 0x18, 0x69, 0x46, 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, + 0x70, 0x47, 0x05, 0x4b, 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, + 0xf8, 0xe7, 0x03, 0x4b, 0x13, 0x60, 0xef, 0xe7, 0x04, 0x0e, 0x00, 0x20, + 0x08, 0x0e, 0x00, 0x20, 0x0c, 0x0e, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, + 0xf8, 0xbc, 0x08, 0xbc, 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, + 0x54, 0x45, 0x2e, 0x42, 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, 0x33, 0x22, 0x00, 0x00, + 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, 0x61, 0x23, 0x00, 0x00, + 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, 0x3f, 0x2f, 0x5b, 0x5d, + 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, + 0xf1, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x1d, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x0f, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x02, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xad, 0x47, 0x00, 0x00, 0xf1, 0x40, 0x00, 0x00, 0xef, 0x46, 0x00, 0x00, + 0xb1, 0x46, 0x00, 0x00, 0xc9, 0x46, 0x00, 0x00, 0x65, 0x48, 0x00, 0x00, + 0x89, 0x44, 0x00, 0x00, 0x79, 0x44, 0x00, 0x00, 0xb1, 0x45, 0x00, 0x00, + 0x9f, 0x44, 0x00, 0x00, 0x75, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb1, 0x48, 0x00, 0x00, + 0xdd, 0x48, 0x00, 0x00, 0xad, 0x48, 0x00, 0x00, 0xd1, 0x48, 0x00, 0x00, + 0xc5, 0x48, 0x00, 0x00, 0x15, 0x49, 0x00, 0x00, 0xf9, 0x48, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x58, 0x00, 0x00, + 0x04, 0x59, 0x00, 0x00, 0x24, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0x01, 0x3b, 0x00, 0x00, + 0x39, 0x49, 0x00, 0x00, 0xdd, 0x4b, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/mkrzero.h b/sparkfun/samd/libraries/SDU/src/boot/mkrzero.h new file mode 100644 index 00000000..0f1470d5 --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/mkrzero.h @@ -0,0 +1,1236 @@ + 0x00, 0x80, 0x00, 0x20, 0x85, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xd9, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0xdd, 0x3a, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, + 0x6d, 0x3b, 0x00, 0x00, 0x6d, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0x44, 0x59, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0x44, 0x59, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x9c, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x3d, 0xfe, 0x02, 0xf0, + 0x75, 0xfd, 0x01, 0x20, 0x01, 0xf0, 0x66, 0xfd, 0x2f, 0x4d, 0x1c, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0xa8, 0x4e, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0xbb, 0xfc, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0xd7, 0xfc, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0x9c, 0xfd, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0xb8, 0x4e, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0x68, 0xfc, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x36, 0xfc, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x2e, 0xfc, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0x00, 0x4f, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0xe0, 0x4e, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0x00, 0x4f, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x88, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x88, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x2b, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x88, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x0b, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x88, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0xc0, 0xf9, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xdc, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xd5, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0x91, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x0a, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x60, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x62, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x30, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x88, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0xf8, 0xf8, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0xf0, 0xf8, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x02, 0xf0, 0x07, 0xf8, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0xe2, 0x4e, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0xa8, 0xfd, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0x99, 0xfd, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0x8b, 0xfd, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0xf8, 0x4e, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x50, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x55, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x88, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x22, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x4b, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x6e, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x08, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x00, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0xf9, 0xfa, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x25, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x0f, 0x4b, 0x10, 0x4a, + 0x10, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x0f, 0x4b, + 0x0f, 0x48, 0x19, 0x60, 0x0a, 0x21, 0x19, 0x71, 0x09, 0x21, 0x99, 0x71, + 0x08, 0x21, 0x59, 0x71, 0x03, 0x21, 0x5a, 0x72, 0xda, 0x71, 0x19, 0x72, + 0x0a, 0x4b, 0x18, 0x60, 0x1d, 0x20, 0x18, 0x71, 0x1b, 0x20, 0x98, 0x71, + 0x1a, 0x20, 0x5a, 0x72, 0x58, 0x71, 0xda, 0x71, 0x19, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x5c, 0x08, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x60, 0x08, 0x00, 0x20, 0x88, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x66, 0xfd, 0x08, 0xbd, 0xc0, 0x46, + 0x98, 0x07, 0x00, 0x20, 0x13, 0xb5, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x31, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x2d, 0xfb, 0x12, 0x49, + 0x12, 0x48, 0x00, 0xf0, 0x29, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, + 0x25, 0xfb, 0x12, 0x49, 0x12, 0x48, 0x00, 0xf0, 0x21, 0xfb, 0x12, 0x4c, + 0x12, 0x49, 0x20, 0x1c, 0x00, 0xf0, 0x1c, 0xfb, 0x03, 0x23, 0x00, 0x93, + 0x01, 0x23, 0x01, 0x93, 0x21, 0x1c, 0x0d, 0x22, 0x0e, 0x23, 0x0e, 0x48, + 0x00, 0xf0, 0x2c, 0xfd, 0x13, 0xbd, 0xc0, 0x46, 0x00, 0x08, 0x00, 0x42, + 0x58, 0x08, 0x00, 0x20, 0x00, 0x0c, 0x00, 0x42, 0x5c, 0x08, 0x00, 0x20, + 0x00, 0x10, 0x00, 0x42, 0x60, 0x08, 0x00, 0x20, 0x00, 0x14, 0x00, 0x42, + 0x54, 0x08, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x64, 0x08, 0x00, 0x20, + 0x68, 0x08, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x98, 0x07, 0x00, 0x20, + 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, 0x1b, 0x68, 0x00, 0x2b, + 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, 0x6c, 0x08, 0x00, 0x20, + 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, 0x04, 0xd1, 0x00, 0xf0, + 0x4f, 0xf8, 0xfe, 0xf7, 0xbf, 0xfa, 0x0b, 0xe0, 0x0c, 0x4d, 0x8d, 0x42, + 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, 0xa2, 0x42, 0x04, 0xd2, + 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, 0xfe, 0xe7, 0x90, 0x42, + 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, 0xe7, 0xd2, 0x00, 0x22, + 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, 0xa0, 0x00, 0x00, 0x20, + 0x48, 0x59, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, 0x50, 0x0d, 0x00, 0x20, + 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x00, 0xf0, + 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, 0x70, 0x47, 0xc0, 0x46, + 0x70, 0x08, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, 0x08, 0xd0, 0x05, 0x4b, + 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, 0x33, 0x68, 0x5b, 0x1b, + 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, 0x70, 0x08, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, 0x1a, 0x60, 0x00, 0xf0, + 0x61, 0xfa, 0x08, 0xbd, 0x70, 0x08, 0x00, 0x20, 0x70, 0x47, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, 0x1e, 0x21, 0x53, 0x68, + 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, 0x53, 0x60, 0x8b, 0x69, + 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, 0x45, 0x4b, 0x9c, 0x82, + 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, 0xda, 0x68, 0x94, 0x07, + 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, 0x14, 0x78, 0xe5, 0x07, + 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xf7, 0xdb, + 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, + 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, 0x65, 0x80, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, 0x9c, 0x84, 0xdc, 0x68, + 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, 0xe5, 0x62, 0xdd, 0x68, + 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, 0x2e, 0x4e, 0x35, 0x43, + 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, 0x25, 0x06, 0xfc, 0xd5, + 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, 0xdc, 0x68, 0xe5, 0x06, + 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, + 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, 0x55, 0x78, 0x1c, 0x4c, + 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, 0x1e, 0x4d, 0x35, 0x40, + 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, 0x1d, 0x62, 0x03, 0x23, + 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, 0x4b, 0x72, 0x8b, 0x72, + 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, 0x16, 0x4b, 0x17, 0x4a, + 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, 0x21, 0x40, 0x11, 0x43, + 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, 0x13, 0x43, 0x12, 0x4a, + 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, 0x43, 0x60, 0x70, 0xbd, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, 0x0c, 0x06, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, 0x01, 0x05, 0x01, 0x00, + 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, 0x00, 0x07, 0x03, 0x00, + 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, 0x00, 0x6c, 0xdc, 0x02, + 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, 0x20, 0x60, 0x80, 0x00, + 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, 0x18, 0x68, 0x10, 0xb5, + 0x89, 0x00, 0x00, 0xf0, 0xe3, 0xfe, 0x2f, 0x4b, 0x01, 0x38, 0x98, 0x42, + 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, 0x18, 0x6a, 0xc0, 0x21, + 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, 0x19, 0x62, 0x00, 0x24, + 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, 0x80, 0x22, 0x09, 0x02, + 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, 0x25, 0x4b, 0xfc, 0x21, + 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xfc, 0x22, 0x92, 0x01, + 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, 0xd2, 0x02, 0x0a, 0x43, + 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, 0x00, 0x21, 0x01, 0x34, + 0x00, 0xf0, 0x70, 0xf8, 0x0f, 0x2c, 0xf8, 0xd1, 0x1a, 0x4c, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, 0x63, 0x80, 0x19, 0x4b, + 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0xe4, 0x22, 0xd2, 0x00, + 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, 0x13, 0x4a, 0xc9, 0x09, + 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, 0x00, 0x20, 0x13, 0x61, + 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, + 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, 0x0c, 0x4b, 0xda, 0x79, + 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, 0x5a, 0x70, 0x10, 0xbd, + 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, 0x10, 0xe0, 0x00, 0xe0, + 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, 0x21, 0x40, 0x00, 0x00, + 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, 0x51, 0x7e, 0x13, 0x1c, + 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, 0x04, 0x28, 0x13, 0xd8, + 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, 0x5a, 0x78, 0x0f, 0x21, + 0x8a, 0x43, 0x00, 0xf0, 0x55, 0xfe, 0x03, 0x05, 0x09, 0x07, 0x03, 0x00, + 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, 0x02, 0x21, 0x0a, 0x43, + 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, 0x1b, 0x05, 0x0b, 0x43, + 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, 0x02, 0x21, 0x0b, 0x43, + 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, 0xff, 0xff, 0xff, 0xf0, + 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, 0x50, 0x43, 0x27, 0x4b, + 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, 0x46, 0xd0, 0x03, 0x29, + 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, 0x29, 0xfe, 0x02, 0x33, + 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, 0x1f, 0x48, + 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, + 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, 0x5b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, + 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, 0x10, 0x48, 0x59, 0x18, + 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, 0x40, 0x30, 0x06, 0x24, + 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, 0x0b, 0x49, 0x52, 0x18, + 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, 0xc3, 0x01, + 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x02, 0x20, + 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, 0x10, 0xbd, 0xc0, 0x46, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, 0x13, 0x18, 0x08, 0x24, + 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, 0x10, 0x4e, 0xd2, 0x01, + 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, 0x86, 0x68, 0xab, 0x40, + 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, 0xbe, 0x41, 0x40, 0x19, + 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, 0x04, 0x26, 0xb4, 0x43, + 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, 0x05, 0x49, 0x52, 0x18, + 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, 0x93, 0x61, 0xf0, 0xbd, + 0x20, 0x55, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0x10, 0x44, 0x00, 0x41, + 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, 0x08, 0x24, 0xaa, 0x18, + 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, 0x48, 0x1c, 0x00, 0x24, + 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0xa0, 0xfd, 0x07, 0x1e, 0x1e, 0x1e, + 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, 0x0a, 0x00, 0x01, 0x24, + 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, 0x18, 0x1c, 0x00, 0x21, + 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, 0x02, 0x21, 0xff, 0xf7, + 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, 0x31, 0xd1, 0x18, 0x1c, + 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, 0x18, 0x22, 0x53, 0x43, + 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, 0x14, 0x1c, 0x04, 0x40, + 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, 0x12, 0x4c, 0x1b, 0x19, + 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, 0x0f, 0x21, 0x31, 0x40, + 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, + 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, 0x09, 0x4e, 0x0f, 0x27, + 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x9a, 0x18, 0xbe, 0x43, + 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, + 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, 0x06, 0x1c, 0x0d, 0x1c, + 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, 0x9c, 0x42, 0x07, 0xd0, + 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, 0x98, 0x47, 0x01, 0x34, + 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, 0x15, 0x4a, 0x13, 0x68, + 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, 0x00, 0x2b, 0x21, 0xd1, + 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, 0x9a, 0x42, 0x07, 0xd8, + 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, 0xda, 0x60, 0xbf, 0xf3, + 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, 0xc8, 0x07, 0xfb, 0xd5, + 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, 0x52, 0x00, 0x01, 0x43, + 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, 0x1a, 0x7d, 0xd1, 0x07, + 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, 0x70, 0x47, 0xc0, 0x46, + 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, 0x03, 0x02, 0x00, 0x00, + 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, 0xf7, 0xb5, 0x08, 0xac, + 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, 0x6c, 0x1e, 0xa5, 0x41, + 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, 0x27, 0x06, 0x3a, 0x43, + 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, 0x50, 0x68, 0xb5, 0x01, + 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, 0x01, 0x43, 0x0c, 0x43, + 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, 0xc0, 0x25, 0x1c, 0x68, + 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, 0xc0, 0x24, 0xa4, 0x02, + 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, 0x03, 0x68, 0x5a, 0x68, + 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, + 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, + 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, + 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, + 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, 0xd1, 0x07, + 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0x03, 0x68, + 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x40, 0x07, + 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0xc0, 0x09, 0x70, 0x47, + 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, 0x0a, 0x43, 0x1a, 0x76, + 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, 0x18, 0x40, 0x70, 0x47, + 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x1a, 0x7e, + 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, 0x70, 0x47, 0x03, 0x68, + 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x03, 0x68, + 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, 0x1c, 0x68, 0x6d, 0x07, + 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, 0x04, 0x68, 0x51, 0x00, + 0x03, 0x48, 0x00, 0xf0, 0x79, 0xfc, 0x01, 0x38, 0xc0, 0xb2, 0x20, 0x73, + 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, 0x03, 0x68, 0x01, 0x21, + 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, 0x01, 0x23, + 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, 0x70, 0x47, + 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, 0xda, 0x69, + 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, 0x8a, 0x43, 0x1a, 0x60, + 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, 0x52, 0x02, 0x11, 0x43, + 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, 0xfc, 0xd5, 0x98, 0x6a, + 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, 0x30, 0xb5, 0x93, 0x42, + 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, + 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, 0x0e, 0x23, 0x19, 0x22, + 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, 0x0a, 0x23, 0x15, 0x22, + 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, 0x0c, 0x23, 0x17, 0x22, + 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, 0x15, 0x49, 0x01, 0x20, + 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, 0x5b, 0x18, 0x03, 0x20, + 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, 0xe0, 0x00, 0xff, 0x24, + 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, 0x85, 0x40, 0x28, 0x1c, + 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, 0x1a, 0x43, 0x0a, 0x4b, + 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, 0xfb, 0xdb, 0x30, 0xbd, + 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, 0x00, 0x10, 0x00, 0x42, + 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, 0x00, 0x1c, 0x00, 0x42, + 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, 0xf8, 0xb5, 0x04, 0x1c, + 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, 0xa3, 0xff, 0x20, 0x1c, + 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, 0x0a, 0x40, 0x69, 0x07, + 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, 0x22, 0x68, 0x84, 0x23, + 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, 0x01, 0x2d, 0x00, 0xd1, + 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, 0xc0, 0x00, 0x00, 0xf0, + 0xcd, 0xfb, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, 0x01, 0x40, 0xd2, 0x04, + 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, 0x23, 0x68, 0x00, 0x04, + 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, 0x10, 0x43, 0x98, 0x81, + 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, 0xf7, 0xb5, 0x01, 0x93, + 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, 0x16, 0x1c, 0xff, 0xf7, + 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, 0xbf, 0x07, 0x0c, 0x22, + 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, 0x16, 0x40, 0xc0, 0x22, + 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, 0x01, 0x99, 0x15, 0x40, + 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, 0x80, 0x21, 0x23, 0x68, + 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, 0x01, 0x20, 0x70, 0x47, + 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, 0x98, 0x47, 0x08, 0xbd, + 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, 0x41, 0xfb, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x3d, 0xfb, 0x10, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x4a, 0xfb, 0x08, 0xbd, 0x10, 0xb5, 0x04, 0x1c, 0x20, 0x1c, + 0x5c, 0x30, 0x00, 0xf0, 0x43, 0xfb, 0x00, 0x28, 0xf9, 0xd1, 0x20, 0x69, + 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, 0x5c, 0x30, 0x00, 0xf0, + 0x3f, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, 0x14, 0x35, 0x04, 0x1c, + 0x28, 0x1c, 0x00, 0xf0, 0x23, 0xfb, 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, + 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x2e, 0xfb, + 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, 0xb4, 0x34, 0x1b, 0x68, + 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, 0x08, 0xb5, 0x14, 0x30, + 0x00, 0xf0, 0x2a, 0xfb, 0x08, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x00, 0x69, + 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, 0x5c, 0x35, 0x00, 0x28, + 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x0c, 0xfb, 0x00, 0x28, 0x0c, 0xd0, + 0x28, 0x1c, 0x00, 0xf0, 0x20, 0xfb, 0x00, 0x28, 0xfa, 0xd1, 0x28, 0x1c, + 0x31, 0x1c, 0x00, 0xf0, 0xe4, 0xfa, 0x20, 0x69, 0xff, 0xf7, 0x97, 0xfe, + 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, 0x8b, 0xfe, 0x01, 0x20, + 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, 0x1d, 0x1c, 0x0a, 0xab, + 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, 0x1b, 0x78, 0x16, 0x1c, + 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, 0x02, 0x93, 0x0d, 0xab, + 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, 0xfa, 0x23, 0x9b, 0x00, + 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, 0x14, 0x30, 0x00, 0xf0, + 0xb1, 0xfa, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0xad, 0xfa, 0x00, 0x9a, + 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, 0x01, 0x9a, 0x20, 0x1c, + 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, 0x03, 0x9a, 0x5d, 0x70, + 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x80, 0x58, 0x00, 0x00, + 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, 0x05, 0x78, 0x09, 0xa8, + 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, 0x02, 0x90, 0x03, 0x90, + 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, 0x05, 0xb0, 0x30, 0xbd, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, 0x24, 0xfe, 0x00, 0x28, + 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, 0x25, 0x1c, 0x14, 0x35, + 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xfa, 0x23, 0x1c, 0xa8, 0x33, + 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x9e, 0xfa, + 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, 0xac, 0x33, 0xb4, 0x32, + 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, 0xff, 0xf7, 0x15, 0xfe, + 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, 0x28, 0x1c, 0x00, 0xf0, + 0x85, 0xfa, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x72, 0xfa, + 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, 0x02, 0xe0, 0x20, 0x69, + 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, 0xf3, 0xfd, 0x00, 0x28, + 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, 0x18, 0x40, 0x30, 0x38, + 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, 0x1b, 0x01, 0x19, 0x40, + 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, 0xc0, 0x23, 0x9b, 0x00, + 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, 0x05, 0x20, 0x99, 0x42, + 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, 0x00, 0xe0, 0x06, 0x20, + 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, 0x05, 0xd0, 0x02, 0x39, + 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, 0x00, 0xe0, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, 0x85, 0xb0, 0x03, 0x91, + 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0x15, 0x1c, 0xff, 0xf7, + 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, 0x3b, 0x1c, 0x43, 0x43, + 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, 0x9b, 0xfc, 0x23, 0x1c, + 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, 0x23, 0x1c, 0xb8, 0x33, + 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, 0x08, 0x21, 0xf7, 0x19, + 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, 0xa8, 0x37, 0x38, 0x78, + 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, 0xf9, 0xfb, 0x3b, 0x78, + 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, 0xdb, 0x01, 0x21, 0x1c, + 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, 0xb6, 0x18, 0x5b, 0x18, + 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, 0x01, 0x21, 0x91, 0x40, + 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, 0x1a, 0x60, 0x01, 0x21, + 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, 0x31, 0xfe, 0x29, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, 0x07, 0x1c, 0x20, 0x1c, + 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, 0x20, 0x1c, 0xff, 0xf7, + 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, 0x20, 0x69, 0x01, 0x22, + 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, 0x19, 0x78, 0x01, 0x3b, + 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, 0x20, 0x69, 0xff, 0xf7, + 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x20, 0x55, 0x00, 0x00, + 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, 0x3f, 0x20, 0x70, 0x47, + 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, 0x54, 0x68, + 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x02, 0x21, 0x00, 0xf0, 0x49, 0xf8, 0x08, 0xbd, 0x08, 0xb5, 0x00, 0x69, + 0x03, 0x21, 0x00, 0xf0, 0x59, 0xf8, 0x08, 0xbd, 0x38, 0xb5, 0x0d, 0x1c, + 0x04, 0x1c, 0x13, 0x1c, 0x00, 0x69, 0x03, 0x21, 0x2a, 0x1c, 0x00, 0xf0, + 0xf1, 0xf8, 0x00, 0x28, 0x01, 0xd1, 0x01, 0x23, 0x63, 0x60, 0x38, 0xbd, + 0x10, 0xb5, 0x05, 0x4c, 0x23, 0x68, 0x5a, 0x1c, 0x04, 0xd1, 0x03, 0x68, + 0x5b, 0x69, 0x98, 0x47, 0x20, 0x60, 0x03, 0x1c, 0x18, 0x1c, 0x10, 0xbd, + 0x0c, 0x00, 0x00, 0x20, 0x07, 0x4a, 0x08, 0xb5, 0x13, 0x68, 0x59, 0x1c, + 0x04, 0xd0, 0x01, 0x21, 0x49, 0x42, 0x11, 0x60, 0x18, 0x1c, 0x03, 0xe0, + 0x00, 0x69, 0x02, 0x21, 0x00, 0xf0, 0xc2, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x0c, 0x00, 0x00, 0x20, 0x06, 0x4b, 0xfa, 0x21, 0x89, 0x00, 0x99, 0x60, + 0x05, 0x49, 0x00, 0x22, 0x08, 0x31, 0x19, 0x60, 0x04, 0x49, 0x5a, 0x60, + 0x19, 0x61, 0x1a, 0x76, 0x70, 0x47, 0xc0, 0x46, 0x74, 0x08, 0x00, 0x20, + 0xb8, 0x58, 0x00, 0x00, 0x34, 0x0c, 0x00, 0x20, 0x08, 0xb5, 0x08, 0x4b, + 0x8a, 0x00, 0xd0, 0x58, 0x00, 0x28, 0x03, 0xd0, 0x03, 0x68, 0x9b, 0x68, + 0x98, 0x47, 0x06, 0xe0, 0xc9, 0xb2, 0x04, 0x4b, 0x49, 0x01, 0x59, 0x18, + 0x88, 0x68, 0x80, 0x04, 0x80, 0x0c, 0x08, 0xbd, 0x18, 0x0c, 0x00, 0x20, + 0x38, 0x0c, 0x00, 0x20, 0x10, 0xb5, 0x0c, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x0c, 0xd0, 0x06, 0x4b, 0xe1, 0xb2, 0x1b, 0x68, 0x08, 0x31, + 0x49, 0x01, 0x59, 0x18, 0x4a, 0x79, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x4b, 0x71, 0x02, 0x23, 0xcb, 0x71, 0x10, 0xbd, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0xc9, 0xb2, 0x0c, 0x48, 0x49, 0x01, 0x43, 0x18, 0x9a, 0x68, + 0x92, 0x04, 0x92, 0x0c, 0x3f, 0x2a, 0x08, 0xd9, 0x14, 0x1c, 0x9a, 0x68, + 0x40, 0x3c, 0xa4, 0x04, 0x92, 0x0b, 0xa4, 0x0c, 0x92, 0x03, 0x22, 0x43, + 0x02, 0xe0, 0x9a, 0x68, 0x92, 0x0b, 0x92, 0x03, 0x9a, 0x60, 0x41, 0x18, + 0x88, 0x68, 0xc0, 0xb2, 0x10, 0xbd, 0xc0, 0x46, 0x38, 0x0c, 0x00, 0x20, + 0xf0, 0xb5, 0x1c, 0x1c, 0x2a, 0x4b, 0x85, 0xb0, 0x1b, 0x68, 0x06, 0x1c, + 0x0d, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x46, 0xd0, 0x27, 0x4b, 0x8a, 0x00, + 0xd0, 0x58, 0x00, 0x28, 0x05, 0xd0, 0x03, 0x68, 0x02, 0x99, 0x5b, 0x68, + 0x22, 0x1c, 0x98, 0x47, 0x3f, 0xe0, 0x30, 0x1c, 0xff, 0xf7, 0x9e, 0xff, + 0xa0, 0x42, 0x04, 0xd2, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x98, 0xff, + 0x04, 0x1c, 0x29, 0x1c, 0x30, 0x1c, 0xff, 0xf7, 0xbf, 0xff, 0x1c, 0x4f, + 0xe9, 0xb2, 0x4a, 0x01, 0x01, 0x91, 0x39, 0x68, 0x03, 0x92, 0x8b, 0x18, + 0xff, 0x33, 0x5a, 0x7a, 0x01, 0x21, 0x0a, 0x43, 0x17, 0x49, 0x5a, 0x72, + 0xab, 0x01, 0xc9, 0x18, 0x02, 0x98, 0x22, 0x1c, 0x00, 0xf0, 0xb5, 0xf9, + 0x00, 0x2c, 0x1b, 0xd0, 0x30, 0x1c, 0x29, 0x1c, 0xff, 0xf7, 0x7a, 0xff, + 0x00, 0x28, 0x15, 0xd1, 0x01, 0x9b, 0x3a, 0x68, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x19, 0x79, 0x40, 0x20, 0x01, 0x43, 0x19, 0x71, 0x01, 0x21, + 0xd9, 0x71, 0x03, 0x99, 0x53, 0x18, 0xff, 0x33, 0x9a, 0x7a, 0x01, 0x21, + 0x0a, 0x43, 0x9a, 0x72, 0x02, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x00, 0xe0, + 0x20, 0x1c, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0x3c, 0x0d, 0x00, 0x20, + 0x18, 0x0c, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, 0x58, 0x0a, 0x00, 0x20, + 0x13, 0xb5, 0x6c, 0x46, 0x07, 0x34, 0x22, 0x1c, 0x01, 0x23, 0xff, 0xf7, + 0x99, 0xff, 0x01, 0x28, 0x01, 0xd1, 0x20, 0x78, 0x01, 0xe0, 0x01, 0x20, + 0x40, 0x42, 0x16, 0xbd, 0xf0, 0xb5, 0x1c, 0x1c, 0x3a, 0x4b, 0x85, 0xb0, + 0x1b, 0x68, 0x0e, 0x1c, 0x02, 0x92, 0x00, 0x2b, 0x60, 0xd0, 0x80, 0x23, + 0xdb, 0x01, 0x9c, 0x42, 0x5c, 0xd8, 0x00, 0x22, 0x00, 0x92, 0x00, 0x2c, + 0x56, 0xd0, 0x34, 0x4d, 0xf7, 0xb2, 0x2b, 0x68, 0x01, 0x93, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0x9b, 0x79, 0xdb, 0x09, + 0x1a, 0xd0, 0x2f, 0x4b, 0x2f, 0x49, 0x18, 0x68, 0x00, 0xf0, 0xc2, 0xf8, + 0x2e, 0x4b, 0x17, 0x21, 0x58, 0x43, 0x00, 0xf0, 0xbd, 0xf8, 0x3b, 0x1c, + 0x08, 0x33, 0x01, 0x9a, 0x5b, 0x01, 0xd3, 0x18, 0xdb, 0x79, 0x9a, 0x07, + 0x08, 0xd4, 0x29, 0x4b, 0x9a, 0x5d, 0x00, 0x2a, 0x38, 0xd1, 0x42, 0x1e, + 0x00, 0x28, 0x35, 0xd0, 0x10, 0x1c, 0xee, 0xe7, 0x24, 0x4b, 0x00, 0x22, + 0x9a, 0x55, 0x25, 0x1e, 0x3f, 0x2d, 0x00, 0xd9, 0x3f, 0x25, 0x22, 0x4a, + 0xb3, 0x01, 0xd3, 0x18, 0x18, 0x1c, 0x02, 0x99, 0x2a, 0x1c, 0x03, 0x93, + 0x00, 0xf0, 0x35, 0xf9, 0x18, 0x4a, 0x7b, 0x01, 0xd3, 0x18, 0x03, 0x9a, + 0xa9, 0x04, 0x5a, 0x61, 0x9a, 0x69, 0x89, 0x0c, 0x92, 0x0b, 0x92, 0x03, + 0x0a, 0x43, 0x9a, 0x61, 0x3b, 0x1c, 0x01, 0x9a, 0x08, 0x33, 0x5b, 0x01, + 0xd3, 0x18, 0x02, 0x22, 0xda, 0x71, 0x59, 0x79, 0x80, 0x22, 0x52, 0x42, + 0x0a, 0x43, 0x5a, 0x71, 0x00, 0x9b, 0x02, 0x9a, 0x5b, 0x19, 0x52, 0x19, + 0x00, 0x93, 0x64, 0x1b, 0x02, 0x92, 0xa6, 0xe7, 0x00, 0x98, 0x0b, 0xe0, + 0x01, 0x20, 0x08, 0xe0, 0x01, 0x22, 0x9a, 0x55, 0x7b, 0x01, 0xed, 0x18, + 0xab, 0x69, 0x10, 0x1c, 0x9b, 0x0b, 0x9b, 0x03, 0xab, 0x61, 0x40, 0x42, + 0x05, 0xb0, 0xf0, 0xbd, 0x3c, 0x0d, 0x00, 0x20, 0x38, 0x0c, 0x00, 0x20, + 0x04, 0x00, 0x00, 0x20, 0x40, 0x42, 0x0f, 0x00, 0x70, 0x11, 0x01, 0x00, + 0x90, 0x08, 0x00, 0x20, 0x98, 0x08, 0x00, 0x20, 0x01, 0x4a, 0x02, 0x4b, + 0x1a, 0x60, 0x70, 0x47, 0x00, 0x50, 0x00, 0x41, 0x38, 0x0c, 0x00, 0x20, + 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, 0x00, 0xf0, 0xf2, 0xf8, + 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, 0x10, 0xbd, 0x02, 0x6c, + 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, 0x44, 0x6c, 0xa3, 0x42, + 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, 0x00, 0x23, 0x03, 0x64, + 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x06, 0xd0, + 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, 0x43, 0x64, 0x10, 0x1c, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, 0x43, 0x6c, + 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, 0x03, 0x6c, 0x40, 0x6c, + 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, 0x01, 0xe0, 0xc0, 0x1a, + 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x01, 0xd0, + 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, + 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, 0xd0, 0x1a, 0x43, 0x42, + 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, 0x02, 0xb4, 0x71, 0x46, + 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc, + 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22, + 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42, + 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7, + 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00, + 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43, + 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43, + 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43, + 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43, + 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7, + 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20, + 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90, + 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0, + 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a, + 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0xb5, 0x0e, 0x4b, + 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, + 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, + 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, + 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, + 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, 0x74, 0x00, 0x00, 0x20, + 0x74, 0x00, 0x00, 0x20, 0x74, 0x00, 0x00, 0x20, 0x98, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x76, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x70, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, + 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x70, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x08, 0xd0, + 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, 0x24, 0x78, 0xa5, 0x42, + 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, 0x30, 0xbd, 0x10, 0xb5, + 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, 0xc4, 0x54, 0x01, 0x33, + 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, 0x93, 0x42, 0x02, 0xd0, + 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, 0x30, 0xb5, 0x00, 0x29, + 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, + 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, + 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, + 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, + 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, + 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, + 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, + 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, + 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, + 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, + 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, + 0x30, 0xbd, 0xc0, 0x46, 0x44, 0x0d, 0x00, 0x20, 0x70, 0xb5, 0x03, 0x23, + 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, 0x0c, 0x2d, 0x01, 0xd2, + 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, 0x8d, 0x42, 0x3d, 0xd3, + 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, 0x00, 0x29, 0x13, 0xd0, + 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, 0x02, 0xd9, 0x0b, 0x60, + 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, 0x63, 0x68, 0x13, 0x60, + 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, 0x16, 0xe0, 0x0c, 0x1c, + 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, 0x00, 0x28, 0x03, 0xd1, + 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, 0x30, 0x1c, 0x29, 0x1c, + 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, 0xc4, 0x1c, 0x03, 0x23, + 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, 0x20, 0x1c, 0x0b, 0x30, + 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, 0x0b, 0xd0, 0x5a, 0x42, + 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, 0x00, 0xf0, 0x0a, 0xf8, + 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, 0x00, 0x20, 0x70, 0xbd, + 0x44, 0x0d, 0x00, 0x20, 0x40, 0x0d, 0x00, 0x20, 0x38, 0xb5, 0x07, 0x4c, + 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, 0x00, 0xf0, 0x2a, 0xf8, + 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x2b, 0x60, + 0x38, 0xbd, 0xc0, 0x46, 0x4c, 0x0d, 0x00, 0x20, 0xc9, 0xb2, 0x03, 0x78, + 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, 0x01, 0x30, 0xf8, 0xe7, + 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, 0x30, 0xb5, 0x03, 0x1c, + 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, 0x5d, 0x1e, 0x01, 0x3a, + 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, 0x9a, 0x18, 0x93, 0x42, + 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x30, 0xbd, + 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, 0x18, 0x18, 0x69, 0x46, + 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, 0x70, 0x47, 0x05, 0x4b, + 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, 0xf8, 0xe7, 0x03, 0x4b, + 0x13, 0x60, 0xef, 0xe7, 0x48, 0x0d, 0x00, 0x20, 0x4c, 0x0d, 0x00, 0x20, + 0x50, 0x0d, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x2e, 0x42, + 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1f, 0x22, 0x00, 0x00, 0x33, 0x22, 0x00, 0x00, + 0x19, 0x22, 0x00, 0x00, 0x5d, 0x22, 0x00, 0x00, 0x61, 0x23, 0x00, 0x00, + 0x8d, 0x22, 0x00, 0x00, 0xa1, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x2f, 0x00, 0x7c, 0x3c, 0x3e, 0x5e, 0x2b, 0x3d, 0x3f, 0x2f, 0x5b, 0x5d, + 0x3b, 0x2c, 0x2a, 0x22, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, + 0xbd, 0x40, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, 0x1d, 0x22, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x10, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x04, + 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, + 0x00, 0x01, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x13, 0x00, 0x01, 0x01, + 0x01, 0x01, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x05, + 0x00, 0x05, 0x0a, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x05, + 0x01, 0x05, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, + 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, + 0x03, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, + 0x01, 0x03, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0b, 0x00, 0xff, 0xff, + 0xff, 0xff, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x01, 0x00, + 0x01, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, + 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, + 0x01, 0x04, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, + 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xdf, 0x44, 0x00, 0x00, 0xbd, 0x40, 0x00, 0x00, 0x97, 0x44, 0x00, 0x00, + 0x7f, 0x44, 0x00, 0x00, 0x75, 0x44, 0x00, 0x00, 0xa1, 0x44, 0x00, 0x00, + 0xd5, 0x44, 0x00, 0x00, 0x49, 0x44, 0x00, 0x00, 0x8d, 0x46, 0x00, 0x00, + 0x59, 0x44, 0x00, 0x00, 0x45, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x85, 0x47, 0x00, 0x00, + 0xb1, 0x47, 0x00, 0x00, 0x81, 0x47, 0x00, 0x00, 0xa5, 0x47, 0x00, 0x00, + 0x99, 0x47, 0x00, 0x00, 0xe9, 0x47, 0x00, 0x00, 0xcd, 0x47, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x58, 0x00, 0x00, + 0x04, 0x59, 0x00, 0x00, 0x24, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xe0, 0x58, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xed, 0x3a, 0x00, 0x00, + 0x0d, 0x48, 0x00, 0x00, 0xb1, 0x4a, 0x00, 0x00, 0xb5, 0x20, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SDU/src/boot/zero.h b/sparkfun/samd/libraries/SDU/src/boot/zero.h new file mode 100644 index 00000000..eb44fe2e --- /dev/null +++ b/sparkfun/samd/libraries/SDU/src/boot/zero.h @@ -0,0 +1,1163 @@ + 0x00, 0x80, 0x00, 0x20, 0x89, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0xdd, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x75, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0xbd, 0x3a, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0xcd, 0x3a, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, + 0x71, 0x3b, 0x00, 0x00, 0x71, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x10, 0xb5, 0x06, 0x4c, 0x23, 0x78, 0x00, 0x2b, 0x07, 0xd1, 0x05, 0x4b, + 0x00, 0x2b, 0x02, 0xd0, 0x04, 0x48, 0x00, 0xe0, 0x00, 0xbf, 0x01, 0x23, + 0x23, 0x70, 0x10, 0xbd, 0xa0, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xdc, 0x55, 0x00, 0x00, 0x08, 0xb5, 0x08, 0x4b, 0x00, 0x2b, 0x03, 0xd0, + 0x07, 0x48, 0x08, 0x49, 0x00, 0xe0, 0x00, 0xbf, 0x07, 0x48, 0x03, 0x68, + 0x00, 0x2b, 0x03, 0xd0, 0x06, 0x4b, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, + 0x08, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x00, 0xdc, 0x55, 0x00, 0x00, + 0xa4, 0x00, 0x00, 0x20, 0x90, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, + 0xf0, 0xb5, 0x33, 0x4c, 0xa5, 0x44, 0x01, 0xf0, 0x3f, 0xfe, 0x02, 0xf0, + 0xd7, 0xfb, 0x01, 0x20, 0x01, 0xf0, 0x68, 0xfd, 0x2f, 0x4d, 0x04, 0x21, + 0x28, 0x1c, 0x00, 0xf0, 0xe7, 0xf9, 0x00, 0x28, 0x44, 0xd0, 0x2d, 0x4e, + 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0xbe, 0xfa, 0x00, 0x28, 0x3d, 0xd0, + 0x29, 0x1c, 0x01, 0xa8, 0x32, 0x1c, 0x01, 0x23, 0x00, 0xf0, 0x6e, 0xfa, + 0x01, 0xa8, 0x00, 0xf0, 0x00, 0xf9, 0x80, 0x21, 0x04, 0x1c, 0xc9, 0x01, + 0x88, 0x42, 0x2d, 0xd9, 0x01, 0xa8, 0x00, 0xf0, 0xe6, 0xf8, 0x22, 0x4a, + 0xc0, 0x21, 0xa7, 0x18, 0x21, 0x48, 0xc9, 0x01, 0x3a, 0x1c, 0x01, 0xf0, + 0xf5, 0xfb, 0xc0, 0x24, 0xe4, 0x01, 0x80, 0x22, 0x0a, 0xa9, 0x92, 0x00, + 0x01, 0xa8, 0x00, 0xf0, 0xcf, 0xf8, 0x80, 0x23, 0x21, 0x1c, 0x0a, 0xaa, + 0x9b, 0x00, 0x19, 0x48, 0x01, 0xf0, 0x8e, 0xfb, 0x80, 0x22, 0x92, 0x00, + 0xa3, 0x18, 0x17, 0x4a, 0xa4, 0x18, 0xbc, 0x42, 0x01, 0xd2, 0x1c, 0x1c, + 0xe9, 0xe7, 0x01, 0x24, 0x01, 0xa8, 0x00, 0xf0, 0xed, 0xf8, 0x00, 0x2c, + 0x06, 0xd0, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x8d, 0xfa, 0x01, 0xe0, + 0x00, 0x24, 0xf3, 0xe7, 0xc0, 0x23, 0xdb, 0x01, 0x1b, 0x68, 0x83, 0xf3, + 0x08, 0x88, 0x0c, 0x4b, 0xc0, 0x22, 0xd2, 0x01, 0x9a, 0x60, 0x0b, 0x4b, + 0x1b, 0x68, 0x18, 0x47, 0x00, 0x20, 0x8b, 0x23, 0x9b, 0x00, 0x9d, 0x44, + 0xf0, 0xbd, 0xc0, 0x46, 0xd4, 0xfd, 0xff, 0xff, 0xd4, 0x00, 0x00, 0x20, + 0x6c, 0x4b, 0x00, 0x00, 0x00, 0xc0, 0xff, 0xff, 0xbc, 0x00, 0x00, 0x20, + 0x00, 0xa2, 0xff, 0xff, 0x00, 0xed, 0x00, 0xe0, 0x04, 0x60, 0x00, 0x00, + 0x08, 0xb5, 0x00, 0x21, 0x02, 0x48, 0x0a, 0x1c, 0x01, 0xf0, 0x38, 0xfb, + 0x08, 0xbd, 0xc0, 0x46, 0xbc, 0x00, 0x00, 0x20, 0x00, 0x20, 0x70, 0x47, + 0x70, 0x47, 0x13, 0xb5, 0x02, 0x68, 0x6b, 0x46, 0xd9, 0x71, 0x07, 0x33, + 0x54, 0x68, 0x19, 0x1c, 0x01, 0x22, 0xa0, 0x47, 0x16, 0xbd, 0x38, 0xb5, + 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x25, 0xa8, 0x42, 0x02, 0xd1, 0x01, 0x23, + 0x63, 0x60, 0x0a, 0xe0, 0x45, 0x60, 0x92, 0xb2, 0x01, 0xf0, 0x04, 0xf8, + 0x23, 0x6a, 0x5b, 0x68, 0x00, 0x2b, 0x02, 0xd0, 0x01, 0x23, 0x63, 0x60, + 0x28, 0x1c, 0x38, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, + 0x00, 0xf0, 0x42, 0xfe, 0x08, 0xbd, 0x00, 0x00, 0x13, 0xb5, 0x6c, 0x46, + 0x07, 0x34, 0x21, 0x1c, 0x01, 0x22, 0x00, 0xf0, 0x5d, 0xfd, 0x01, 0x28, + 0x01, 0xd1, 0x20, 0x78, 0x00, 0xe0, 0x01, 0x48, 0x00, 0xb2, 0x16, 0xbd, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x02, 0xd0, + 0xff, 0xf7, 0xea, 0xff, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x08, 0xbd, + 0x38, 0xb5, 0x05, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0a, 0xd0, 0xff, 0xf7, + 0xdf, 0xff, 0x04, 0x1c, 0x63, 0x1c, 0x05, 0xd0, 0x28, 0x6a, 0x01, 0x69, + 0x01, 0x39, 0x00, 0xf0, 0xe5, 0xfd, 0x20, 0x1c, 0x38, 0xbd, 0x00, 0x00, + 0xf8, 0xb5, 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x00, 0x25, + 0x08, 0x33, 0x04, 0x1c, 0x45, 0x60, 0x03, 0x60, 0x28, 0x20, 0x0f, 0x1c, + 0x16, 0x1c, 0x02, 0xf0, 0x1d, 0xfb, 0x20, 0x62, 0xa8, 0x42, 0x0a, 0xd0, + 0x39, 0x1c, 0x28, 0x22, 0x02, 0xf0, 0x39, 0xfb, 0x20, 0x1c, 0x10, 0x30, + 0x31, 0x1c, 0x0c, 0x22, 0x02, 0xf0, 0xfe, 0xfb, 0x25, 0x77, 0x20, 0x1c, + 0xf8, 0xbd, 0xc0, 0x46, 0x78, 0x4b, 0x00, 0x00, 0xfa, 0x22, 0x92, 0x00, + 0x82, 0x60, 0x04, 0x4a, 0x00, 0x23, 0x08, 0x32, 0x43, 0x60, 0x02, 0x60, + 0x03, 0x62, 0x03, 0x74, 0x70, 0x47, 0xc0, 0x46, 0x78, 0x4b, 0x00, 0x00, + 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x01, 0xd0, 0x00, 0xf0, 0x02, 0xfd, + 0x08, 0xbd, 0x00, 0x6a, 0x08, 0xb5, 0x00, 0x28, 0x04, 0xd0, 0x00, 0xf0, + 0xa5, 0xfd, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x08, 0xbd, 0x03, 0x6a, + 0x00, 0x2b, 0x01, 0xd0, 0x18, 0x69, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, + 0x70, 0x47, 0x00, 0x6a, 0x00, 0x28, 0x00, 0xd0, 0xc0, 0x69, 0x70, 0x47, + 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0xf3, 0xff, 0x05, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0xe7, 0xff, + 0x02, 0x4b, 0x28, 0x1a, 0x98, 0x42, 0x00, 0xd9, 0x18, 0x1c, 0x38, 0xbd, + 0xff, 0x7f, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, 0x00, 0x6a, 0x00, 0x28, + 0x06, 0xd0, 0x00, 0xf0, 0xe7, 0xfd, 0x20, 0x6a, 0x02, 0xf0, 0xca, 0xfa, + 0x00, 0x23, 0x23, 0x62, 0x10, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x0a, 0x1c, + 0x0c, 0x49, 0x8a, 0xb0, 0x04, 0x1c, 0x00, 0x23, 0x00, 0x91, 0x69, 0x46, + 0x4b, 0x72, 0x01, 0x93, 0x21, 0x1c, 0x68, 0x46, 0x01, 0x23, 0x00, 0xf0, + 0x81, 0xfe, 0x04, 0x1c, 0x60, 0x1e, 0x84, 0x41, 0xe4, 0xb2, 0x00, 0x2c, + 0x02, 0xd0, 0x68, 0x46, 0x00, 0xf0, 0xc8, 0xfd, 0x20, 0x1c, 0x0a, 0xb0, + 0x10, 0xbd, 0xc0, 0x46, 0xc0, 0x4b, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x23, + 0x00, 0x2a, 0x05, 0xd0, 0x00, 0xf0, 0x1a, 0xff, 0x03, 0x1c, 0x58, 0x1e, + 0x83, 0x41, 0xdb, 0xb2, 0x18, 0x1c, 0x08, 0xbd, 0x38, 0xb5, 0x01, 0x22, + 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0xf0, 0x94, 0xf9, 0x02, 0x1c, 0x01, 0x20, + 0x00, 0x2a, 0x03, 0xd1, 0x28, 0x1c, 0x21, 0x1c, 0x01, 0xf0, 0x8c, 0xf9, + 0x38, 0xbd, 0xf0, 0xb5, 0x0c, 0x68, 0x03, 0x5d, 0x2f, 0x3b, 0x5d, 0x42, + 0x6b, 0x41, 0xe4, 0x18, 0x27, 0x1c, 0x0c, 0x37, 0x23, 0x1c, 0xc5, 0x5c, + 0x1e, 0x1b, 0x2f, 0x2d, 0x09, 0xd0, 0x00, 0x2d, 0x07, 0xd0, 0x01, 0x33, + 0x16, 0x1b, 0xf6, 0x18, 0x01, 0x3e, 0x35, 0x70, 0xbb, 0x42, 0xf2, 0xd1, + 0x0c, 0x26, 0x00, 0x24, 0x94, 0x55, 0xc2, 0x5c, 0x2f, 0x3a, 0x54, 0x42, + 0x62, 0x41, 0x9b, 0x18, 0x0b, 0x60, 0xc0, 0x5c, 0x43, 0x1e, 0x98, 0x41, + 0xc0, 0xb2, 0xf0, 0xbd, 0xf0, 0xb5, 0xa1, 0xb0, 0x03, 0x90, 0x25, 0x48, + 0x0d, 0x1c, 0x04, 0x92, 0x05, 0x93, 0x0c, 0xaa, 0x00, 0x23, 0x16, 0xa9, + 0x0d, 0x93, 0x0c, 0x90, 0x53, 0x72, 0x17, 0x93, 0x16, 0x90, 0x4b, 0x72, + 0x07, 0x93, 0x2c, 0x1c, 0x00, 0x92, 0x07, 0xa9, 0x08, 0xaa, 0x03, 0x98, + 0xff, 0xf7, 0xc3, 0xff, 0x01, 0x26, 0x02, 0x1c, 0x72, 0x40, 0x01, 0x90, + 0xd2, 0xb2, 0x20, 0x1c, 0x08, 0xa9, 0x05, 0x9b, 0x04, 0x9f, 0xb8, 0x47, + 0x00, 0x28, 0x07, 0xd1, 0xac, 0x42, 0x01, 0xd1, 0x00, 0x20, 0x23, 0xe0, + 0x20, 0x1c, 0x00, 0xf0, 0x57, 0xfd, 0xf9, 0xe7, 0x01, 0x9f, 0x00, 0x2f, + 0x11, 0xd0, 0x33, 0x1c, 0x00, 0x98, 0x21, 0x1c, 0x08, 0xaa, 0x00, 0xf0, + 0xfd, 0xfd, 0x06, 0x1c, 0xac, 0x42, 0x0f, 0xd0, 0x20, 0x1c, 0x00, 0xf0, + 0x47, 0xfd, 0x00, 0x2e, 0xe8, 0xd0, 0x23, 0x1c, 0x00, 0x9c, 0x00, 0x93, + 0xd1, 0xe7, 0xac, 0x42, 0x02, 0xd0, 0x20, 0x1c, 0x00, 0xf0, 0x3c, 0xfd, + 0x30, 0x1c, 0x03, 0xe0, 0x00, 0x28, 0xdb, 0xd0, 0x16, 0xac, 0xf0, 0xe7, + 0x21, 0xb0, 0xf0, 0xbd, 0xc0, 0x4b, 0x00, 0x00, 0x38, 0xb5, 0x03, 0x1c, + 0x41, 0x33, 0x1b, 0x78, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2b, 0x02, 0xd0, + 0x38, 0x30, 0x00, 0xf0, 0x27, 0xfd, 0x20, 0x1c, 0x01, 0x21, 0x2a, 0x1c, + 0x00, 0xf0, 0xc8, 0xf9, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x0f, 0xe0, + 0x25, 0x1c, 0x10, 0x35, 0x28, 0x1c, 0x21, 0x1c, 0xff, 0xf7, 0x62, 0xff, + 0x00, 0x28, 0xf5, 0xd0, 0x20, 0x1c, 0x38, 0x30, 0x29, 0x1c, 0x00, 0xf0, + 0xcf, 0xfb, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x38, 0xbd, 0x00, 0x00, + 0x4b, 0x68, 0x43, 0x60, 0x0a, 0x4b, 0x03, 0x60, 0x0b, 0x7a, 0x03, 0x72, + 0x4b, 0x7a, 0x43, 0x72, 0xcb, 0x68, 0xc3, 0x60, 0x0b, 0x69, 0x03, 0x61, + 0x4b, 0x69, 0x43, 0x61, 0x0b, 0x7e, 0x03, 0x76, 0xcb, 0x69, 0xc3, 0x61, + 0x0b, 0x6a, 0x49, 0x6a, 0x03, 0x62, 0x41, 0x62, 0x70, 0x47, 0xc0, 0x46, + 0xc0, 0x4b, 0x00, 0x00, 0xf0, 0xb5, 0x9d, 0xb0, 0x08, 0xae, 0x02, 0x92, + 0x03, 0x93, 0x27, 0x4a, 0x00, 0x23, 0x12, 0xaf, 0x05, 0x1c, 0x73, 0x60, + 0x7b, 0x60, 0x10, 0x31, 0x30, 0x1c, 0x08, 0x92, 0x73, 0x72, 0x12, 0x92, + 0x7b, 0x72, 0x00, 0xf0, 0x9d, 0xfb, 0x02, 0x9c, 0x20, 0x1c, 0x2f, 0x21, + 0x02, 0xf0, 0x98, 0xfa, 0x00, 0x28, 0x2e, 0xd0, 0x23, 0x78, 0x2f, 0x2b, + 0x01, 0xd1, 0x01, 0x34, 0xf4, 0xe7, 0x00, 0x1b, 0xc0, 0xb2, 0x03, 0x1c, + 0x0c, 0x28, 0x00, 0xd9, 0x0c, 0x23, 0xdb, 0xb2, 0x1a, 0x1c, 0x21, 0x1c, + 0x04, 0xa8, 0x01, 0x93, 0x02, 0xf0, 0x90, 0xfa, 0x01, 0x9a, 0x00, 0x23, + 0x04, 0xa9, 0x38, 0x1c, 0x8b, 0x54, 0x00, 0xf0, 0xbf, 0xfc, 0x38, 0x1c, + 0x31, 0x1c, 0x04, 0xaa, 0x01, 0x23, 0x00, 0xf0, 0x69, 0xfd, 0x00, 0x28, + 0x04, 0xd1, 0x0c, 0x4b, 0x68, 0x60, 0x2b, 0x60, 0x68, 0x72, 0x10, 0xe0, + 0x01, 0x9b, 0x30, 0x1c, 0xe4, 0x18, 0x00, 0xf0, 0xad, 0xfc, 0x33, 0x1c, + 0x3e, 0x1c, 0x1f, 0x1c, 0xca, 0xe7, 0x02, 0x99, 0x03, 0x9a, 0x64, 0x1a, + 0x14, 0x60, 0x28, 0x1c, 0x31, 0x1c, 0xff, 0xf7, 0x95, 0xff, 0x28, 0x1c, + 0x1d, 0xb0, 0xf0, 0xbd, 0xc0, 0x4b, 0x00, 0x00, 0xf0, 0xb5, 0xa1, 0xb0, + 0x05, 0x1c, 0x1f, 0x1c, 0x02, 0xa8, 0x01, 0xab, 0x16, 0x1c, 0xff, 0xf7, + 0xa1, 0xff, 0x01, 0x9b, 0xf6, 0x18, 0x33, 0x78, 0x00, 0x2b, 0x07, 0xd1, + 0x02, 0xa9, 0x16, 0xa8, 0xff, 0xf7, 0x7e, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x17, 0x4a, 0x28, 0xe0, 0x00, 0x23, 0x0c, 0xac, 0x63, 0x60, 0x63, 0x72, + 0x6b, 0x46, 0x11, 0x33, 0x14, 0x4a, 0x1b, 0x78, 0x0c, 0x92, 0x00, 0x2b, + 0x03, 0xd1, 0x28, 0x1c, 0xff, 0xf7, 0x4a, 0xfe, 0x1b, 0xe0, 0x20, 0x1c, + 0x02, 0xa9, 0x32, 0x1c, 0x3b, 0x1c, 0x00, 0xf0, 0x21, 0xfd, 0x00, 0x28, + 0xf3, 0xd0, 0x02, 0xa8, 0x00, 0xf0, 0x6c, 0xfc, 0x06, 0x23, 0x1f, 0x40, + 0x9f, 0x42, 0x03, 0xd1, 0x20, 0x1c, 0x13, 0x99, 0x00, 0xf0, 0xf6, 0xfb, + 0x21, 0x1c, 0x16, 0xa8, 0xff, 0xf7, 0x54, 0xff, 0x28, 0x1c, 0x16, 0xa9, + 0x32, 0x1c, 0xff, 0xf7, 0x0b, 0xfe, 0x28, 0x1c, 0x21, 0xb0, 0xf0, 0xbd, + 0xa0, 0x4b, 0x00, 0x00, 0xc0, 0x4b, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xc9, 0xfe, 0x08, 0xbd, 0xa5, 0x23, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x1c, + 0x08, 0x1c, 0x19, 0x1c, 0x38, 0x31, 0x02, 0x4a, 0x00, 0x23, 0xff, 0xf7, + 0xbd, 0xfe, 0x08, 0xbd, 0xe1, 0x23, 0x00, 0x00, 0x08, 0x4b, 0x02, 0x21, + 0x19, 0x61, 0x19, 0x1c, 0x00, 0x22, 0x30, 0x31, 0x0a, 0x70, 0x06, 0x49, + 0x5a, 0x71, 0x9a, 0x71, 0x9a, 0x72, 0x1a, 0x73, 0xda, 0x63, 0x99, 0x63, + 0x41, 0x33, 0x1a, 0x70, 0x70, 0x47, 0xc0, 0x46, 0xd4, 0x00, 0x00, 0x20, + 0xc0, 0x4b, 0x00, 0x00, 0x08, 0xb5, 0x01, 0x1c, 0x01, 0x48, 0x01, 0xf0, + 0xab, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0xff, 0x21, 0x01, 0xf0, 0xa3, 0xf9, 0x08, 0xbd, 0x78, 0x07, 0x00, 0x20, + 0x08, 0xb5, 0x01, 0x21, 0x00, 0x79, 0x01, 0xf0, 0x2d, 0xfc, 0x05, 0x4b, + 0x1a, 0x78, 0x00, 0x2a, 0x04, 0xd0, 0x00, 0x22, 0x03, 0x48, 0x1a, 0x70, + 0x01, 0xf0, 0x80, 0xf9, 0x08, 0xbd, 0xc0, 0x46, 0x40, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x08, 0x4b, 0x04, 0x1c, 0x1a, 0x78, + 0x00, 0x2a, 0x06, 0xd1, 0x01, 0x22, 0x1a, 0x70, 0x05, 0x4b, 0x06, 0x48, + 0x06, 0xcb, 0x01, 0xf0, 0x51, 0xf9, 0x20, 0x79, 0x00, 0x21, 0x01, 0xf0, + 0x0d, 0xfc, 0x10, 0xbd, 0x40, 0x01, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x10, 0xb5, 0x83, 0x79, 0x04, 0x1c, 0x00, 0x2b, + 0x0d, 0xd0, 0x23, 0x89, 0x5a, 0x1c, 0x22, 0x81, 0x05, 0x4a, 0x93, 0x42, + 0x02, 0xd8, 0xff, 0xf7, 0xbf, 0xff, 0xf6, 0xe7, 0x20, 0x1c, 0xff, 0xf7, + 0xc3, 0xff, 0x00, 0x23, 0xa3, 0x71, 0x10, 0xbd, 0x01, 0x02, 0x00, 0x00, + 0x00, 0xb5, 0x06, 0x29, 0x03, 0xd9, 0x16, 0x23, 0x43, 0x71, 0x00, 0x20, + 0x1c, 0xe0, 0x0f, 0x4b, 0x05, 0x29, 0x13, 0xd8, 0x08, 0x1c, 0x00, 0x22, + 0x02, 0xf0, 0x22, 0xf8, 0x03, 0x05, 0x07, 0x09, 0x0b, 0x0d, 0x0b, 0x49, + 0x08, 0xe0, 0x0b, 0x49, 0x06, 0xe0, 0x0b, 0x49, 0x04, 0xe0, 0x0b, 0x49, + 0x02, 0xe0, 0x0b, 0x49, 0x00, 0xe0, 0x0b, 0x49, 0x19, 0x60, 0x02, 0xe0, + 0x0a, 0x4a, 0x1a, 0x60, 0x00, 0x22, 0x1a, 0x71, 0x5a, 0x71, 0x01, 0x20, + 0x00, 0xbd, 0xc0, 0x46, 0x38, 0x01, 0x00, 0x20, 0x00, 0x1b, 0xb7, 0x00, + 0x00, 0x09, 0x3d, 0x00, 0x80, 0x84, 0x1e, 0x00, 0x40, 0x42, 0x0f, 0x00, + 0x20, 0xa1, 0x07, 0x00, 0x90, 0xd0, 0x03, 0x00, 0x48, 0xe8, 0x01, 0x00, + 0x38, 0xb5, 0x0c, 0x1c, 0x01, 0xf0, 0xde, 0xf9, 0x05, 0x1c, 0xff, 0xf7, + 0x79, 0xff, 0xff, 0x28, 0x06, 0xd0, 0x01, 0xf0, 0xd7, 0xf9, 0x40, 0x1b, + 0xa0, 0x42, 0xf6, 0xd3, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0e, 0x1c, 0x17, 0x1c, 0xff, 0xf7, 0x9c, 0xff, + 0x20, 0x1c, 0xff, 0xf7, 0x81, 0xff, 0x96, 0x21, 0x49, 0x00, 0x20, 0x1c, + 0xff, 0xf7, 0xe0, 0xff, 0x40, 0x20, 0x30, 0x43, 0xff, 0xf7, 0x54, 0xff, + 0x18, 0x25, 0x38, 0x1c, 0xe8, 0x40, 0xc0, 0xb2, 0x08, 0x3d, 0xff, 0xf7, + 0x4d, 0xff, 0x2b, 0x1c, 0x08, 0x33, 0xf6, 0xd1, 0x95, 0x20, 0x00, 0x2e, + 0x03, 0xd0, 0x87, 0x20, 0x08, 0x2e, 0x00, 0xd0, 0xff, 0x20, 0xff, 0xf7, + 0x41, 0xff, 0x00, 0x25, 0xff, 0xf7, 0x46, 0xff, 0x43, 0xb2, 0xe0, 0x72, + 0x00, 0x2b, 0x04, 0xda, 0xff, 0x2d, 0x02, 0xd0, 0x01, 0x35, 0xed, 0xb2, + 0xf4, 0xe7, 0xf8, 0xbd, 0xf7, 0xb5, 0x00, 0x25, 0x02, 0x71, 0x05, 0x73, + 0x85, 0x72, 0x85, 0x71, 0x45, 0x71, 0x04, 0x1c, 0x01, 0x91, 0x01, 0xf0, + 0x93, 0xf9, 0x01, 0x21, 0x07, 0x1c, 0x20, 0x79, 0x01, 0xf0, 0x0c, 0xfb, + 0x01, 0x21, 0x20, 0x79, 0x01, 0xf0, 0x62, 0xfb, 0x42, 0x4e, 0x30, 0x1c, + 0x01, 0xf0, 0x76, 0xf8, 0x41, 0x4b, 0x42, 0x49, 0x1d, 0x71, 0x5d, 0x71, + 0x19, 0x60, 0x30, 0x1c, 0x5a, 0x68, 0x01, 0xf0, 0x95, 0xf8, 0x0a, 0x25, + 0x01, 0x3d, 0xff, 0x20, 0xed, 0xb2, 0xff, 0xf7, 0x0d, 0xff, 0x00, 0x2d, + 0xf8, 0xd1, 0x30, 0x1c, 0x01, 0xf0, 0xa6, 0xf8, 0x20, 0x1c, 0xff, 0xf7, + 0x29, 0xff, 0x00, 0x21, 0x20, 0x1c, 0x0a, 0x1c, 0xff, 0xf7, 0x9a, 0xff, + 0x06, 0x1c, 0xe0, 0x72, 0x01, 0x28, 0x08, 0xd0, 0x01, 0xf0, 0x64, 0xf9, + 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, 0xef, 0xd9, 0x01, 0x23, + 0x3b, 0xe0, 0xd5, 0x22, 0x20, 0x1c, 0x08, 0x21, 0x52, 0x00, 0xff, 0xf7, + 0x87, 0xff, 0x04, 0x23, 0x18, 0x42, 0x01, 0xd0, 0x26, 0x73, 0x0b, 0xe0, + 0x1e, 0x1c, 0xff, 0xf7, 0xed, 0xfe, 0x01, 0x3e, 0xf6, 0xb2, 0xe0, 0x72, + 0x00, 0x2e, 0xf8, 0xd1, 0x02, 0x23, 0xaa, 0x28, 0x25, 0xd1, 0x23, 0x73, + 0x26, 0x7b, 0x02, 0x3e, 0x73, 0x42, 0x5e, 0x41, 0xb6, 0x07, 0x37, 0x21, + 0x00, 0x22, 0x20, 0x1c, 0xff, 0xf7, 0x6c, 0xff, 0x32, 0x1c, 0x20, 0x1c, + 0x29, 0x21, 0xff, 0xf7, 0x67, 0xff, 0x02, 0x1c, 0xe0, 0x72, 0x08, 0xd0, + 0x01, 0xf0, 0x32, 0xf9, 0xfa, 0x23, 0xc0, 0x1b, 0xdb, 0x00, 0x98, 0x42, + 0xeb, 0xd9, 0x08, 0x23, 0x09, 0xe0, 0x23, 0x7b, 0x02, 0x2b, 0x19, 0xd1, + 0x20, 0x1c, 0x3a, 0x21, 0xff, 0xf7, 0x54, 0xff, 0x00, 0x28, 0x05, 0xd0, + 0x06, 0x23, 0x63, 0x71, 0x20, 0x1c, 0xff, 0xf7, 0xc3, 0xfe, 0x15, 0xe0, + 0xff, 0xf7, 0xb8, 0xfe, 0xc0, 0x23, 0x18, 0x40, 0x98, 0x42, 0x01, 0xd1, + 0x03, 0x23, 0x23, 0x73, 0xff, 0xf7, 0xb0, 0xfe, 0xff, 0xf7, 0xae, 0xfe, + 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0xff, 0xf7, 0xb1, 0xfe, 0x20, 0x1c, + 0x01, 0x99, 0xff, 0xf7, 0xef, 0xfe, 0x05, 0x1c, 0x28, 0x1c, 0xfe, 0xbd, + 0x78, 0x07, 0x00, 0x20, 0x38, 0x01, 0x00, 0x20, 0x90, 0xd0, 0x03, 0x00, + 0x38, 0xb5, 0x04, 0x1c, 0x01, 0xf0, 0xfa, 0xf8, 0x05, 0x1c, 0xff, 0xf7, + 0x95, 0xfe, 0xe0, 0x72, 0xff, 0x28, 0x08, 0xd1, 0x01, 0xf0, 0xf2, 0xf8, + 0x96, 0x23, 0x40, 0x1b, 0x5b, 0x00, 0x98, 0x42, 0xf3, 0xd9, 0x0f, 0x23, + 0x02, 0xe0, 0xfe, 0x28, 0x06, 0xd0, 0x0d, 0x23, 0x20, 0x1c, 0x63, 0x71, + 0xff, 0xf7, 0x8a, 0xfe, 0x00, 0x20, 0x00, 0xe0, 0x01, 0x20, 0x38, 0xbd, + 0xf8, 0xb5, 0x04, 0x1c, 0x0f, 0x1c, 0x15, 0x1c, 0x1e, 0x1e, 0x45, 0xd0, + 0x9a, 0x18, 0x80, 0x23, 0x9b, 0x00, 0x9a, 0x42, 0x42, 0xdc, 0x83, 0x79, + 0x00, 0x2b, 0x05, 0xd0, 0x02, 0x68, 0x91, 0x42, 0x02, 0xd1, 0x03, 0x89, + 0xab, 0x42, 0x16, 0xd9, 0x23, 0x7b, 0x27, 0x60, 0x03, 0x2b, 0x00, 0xd0, + 0x7f, 0x02, 0x3a, 0x1c, 0x20, 0x1c, 0x11, 0x21, 0xff, 0xf7, 0xf2, 0xfe, + 0x07, 0x1e, 0x02, 0xd0, 0x03, 0x23, 0x63, 0x71, 0x2a, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xbc, 0xff, 0x00, 0x28, 0x25, 0xd0, 0x01, 0x23, 0x27, 0x81, + 0xa3, 0x71, 0x23, 0x89, 0xab, 0x42, 0x05, 0xd2, 0xff, 0xf7, 0x4e, 0xfe, + 0x23, 0x89, 0x01, 0x33, 0x23, 0x81, 0xf6, 0xe7, 0x06, 0x9d, 0x06, 0x9a, + 0xab, 0x1a, 0x9b, 0xb2, 0xb3, 0x42, 0x04, 0xd2, 0xff, 0xf7, 0x42, 0xfe, + 0x28, 0x70, 0x01, 0x35, 0xf5, 0xe7, 0x23, 0x89, 0xa2, 0x7a, 0xf3, 0x18, + 0x9b, 0xb2, 0x23, 0x81, 0x00, 0x2a, 0x02, 0xd0, 0x06, 0x4a, 0x93, 0x42, + 0x02, 0xd9, 0x20, 0x1c, 0xff, 0xf7, 0x66, 0xfe, 0x01, 0x20, 0x03, 0xe0, + 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xfe, 0x00, 0x20, 0xf8, 0xbd, 0xc0, 0x46, + 0xff, 0x01, 0x00, 0x00, 0x07, 0xb5, 0x80, 0x23, 0x00, 0x92, 0x9b, 0x00, + 0x00, 0x22, 0xff, 0xf7, 0xa3, 0xff, 0x0e, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x08, 0x1c, 0x16, 0x1c, 0xff, 0xf7, 0x12, 0xfe, 0x00, 0x24, 0x30, 0x5d, + 0xff, 0xf7, 0x0e, 0xfe, 0x01, 0x34, 0x80, 0x23, 0x9b, 0x00, 0x9c, 0x42, + 0xf7, 0xd1, 0xff, 0x20, 0xff, 0xf7, 0x06, 0xfe, 0xff, 0x20, 0xff, 0xf7, + 0x03, 0xfe, 0xff, 0xf7, 0x09, 0xfe, 0x1f, 0x23, 0xe8, 0x72, 0x03, 0x40, + 0x01, 0x20, 0x05, 0x2b, 0x05, 0xd0, 0x11, 0x23, 0x28, 0x1c, 0x6b, 0x71, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x20, 0x70, 0xbd, 0x70, 0xb5, 0x0b, 0x1c, + 0x04, 0x1c, 0x16, 0x1c, 0x00, 0x29, 0x01, 0xd1, 0x12, 0x23, 0x28, 0xe0, + 0x02, 0x7b, 0x03, 0x2a, 0x00, 0xd0, 0x4b, 0x02, 0x20, 0x1c, 0x18, 0x21, + 0x1a, 0x1c, 0xff, 0xf7, 0x7d, 0xfe, 0x05, 0x1e, 0x01, 0xd0, 0x04, 0x23, + 0x1b, 0xe0, 0x20, 0x1c, 0xfe, 0x21, 0x32, 0x1c, 0xff, 0xf7, 0xc2, 0xff, + 0x00, 0x28, 0x15, 0xd0, 0x96, 0x21, 0x20, 0x1c, 0x89, 0x00, 0xff, 0xf7, + 0x5b, 0xfe, 0x00, 0x28, 0x01, 0xd1, 0x15, 0x23, 0x0b, 0xe0, 0x20, 0x1c, + 0x0d, 0x21, 0x2a, 0x1c, 0xff, 0xf7, 0x64, 0xfe, 0x00, 0x28, 0x03, 0xd1, + 0xff, 0xf7, 0xce, 0xfd, 0x00, 0x28, 0x06, 0xd0, 0x14, 0x23, 0x63, 0x71, + 0x20, 0x1c, 0xff, 0xf7, 0xcf, 0xfd, 0x00, 0x20, 0x03, 0xe0, 0x20, 0x1c, + 0xff, 0xf7, 0xca, 0xfd, 0x01, 0x20, 0x70, 0xbd, 0x03, 0x4b, 0x04, 0x4a, + 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x70, 0x47, 0xc0, 0x46, + 0x38, 0x01, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x02, 0x1c, 0x10, 0xb5, + 0x0c, 0x32, 0x04, 0x1c, 0x01, 0x21, 0x40, 0x6a, 0x00, 0xf0, 0x24, 0xfd, + 0x00, 0x28, 0x0a, 0xd0, 0x23, 0x6a, 0x01, 0x20, 0x00, 0x2b, 0x06, 0xd1, + 0xe3, 0x68, 0x22, 0x7a, 0x23, 0x62, 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, + 0x23, 0x72, 0x10, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xe6, 0xff, + 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x1b, 0xe0, 0x63, 0x6a, 0xe6, 0x68, + 0x1a, 0x7c, 0x02, 0x3e, 0x96, 0x40, 0x5a, 0x69, 0x1d, 0x79, 0xb6, 0x18, + 0x00, 0x2d, 0x08, 0xd0, 0x70, 0x1e, 0x40, 0x19, 0x00, 0xf0, 0x4c, 0xfc, + 0x00, 0x28, 0xed, 0xd0, 0x01, 0x3d, 0xed, 0xb2, 0xf4, 0xe7, 0x63, 0x6a, + 0x01, 0x20, 0x1a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, 0xe2, 0x69, + 0xd3, 0x18, 0xe3, 0x61, 0x70, 0xbd, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x40, 0x69, 0x00, 0xf0, 0x13, 0xfc, 0x00, 0x28, 0x03, 0xd0, 0x20, 0x7e, + 0x01, 0x4b, 0x40, 0x01, 0xc0, 0x18, 0x10, 0xbd, 0x50, 0x01, 0x00, 0x20, + 0xf0, 0xb5, 0x00, 0x23, 0x87, 0xb0, 0x07, 0x1c, 0x0e, 0x1c, 0x20, 0x22, + 0xf2, 0x54, 0x01, 0x33, 0x0b, 0x2b, 0xfa, 0xd1, 0x07, 0x21, 0x00, 0x25, + 0x01, 0x91, 0x3c, 0x78, 0x00, 0x2c, 0x2a, 0xd0, 0x2e, 0x2c, 0x06, 0xd1, + 0x01, 0x9b, 0x0a, 0x2b, 0x2b, 0xd0, 0x0a, 0x21, 0x08, 0x25, 0x01, 0x91, + 0x1f, 0xe0, 0x02, 0xa8, 0x14, 0x49, 0x10, 0x22, 0x01, 0xf0, 0x69, 0xfe, + 0x00, 0x23, 0x02, 0xa9, 0xca, 0x5c, 0x00, 0x2a, 0x03, 0xd0, 0x01, 0x33, + 0xa2, 0x42, 0xf8, 0xd1, 0x19, 0xe0, 0x01, 0x9b, 0x9d, 0x42, 0x16, 0xd8, + 0x23, 0x1c, 0x21, 0x3b, 0x5d, 0x2b, 0x12, 0xd8, 0x22, 0x1c, 0x6b, 0x1c, + 0x61, 0x3a, 0xdb, 0xb2, 0x75, 0x19, 0x19, 0x2a, 0x01, 0xd8, 0x20, 0x3c, + 0xe4, 0xb2, 0x2c, 0x70, 0x1d, 0x1c, 0x01, 0x37, 0xd1, 0xe7, 0x30, 0x78, + 0x20, 0x38, 0x43, 0x1e, 0x98, 0x41, 0xc0, 0xb2, 0x00, 0xe0, 0x00, 0x20, + 0x07, 0xb0, 0xf0, 0xbd, 0xa2, 0x4b, 0x00, 0x00, 0x38, 0xb5, 0x42, 0x7a, + 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x2a, 0x01, 0xd0, 0x00, 0x20, 0x1f, 0xe0, + 0x4b, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x06, 0xd1, 0x02, 0x23, 0x43, 0x72, + 0x02, 0x62, 0x4b, 0x8c, 0x5b, 0x01, 0xc3, 0x61, 0x0c, 0xe0, 0x20, 0x2b, + 0xf0, 0xd1, 0x03, 0x23, 0x43, 0x72, 0x49, 0x6a, 0x22, 0x1c, 0x01, 0x62, + 0x1c, 0x32, 0x28, 0x1c, 0x00, 0xf0, 0x18, 0xfc, 0x00, 0x28, 0xe5, 0xd0, + 0x00, 0x23, 0x01, 0x20, 0x65, 0x62, 0x20, 0x72, 0xe3, 0x60, 0x23, 0x61, + 0x63, 0x61, 0x23, 0x76, 0x38, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x43, 0x7a, + 0x85, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x03, 0x92, 0x00, 0x2b, 0x01, 0xd1, + 0x3a, 0x48, 0x11, 0xe0, 0x03, 0x7a, 0xd8, 0x07, 0xfa, 0xd5, 0xe2, 0x69, + 0x20, 0x69, 0x03, 0x99, 0x13, 0x1a, 0x99, 0x42, 0x01, 0xd9, 0x9b, 0xb2, + 0x03, 0x93, 0x03, 0x99, 0x02, 0x91, 0x02, 0x9b, 0x00, 0x2b, 0x04, 0xd1, + 0x03, 0x99, 0x88, 0xb2, 0x00, 0xb2, 0x05, 0xb0, 0xf0, 0xbd, 0x23, 0x69, + 0x61, 0x7a, 0xdf, 0x05, 0xff, 0x0d, 0x5a, 0x0a, 0x60, 0x6a, 0x02, 0x29, + 0x02, 0xd1, 0x41, 0x6a, 0x51, 0x18, 0x1b, 0xe0, 0x05, 0x79, 0x01, 0x3d, + 0x2a, 0x40, 0xd5, 0xb2, 0x00, 0x2f, 0x0d, 0xd1, 0x00, 0x2d, 0x0b, 0xd1, + 0x00, 0x2b, 0x02, 0xd1, 0x22, 0x6a, 0xe2, 0x60, 0x06, 0xe0, 0x22, 0x1c, + 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, 0xa0, 0xfb, 0x00, 0x28, 0xc9, 0xd0, + 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, 0x5b, 0x69, 0x91, 0x40, + 0xc9, 0x18, 0x49, 0x19, 0x80, 0x22, 0x02, 0x9d, 0x92, 0x00, 0xd3, 0x1b, + 0x9d, 0x42, 0x00, 0xdd, 0x9d, 0xb2, 0x23, 0x7a, 0x58, 0x06, 0x01, 0xd4, + 0x95, 0x42, 0x18, 0xd1, 0x16, 0x4b, 0x1b, 0x68, 0x99, 0x42, 0x14, 0xd0, + 0x15, 0x4b, 0x3a, 0x1c, 0x18, 0x68, 0x00, 0x96, 0x2b, 0x1c, 0xff, 0xf7, + 0x1f, 0xfe, 0x00, 0x28, 0xa8, 0xd0, 0x76, 0x19, 0x01, 0xe0, 0xdf, 0x1b, + 0xf6, 0x19, 0x21, 0x69, 0x02, 0x9a, 0x4b, 0x19, 0x55, 0x1b, 0xad, 0xb2, + 0x23, 0x61, 0x02, 0x95, 0xab, 0xe7, 0x08, 0x1c, 0x00, 0x21, 0x00, 0xf0, + 0x2b, 0xfb, 0x00, 0x28, 0x96, 0xd0, 0x09, 0x4b, 0x32, 0x1c, 0xff, 0x18, + 0x79, 0x19, 0x3b, 0x1c, 0x8b, 0x42, 0xe8, 0xd0, 0x18, 0x78, 0x01, 0x33, + 0x10, 0x70, 0x01, 0x32, 0xf8, 0xe7, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x73, 0xb5, 0x43, 0x7a, 0x04, 0x1c, 0x01, 0x2b, 0x01, 0xd8, 0x00, 0x20, + 0x16, 0xe0, 0x03, 0x69, 0x6d, 0x46, 0x07, 0x35, 0xde, 0x05, 0x29, 0x1c, + 0x01, 0x22, 0x36, 0x0f, 0xff, 0xf7, 0x6a, 0xff, 0x01, 0x28, 0x01, 0xd1, + 0x2b, 0x78, 0x00, 0xe0, 0x05, 0x4b, 0x1b, 0xb2, 0x01, 0x33, 0xec, 0xd0, + 0x23, 0x69, 0x70, 0x01, 0x1f, 0x33, 0x23, 0x61, 0x02, 0x4b, 0xc0, 0x18, + 0x76, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0x00, 0x00, 0x50, 0x01, 0x00, 0x20, + 0x70, 0xb5, 0x04, 0x1c, 0x40, 0x7a, 0x0d, 0x1c, 0x00, 0x28, 0x2a, 0xd0, + 0xe2, 0x69, 0x91, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x25, 0xe0, 0x02, 0x28, + 0x21, 0xd0, 0x00, 0x2d, 0x01, 0xd1, 0xe5, 0x60, 0x1d, 0xe0, 0x62, 0x6a, + 0x21, 0x69, 0x13, 0x7c, 0x68, 0x1e, 0x09, 0x33, 0x4a, 0x1e, 0xd8, 0x40, + 0xda, 0x40, 0x03, 0x1e, 0x93, 0x42, 0x01, 0xd3, 0x00, 0x29, 0x02, 0xd1, + 0x22, 0x6a, 0xe2, 0x60, 0x00, 0xe0, 0x83, 0x1a, 0x1e, 0x1c, 0x00, 0x2e, + 0x09, 0xd0, 0x22, 0x1c, 0x60, 0x6a, 0xe1, 0x68, 0x0c, 0x32, 0x00, 0xf0, + 0x07, 0xfb, 0x01, 0x3e, 0x00, 0x28, 0xf4, 0xd1, 0x01, 0xe0, 0x25, 0x61, + 0x01, 0x20, 0x70, 0xbd, 0x38, 0xb5, 0x05, 0x1c, 0x40, 0x7a, 0x00, 0x28, + 0x33, 0xd0, 0x2b, 0x7a, 0x7f, 0x2b, 0x2d, 0xd9, 0x28, 0x1c, 0x01, 0x21, + 0xff, 0xf7, 0x9a, 0xfe, 0x04, 0x1e, 0x2a, 0xd0, 0x6b, 0x7a, 0x01, 0x2b, + 0x07, 0xd8, 0x2b, 0x7f, 0x03, 0x77, 0x6b, 0x7f, 0x43, 0x77, 0xab, 0x7f, + 0x83, 0x77, 0xeb, 0x7f, 0xc3, 0x77, 0x2b, 0x6a, 0x9a, 0xb2, 0x1b, 0x0c, + 0x23, 0x75, 0x1b, 0x0a, 0x63, 0x75, 0x0d, 0x4b, 0xa2, 0x76, 0x1b, 0x68, + 0x12, 0x0a, 0xe2, 0x76, 0x00, 0x2b, 0x0b, 0xd0, 0x20, 0x1c, 0x21, 0x1c, + 0x18, 0x30, 0x16, 0x31, 0x98, 0x47, 0x63, 0x7e, 0x22, 0x7e, 0x1b, 0x02, + 0x13, 0x43, 0xa3, 0x74, 0x1b, 0x0a, 0xe3, 0x74, 0x2a, 0x7a, 0x7f, 0x23, + 0x13, 0x40, 0x2b, 0x72, 0x00, 0xf0, 0x5c, 0xfa, 0xff, 0xe7, 0x38, 0xbd, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xc0, 0xff, + 0x00, 0x28, 0x02, 0xd0, 0x00, 0x23, 0x63, 0x72, 0x01, 0x20, 0x10, 0xbd, + 0x73, 0xb5, 0x42, 0x7a, 0x04, 0x1c, 0x0d, 0x1c, 0x00, 0x20, 0x01, 0x2a, + 0x4b, 0xd1, 0x20, 0x7a, 0x02, 0x23, 0x18, 0x40, 0x47, 0xd0, 0xe3, 0x69, + 0x00, 0x20, 0x99, 0x42, 0x43, 0xd8, 0x10, 0x1c, 0x00, 0x2b, 0x40, 0xd0, + 0x20, 0x1c, 0x29, 0x1c, 0x26, 0x69, 0xff, 0xf7, 0x71, 0xff, 0x00, 0x28, + 0x25, 0xd0, 0x60, 0x6a, 0x00, 0x2d, 0x06, 0xd1, 0x21, 0x6a, 0x00, 0xf0, + 0x95, 0xfb, 0x00, 0x28, 0x1d, 0xd0, 0x25, 0x62, 0x1d, 0xe0, 0xe1, 0x68, + 0x01, 0xaa, 0x00, 0xf0, 0x93, 0xfa, 0x00, 0x28, 0x15, 0xd0, 0x60, 0x6a, + 0x01, 0x99, 0x43, 0x1c, 0xdb, 0x7f, 0x10, 0x2b, 0x01, 0xd1, 0x12, 0x4b, + 0x00, 0xe0, 0x12, 0x4b, 0x99, 0x42, 0x0c, 0xd2, 0x00, 0xf0, 0x7e, 0xfb, + 0x00, 0x28, 0x06, 0xd0, 0x60, 0x6a, 0xe1, 0x68, 0x0e, 0x4a, 0x00, 0xf0, + 0xcf, 0xfa, 0x00, 0x28, 0x01, 0xd1, 0x00, 0x20, 0x11, 0xe0, 0x22, 0x7a, + 0x80, 0x23, 0x5b, 0x42, 0x13, 0x43, 0xe5, 0x61, 0x23, 0x72, 0x20, 0x1c, + 0xff, 0xf7, 0x70, 0xff, 0x00, 0x28, 0xf2, 0xd0, 0x29, 0x1e, 0xb1, 0x42, + 0x00, 0xd9, 0x31, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x35, 0xff, 0x76, 0xbd, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0xff, 0xff, 0xff, 0x0f, + 0x38, 0xb5, 0x23, 0x4b, 0x15, 0x1c, 0x4a, 0x01, 0xd3, 0x18, 0x04, 0x1c, + 0xd8, 0x7a, 0x11, 0x22, 0x10, 0x42, 0x04, 0xd0, 0x42, 0x22, 0x15, 0x42, + 0x01, 0xd0, 0x00, 0x20, 0x36, 0xe0, 0x1d, 0x4a, 0x21, 0x76, 0x12, 0x68, + 0x62, 0x61, 0x5a, 0x7d, 0x18, 0x7d, 0xd9, 0x7e, 0x12, 0x02, 0x02, 0x43, + 0x98, 0x7e, 0x09, 0x02, 0x12, 0x04, 0x01, 0x43, 0x11, 0x43, 0x21, 0x62, + 0xd8, 0x7a, 0x18, 0x22, 0x02, 0x40, 0x0c, 0xd1, 0x5a, 0x7f, 0x19, 0x7f, + 0x12, 0x02, 0x0a, 0x43, 0x99, 0x7f, 0xdb, 0x7f, 0x09, 0x04, 0x0a, 0x43, + 0x1b, 0x06, 0x13, 0x43, 0xe3, 0x61, 0x01, 0x23, 0x09, 0xe0, 0x10, 0x2a, + 0xdb, 0xd1, 0x22, 0x1c, 0x60, 0x6a, 0x1c, 0x32, 0x00, 0xf0, 0x5a, 0xfa, + 0x00, 0x28, 0xd4, 0xd0, 0x04, 0x23, 0x63, 0x72, 0x0f, 0x23, 0x00, 0x21, + 0x2b, 0x40, 0x23, 0x72, 0xe1, 0x60, 0x21, 0x61, 0x01, 0x20, 0x6a, 0x06, + 0x02, 0xd5, 0x20, 0x1c, 0xff, 0xf7, 0x60, 0xff, 0x38, 0xbd, 0xc0, 0x46, + 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0xf0, 0xb5, 0x45, 0x7a, + 0x87, 0xb0, 0x04, 0x1c, 0x0e, 0x1c, 0x01, 0x93, 0x00, 0x2d, 0x00, 0xd0, + 0x86, 0xe0, 0x10, 0x1c, 0x03, 0xa9, 0xff, 0xf7, 0xbb, 0xfd, 0x00, 0x28, + 0x00, 0xd1, 0x80, 0xe0, 0x72, 0x6a, 0x2f, 0x1c, 0x62, 0x62, 0xf5, 0x60, + 0x35, 0x61, 0x33, 0x69, 0xf2, 0x69, 0x93, 0x42, 0x26, 0xd2, 0xdb, 0x05, + 0x1b, 0x0f, 0x30, 0x1c, 0x00, 0x93, 0xff, 0xf7, 0x9f, 0xfe, 0x01, 0x1e, + 0x6f, 0xd0, 0x03, 0x78, 0x00, 0x2b, 0x01, 0xd0, 0xe5, 0x2b, 0x0b, 0xd1, + 0x00, 0x2f, 0x04, 0xd1, 0x00, 0x9b, 0x23, 0x76, 0x34, 0x4b, 0x1b, 0x68, + 0x63, 0x61, 0x0b, 0x78, 0x01, 0x27, 0x00, 0x2b, 0xe3, 0xd1, 0x0d, 0xe0, + 0x03, 0xa8, 0x0b, 0x22, 0x01, 0xf0, 0x0a, 0xfc, 0x00, 0x28, 0xdc, 0xd1, + 0x01, 0x9a, 0x30, 0x23, 0x13, 0x40, 0x30, 0x2b, 0x53, 0xd0, 0x20, 0x1c, + 0x00, 0x99, 0x4b, 0xe0, 0x01, 0x9a, 0x12, 0x23, 0x13, 0x40, 0x12, 0x2b, + 0x4b, 0xd1, 0x00, 0x2f, 0x06, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x6f, 0xfd, 0x06, 0x1e, 0x0a, 0xd1, 0x42, 0xe0, 0x73, 0x7a, 0x02, 0x2b, + 0x3f, 0xd0, 0x30, 0x1c, 0xff, 0xf7, 0x40, 0xfd, 0x00, 0x28, 0x3a, 0xd0, + 0x1f, 0x4e, 0x27, 0x76, 0x00, 0x21, 0x20, 0x22, 0x30, 0x1c, 0x01, 0xf0, + 0xfb, 0xfb, 0x30, 0x1c, 0x03, 0xa9, 0x0b, 0x22, 0x01, 0xf0, 0xed, 0xfb, + 0x1a, 0x4b, 0x1b, 0x68, 0x00, 0x2b, 0x05, 0xd0, 0x30, 0x1c, 0x31, 0x1c, + 0x10, 0x30, 0x0e, 0x31, 0x98, 0x47, 0x06, 0xe0, 0x21, 0x22, 0x32, 0x74, + 0xb3, 0x73, 0x28, 0x22, 0x08, 0x23, 0x72, 0x74, 0xf3, 0x73, 0x73, 0x7c, + 0x32, 0x7c, 0x1b, 0x02, 0x13, 0x43, 0xff, 0x22, 0x1a, 0x40, 0x1b, 0x0a, + 0xf3, 0x74, 0x73, 0x76, 0xf3, 0x7b, 0xb2, 0x74, 0x32, 0x76, 0xb2, 0x7b, + 0x1b, 0x02, 0x13, 0x43, 0xb3, 0x75, 0x1b, 0x0a, 0xf3, 0x75, 0x00, 0xf0, + 0x21, 0xf9, 0x00, 0x28, 0x07, 0xd0, 0x21, 0x7e, 0x01, 0x9a, 0x20, 0x1c, + 0xff, 0xf7, 0x26, 0xff, 0x05, 0x1c, 0x00, 0xe0, 0x00, 0x25, 0x28, 0x1c, + 0x07, 0xb0, 0xf0, 0xbd, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x44, 0x01, 0x00, 0x20, 0x10, 0xb5, 0x00, 0x21, 0x04, 0x1c, 0xff, 0xf7, + 0xbb, 0xfe, 0x00, 0x28, 0x0b, 0xd0, 0x20, 0x1c, 0x01, 0x21, 0xff, 0xf7, + 0x15, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0xe5, 0x23, 0x03, 0x70, 0x00, 0x23, + 0x63, 0x72, 0x00, 0xf0, 0xfb, 0xf8, 0x10, 0xbd, 0x10, 0xb5, 0x0a, 0x1c, + 0x0a, 0x49, 0x8a, 0xb0, 0x08, 0x31, 0x00, 0x23, 0x04, 0x1c, 0x00, 0x91, + 0x69, 0x46, 0x4b, 0x72, 0x01, 0x93, 0x68, 0x46, 0x21, 0x1c, 0x02, 0x23, + 0xff, 0xf7, 0x42, 0xff, 0x00, 0x28, 0x02, 0xd0, 0x68, 0x46, 0xff, 0xf7, + 0xd7, 0xff, 0x0a, 0xb0, 0x10, 0xbd, 0xc0, 0x46, 0xb8, 0x4b, 0x00, 0x00, + 0xf0, 0xb5, 0x43, 0x7a, 0x87, 0xb0, 0x04, 0x1c, 0x0d, 0x1c, 0x03, 0x92, + 0x01, 0x2b, 0x0d, 0xd1, 0x03, 0x7a, 0x99, 0x07, 0x0a, 0xd5, 0x5a, 0x07, + 0x0c, 0xd5, 0xe1, 0x69, 0x22, 0x69, 0x8a, 0x42, 0x08, 0xd0, 0x20, 0x1c, + 0xff, 0xf7, 0x06, 0xfe, 0x00, 0x28, 0x03, 0xd1, 0x01, 0x23, 0x63, 0x60, + 0x00, 0x20, 0xaa, 0xe0, 0x03, 0x9b, 0x01, 0x93, 0x3b, 0xe0, 0x60, 0x6a, + 0x73, 0x0a, 0x07, 0x79, 0xf6, 0x05, 0x01, 0x3f, 0x1f, 0x40, 0xff, 0xb2, + 0xf6, 0x0d, 0x00, 0x2f, 0x36, 0xd0, 0x80, 0x22, 0x92, 0x00, 0x92, 0x1b, + 0x01, 0x99, 0x92, 0xb2, 0x0b, 0x1c, 0x91, 0x42, 0x00, 0xd9, 0x13, 0x1c, + 0x9b, 0xb2, 0x02, 0x93, 0x63, 0x6a, 0xe1, 0x68, 0x1a, 0x7c, 0x02, 0x39, + 0x91, 0x40, 0x5a, 0x69, 0x8b, 0x18, 0x02, 0x9a, 0xdf, 0x19, 0x80, 0x23, + 0x9b, 0x00, 0x9a, 0x42, 0x3f, 0xd1, 0x44, 0x4b, 0x19, 0x68, 0xb9, 0x42, + 0x02, 0xd1, 0x01, 0x22, 0x52, 0x42, 0x1a, 0x60, 0x41, 0x4b, 0x39, 0x1c, + 0x18, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x22, 0xfc, 0x00, 0x28, 0xc7, 0xd0, + 0x80, 0x22, 0x92, 0x00, 0xad, 0x18, 0x01, 0x99, 0x02, 0x9a, 0x8b, 0x1a, + 0x21, 0x69, 0x9b, 0xb2, 0x01, 0x93, 0x8b, 0x18, 0x23, 0x61, 0x01, 0x9a, + 0x26, 0x69, 0x00, 0x2a, 0xbf, 0xd1, 0x49, 0xe0, 0x00, 0x2e, 0xc6, 0xd1, + 0xe1, 0x68, 0x00, 0x29, 0x03, 0xd1, 0x23, 0x6a, 0x00, 0x2b, 0x16, 0xd1, + 0x0f, 0xe0, 0x05, 0xaa, 0x00, 0xf0, 0xe2, 0xf8, 0x00, 0x28, 0x58, 0xd0, + 0x62, 0x6a, 0x05, 0x9b, 0x01, 0x32, 0xd2, 0x7f, 0x10, 0x2a, 0x01, 0xd1, + 0x2c, 0x4a, 0x00, 0xe0, 0x2c, 0x4a, 0x93, 0x42, 0x05, 0xd3, 0x20, 0x1c, + 0xff, 0xf7, 0x3c, 0xfc, 0x00, 0x28, 0xaa, 0xd1, 0x98, 0xe7, 0xe3, 0x60, + 0xa7, 0xe7, 0x00, 0x2e, 0x0f, 0xd1, 0x23, 0x69, 0xe1, 0x69, 0x8b, 0x42, + 0x0b, 0xd3, 0x00, 0xf0, 0x59, 0xf8, 0x00, 0x28, 0x8c, 0xd0, 0x1f, 0x4b, + 0x01, 0x21, 0x1f, 0x60, 0x21, 0x4b, 0x1a, 0x78, 0x0a, 0x43, 0x1a, 0x70, + 0x06, 0xe0, 0x38, 0x1c, 0x01, 0x21, 0x00, 0xf0, 0x75, 0xf8, 0x00, 0x28, + 0x00, 0xd1, 0x7d, 0xe7, 0x1c, 0x4b, 0x2a, 0x1c, 0xf6, 0x18, 0x02, 0x9b, + 0xf1, 0x18, 0x33, 0x1c, 0x8b, 0x42, 0x04, 0xd0, 0x10, 0x78, 0x01, 0x32, + 0x18, 0x70, 0x01, 0x33, 0xf8, 0xe7, 0x9e, 0x1b, 0xad, 0x19, 0xa8, 0xe7, + 0xe1, 0x69, 0x23, 0x7a, 0x8e, 0x42, 0x01, 0xd9, 0xe6, 0x61, 0x06, 0xe0, + 0x12, 0x4a, 0x12, 0x68, 0x00, 0x2a, 0x06, 0xd0, 0x03, 0x9a, 0x00, 0x2a, + 0x03, 0xd0, 0x80, 0x22, 0x52, 0x42, 0x13, 0x43, 0x23, 0x72, 0x23, 0x7a, + 0x19, 0x07, 0x01, 0xd4, 0x03, 0x98, 0x06, 0xe0, 0x20, 0x1c, 0xff, 0xf7, + 0x8b, 0xfd, 0x00, 0x28, 0x00, 0xd1, 0x51, 0xe7, 0xf6, 0xe7, 0x07, 0xb0, + 0xf0, 0xbd, 0xc0, 0x46, 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, + 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, 0x50, 0x03, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x44, 0x01, 0x00, 0x20, 0x07, 0xb5, 0x6b, 0x46, + 0xd9, 0x71, 0x07, 0x33, 0x19, 0x1c, 0x01, 0x22, 0xff, 0xf7, 0x22, 0xff, + 0x0e, 0xbd, 0x00, 0x00, 0xf8, 0xb5, 0x0f, 0x4f, 0x01, 0x20, 0x3b, 0x78, + 0x00, 0x2b, 0x18, 0xd0, 0x0d, 0x4e, 0x0e, 0x4b, 0x0e, 0x4d, 0x19, 0x68, + 0x30, 0x68, 0x2a, 0x1c, 0xff, 0xf7, 0x80, 0xfb, 0x00, 0x28, 0x0e, 0xd0, + 0x0b, 0x4c, 0x21, 0x68, 0x00, 0x29, 0x07, 0xd0, 0x30, 0x68, 0x2a, 0x1c, + 0xff, 0xf7, 0x76, 0xfb, 0x00, 0x28, 0x04, 0xd0, 0x00, 0x23, 0x23, 0x60, + 0x00, 0x23, 0x3b, 0x70, 0x01, 0x20, 0xf8, 0xbd, 0x50, 0x03, 0x00, 0x20, + 0x4c, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0x70, 0xb5, 0x0d, 0x4d, 0x04, 0x1c, 0x2b, 0x68, + 0x0e, 0x1c, 0x83, 0x42, 0x0e, 0xd0, 0xff, 0xf7, 0xcd, 0xff, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0x20, 0x0d, 0xe0, 0x08, 0x4b, 0x21, 0x1c, 0x18, 0x68, + 0x07, 0x4a, 0xff, 0xf7, 0x25, 0xfb, 0x00, 0x28, 0xf5, 0xd0, 0x2c, 0x60, + 0x05, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x16, 0x43, 0x1e, 0x70, 0x70, 0xbd, + 0x00, 0x00, 0x00, 0x20, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0x10, 0xb5, 0x04, 0x1c, 0xff, 0xf7, 0xae, 0xff, + 0x00, 0x28, 0x0f, 0xd0, 0x00, 0x23, 0x08, 0x4a, 0x00, 0x21, 0x99, 0x54, + 0x80, 0x22, 0x01, 0x33, 0x92, 0x00, 0x93, 0x42, 0xf7, 0xd1, 0x05, 0x4b, + 0x01, 0x20, 0x1c, 0x60, 0x04, 0x4b, 0x1a, 0x78, 0x02, 0x43, 0x1a, 0x70, + 0x10, 0xbd, 0xc0, 0x46, 0x50, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x03, 0x00, 0x20, 0xc3, 0x68, 0x70, 0xb5, 0x01, 0x33, 0x0c, 0x1c, + 0x15, 0x1c, 0x99, 0x42, 0x01, 0xd9, 0x00, 0x20, 0x21, 0xe0, 0x46, 0x1c, + 0xf1, 0x7f, 0xc2, 0x69, 0xe3, 0x09, 0x10, 0x29, 0x00, 0xd1, 0x23, 0x0a, + 0x98, 0x18, 0x0d, 0x4b, 0x1b, 0x68, 0x98, 0x42, 0x07, 0xd1, 0xf2, 0x7f, + 0x0b, 0x4b, 0x10, 0x2a, 0x09, 0xd1, 0xe4, 0xb2, 0x64, 0x00, 0x1b, 0x5b, + 0x0b, 0xe0, 0x00, 0x21, 0xff, 0xf7, 0x9e, 0xff, 0x00, 0x28, 0xf2, 0xd1, + 0xe3, 0xe7, 0x7f, 0x22, 0x14, 0x40, 0xa4, 0x00, 0x1b, 0x59, 0x1b, 0x01, + 0x1b, 0x09, 0x2b, 0x60, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0x00, 0x20, + 0x50, 0x01, 0x00, 0x20, 0x73, 0xb5, 0x05, 0x1c, 0x01, 0x91, 0x16, 0x1c, + 0x00, 0x24, 0x28, 0x1c, 0x01, 0x99, 0x01, 0xaa, 0xff, 0xf7, 0xc6, 0xff, + 0x00, 0x28, 0x10, 0xd0, 0x2a, 0x7c, 0x80, 0x23, 0x9b, 0x00, 0x93, 0x40, + 0xe4, 0x18, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9a, 0x10, 0x2b, 0x01, 0xd1, + 0x03, 0x4b, 0x00, 0xe0, 0x03, 0x4b, 0x9a, 0x42, 0xe9, 0xd3, 0x34, 0x60, + 0x01, 0x20, 0x76, 0xbd, 0xf8, 0xff, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x0f, + 0xf7, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x01, 0x92, 0x01, 0x29, 0x32, 0xd9, + 0xc3, 0x68, 0x00, 0x20, 0x01, 0x33, 0x99, 0x42, 0x2e, 0xd8, 0x6f, 0x1c, + 0xfa, 0x7f, 0xee, 0x69, 0xcb, 0x09, 0x10, 0x2a, 0x00, 0xd1, 0x0b, 0x0a, + 0x9e, 0x19, 0x14, 0x4b, 0x1b, 0x68, 0x9e, 0x42, 0x08, 0xd1, 0xfa, 0x7f, + 0x12, 0x4b, 0x10, 0x2a, 0x0b, 0xd1, 0xe4, 0xb2, 0x01, 0x9a, 0x64, 0x00, + 0x1a, 0x53, 0x0b, 0xe0, 0x30, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x48, 0xff, + 0x00, 0x28, 0xf0, 0xd1, 0x12, 0xe0, 0x7f, 0x22, 0x14, 0x40, 0x01, 0x9a, + 0xa4, 0x00, 0x1a, 0x51, 0x09, 0x4b, 0x01, 0x20, 0x1a, 0x78, 0x02, 0x43, + 0x1a, 0x70, 0x2b, 0x7e, 0x83, 0x42, 0x05, 0xd9, 0xab, 0x68, 0xf6, 0x18, + 0x05, 0x4b, 0x1e, 0x60, 0x00, 0xe0, 0x00, 0x20, 0xfe, 0xbd, 0xc0, 0x46, + 0x00, 0x00, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, 0x50, 0x03, 0x00, 0x20, + 0x48, 0x01, 0x00, 0x20, 0xf0, 0xb5, 0x15, 0x68, 0x87, 0xb0, 0x06, 0x1c, + 0x02, 0x91, 0x17, 0x1c, 0x00, 0x2d, 0x03, 0xd0, 0x00, 0x21, 0x01, 0x35, + 0x01, 0x91, 0x06, 0xe0, 0x02, 0x9b, 0x05, 0x68, 0x01, 0x3b, 0x5a, 0x42, + 0x53, 0x41, 0xdb, 0xb2, 0x01, 0x93, 0xf2, 0x68, 0x00, 0x23, 0x01, 0x32, + 0x03, 0x92, 0x2c, 0x1c, 0x00, 0x93, 0x00, 0x99, 0xf2, 0x68, 0x91, 0x42, + 0x21, 0xd2, 0x03, 0x9b, 0x9c, 0x42, 0x01, 0xd9, 0x02, 0x24, 0x25, 0x1c, + 0x30, 0x1c, 0x21, 0x1c, 0x05, 0xaa, 0xff, 0xf7, 0x43, 0xff, 0x00, 0x28, + 0x15, 0xd0, 0x05, 0x99, 0x63, 0x1c, 0x00, 0x29, 0x01, 0xd0, 0x1d, 0x1c, + 0x03, 0xe0, 0x02, 0x99, 0x5a, 0x1b, 0x8a, 0x42, 0x04, 0xd0, 0x00, 0x9a, + 0x1c, 0x1c, 0x01, 0x32, 0x00, 0x92, 0xe0, 0xe7, 0x30, 0x1c, 0x21, 0x1c, + 0x13, 0x4a, 0xff, 0xf7, 0x7f, 0xff, 0x00, 0x28, 0x0b, 0xd1, 0x00, 0x20, + 0x1d, 0xe0, 0x63, 0x1e, 0x30, 0x1c, 0x19, 0x1c, 0x22, 0x1c, 0x00, 0x93, + 0xff, 0xf7, 0x74, 0xff, 0x00, 0x28, 0xf4, 0xd0, 0x00, 0x9c, 0xac, 0x42, + 0xf3, 0xd8, 0x39, 0x68, 0x00, 0x29, 0x06, 0xd1, 0x01, 0x99, 0x3d, 0x60, + 0x00, 0x29, 0x09, 0xd0, 0x01, 0x35, 0x35, 0x60, 0x06, 0xe0, 0x30, 0x1c, + 0x2a, 0x1c, 0xff, 0xf7, 0x61, 0xff, 0x00, 0x28, 0xf2, 0xd1, 0xe0, 0xe7, + 0x01, 0x20, 0x07, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, 0xff, 0xff, 0xff, 0x0f, + 0x02, 0x23, 0x37, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x03, 0x60, 0x28, 0x1c, + 0x21, 0x1c, 0x01, 0xaa, 0xff, 0xf7, 0xfc, 0xfe, 0x00, 0x28, 0x12, 0xd0, + 0x28, 0x1c, 0x21, 0x1c, 0x00, 0x22, 0xff, 0xf7, 0x47, 0xff, 0x00, 0x28, + 0x0b, 0xd0, 0x6b, 0x1c, 0xdb, 0x7f, 0x01, 0x9c, 0x10, 0x2b, 0x01, 0xd1, + 0x04, 0x4b, 0x00, 0xe0, 0x04, 0x4b, 0x9c, 0x42, 0xe7, 0xd3, 0x01, 0x20, + 0x00, 0xe0, 0x00, 0x20, 0x3e, 0xbd, 0xc0, 0x46, 0xf8, 0xff, 0x00, 0x00, + 0xf8, 0xff, 0xff, 0x0f, 0xf8, 0xb5, 0x44, 0x4b, 0x04, 0x1c, 0x15, 0x1c, + 0x19, 0x60, 0x29, 0xd0, 0x04, 0x2a, 0x01, 0xd9, 0x00, 0x20, 0x7d, 0xe0, + 0x00, 0x20, 0x01, 0x1c, 0xff, 0xf7, 0x90, 0xfe, 0x00, 0x28, 0xf7, 0xd0, + 0x2d, 0x01, 0x3d, 0x4b, 0xa9, 0x35, 0xff, 0x35, 0x5d, 0x19, 0xaa, 0x79, + 0xab, 0x1d, 0x50, 0x06, 0xee, 0xd1, 0xea, 0x7c, 0xa9, 0x7c, 0x12, 0x02, + 0x0a, 0x43, 0x29, 0x7d, 0x09, 0x04, 0x0a, 0x43, 0x69, 0x7d, 0x09, 0x06, + 0x0a, 0x43, 0x63, 0x2a, 0xe2, 0xd9, 0xaa, 0x7b, 0xed, 0x7b, 0x2d, 0x02, + 0x15, 0x43, 0x9a, 0x7a, 0xdb, 0x7a, 0x12, 0x04, 0x15, 0x43, 0x1b, 0x06, + 0x1d, 0x43, 0xd7, 0xd0, 0x28, 0x1c, 0x00, 0x21, 0xff, 0xf7, 0x6a, 0xfe, + 0x00, 0x28, 0xd1, 0xd0, 0x2a, 0x4b, 0x19, 0x7b, 0xda, 0x7a, 0x09, 0x02, + 0x11, 0x43, 0x80, 0x22, 0x92, 0x00, 0x91, 0x42, 0xc8, 0xd1, 0x1a, 0x7c, + 0x00, 0x2a, 0xc5, 0xd0, 0xd9, 0x89, 0x00, 0x29, 0xc2, 0xd0, 0x59, 0x7b, + 0x00, 0x29, 0xbf, 0xd0, 0x22, 0x76, 0x00, 0x22, 0x21, 0x71, 0x22, 0x74, + 0x22, 0x7c, 0x01, 0x20, 0x90, 0x40, 0x81, 0x42, 0x04, 0xd0, 0x50, 0x1c, + 0x20, 0x74, 0x07, 0x2a, 0xf6, 0xd9, 0xb1, 0xe7, 0xd9, 0x8a, 0x00, 0x29, + 0x00, 0xd1, 0x59, 0x6a, 0xa1, 0x60, 0xd8, 0x89, 0x28, 0x18, 0xe0, 0x61, + 0x1f, 0x69, 0x3e, 0x02, 0x36, 0x0c, 0x66, 0x84, 0xb7, 0xb2, 0x1e, 0x7c, + 0x71, 0x43, 0x0e, 0x18, 0x13, 0x48, 0x79, 0x01, 0x09, 0x18, 0x49, 0x12, + 0x71, 0x18, 0x66, 0x62, 0x61, 0x61, 0x18, 0x7d, 0xde, 0x7c, 0x00, 0x02, + 0x30, 0x43, 0x00, 0xd1, 0x18, 0x6a, 0x6d, 0x1a, 0x28, 0x18, 0xd0, 0x40, + 0x02, 0x1c, 0xe0, 0x60, 0x0b, 0x48, 0x61, 0x1c, 0x82, 0x42, 0x01, 0xd8, + 0x0c, 0x23, 0x07, 0xe0, 0x09, 0x48, 0x82, 0x42, 0x01, 0xd8, 0x10, 0x23, + 0x02, 0xe0, 0xdb, 0x6a, 0x63, 0x62, 0x20, 0x23, 0xcb, 0x77, 0x01, 0x20, + 0xf8, 0xbd, 0xc0, 0x46, 0x4c, 0x01, 0x00, 0x20, 0x50, 0x01, 0x00, 0x20, + 0xff, 0x01, 0x00, 0x00, 0xf4, 0x0f, 0x00, 0x00, 0xf4, 0xff, 0x00, 0x00, + 0x08, 0xb5, 0x05, 0x49, 0x05, 0x4a, 0x06, 0x48, 0x00, 0xf0, 0x10, 0xf8, + 0x05, 0x4b, 0x06, 0x49, 0x00, 0x22, 0x1a, 0x70, 0x5a, 0x54, 0x08, 0xbd, + 0x00, 0x4c, 0x00, 0x00, 0x01, 0x04, 0x00, 0x00, 0x54, 0x03, 0x00, 0x20, + 0x6c, 0x03, 0x00, 0x20, 0x02, 0x04, 0x00, 0x00, 0x30, 0xb5, 0x09, 0x4c, + 0x09, 0x4b, 0xa5, 0x68, 0x6d, 0x03, 0x6d, 0x0f, 0xad, 0x00, 0xeb, 0x58, + 0x03, 0x60, 0xa4, 0x68, 0x01, 0x61, 0xa4, 0xb2, 0x44, 0x60, 0x5c, 0x43, + 0x9b, 0x00, 0x84, 0x60, 0xc3, 0x60, 0x42, 0x61, 0x30, 0xbd, 0xc0, 0x46, + 0x00, 0x40, 0x00, 0x41, 0x00, 0x51, 0x00, 0x00, 0xf7, 0xb5, 0x1f, 0x4e, + 0x80, 0x27, 0x75, 0x68, 0x03, 0x33, 0x3d, 0x43, 0x9b, 0x08, 0x75, 0x60, + 0x00, 0x2b, 0x34, 0xd0, 0x1b, 0x4d, 0x35, 0x80, 0x35, 0x7d, 0xef, 0x07, + 0xfc, 0xd5, 0x1d, 0x1c, 0x5f, 0x1b, 0x01, 0x97, 0x07, 0x68, 0xbf, 0x08, + 0xbc, 0x46, 0x01, 0x9f, 0x67, 0x45, 0x1f, 0xd2, 0x00, 0x2d, 0x1d, 0xd0, + 0x17, 0x78, 0x01, 0x3d, 0x01, 0x97, 0xff, 0x27, 0xbc, 0x43, 0x01, 0x9f, + 0x3c, 0x43, 0x57, 0x78, 0x3f, 0x02, 0x01, 0x97, 0x0f, 0x4f, 0x3c, 0x40, + 0x01, 0x9f, 0x3c, 0x43, 0x97, 0x78, 0x3f, 0x04, 0xbc, 0x46, 0x0d, 0x4f, + 0x3c, 0x40, 0xd7, 0x78, 0xa4, 0xb2, 0x3f, 0x06, 0x00, 0x97, 0x67, 0x46, + 0x3c, 0x43, 0x00, 0x9f, 0x04, 0x32, 0x3c, 0x43, 0x10, 0xc1, 0xd7, 0xe7, + 0x07, 0x4b, 0x33, 0x80, 0x33, 0x7d, 0xdf, 0x07, 0xfc, 0xd5, 0x2b, 0x1c, + 0xc8, 0xe7, 0xf7, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x44, 0xa5, 0xff, 0xff, + 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0xff, 0x04, 0xa5, 0xff, 0xff, + 0x04, 0x4b, 0x05, 0x4a, 0x49, 0x08, 0xd9, 0x61, 0x1a, 0x80, 0x1a, 0x7d, + 0xd1, 0x07, 0xfc, 0xd5, 0x70, 0x47, 0xc0, 0x46, 0x00, 0x40, 0x00, 0x41, + 0x02, 0xa5, 0xff, 0xff, 0x70, 0xb5, 0x05, 0x1c, 0x0c, 0x1c, 0x16, 0x1c, + 0xeb, 0x68, 0x28, 0x1c, 0x21, 0x1c, 0x9e, 0x42, 0x05, 0xd9, 0xff, 0xf7, + 0xe7, 0xff, 0xeb, 0x68, 0xe4, 0x18, 0xf6, 0x1a, 0xf4, 0xe7, 0xff, 0xf7, + 0xe1, 0xff, 0x70, 0xbd, 0x43, 0x7a, 0x00, 0x2b, 0x04, 0xd1, 0x83, 0x72, + 0xc3, 0x72, 0xc3, 0x60, 0x01, 0x23, 0x43, 0x72, 0x70, 0x47, 0x30, 0xb5, + 0x85, 0xb0, 0x04, 0x1c, 0x02, 0xad, 0x00, 0x68, 0x02, 0x91, 0x03, 0x92, + 0x00, 0xf0, 0x8a, 0xfc, 0x6b, 0x79, 0xe1, 0x79, 0x22, 0x7a, 0x00, 0x93, + 0x20, 0x68, 0x00, 0x23, 0x00, 0xf0, 0x24, 0xfd, 0x29, 0x79, 0x20, 0x68, + 0x02, 0x9a, 0x00, 0xf0, 0x4d, 0xfc, 0x20, 0x68, 0x00, 0xf0, 0x70, 0xfc, + 0x05, 0xb0, 0x30, 0xbd, 0x70, 0xb5, 0x04, 0x1c, 0x18, 0x26, 0xff, 0xf7, + 0xd7, 0xff, 0x20, 0x79, 0x33, 0x1c, 0x43, 0x43, 0x0d, 0x4d, 0x08, 0x21, + 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x0a, 0xfb, 0xa0, 0x79, 0x33, 0x1c, + 0x43, 0x43, 0x08, 0x21, 0xeb, 0x18, 0x59, 0x56, 0x00, 0xf0, 0x02, 0xfb, + 0x60, 0x79, 0x08, 0x21, 0x46, 0x43, 0xad, 0x19, 0x69, 0x56, 0x00, 0xf0, + 0xfb, 0xfa, 0x04, 0x4b, 0x20, 0x1c, 0x06, 0xcb, 0xff, 0xf7, 0xc3, 0xff, + 0x70, 0xbd, 0xc0, 0x46, 0x20, 0x51, 0x00, 0x00, 0x70, 0x07, 0x00, 0x20, + 0x07, 0xb5, 0x83, 0x7a, 0x00, 0x91, 0x01, 0x92, 0x00, 0x2b, 0x0d, 0xd0, + 0x9a, 0x07, 0x06, 0xd5, 0xef, 0xf3, 0x10, 0x83, 0x5a, 0x42, 0x53, 0x41, + 0xc3, 0x72, 0x72, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, + 0x03, 0x4b, 0x9a, 0x60, 0x00, 0x99, 0x01, 0x9a, 0xff, 0xf7, 0xa5, 0xff, + 0x07, 0xbd, 0xc0, 0x46, 0x00, 0x18, 0x00, 0x40, 0x83, 0x7a, 0x00, 0x2b, + 0x0b, 0xd0, 0x9a, 0x07, 0x04, 0xd5, 0xc3, 0x7a, 0x00, 0x2b, 0x06, 0xd0, + 0x62, 0xb6, 0x04, 0xe0, 0xda, 0x07, 0x02, 0xd5, 0x82, 0x89, 0x01, 0x4b, + 0xda, 0x60, 0x70, 0x47, 0x00, 0x18, 0x00, 0x40, 0x08, 0xb5, 0x00, 0x68, + 0x00, 0xf0, 0x27, 0xfc, 0x08, 0xbd, 0x00, 0x00, 0x09, 0x4b, 0x0a, 0x4a, + 0x0a, 0x49, 0x1a, 0x60, 0x00, 0x22, 0x5a, 0x71, 0x1a, 0x71, 0x09, 0x4b, + 0x19, 0x60, 0x16, 0x21, 0x19, 0x71, 0x18, 0x21, 0x99, 0x71, 0x17, 0x21, + 0x59, 0x71, 0x01, 0x21, 0x5a, 0x72, 0xd9, 0x71, 0x1a, 0x72, 0x70, 0x47, + 0x70, 0x07, 0x00, 0x20, 0x00, 0x09, 0x3d, 0x00, 0x10, 0x09, 0x00, 0x20, + 0x78, 0x07, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, 0x00, 0xf0, 0x78, 0xfd, + 0x08, 0xbd, 0xc0, 0x46, 0x44, 0x08, 0x00, 0x20, 0x08, 0xb5, 0x02, 0x48, + 0x00, 0xf0, 0x70, 0xfd, 0x08, 0xbd, 0xc0, 0x46, 0x88, 0x07, 0x00, 0x20, + 0xf7, 0xb5, 0x16, 0x4f, 0x16, 0x49, 0x38, 0x1c, 0x00, 0xf0, 0x3a, 0xfb, + 0x15, 0x49, 0x16, 0x48, 0x00, 0xf0, 0x36, 0xfb, 0x15, 0x49, 0x16, 0x48, + 0x00, 0xf0, 0x32, 0xfb, 0x15, 0x49, 0x16, 0x48, 0x00, 0xf0, 0x2e, 0xfb, + 0x15, 0x49, 0x16, 0x48, 0x00, 0xf0, 0x2a, 0xfb, 0x15, 0x4d, 0x03, 0x26, + 0x01, 0x24, 0x28, 0x1c, 0x14, 0x49, 0x00, 0xf0, 0x23, 0xfb, 0x39, 0x1c, + 0x00, 0x96, 0x23, 0x1c, 0x01, 0x94, 0x00, 0x22, 0x11, 0x48, 0x00, 0xf0, + 0x35, 0xfd, 0x00, 0x96, 0x29, 0x1c, 0x01, 0x94, 0x1f, 0x22, 0x1e, 0x23, + 0x0e, 0x48, 0x00, 0xf0, 0x2d, 0xfd, 0xf7, 0xbd, 0x04, 0x09, 0x00, 0x20, + 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, 0x08, 0x09, 0x00, 0x20, + 0x00, 0x10, 0x00, 0x42, 0x0c, 0x09, 0x00, 0x20, 0x00, 0x14, 0x00, 0x42, + 0x00, 0x09, 0x00, 0x20, 0x00, 0x18, 0x00, 0x42, 0x10, 0x09, 0x00, 0x20, + 0x14, 0x09, 0x00, 0x20, 0x00, 0x1c, 0x00, 0x42, 0x44, 0x08, 0x00, 0x20, + 0x88, 0x07, 0x00, 0x20, 0xfe, 0xe7, 0x00, 0x00, 0x08, 0xb5, 0x03, 0x4b, + 0x1b, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x98, 0x47, 0x08, 0xbd, 0xc0, 0x46, + 0x18, 0x09, 0x00, 0x20, 0x38, 0xb5, 0x0f, 0x49, 0x0f, 0x4c, 0xa1, 0x42, + 0x04, 0xd1, 0x00, 0xf0, 0x4f, 0xf8, 0xfe, 0xf7, 0xbd, 0xfa, 0x0b, 0xe0, + 0x0c, 0x4d, 0x8d, 0x42, 0xf7, 0xd0, 0x00, 0x23, 0xca, 0x18, 0xe8, 0x18, + 0xa2, 0x42, 0x04, 0xd2, 0x00, 0x68, 0x04, 0x33, 0x10, 0x60, 0xf7, 0xe7, + 0xfe, 0xe7, 0x90, 0x42, 0xeb, 0xd0, 0x06, 0x4b, 0x06, 0x4a, 0x93, 0x42, + 0xe7, 0xd2, 0x00, 0x22, 0x04, 0xc3, 0xf9, 0xe7, 0x00, 0x00, 0x00, 0x20, + 0xa0, 0x00, 0x00, 0x20, 0xe0, 0x55, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x20, + 0x30, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x00, 0xf0, 0x26, 0xf8, 0x00, 0x28, + 0x01, 0xd1, 0x00, 0xf0, 0x17, 0xf8, 0x08, 0xbd, 0x01, 0x4b, 0x18, 0x68, + 0x70, 0x47, 0xc0, 0x46, 0x1c, 0x09, 0x00, 0x20, 0x70, 0xb5, 0x04, 0x1e, + 0x08, 0xd0, 0x05, 0x4b, 0x1d, 0x68, 0x1e, 0x1c, 0x00, 0xf0, 0x12, 0xf8, + 0x33, 0x68, 0x5b, 0x1b, 0xa3, 0x42, 0xf9, 0xd3, 0x70, 0xbd, 0xc0, 0x46, + 0x1c, 0x09, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, 0x1a, 0x68, 0x01, 0x32, + 0x1a, 0x60, 0x00, 0xf0, 0x61, 0xfa, 0x08, 0xbd, 0x1c, 0x09, 0x00, 0x20, + 0x70, 0x47, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0x70, 0xb5, 0x49, 0x4a, + 0x1e, 0x21, 0x53, 0x68, 0x02, 0x20, 0x8b, 0x43, 0x03, 0x43, 0x47, 0x49, + 0x53, 0x60, 0x8b, 0x69, 0x08, 0x24, 0x23, 0x43, 0x8b, 0x61, 0x45, 0x4c, + 0x45, 0x4b, 0x9c, 0x82, 0x9c, 0x8a, 0x20, 0x43, 0x98, 0x82, 0x10, 0x1c, + 0xda, 0x68, 0x94, 0x07, 0xfc, 0xd5, 0x42, 0x4a, 0x01, 0x24, 0x14, 0x70, + 0x14, 0x78, 0xe5, 0x07, 0x04, 0xd5, 0x3f, 0x4c, 0x64, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xf7, 0xdb, 0x01, 0x24, 0x94, 0x60, 0x54, 0x78, 0x64, 0xb2, + 0x00, 0x2c, 0xfb, 0xdb, 0x3a, 0x4d, 0x39, 0x4c, 0x65, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x82, 0x25, 0x35, 0x4c, 0xed, 0x01, + 0x65, 0x80, 0x54, 0x78, 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x02, 0x24, + 0x9c, 0x84, 0xdc, 0x68, 0xe6, 0x06, 0xfc, 0xd5, 0x31, 0x4d, 0x2e, 0x4c, + 0xe5, 0x62, 0xdd, 0x68, 0x2c, 0x4c, 0xee, 0x06, 0xfb, 0xd5, 0xa5, 0x8c, + 0x2e, 0x4e, 0x35, 0x43, 0xa5, 0x84, 0xdd, 0x68, 0x28, 0x4c, 0xee, 0x06, + 0xfb, 0xd5, 0xa5, 0x8c, 0x02, 0x26, 0x35, 0x43, 0xa5, 0x84, 0xdc, 0x68, + 0x25, 0x06, 0xfc, 0xd5, 0x23, 0x4c, 0xe4, 0x68, 0x66, 0x06, 0xf8, 0xd5, + 0xdc, 0x68, 0xe5, 0x06, 0xfc, 0xd5, 0x00, 0x24, 0x94, 0x60, 0x54, 0x78, + 0x64, 0xb2, 0x00, 0x2c, 0xfb, 0xdb, 0x22, 0x4d, 0x1d, 0x4c, 0x65, 0x60, + 0x55, 0x78, 0x1c, 0x4c, 0x6d, 0xb2, 0x00, 0x2d, 0xfa, 0xdb, 0x1e, 0x6a, + 0x1e, 0x4d, 0x35, 0x40, 0x1d, 0x62, 0x1d, 0x6a, 0x80, 0x26, 0xb5, 0x43, + 0x1d, 0x62, 0x03, 0x23, 0xa3, 0x60, 0x1b, 0x4b, 0x63, 0x60, 0x53, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x00, 0x23, 0x0b, 0x72, 0x18, 0x4a, + 0x4b, 0x72, 0x8b, 0x72, 0xcb, 0x72, 0x17, 0x4b, 0xff, 0x21, 0x1a, 0x60, + 0x16, 0x4b, 0x17, 0x4a, 0x1b, 0x68, 0x12, 0x68, 0x5c, 0x01, 0xd2, 0x0e, + 0x21, 0x40, 0x11, 0x43, 0x9a, 0x06, 0x52, 0x0f, 0x12, 0x02, 0x0b, 0x1c, + 0x13, 0x43, 0x12, 0x4a, 0x13, 0x85, 0x43, 0x68, 0x80, 0x22, 0x13, 0x43, + 0x43, 0x60, 0x70, 0xbd, 0x00, 0x40, 0x00, 0x41, 0x00, 0x04, 0x00, 0x40, + 0x0c, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x0c, 0x00, 0x40, + 0x01, 0x05, 0x01, 0x00, 0xb9, 0x05, 0xff, 0x7d, 0x04, 0x0a, 0x00, 0x00, + 0x00, 0x07, 0x03, 0x00, 0xff, 0xfc, 0xff, 0xff, 0x03, 0x06, 0x01, 0x00, + 0x00, 0x6c, 0xdc, 0x02, 0x04, 0x00, 0x00, 0x20, 0x24, 0x60, 0x80, 0x00, + 0x20, 0x60, 0x80, 0x00, 0x00, 0x40, 0x00, 0x42, 0x31, 0x4b, 0xfa, 0x21, + 0x18, 0x68, 0x10, 0xb5, 0x89, 0x00, 0x00, 0xf0, 0x43, 0xfd, 0x2f, 0x4b, + 0x01, 0x38, 0x98, 0x42, 0x24, 0xd8, 0x2e, 0x4a, 0x2e, 0x4b, 0x50, 0x60, + 0x18, 0x6a, 0xc0, 0x21, 0x00, 0x02, 0x00, 0x0a, 0x09, 0x06, 0x01, 0x43, + 0x19, 0x62, 0x00, 0x24, 0x07, 0x21, 0x94, 0x60, 0x11, 0x60, 0x19, 0x6a, + 0x80, 0x22, 0x09, 0x02, 0x09, 0x0a, 0x12, 0x06, 0x0a, 0x43, 0x1a, 0x62, + 0x25, 0x4b, 0xfc, 0x21, 0x1a, 0x6a, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, + 0xfc, 0x22, 0x92, 0x01, 0x0a, 0x43, 0x1a, 0x62, 0x19, 0x6a, 0xa0, 0x22, + 0xd2, 0x02, 0x0a, 0x43, 0x1a, 0x62, 0x00, 0xe0, 0xfe, 0xe7, 0x20, 0x1c, + 0x00, 0x21, 0x01, 0x34, 0x00, 0xf0, 0x70, 0xf8, 0x14, 0x2c, 0xf8, 0xd1, + 0x1a, 0x4c, 0x63, 0x78, 0x5b, 0xb2, 0x00, 0x2b, 0xfa, 0xdb, 0x19, 0x4b, + 0x63, 0x80, 0x19, 0x4b, 0x5a, 0x7e, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, + 0xe4, 0x22, 0xd2, 0x00, 0x9a, 0x80, 0x3f, 0x22, 0xda, 0x70, 0x59, 0x7e, + 0x13, 0x4a, 0xc9, 0x09, 0x01, 0x29, 0xfa, 0xd0, 0xc0, 0x23, 0x5b, 0x01, + 0x00, 0x20, 0x13, 0x61, 0x90, 0x70, 0x00, 0xf0, 0x23, 0xf8, 0x63, 0x78, + 0x5b, 0xb2, 0x00, 0x2b, 0xfb, 0xdb, 0x0d, 0x4a, 0x09, 0x4b, 0x5a, 0x80, + 0x0c, 0x4b, 0xda, 0x79, 0xd2, 0x09, 0x01, 0x2a, 0xfa, 0xd0, 0x41, 0x22, + 0x5a, 0x70, 0x10, 0xbd, 0x04, 0x00, 0x00, 0x20, 0xff, 0xff, 0xff, 0x00, + 0x10, 0xe0, 0x00, 0xe0, 0x00, 0xed, 0x00, 0xe0, 0x00, 0x04, 0x00, 0x40, + 0x00, 0x0c, 0x00, 0x40, 0x1e, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x42, + 0x21, 0x40, 0x00, 0x00, 0x00, 0x48, 0x00, 0x42, 0x00, 0xb5, 0x14, 0x4a, + 0x51, 0x7e, 0x13, 0x1c, 0xc9, 0x09, 0x01, 0x29, 0xf9, 0xd0, 0x01, 0x38, + 0x04, 0x28, 0x13, 0xd8, 0x19, 0x69, 0x10, 0x4a, 0x0a, 0x40, 0x1a, 0x61, + 0x5a, 0x78, 0x0f, 0x21, 0x8a, 0x43, 0x00, 0xf0, 0xb5, 0xfc, 0x03, 0x05, + 0x09, 0x07, 0x03, 0x00, 0x01, 0x21, 0x02, 0xe0, 0x03, 0x21, 0x00, 0xe0, + 0x02, 0x21, 0x0a, 0x43, 0x5a, 0x70, 0x0a, 0xe0, 0x11, 0x69, 0xf0, 0x23, + 0x1b, 0x05, 0x0b, 0x43, 0x13, 0x61, 0x53, 0x78, 0x0f, 0x21, 0x8b, 0x43, + 0x02, 0x21, 0x0b, 0x43, 0x53, 0x70, 0x00, 0xbd, 0x00, 0x40, 0x00, 0x42, + 0xff, 0xff, 0xff, 0xf0, 0x10, 0xb5, 0x18, 0x24, 0x02, 0x1c, 0x20, 0x1c, + 0x50, 0x43, 0x27, 0x4b, 0x18, 0x18, 0x00, 0x7a, 0x40, 0xb2, 0x01, 0x30, + 0x46, 0xd0, 0x03, 0x29, 0x44, 0xd8, 0x08, 0x1c, 0x21, 0x1c, 0x00, 0xf0, + 0x89, 0xfc, 0x02, 0x33, 0x11, 0x21, 0x62, 0x43, 0x98, 0x56, 0x9a, 0x18, + 0xc3, 0x01, 0x1f, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, 0x40, 0x31, + 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x59, 0x60, 0x2f, 0xe0, + 0x62, 0x43, 0x98, 0x56, 0x18, 0x49, 0x9a, 0x18, 0x52, 0x68, 0xc3, 0x01, + 0x5b, 0x18, 0x99, 0x18, 0x40, 0x31, 0x06, 0x20, 0x08, 0x70, 0x01, 0x21, + 0x91, 0x40, 0x59, 0x60, 0x99, 0x61, 0x1f, 0xe0, 0x51, 0x43, 0x5a, 0x56, + 0x10, 0x48, 0x59, 0x18, 0x4b, 0x68, 0xd2, 0x01, 0x11, 0x18, 0xc8, 0x18, + 0x40, 0x30, 0x06, 0x24, 0x04, 0x70, 0x01, 0x20, 0x98, 0x40, 0x48, 0x60, + 0x0b, 0x49, 0x52, 0x18, 0x50, 0x60, 0x0d, 0xe0, 0x62, 0x43, 0x98, 0x56, + 0x9a, 0x18, 0xc3, 0x01, 0x06, 0x48, 0x52, 0x68, 0x1b, 0x18, 0x99, 0x18, + 0x40, 0x31, 0x02, 0x20, 0x08, 0x70, 0x01, 0x21, 0x91, 0x40, 0x99, 0x60, + 0x10, 0xbd, 0xc0, 0x46, 0x20, 0x51, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x23, 0x58, 0x43, 0x13, 0x4a, 0xf0, 0xb5, + 0x13, 0x18, 0x08, 0x24, 0x1c, 0x57, 0x01, 0x34, 0x1f, 0xd0, 0x82, 0x56, + 0x10, 0x4e, 0xd2, 0x01, 0x5d, 0x68, 0x01, 0x24, 0x90, 0x19, 0x23, 0x1c, + 0x86, 0x68, 0xab, 0x40, 0x1e, 0x42, 0x0b, 0xd1, 0x0e, 0x1c, 0x77, 0x1e, + 0xbe, 0x41, 0x40, 0x19, 0x34, 0x40, 0x40, 0x30, 0xa5, 0x00, 0x04, 0x78, + 0x04, 0x26, 0xb4, 0x43, 0x2c, 0x43, 0x04, 0x70, 0x00, 0x29, 0x03, 0xd1, + 0x05, 0x49, 0x52, 0x18, 0x53, 0x60, 0x02, 0xe0, 0x02, 0x4e, 0x92, 0x19, + 0x93, 0x61, 0xf0, 0xbd, 0x20, 0x51, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, + 0x10, 0x44, 0x00, 0x41, 0x18, 0x22, 0x42, 0x43, 0xf8, 0xb5, 0x2d, 0x4d, + 0x08, 0x24, 0xaa, 0x18, 0x14, 0x57, 0x03, 0x1c, 0x62, 0x1c, 0x50, 0xd0, + 0x48, 0x1c, 0x00, 0x24, 0x0c, 0x28, 0x4c, 0xd8, 0x00, 0xf0, 0x00, 0xfc, + 0x07, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x1e, 0x0a, 0x0a, 0x0a, + 0x0a, 0x00, 0x01, 0x24, 0x64, 0x42, 0x40, 0xe0, 0x09, 0x29, 0x02, 0xd1, + 0x18, 0x1c, 0x00, 0x21, 0x03, 0xe0, 0x0a, 0x29, 0x04, 0xd1, 0x18, 0x1c, + 0x02, 0x21, 0xff, 0xf7, 0x51, 0xff, 0x23, 0xe0, 0x00, 0x24, 0x0b, 0x29, + 0x31, 0xd1, 0x18, 0x1c, 0x01, 0x21, 0xff, 0xf7, 0x49, 0xff, 0x2c, 0xe0, + 0x18, 0x22, 0x53, 0x43, 0xea, 0x18, 0x52, 0x68, 0xeb, 0x56, 0x01, 0x20, + 0x14, 0x1c, 0x04, 0x40, 0x55, 0x08, 0xdb, 0x01, 0x00, 0x2c, 0x11, 0xd0, + 0x12, 0x4c, 0x1b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, 0x0c, 0x01, + 0x0f, 0x21, 0x31, 0x40, 0x21, 0x43, 0x9a, 0x18, 0xc9, 0xb2, 0x29, 0x70, + 0x40, 0x32, 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x00, 0x24, 0x0e, 0xe0, + 0x09, 0x4e, 0x0f, 0x27, 0x9b, 0x19, 0x5d, 0x19, 0x30, 0x35, 0x2e, 0x78, + 0x9a, 0x18, 0xbe, 0x43, 0x31, 0x43, 0xc9, 0xb2, 0x29, 0x70, 0x40, 0x32, + 0x13, 0x78, 0x18, 0x43, 0x10, 0x70, 0x20, 0x1c, 0xf8, 0xbd, 0xc0, 0x46, + 0x20, 0x51, 0x00, 0x00, 0x00, 0x44, 0x00, 0x41, 0xf7, 0xb5, 0x8a, 0x18, + 0x06, 0x1c, 0x0d, 0x1c, 0x01, 0x92, 0x0c, 0x1c, 0x01, 0x9b, 0x67, 0x1b, + 0x9c, 0x42, 0x07, 0xd0, 0x33, 0x68, 0x21, 0x78, 0x1b, 0x68, 0x30, 0x1c, + 0x98, 0x47, 0x01, 0x34, 0x00, 0x28, 0xf3, 0xd1, 0x38, 0x1c, 0xfe, 0xbd, + 0x15, 0x4a, 0x13, 0x68, 0x58, 0x1c, 0x25, 0xd0, 0x01, 0x3b, 0x13, 0x60, + 0x00, 0x2b, 0x21, 0xd1, 0x72, 0xb6, 0x12, 0x4a, 0x12, 0x4b, 0x04, 0x32, + 0x9a, 0x42, 0x07, 0xd8, 0xbf, 0xf3, 0x4f, 0x8f, 0x10, 0x4a, 0x11, 0x4b, + 0xda, 0x60, 0xbf, 0xf3, 0x4f, 0x8f, 0x11, 0xe0, 0x0f, 0x4b, 0x19, 0x7d, + 0xc8, 0x07, 0xfb, 0xd5, 0x18, 0x8b, 0x20, 0x21, 0xff, 0x31, 0x92, 0x08, + 0x52, 0x00, 0x01, 0x43, 0x19, 0x83, 0xda, 0x61, 0x0a, 0x4a, 0x1a, 0x80, + 0x1a, 0x7d, 0xd1, 0x07, 0xfc, 0xd5, 0xe5, 0xe7, 0xc0, 0x46, 0xfd, 0xe7, + 0x70, 0x47, 0xc0, 0x46, 0x08, 0x00, 0x00, 0x20, 0x00, 0x20, 0x00, 0x00, + 0x03, 0x02, 0x00, 0x00, 0x04, 0x00, 0xfa, 0x05, 0x00, 0xed, 0x00, 0xe0, + 0x00, 0x40, 0x00, 0x41, 0x02, 0xa5, 0xff, 0xff, 0x01, 0x60, 0x70, 0x47, + 0xf7, 0xb5, 0x08, 0xac, 0x26, 0x78, 0x04, 0x68, 0x9d, 0x1e, 0x27, 0x68, + 0x6c, 0x1e, 0xa5, 0x41, 0xec, 0xb2, 0x92, 0x07, 0x05, 0x68, 0x3a, 0x43, + 0x27, 0x06, 0x3a, 0x43, 0x2a, 0x60, 0x02, 0x68, 0x07, 0x25, 0x29, 0x40, + 0x50, 0x68, 0xb5, 0x01, 0x00, 0x2c, 0x00, 0xd0, 0x5c, 0x03, 0x29, 0x43, + 0x01, 0x43, 0x0c, 0x43, 0x54, 0x60, 0xf7, 0xbd, 0x30, 0xb5, 0x03, 0x68, + 0xc0, 0x25, 0x1c, 0x68, 0xad, 0x03, 0x12, 0x05, 0x2a, 0x40, 0x22, 0x43, + 0xc0, 0x24, 0xa4, 0x02, 0x09, 0x04, 0x21, 0x40, 0x11, 0x43, 0x19, 0x60, + 0x03, 0x68, 0x5a, 0x68, 0x14, 0x43, 0x5c, 0x60, 0x30, 0xbd, 0x03, 0x68, + 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, 0x11, 0x68, + 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, 0xf8, 0xd1, + 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, + 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, 0x03, 0x68, + 0x1a, 0x7e, 0xd1, 0x07, 0x02, 0xd4, 0x1a, 0x7e, 0x91, 0x07, 0xfc, 0xd5, + 0x70, 0x47, 0x03, 0x68, 0x00, 0x22, 0x5a, 0x83, 0x70, 0x47, 0x03, 0x68, + 0x18, 0x7e, 0x40, 0x07, 0xc0, 0x0f, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, + 0xc0, 0x09, 0x70, 0x47, 0x03, 0x68, 0x80, 0x22, 0x19, 0x7e, 0x52, 0x42, + 0x0a, 0x43, 0x1a, 0x76, 0x70, 0x47, 0x03, 0x68, 0x18, 0x7e, 0x01, 0x23, + 0x18, 0x40, 0x70, 0x47, 0x03, 0x68, 0x18, 0x8d, 0xc0, 0xb2, 0x70, 0x47, + 0x03, 0x68, 0x1a, 0x7e, 0x01, 0x20, 0x02, 0x42, 0xfb, 0xd0, 0x19, 0x85, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x21, 0x9a, 0x7d, 0x0a, 0x43, 0x9a, 0x75, + 0x70, 0x47, 0x03, 0x68, 0x01, 0x22, 0x1a, 0x75, 0x70, 0x47, 0x00, 0x00, + 0x70, 0xb5, 0x03, 0x68, 0x01, 0x26, 0x8d, 0x07, 0xed, 0x0f, 0x31, 0x40, + 0x1c, 0x68, 0x6d, 0x07, 0x09, 0x07, 0x29, 0x43, 0x21, 0x43, 0x19, 0x60, + 0x04, 0x68, 0x51, 0x00, 0x03, 0x48, 0x00, 0xf0, 0xd9, 0xfa, 0x01, 0x38, + 0xc0, 0xb2, 0x20, 0x73, 0x70, 0xbd, 0xc0, 0x46, 0x00, 0x6c, 0xdc, 0x02, + 0x03, 0x68, 0x01, 0x21, 0x1a, 0x68, 0x0a, 0x43, 0x1a, 0x60, 0x02, 0x68, + 0x11, 0x68, 0x01, 0x23, 0x19, 0x42, 0xfb, 0xd1, 0xd1, 0x69, 0x19, 0x42, + 0xf8, 0xd1, 0x70, 0x47, 0x03, 0x68, 0x02, 0x21, 0x1a, 0x68, 0x0a, 0x43, + 0x1a, 0x60, 0x02, 0x68, 0xd3, 0x69, 0x99, 0x07, 0xfc, 0xd4, 0x70, 0x47, + 0x03, 0x68, 0xda, 0x69, 0x91, 0x07, 0xfc, 0xd4, 0x1a, 0x68, 0x02, 0x21, + 0x8a, 0x43, 0x1a, 0x60, 0x70, 0x47, 0x03, 0x68, 0x9a, 0x6a, 0x52, 0x0a, + 0x52, 0x02, 0x11, 0x43, 0x99, 0x62, 0x03, 0x68, 0x1a, 0x7e, 0x51, 0x07, + 0xfc, 0xd5, 0x98, 0x6a, 0xc0, 0xb2, 0x70, 0x47, 0x03, 0x68, 0x22, 0x4a, + 0x30, 0xb5, 0x93, 0x42, 0x11, 0xd0, 0x21, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x20, 0x4a, 0x93, 0x42, 0x11, 0xd0, + 0x1f, 0x4a, 0x93, 0x42, 0x11, 0xd0, 0x1f, 0x4a, 0x93, 0x42, 0x30, 0xd1, + 0x0e, 0x23, 0x19, 0x22, 0x0d, 0xe0, 0x09, 0x23, 0x14, 0x22, 0x0a, 0xe0, + 0x0a, 0x23, 0x15, 0x22, 0x07, 0xe0, 0x0b, 0x23, 0x16, 0x22, 0x04, 0xe0, + 0x0c, 0x23, 0x17, 0x22, 0x01, 0xe0, 0x0d, 0x23, 0x18, 0x22, 0xdc, 0xb2, + 0x15, 0x49, 0x01, 0x20, 0x9b, 0x08, 0xa0, 0x40, 0x9b, 0x00, 0x08, 0x60, + 0x5b, 0x18, 0x03, 0x20, 0xc0, 0x21, 0x89, 0x00, 0x04, 0x40, 0x5d, 0x58, + 0xe0, 0x00, 0xff, 0x24, 0x84, 0x40, 0xa5, 0x43, 0x2c, 0x1c, 0xc0, 0x25, + 0x85, 0x40, 0x28, 0x1c, 0x20, 0x43, 0x58, 0x50, 0x80, 0x23, 0xdb, 0x01, + 0x1a, 0x43, 0x0a, 0x4b, 0x5a, 0x80, 0x5a, 0x78, 0x52, 0xb2, 0x00, 0x2a, + 0xfb, 0xdb, 0x30, 0xbd, 0x00, 0x08, 0x00, 0x42, 0x00, 0x0c, 0x00, 0x42, + 0x00, 0x10, 0x00, 0x42, 0x00, 0x14, 0x00, 0x42, 0x00, 0x18, 0x00, 0x42, + 0x00, 0x1c, 0x00, 0x42, 0x00, 0xe1, 0x00, 0xe0, 0x00, 0x0c, 0x00, 0x40, + 0xf8, 0xb5, 0x04, 0x1c, 0x15, 0x1c, 0x0e, 0x1c, 0x1f, 0x1c, 0xff, 0xf7, + 0xa3, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x0b, 0xff, 0xb1, 0x00, 0x1c, 0x22, + 0x0a, 0x40, 0x69, 0x07, 0x23, 0x68, 0x09, 0x0c, 0x0a, 0x43, 0x1a, 0x60, + 0x22, 0x68, 0x84, 0x23, 0x93, 0x75, 0x01, 0x2e, 0x1a, 0xd1, 0x08, 0x21, + 0x01, 0x2d, 0x00, 0xd1, 0x10, 0x21, 0x0c, 0x4b, 0x79, 0x43, 0x18, 0x68, + 0xc0, 0x00, 0x00, 0xf0, 0x2d, 0xfa, 0x23, 0x68, 0x07, 0x21, 0x9a, 0x89, + 0x01, 0x40, 0xd2, 0x04, 0x49, 0x03, 0xd2, 0x0c, 0x0a, 0x43, 0x9a, 0x81, + 0x23, 0x68, 0x00, 0x04, 0xc2, 0x0c, 0x98, 0x89, 0x40, 0x0b, 0x40, 0x03, + 0x10, 0x43, 0x98, 0x81, 0xf8, 0xbd, 0xc0, 0x46, 0x04, 0x00, 0x00, 0x20, + 0xf7, 0xb5, 0x01, 0x93, 0x08, 0xab, 0x04, 0x1c, 0x1f, 0x78, 0x0d, 0x1c, + 0x16, 0x1c, 0xff, 0xf7, 0x3d, 0xff, 0x20, 0x1c, 0xff, 0xf7, 0x68, 0xff, + 0xbf, 0x07, 0x0c, 0x22, 0x17, 0x43, 0xc0, 0x22, 0x92, 0x03, 0x36, 0x05, + 0x16, 0x40, 0xc0, 0x22, 0x92, 0x02, 0x2d, 0x04, 0x23, 0x68, 0x3e, 0x43, + 0x01, 0x99, 0x15, 0x40, 0x35, 0x43, 0x07, 0x22, 0x1d, 0x60, 0x0a, 0x40, + 0x80, 0x21, 0x23, 0x68, 0x89, 0x02, 0x0a, 0x43, 0x5a, 0x60, 0xf7, 0xbd, + 0x01, 0x20, 0x70, 0x47, 0x08, 0xb5, 0x03, 0x68, 0x01, 0x4a, 0x1b, 0x6a, + 0x98, 0x47, 0x08, 0xbd, 0x13, 0x04, 0x00, 0x00, 0x10, 0xb5, 0x04, 0x1c, + 0x00, 0x69, 0xff, 0xf7, 0xac, 0xfe, 0x20, 0x1c, 0x14, 0x30, 0x00, 0xf0, + 0xa1, 0xf9, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0x9d, 0xf9, 0x10, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0xaa, 0xf9, 0x08, 0xbd, 0x10, 0xb5, + 0x04, 0x1c, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, 0xa3, 0xf9, 0x00, 0x28, + 0xf9, 0xd1, 0x20, 0x69, 0xff, 0xf7, 0xab, 0xfe, 0x10, 0xbd, 0x08, 0xb5, + 0x5c, 0x30, 0x00, 0xf0, 0x9f, 0xf9, 0x08, 0xbd, 0x70, 0xb5, 0x05, 0x1c, + 0x14, 0x35, 0x04, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0x83, 0xf9, 0x23, 0x1c, + 0xa8, 0x33, 0x1b, 0x78, 0x06, 0x1c, 0xff, 0x2b, 0x0a, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0x8e, 0xf9, 0x0a, 0x28, 0x05, 0xdd, 0x23, 0x1c, 0xb0, 0x33, + 0xb4, 0x34, 0x1b, 0x68, 0x22, 0x68, 0x1a, 0x60, 0x30, 0x1c, 0x70, 0xbd, + 0x08, 0xb5, 0x14, 0x30, 0x00, 0xf0, 0x8a, 0xf9, 0x08, 0xbd, 0x70, 0xb5, + 0x04, 0x1c, 0x00, 0x69, 0x0e, 0x1c, 0xff, 0xf7, 0x9c, 0xfe, 0x25, 0x1c, + 0x5c, 0x35, 0x00, 0x28, 0x04, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x6c, 0xf9, + 0x00, 0x28, 0x0c, 0xd0, 0x28, 0x1c, 0x00, 0xf0, 0x80, 0xf9, 0x00, 0x28, + 0xfa, 0xd1, 0x28, 0x1c, 0x31, 0x1c, 0x00, 0xf0, 0x44, 0xf9, 0x20, 0x69, + 0xff, 0xf7, 0x97, 0xfe, 0x03, 0xe0, 0x20, 0x69, 0x31, 0x1c, 0xff, 0xf7, + 0x8b, 0xfe, 0x01, 0x20, 0x70, 0xbd, 0x00, 0x00, 0xf0, 0xb5, 0x85, 0xb0, + 0x1d, 0x1c, 0x0a, 0xab, 0x1b, 0x78, 0x04, 0x1c, 0x00, 0x93, 0x0b, 0xab, + 0x1b, 0x78, 0x16, 0x1c, 0x01, 0x93, 0x0c, 0xab, 0x1b, 0x78, 0x0f, 0x1c, + 0x02, 0x93, 0x0d, 0xab, 0x1b, 0x78, 0x03, 0x93, 0x00, 0x23, 0x43, 0x60, + 0xfa, 0x23, 0x9b, 0x00, 0x83, 0x60, 0x0d, 0x4b, 0x08, 0x33, 0x03, 0x60, + 0x14, 0x30, 0x00, 0xf0, 0x11, 0xf9, 0x20, 0x1c, 0x5c, 0x30, 0x00, 0xf0, + 0x0d, 0xf9, 0x00, 0x9a, 0x23, 0x1c, 0xa4, 0x33, 0x27, 0x61, 0x9a, 0x70, + 0x01, 0x9a, 0x20, 0x1c, 0xda, 0x70, 0x02, 0x9a, 0x1e, 0x70, 0x1a, 0x71, + 0x03, 0x9a, 0x5d, 0x70, 0x1a, 0x75, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0x40, 0x55, 0x00, 0x00, 0x30, 0xb5, 0x85, 0xb0, 0x04, 0x1c, 0x08, 0xa8, + 0x05, 0x78, 0x09, 0xa8, 0x00, 0x78, 0x00, 0x95, 0x01, 0x90, 0xff, 0x20, + 0x02, 0x90, 0x03, 0x90, 0x20, 0x1c, 0xff, 0xf7, 0xbd, 0xff, 0x20, 0x1c, + 0x05, 0xb0, 0x30, 0xbd, 0x38, 0xb5, 0x04, 0x1c, 0x00, 0x69, 0xff, 0xf7, + 0x24, 0xfe, 0x00, 0x28, 0x19, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfe, + 0x25, 0x1c, 0x14, 0x35, 0x01, 0x1c, 0x28, 0x1c, 0x00, 0xf0, 0xe3, 0xf8, + 0x23, 0x1c, 0xa8, 0x33, 0x1b, 0x78, 0xff, 0x2b, 0x0b, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0xfe, 0xf8, 0x09, 0x28, 0x06, 0xdc, 0x23, 0x1c, 0x22, 0x1c, + 0xac, 0x33, 0xb4, 0x32, 0x1b, 0x68, 0x12, 0x68, 0x1a, 0x60, 0x20, 0x69, + 0xff, 0xf7, 0x15, 0xfe, 0x00, 0x28, 0x11, 0xd0, 0x25, 0x1c, 0x5c, 0x35, + 0x28, 0x1c, 0x00, 0xf0, 0xe5, 0xf8, 0x00, 0x28, 0x07, 0xd0, 0x28, 0x1c, + 0x00, 0xf0, 0xd2, 0xf8, 0xc1, 0xb2, 0x20, 0x69, 0xff, 0xf7, 0x0e, 0xfe, + 0x02, 0xe0, 0x20, 0x69, 0xff, 0xf7, 0x17, 0xfe, 0x20, 0x69, 0xff, 0xf7, + 0xf3, 0xfd, 0x00, 0x28, 0x05, 0xd0, 0x20, 0x69, 0xff, 0xf7, 0xf2, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0xe2, 0xfd, 0x38, 0xbd, 0xf0, 0x23, 0x08, 0x1c, + 0x18, 0x40, 0x30, 0x38, 0x43, 0x42, 0x58, 0x41, 0x70, 0x47, 0xf0, 0x23, + 0x1b, 0x01, 0x19, 0x40, 0x80, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x0c, 0xd0, + 0xc0, 0x23, 0x9b, 0x00, 0x99, 0x42, 0x06, 0xd0, 0x80, 0x23, 0x5b, 0x00, + 0x05, 0x20, 0x99, 0x42, 0x04, 0xd0, 0x00, 0x20, 0x02, 0xe0, 0x07, 0x20, + 0x00, 0xe0, 0x06, 0x20, 0x70, 0x47, 0x0f, 0x23, 0x19, 0x40, 0x01, 0x29, + 0x05, 0xd0, 0x02, 0x39, 0x4b, 0x42, 0x4b, 0x41, 0x02, 0x20, 0xc0, 0x1a, + 0x00, 0xe0, 0x00, 0x20, 0x70, 0x47, 0x00, 0x00, 0xf0, 0xb5, 0x03, 0x1c, + 0x85, 0xb0, 0x03, 0x91, 0xa4, 0x33, 0x04, 0x1c, 0x18, 0x27, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x34, 0x4e, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, + 0x15, 0x1c, 0xff, 0xf7, 0xa5, 0xfc, 0x23, 0x1c, 0xa5, 0x33, 0x18, 0x78, + 0x3b, 0x1c, 0x43, 0x43, 0x08, 0x21, 0xf3, 0x18, 0x59, 0x56, 0xff, 0xf7, + 0x9b, 0xfc, 0x23, 0x1c, 0xa7, 0x33, 0x1b, 0x78, 0x02, 0x2b, 0x0a, 0xd1, + 0x23, 0x1c, 0xb8, 0x33, 0x18, 0x78, 0xff, 0x28, 0x05, 0xd0, 0x47, 0x43, + 0x08, 0x21, 0xf7, 0x19, 0x79, 0x56, 0xff, 0xf7, 0x8b, 0xfc, 0x27, 0x1c, + 0xa8, 0x37, 0x38, 0x78, 0xff, 0x28, 0x1a, 0xd0, 0x01, 0x21, 0xff, 0xf7, + 0xf9, 0xfb, 0x3b, 0x78, 0x18, 0x22, 0x5a, 0x43, 0xb3, 0x56, 0x1f, 0x4f, + 0xdb, 0x01, 0x21, 0x1c, 0xac, 0x31, 0xd8, 0x19, 0x08, 0x60, 0x1d, 0x49, + 0xb6, 0x18, 0x5b, 0x18, 0x21, 0x1c, 0x72, 0x68, 0xb0, 0x31, 0x0b, 0x60, + 0x01, 0x21, 0x91, 0x40, 0x0a, 0x1c, 0x21, 0x1c, 0xb4, 0x31, 0x0a, 0x60, + 0x1a, 0x60, 0x01, 0x21, 0x0a, 0x1c, 0x03, 0x9b, 0x20, 0x69, 0xff, 0xf7, + 0x31, 0xfe, 0x29, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x88, 0xff, 0x29, 0x1c, + 0x07, 0x1c, 0x20, 0x1c, 0xff, 0xf7, 0x99, 0xff, 0x29, 0x1c, 0x06, 0x1c, + 0x20, 0x1c, 0xff, 0xf7, 0x77, 0xff, 0x39, 0x1c, 0x00, 0x90, 0x33, 0x1c, + 0x20, 0x69, 0x01, 0x22, 0xff, 0xf7, 0x02, 0xfd, 0x23, 0x1c, 0xa7, 0x33, + 0x19, 0x78, 0x01, 0x3b, 0x1a, 0x78, 0x20, 0x69, 0xff, 0xf7, 0x16, 0xfd, + 0x20, 0x69, 0xff, 0xf7, 0x34, 0xfd, 0x05, 0xb0, 0xf0, 0xbd, 0xc0, 0x46, + 0x20, 0x51, 0x00, 0x00, 0x18, 0x44, 0x00, 0x41, 0x14, 0x44, 0x00, 0x41, + 0x10, 0xb5, 0x00, 0x21, 0x40, 0x22, 0x04, 0x1c, 0x00, 0xf0, 0xf2, 0xf8, + 0x00, 0x23, 0x20, 0x1c, 0x23, 0x64, 0x63, 0x64, 0x10, 0xbd, 0x02, 0x6c, + 0x10, 0xb5, 0x3f, 0x23, 0x54, 0x1c, 0x23, 0x40, 0x44, 0x6c, 0xa3, 0x42, + 0x01, 0xd0, 0x81, 0x54, 0x03, 0x64, 0x10, 0xbd, 0x00, 0x23, 0x03, 0x64, + 0x43, 0x64, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x06, 0xd0, + 0xc2, 0x5c, 0x3f, 0x21, 0x01, 0x33, 0x0b, 0x40, 0x43, 0x64, 0x10, 0x1c, + 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, 0x43, 0x6c, + 0xd0, 0x1a, 0x00, 0xd5, 0x40, 0x30, 0x70, 0x47, 0x03, 0x6c, 0x40, 0x6c, + 0x83, 0x42, 0x02, 0xdb, 0xc0, 0x1a, 0x3f, 0x30, 0x01, 0xe0, 0xc0, 0x1a, + 0x01, 0x38, 0x70, 0x47, 0x43, 0x6c, 0x02, 0x6c, 0x93, 0x42, 0x01, 0xd0, + 0xc0, 0x5c, 0x01, 0xe0, 0x01, 0x20, 0x40, 0x42, 0x70, 0x47, 0x02, 0x6c, + 0x3f, 0x23, 0x01, 0x32, 0x1a, 0x40, 0x43, 0x6c, 0xd0, 0x1a, 0x43, 0x42, + 0x58, 0x41, 0xc0, 0xb2, 0x70, 0x47, 0x00, 0x00, 0x02, 0xb4, 0x71, 0x46, + 0x49, 0x08, 0x49, 0x00, 0x09, 0x5c, 0x49, 0x00, 0x8e, 0x44, 0x02, 0xbc, + 0x70, 0x47, 0xc0, 0x46, 0x00, 0x29, 0x34, 0xd0, 0x01, 0x23, 0x00, 0x22, + 0x10, 0xb4, 0x88, 0x42, 0x2c, 0xd3, 0x01, 0x24, 0x24, 0x07, 0xa1, 0x42, + 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x09, 0x01, 0x1b, 0x01, 0xf8, 0xe7, + 0xe4, 0x00, 0xa1, 0x42, 0x04, 0xd2, 0x81, 0x42, 0x02, 0xd2, 0x49, 0x00, + 0x5b, 0x00, 0xf8, 0xe7, 0x88, 0x42, 0x01, 0xd3, 0x40, 0x1a, 0x1a, 0x43, + 0x4c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x5c, 0x08, 0x22, 0x43, + 0x8c, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0x9c, 0x08, 0x22, 0x43, + 0xcc, 0x08, 0xa0, 0x42, 0x02, 0xd3, 0x00, 0x1b, 0xdc, 0x08, 0x22, 0x43, + 0x00, 0x28, 0x03, 0xd0, 0x1b, 0x09, 0x01, 0xd0, 0x09, 0x09, 0xe3, 0xe7, + 0x10, 0x1c, 0x10, 0xbc, 0x70, 0x47, 0x00, 0x28, 0x01, 0xd0, 0x00, 0x20, + 0xc0, 0x43, 0x07, 0xb4, 0x02, 0x48, 0x02, 0xa1, 0x40, 0x18, 0x02, 0x90, + 0x03, 0xbd, 0xc0, 0x46, 0x19, 0x00, 0x00, 0x00, 0x00, 0x29, 0xf0, 0xd0, + 0x03, 0xb5, 0xff, 0xf7, 0xb9, 0xff, 0x0e, 0xbc, 0x42, 0x43, 0x89, 0x1a, + 0x18, 0x47, 0xc0, 0x46, 0x70, 0x47, 0xc0, 0x46, 0x70, 0xb5, 0x0e, 0x4b, + 0x0e, 0x4d, 0x00, 0x24, 0xed, 0x1a, 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, + 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, + 0x00, 0xf0, 0x32, 0xf9, 0x08, 0x4b, 0x09, 0x4d, 0x00, 0x24, 0xed, 0x1a, + 0xad, 0x10, 0x1e, 0x1c, 0xac, 0x42, 0x04, 0xd0, 0xa3, 0x00, 0xf3, 0x58, + 0x98, 0x47, 0x01, 0x34, 0xf8, 0xe7, 0x70, 0xbd, 0x70, 0x00, 0x00, 0x20, + 0x70, 0x00, 0x00, 0x20, 0x70, 0x00, 0x00, 0x20, 0x8c, 0x00, 0x00, 0x20, + 0x08, 0xb5, 0x03, 0x4b, 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x76, 0xf8, + 0x08, 0xbd, 0xc0, 0x46, 0x6c, 0x00, 0x00, 0x20, 0x08, 0xb5, 0x03, 0x4b, + 0x01, 0x1c, 0x18, 0x68, 0x00, 0xf0, 0x24, 0xf8, 0x08, 0xbd, 0xc0, 0x46, + 0x6c, 0x00, 0x00, 0x20, 0x30, 0xb5, 0x00, 0x23, 0x93, 0x42, 0x08, 0xd0, + 0xc5, 0x5c, 0x01, 0x33, 0xcc, 0x18, 0x01, 0x3c, 0x24, 0x78, 0xa5, 0x42, + 0xf6, 0xd0, 0x28, 0x1b, 0x00, 0xe0, 0x00, 0x20, 0x30, 0xbd, 0x10, 0xb5, + 0x00, 0x23, 0x93, 0x42, 0x03, 0xd0, 0xcc, 0x5c, 0xc4, 0x54, 0x01, 0x33, + 0xf9, 0xe7, 0x10, 0xbd, 0x03, 0x1c, 0x82, 0x18, 0x93, 0x42, 0x02, 0xd0, + 0x19, 0x70, 0x01, 0x33, 0xfa, 0xe7, 0x70, 0x47, 0x30, 0xb5, 0x00, 0x29, + 0x40, 0xd0, 0x04, 0x39, 0x0b, 0x68, 0x00, 0x2b, 0x00, 0xda, 0xc9, 0x18, + 0x1e, 0x4a, 0x13, 0x68, 0x14, 0x1c, 0x00, 0x2b, 0x02, 0xd1, 0x4b, 0x60, + 0x11, 0x60, 0x33, 0xe0, 0x99, 0x42, 0x0f, 0xd2, 0x08, 0x68, 0x0a, 0x18, + 0x9a, 0x42, 0x05, 0xd1, 0x13, 0x68, 0x52, 0x68, 0xc0, 0x18, 0x08, 0x60, + 0x4a, 0x60, 0x00, 0xe0, 0x4b, 0x60, 0x21, 0x60, 0x24, 0xe0, 0x8a, 0x42, + 0x03, 0xd8, 0x13, 0x1c, 0x5a, 0x68, 0x00, 0x2a, 0xf9, 0xd1, 0x1d, 0x68, + 0x5c, 0x19, 0x8c, 0x42, 0x0b, 0xd1, 0x09, 0x68, 0x69, 0x18, 0x58, 0x18, + 0x19, 0x60, 0x90, 0x42, 0x14, 0xd1, 0x14, 0x68, 0x52, 0x68, 0x09, 0x19, + 0x19, 0x60, 0x5a, 0x60, 0x0e, 0xe0, 0x8c, 0x42, 0x02, 0xd9, 0x0c, 0x23, + 0x03, 0x60, 0x09, 0xe0, 0x08, 0x68, 0x0c, 0x18, 0x94, 0x42, 0x03, 0xd1, + 0x14, 0x68, 0x52, 0x68, 0x00, 0x19, 0x08, 0x60, 0x4a, 0x60, 0x59, 0x60, + 0x30, 0xbd, 0xc0, 0x46, 0x24, 0x09, 0x00, 0x20, 0x70, 0xb5, 0x03, 0x23, + 0xcd, 0x1c, 0x9d, 0x43, 0x08, 0x35, 0x06, 0x1c, 0x0c, 0x2d, 0x01, 0xd2, + 0x0c, 0x25, 0x01, 0xe0, 0x00, 0x2d, 0x3f, 0xdb, 0x8d, 0x42, 0x3d, 0xd3, + 0x20, 0x4b, 0x1c, 0x68, 0x1a, 0x1c, 0x21, 0x1c, 0x00, 0x29, 0x13, 0xd0, + 0x08, 0x68, 0x43, 0x1b, 0x0d, 0xd4, 0x0b, 0x2b, 0x02, 0xd9, 0x0b, 0x60, + 0xcc, 0x18, 0x1e, 0xe0, 0x8c, 0x42, 0x02, 0xd1, 0x63, 0x68, 0x13, 0x60, + 0x1a, 0xe0, 0x48, 0x68, 0x60, 0x60, 0x0c, 0x1c, 0x16, 0xe0, 0x0c, 0x1c, + 0x49, 0x68, 0xe9, 0xe7, 0x14, 0x4c, 0x20, 0x68, 0x00, 0x28, 0x03, 0xd1, + 0x30, 0x1c, 0x00, 0xf0, 0x25, 0xf8, 0x20, 0x60, 0x30, 0x1c, 0x29, 0x1c, + 0x00, 0xf0, 0x20, 0xf8, 0x43, 0x1c, 0x15, 0xd0, 0xc4, 0x1c, 0x03, 0x23, + 0x9c, 0x43, 0x84, 0x42, 0x0a, 0xd1, 0x25, 0x60, 0x20, 0x1c, 0x0b, 0x30, + 0x07, 0x22, 0x23, 0x1d, 0x90, 0x43, 0xc3, 0x1a, 0x0b, 0xd0, 0x5a, 0x42, + 0xe2, 0x50, 0x08, 0xe0, 0x21, 0x1a, 0x30, 0x1c, 0x00, 0xf0, 0x0a, 0xf8, + 0x01, 0x30, 0xee, 0xd1, 0x0c, 0x23, 0x33, 0x60, 0x00, 0x20, 0x70, 0xbd, + 0x24, 0x09, 0x00, 0x20, 0x20, 0x09, 0x00, 0x20, 0x38, 0xb5, 0x07, 0x4c, + 0x00, 0x23, 0x05, 0x1c, 0x08, 0x1c, 0x23, 0x60, 0x00, 0xf0, 0x2a, 0xf8, + 0x43, 0x1c, 0x03, 0xd1, 0x23, 0x68, 0x00, 0x2b, 0x00, 0xd0, 0x2b, 0x60, + 0x38, 0xbd, 0xc0, 0x46, 0x2c, 0x09, 0x00, 0x20, 0xc9, 0xb2, 0x03, 0x78, + 0x00, 0x2b, 0x03, 0xd0, 0x8b, 0x42, 0x04, 0xd0, 0x01, 0x30, 0xf8, 0xe7, + 0x00, 0x29, 0x00, 0xd0, 0x18, 0x1c, 0x70, 0x47, 0x30, 0xb5, 0x03, 0x1c, + 0x00, 0x2a, 0x07, 0xd0, 0x0c, 0x78, 0x01, 0x33, 0x5d, 0x1e, 0x01, 0x3a, + 0x2c, 0x70, 0x01, 0x31, 0x00, 0x2c, 0xf5, 0xd1, 0x9a, 0x18, 0x93, 0x42, + 0x03, 0xd0, 0x00, 0x21, 0x19, 0x70, 0x01, 0x33, 0xf9, 0xe7, 0x30, 0xbd, + 0x09, 0x4a, 0x13, 0x68, 0x00, 0x2b, 0x0c, 0xd0, 0x18, 0x18, 0x69, 0x46, + 0x88, 0x42, 0x02, 0xd8, 0x10, 0x60, 0x18, 0x1c, 0x70, 0x47, 0x05, 0x4b, + 0x0c, 0x22, 0x01, 0x20, 0x1a, 0x60, 0x40, 0x42, 0xf8, 0xe7, 0x03, 0x4b, + 0x13, 0x60, 0xef, 0xe7, 0x28, 0x09, 0x00, 0x20, 0x2c, 0x09, 0x00, 0x20, + 0x30, 0x09, 0x00, 0x20, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0xf8, 0xb5, 0xc0, 0x46, 0xf8, 0xbc, 0x08, 0xbc, + 0x9e, 0x46, 0x70, 0x47, 0x55, 0x50, 0x44, 0x41, 0x54, 0x45, 0x2e, 0x42, + 0x49, 0x4e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x1f, 0x22, 0x00, 0x00, 0x33, 0x22, 0x00, 0x00, 0x19, 0x22, 0x00, 0x00, + 0x5d, 0x22, 0x00, 0x00, 0x61, 0x23, 0x00, 0x00, 0x8d, 0x22, 0x00, 0x00, + 0xa1, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2f, 0x00, 0x7c, 0x3c, + 0x3e, 0x5e, 0x2b, 0x3d, 0x3f, 0x2f, 0x5b, 0x5d, 0x3b, 0x2c, 0x2a, 0x22, + 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x34, 0x00, 0x00, 0xc1, 0x40, 0x00, 0x00, + 0x19, 0x22, 0x00, 0x00, 0x1d, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, + 0x20, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, + 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0x01, 0x00, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x03, 0x01, 0x03, 0x0f, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x02, 0x00, 0x02, 0x00, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, 0x03, 0x00, 0x05, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x01, 0x00, 0x01, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x01, 0x01, 0x01, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x03, 0x00, 0x03, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x02, 0x00, 0x02, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x2c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x1c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x02, 0x01, 0x02, 0x01, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x04, 0x00, 0x04, 0x08, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x18, 0x00, 0x00, 0x00, 0x03, 0x00, 0x01, 0x04, 0x01, 0x04, 0x09, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0xff, 0xff, 0xff, 0xff, 0x04, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x06, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x07, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0a, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0x0b, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x16, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x00, 0xff, 0xff, 0x0d, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x03, 0x00, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x01, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x00, 0x00, 0xff, 0x00, 0x01, 0x01, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x02, 0x00, 0x00, 0x00, 0x14, 0x00, 0xff, 0xff, 0xff, 0xff, 0x02, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe3, 0x44, 0x00, 0x00, + 0xc1, 0x40, 0x00, 0x00, 0x9b, 0x44, 0x00, 0x00, 0x83, 0x44, 0x00, 0x00, + 0x79, 0x44, 0x00, 0x00, 0xa5, 0x44, 0x00, 0x00, 0xd9, 0x44, 0x00, 0x00, + 0x4d, 0x44, 0x00, 0x00, 0x91, 0x46, 0x00, 0x00, 0x5d, 0x44, 0x00, 0x00, + 0x49, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x40, 0x42, 0x0f, 0x00, + 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x7c, 0x55, 0x00, 0x00, + 0x9c, 0x55, 0x00, 0x00, 0xbc, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x78, 0x55, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x20, 0xdd, 0x20, 0x00, 0x00, + 0x05, 0x22, 0x00, 0x00, 0xed, 0x26, 0x00, 0x00, 0xa9, 0x2b, 0x00, 0x00, + 0x55, 0x38, 0x00, 0x00, 0x85, 0x3a, 0x00, 0x00, 0xdd, 0x3a, 0x00, 0x00, + 0xb5, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 diff --git a/sparkfun/samd/libraries/SPI/SPI.cpp b/sparkfun/samd/libraries/SPI/SPI.cpp index 8afb8146..d154e367 100644 --- a/sparkfun/samd/libraries/SPI/SPI.cpp +++ b/sparkfun/samd/libraries/SPI/SPI.cpp @@ -105,13 +105,33 @@ void SPIClass::usingInterrupt(int interruptNumber) else { interruptMode |= SPI_IMODE_EXTINT; - interruptMask |= (1 << interruptNumber); + interruptMask |= (1 << g_APinDescription[interruptNumber].ulExtInt); } if (irestore) interrupts(); } +void SPIClass::notUsingInterrupt(int interruptNumber) +{ + if ((interruptNumber == NOT_AN_INTERRUPT) || (interruptNumber == EXTERNAL_INT_NMI)) + return; + + if (interruptMode & SPI_IMODE_GLOBAL) + return; // can't go back, as there is no reference count + + uint8_t irestore = interruptsStatus(); + noInterrupts(); + + interruptMask &= ~(1 << g_APinDescription[interruptNumber].ulExtInt); + + if (interruptMask == 0) + interruptMode = SPI_IMODE_NONE; + + if (irestore) + interrupts(); +} + void SPIClass::beginTransaction(SPISettings settings) { if (interruptMode != SPI_IMODE_NONE) diff --git a/sparkfun/samd/libraries/SPI/SPI.h b/sparkfun/samd/libraries/SPI/SPI.h index d119bf4a..fce636b9 100644 --- a/sparkfun/samd/libraries/SPI/SPI.h +++ b/sparkfun/samd/libraries/SPI/SPI.h @@ -29,19 +29,20 @@ // - SPISetting(clock, bitOrder, dataMode) #define SPI_HAS_TRANSACTION 1 +// SPI_HAS_NOTUSINGINTERRUPT means that SPI has notUsingInterrupt() method +#define SPI_HAS_NOTUSINGINTERRUPT 1 + #define SPI_MODE0 0x02 #define SPI_MODE1 0x00 #define SPI_MODE2 0x03 #define SPI_MODE3 0x01 -#if defined(__SAMD21G18A__) - // Even if not specified on the datasheet, the SAMD21G18A MCU - // doesn't operate correctly with clock dividers lower than 4. - // This allows a theoretical maximum SPI clock speed of 12Mhz - #define SPI_MIN_CLOCK_DIVIDER 4 - // Other SAMD21xxxxx MCU may be affected as well -#else - #define SPI_MIN_CLOCK_DIVIDER 2 +#if defined(ARDUINO_ARCH_SAMD) + // The datasheet specifies a typical SPI SCK period (tSCK) of 42 ns, + // see "Table 36-48. SPI Timing Characteristics and Requirements", + // which translates into a maximum SPI clock of 23.8 MHz. + // Conservatively, the divider is set for a 12 MHz maximum SPI clock. + #define SPI_MIN_CLOCK_DIVIDER (uint8_t)(1 + ((F_CPU - 1) / 12000000)) #endif class SPISettings { @@ -100,6 +101,7 @@ class SPIClass { // Transaction Functions void usingInterrupt(int interruptNumber); + void notUsingInterrupt(int interruptNumber); void beginTransaction(SPISettings settings); void endTransaction(void); @@ -161,6 +163,16 @@ class SPIClass { #define SPI_CLOCK_DIV32 96 #define SPI_CLOCK_DIV64 192 #define SPI_CLOCK_DIV128 255 -#endif +#endif /* F_CPU == 48000000 */ +#if F_CPU == 120000000 + #define SPI_CLOCK_DIV2 15 + #define SPI_CLOCK_DIV4 30 + #define SPI_CLOCK_DIV8 60 + #define SPI_CLOCK_DIV16 120 + #define SPI_CLOCK_DIV32 240 + #define SPI_CLOCK_DIV64 480 + #define SPI_CLOCK_DIV128 960 +#endif /* F_CPU == 120000000 */ + #endif diff --git a/sparkfun/samd/libraries/USBHost/examples/USB_desc/USB_desc.ino b/sparkfun/samd/libraries/USBHost/examples/USB_desc/USB_desc.ino index 87b9df6e..a7ede046 100644 --- a/sparkfun/samd/libraries/USBHost/examples/USB_desc/USB_desc.ino +++ b/sparkfun/samd/libraries/USBHost/examples/USB_desc/USB_desc.ino @@ -217,13 +217,13 @@ byte getconfdescr( byte addr, byte conf ) byte rcode; byte descr_length; byte descr_type; - unsigned int total_length; + uint16_t total_length; rcode = usb.getConfDescr( addr, 0, 4, conf, buf ); //get total length LOBYTE( total_length ) = buf[ 2 ]; HIBYTE( total_length ) = buf[ 3 ]; - if( total_length > 256 ) { //check if total length is larger than buffer + if( total_length > sizeof(buf)) { //check if total length is larger than buffer printProgStr(Conf_Trunc_str); - total_length = 256; + total_length = sizeof(buf); } rcode = usb.getConfDescr( addr, 0, total_length, conf, buf ); //get the whole descriptor while( buf_ptr < buf + total_length ) { //parsing descriptors diff --git a/sparkfun/samd/libraries/Wire/Wire.cpp b/sparkfun/samd/libraries/Wire/Wire.cpp index 0326bf68..ec363413 100644 --- a/sparkfun/samd/libraries/Wire/Wire.cpp +++ b/sparkfun/samd/libraries/Wire/Wire.cpp @@ -43,9 +43,9 @@ void TwoWire::begin(void) { pinPeripheral(_uc_pinSCL, g_APinDescription[_uc_pinSCL].ulPinType); } -void TwoWire::begin(uint8_t address) { +void TwoWire::begin(uint8_t address, bool enableGeneralCall) { //Slave mode - sercom->initSlaveWIRE(address); + sercom->initSlaveWIRE(address, enableGeneralCall); sercom->enableWIRE(); pinPeripheral(_uc_pinSDA, g_APinDescription[_uc_pinSDA].ulPinType); @@ -287,6 +287,13 @@ void TwoWire::onService(void) void WIRE_IT_HANDLER(void) { Wire.onService(); } + + #if defined(__SAMD51__) + void WIRE_IT_HANDLER_0(void) { Wire.onService(); } + void WIRE_IT_HANDLER_1(void) { Wire.onService(); } + void WIRE_IT_HANDLER_2(void) { Wire.onService(); } + void WIRE_IT_HANDLER_3(void) { Wire.onService(); } + #endif // __SAMD51__ #endif #if WIRE_INTERFACES_COUNT > 1 @@ -295,6 +302,13 @@ void TwoWire::onService(void) void WIRE1_IT_HANDLER(void) { Wire1.onService(); } + + #if defined(__SAMD51__) + void WIRE1_IT_HANDLER_0(void) { Wire1.onService(); } + void WIRE1_IT_HANDLER_1(void) { Wire1.onService(); } + void WIRE1_IT_HANDLER_2(void) { Wire1.onService(); } + void WIRE1_IT_HANDLER_3(void) { Wire1.onService(); } + #endif // __SAMD51__ #endif #if WIRE_INTERFACES_COUNT > 2 @@ -303,6 +317,13 @@ void TwoWire::onService(void) void WIRE2_IT_HANDLER(void) { Wire2.onService(); } + + #if defined(__SAMD51__) + void WIRE2_IT_HANDLER_0(void) { Wire2.onService(); } + void WIRE2_IT_HANDLER_1(void) { Wire2.onService(); } + void WIRE2_IT_HANDLER_2(void) { Wire2.onService(); } + void WIRE2_IT_HANDLER_3(void) { Wire2.onService(); } + #endif // __SAMD51__ #endif #if WIRE_INTERFACES_COUNT > 3 @@ -311,6 +332,13 @@ void TwoWire::onService(void) void WIRE3_IT_HANDLER(void) { Wire3.onService(); } + + #if defined(__SAMD51__) + void WIRE3_IT_HANDLER_0(void) { Wire3.onService(); } + void WIRE3_IT_HANDLER_1(void) { Wire3.onService(); } + void WIRE3_IT_HANDLER_2(void) { Wire3.onService(); } + void WIRE3_IT_HANDLER_3(void) { Wire3.onService(); } + #endif // __SAMD51__ #endif #if WIRE_INTERFACES_COUNT > 4 @@ -319,6 +347,13 @@ void TwoWire::onService(void) void WIRE4_IT_HANDLER(void) { Wire4.onService(); } + + #if defined(__SAMD51__) + void WIRE4_IT_HANDLER_0(void) { Wire4.onService(); } + void WIRE4_IT_HANDLER_1(void) { Wire4.onService(); } + void WIRE4_IT_HANDLER_2(void) { Wire4.onService(); } + void WIRE4_IT_HANDLER_3(void) { Wire4.onService(); } + #endif // __SAMD51__ #endif #if WIRE_INTERFACES_COUNT > 5 @@ -327,5 +362,12 @@ void TwoWire::onService(void) void WIRE5_IT_HANDLER(void) { Wire5.onService(); } + + #if defined(__SAMD51__) + void WIRE5_IT_HANDLER_0(void) { Wire5.onService(); } + void WIRE5_IT_HANDLER_1(void) { Wire5.onService(); } + void WIRE5_IT_HANDLER_2(void) { Wire5.onService(); } + void WIRE5_IT_HANDLER_3(void) { Wire5.onService(); } + #endif // __SAMD51__ #endif diff --git a/sparkfun/samd/libraries/Wire/Wire.h b/sparkfun/samd/libraries/Wire/Wire.h index f437db89..db2ae646 100644 --- a/sparkfun/samd/libraries/Wire/Wire.h +++ b/sparkfun/samd/libraries/Wire/Wire.h @@ -34,7 +34,7 @@ class TwoWire : public Stream public: TwoWire(SERCOM *s, uint8_t pinSDA, uint8_t pinSCL); void begin(); - void begin(uint8_t); + void begin(uint8_t, bool enableGeneralCall = false); void end(); void setClock(uint32_t); @@ -71,10 +71,10 @@ class TwoWire : public Stream bool transmissionBegun; // RX Buffer - RingBuffer rxBuffer; + RingBufferN<256> rxBuffer; //TX buffer - RingBuffer txBuffer; + RingBufferN<256> txBuffer; uint8_t txAddress; // Callback user functions diff --git a/sparkfun/samd/libraries/Wire/examples/master_reader/master_reader.ino b/sparkfun/samd/libraries/Wire/examples/master_reader/master_reader.ino index 4124d7d6..1fb5f49f 100644 --- a/sparkfun/samd/libraries/Wire/examples/master_reader/master_reader.ino +++ b/sparkfun/samd/libraries/Wire/examples/master_reader/master_reader.ino @@ -6,26 +6,33 @@ // Refer to the "Wire Slave Sender" example for use with this // Created 29 March 2006 +// Updated 22 October 2020 // This example code is in the public domain. #include +#define SEN_ADDR 0x69 +#define REG_REQUEST 0x14 + void setup() { - Wire.begin(); // join i2c bus (address optional for master) - Serial.begin(9600); // start serial for output + Wire.begin(); + Serial.begin(115200); // Start serial for output } void loop() { - Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 + Wire.beginTransmission(SEN_ADDR); // Begin at sensor's address + Wire.write(REG_REQUEST); //Request information from specified register + Wire.endTransmission(); - while(Wire.available()) // slave may send less than requested + Wire.requestFrom(SEN_ADDR, 2); // Expecting two bytes + while(Wire.available()) // Sensor may send less than requested { - char c = Wire.read(); // receive a byte as character - Serial.print(c); // print the character + uint8_t c = Wire.read(); // Read single byte + Serial.println(c, HEX); // Print byte as a hex value } delay(500); diff --git a/sparkfun/samd/platform.txt b/sparkfun/samd/platform.txt index 0404ce09..a4e24271 100644 --- a/sparkfun/samd/platform.txt +++ b/sparkfun/samd/platform.txt @@ -20,7 +20,7 @@ # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5---3rd-party-Hardware-specification name=SparkFun SAMD (32-bits ARM Cortex-M0+) Boards -version=1.4.0 +version=1.6.0 # Compile variables # ----------------- @@ -31,7 +31,8 @@ compiler.warning_flags.default= compiler.warning_flags.more=-Wall compiler.warning_flags.all=-Wall -Wextra -compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ +compiler.path={runtime.tools.arm-none-eabi-gcc-7-2017q4.path}/bin/ +#compiler.path={runtime.tools.arm-none-eabi-gcc.path}/bin/ compiler.c.cmd=arm-none-eabi-gcc compiler.c.flags=-mcpu={build.mcu} -mthumb -c -g -Os {compiler.warning_flags} -std=gnu11 -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 -MMD compiler.c.elf.cmd=arm-none-eabi-gcc @@ -64,7 +65,7 @@ compiler.S.extra_flags= compiler.ar.extra_flags= compiler.elf2hex.extra_flags= -compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.1.0.path}/CMSIS/Device/ATMEL/" +compiler.arm.cmsis.c.flags="-I{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Include/" "-I{runtime.tools.CMSIS-Atmel-1.2.0.path}/CMSIS/Device/ATMEL/" compiler.arm.cmsis.ldflags="-L{runtime.tools.CMSIS-4.5.0.path}/CMSIS/Lib/GCC/" -larm_cortexM0l_math # USB Flags @@ -75,7 +76,6 @@ build.usb_flags=-DUSB_VID={build.vid} -DUSB_PID={build.pid} -DUSBCON '-DUSB_MANU # numeric vendor ID if available or by board's specific value. build.usb_manufacturer="Unknown" - # Compile patterns # ---------------- @@ -110,8 +110,8 @@ recipe.output.save_file={build.project_name}.{build.variant}.{build.preferred_ou ## Compute size recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf" -recipe.size.regex=\.text\s+([0-9]+).* - +recipe.size.regex=^(?:\.text|\.data|)\s+([0-9]+).* +recipe.size.regex.data=^(?:\.data|\.bss)\s+([0-9]+).* # Uploader tools # -------------- @@ -133,7 +133,7 @@ tools.avrdude_remote.upload.pattern="openocd --version 2>&1 | grep 2016 && if op # # BOSSA # -tools.bossac.path={runtime.tools.bossac.path} +tools.bossac.path={runtime.tools.bossac-1.7.0-arduino3.path} tools.bossac.cmd=bossac tools.bossac.cmd.windows=bossac.exe @@ -146,11 +146,24 @@ tools.bossac_remote.upload.pattern=/usr/bin/run-bossac {upload.verbose} --port=t tools.bossac.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA tools.bossac.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b +# v1.8.0 + +tools.bossac18.path={runtime.tools.bossac-1.8.0-48-gb176eee.path} +tools.bossac18.cmd=bossac + +tools.bossac18.upload.params.verbose=-i -d +tools.bossac18.upload.params.quiet= +tools.bossac18.upload.pattern="{path}/{cmd}" {upload.verbose} --port={serial.port.file} -U -i --offset={upload.offset} -w -v "{build.path}/{build.project_name}.bin" -R + +tools.bossac18.network_cmd={runtime.tools.arduinoOTA.path}/bin/arduinoOTA +tools.bossac18.upload.network_pattern="{network_cmd}" -address {serial.port} -port 65280 -username arduino -password "{network.password}" -sketch "{build.path}/{build.project_name}.bin" -upload /sketch -b + # # OpenOCD sketch upload # -tools.openocd.path={runtime.tools.openocd-0.9.0-arduino6-static.path} +tools.openocd.path={runtime.tools.openocd-0.10.0-arduino7.path} +#tools.openocd.path={runtime.tools.openocd} tools.openocd.cmd=bin/openocd tools.openocd.cmd.windows=bin/openocd.exe @@ -179,7 +192,8 @@ tools.openocd.bootloader.pattern="{path}/{cmd}" {bootloader.verbose} -s "{path}/ # FIXME: this programmer is a workaround for default options being overwritten by uploadUsingPreferences # -tools.openocd-withbootsize.path={runtime.tools.openocd-0.9.0-arduino6-static.path} +#tools.openocd-withbootsize.path={runtime.tools.openocd-0.10.0-arduino7.path} +tools.openocd-withbootsize.path={runtime.tools.openocd} tools.openocd-withbootsize.cmd=bin/openocd tools.openocd-withbootsize.cmd.windows=bin/openocd.exe diff --git a/sparkfun/samd/variants/arduino_zero/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_LoRaSerial/debug_scripts/variant.gdb similarity index 100% rename from sparkfun/samd/variants/arduino_zero/debug_scripts/variant.gdb rename to sparkfun/samd/variants/SparkFun_LoRaSerial/debug_scripts/variant.gdb diff --git a/sparkfun/samd/variants/arduino_zero/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_LoRaSerial/linker_scripts/gcc/flash_with_bootloader.ld similarity index 100% rename from sparkfun/samd/variants/arduino_zero/linker_scripts/gcc/flash_with_bootloader.ld rename to sparkfun/samd/variants/SparkFun_LoRaSerial/linker_scripts/gcc/flash_with_bootloader.ld diff --git a/sparkfun/samd/variants/arduino_zero/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_LoRaSerial/linker_scripts/gcc/flash_without_bootloader.ld similarity index 100% rename from sparkfun/samd/variants/arduino_zero/linker_scripts/gcc/flash_without_bootloader.ld rename to sparkfun/samd/variants/SparkFun_LoRaSerial/linker_scripts/gcc/flash_without_bootloader.ld diff --git a/sparkfun/samd/variants/arduino_zero/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_LoRaSerial/openocd_scripts/arduino_zero.cfg similarity index 100% rename from sparkfun/samd/variants/arduino_zero/openocd_scripts/arduino_zero.cfg rename to sparkfun/samd/variants/SparkFun_LoRaSerial/openocd_scripts/arduino_zero.cfg diff --git a/sparkfun/samd/variants/arduino_zero/pins_arduino.h b/sparkfun/samd/variants/SparkFun_LoRaSerial/pins_arduino.h similarity index 100% rename from sparkfun/samd/variants/arduino_zero/pins_arduino.h rename to sparkfun/samd/variants/SparkFun_LoRaSerial/pins_arduino.h diff --git a/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.cpp b/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.cpp new file mode 100644 index 00000000..cda79706 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.cpp @@ -0,0 +1,221 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + SAMD21 Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 | PA14 | | EIC/EXTINT[14] SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 | PA09 | | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] SERCOM2/PAD[1] *TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 | PA08 | | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] SERCOM2/PAD[0] *TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] *TCC0/WO[6] + * | 7 | 7 | PA21 | | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | A5 | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | EDBG | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | EDBG_UART TX | *SERCOM5/PAD[2] + * | 31 | | PB23 | EDBG_UART RX | *SERCOM5/PAD[3] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 32 | | PA22 | EDBG_SDA | Pin 20 (SDA) + * | 33 | | PA23 | EDBG_SCL | Pin 21 (SCL) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 34 | | PA19 | EDBG_MISO | EIC/EXTINT[3] *SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] TCC0/WO[3] + * | 35 | | PA16 | EDBG_MOSI | EIC/EXTINT[0] *SERCOM1/PAD[0] SERCOM3/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | 36 | | PA18 | EDBG_SS | EIC/EXTINT[2] *SERCOM1/PAD[2] SERCOM3/PAD[2] TC3/WO[0] TCC0/WO[2] + * | 37 | | PA17 | EDBG_SCK | EIC/EXTINT[1] *SERCOM1/PAD[1] SERCOM3/PAD[1] TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 38 | ATN | PA13 | EDBG_GPIO0 | EIC/EXTINT[13] SERCOM2/PAD[1] SERCOM4/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * | 39 | | PA21 | EDBG_GPIO1 | Pin 7 + * | 40 | | PA06 | EDBG_GPIO2 | Pin 8 + * | 41 | | PA07 | EDBG_GPIO3 | Pin 9 + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * | 42 | AREF | PA03 | | EIC/EXTINT[3] *[ADC|DAC]/VREFA ADC/AIN[1] PTC/Y[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..12 + // Digital Low + { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM2_CH1, NOT_ON_TIMER, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTB, 3, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..41 - Extra UART + // ---------------------- + // 30/31 - Extra UART + /*Placeholder - not broken out */ { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // 30/TX: SERCOM5/PAD[2] + /*Placeholder - not broken out */ { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] + + // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) + { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] + + // 34..37 - D10-D13 SPI + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCK: SERCOM1/PAD[1] + + // 38..41 - EDBG/Digital + /*Placeholder - not broken out */ { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 9 + + // 42 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP + + // ---------------------- + // 43 - Alternate use of A0 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // DAC/VOUT +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; +Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial1.IrqHandler(); +} + +void SERCOM5_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.h b/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.h new file mode 100644 index 00000000..9846abfd --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_LoRaSerial/variant.h @@ -0,0 +1,227 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_ZERO_ +#define _VARIANT_ARDUINO_ZERO_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (48000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (26u) +#define NUM_DIGITAL_PINS (14u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (15ul) +#define PIN_A2 (16ul) +#define PIN_A3 (17ul) +#define PIN_A4 (18ul) +#define PIN_A5 (19ul) +#define PIN_DAC0 (14ul) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t DAC0 = PIN_DAC0; +#define ADC_RESOLUTION 12 + +// Other pins +#define PIN_ATN (38ul) +static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ +// Serial (EDBG) +#define PIN_SERIAL_RX (31ul) +#define PIN_SERIAL_TX (30ul) +#define PAD_SERIAL_TX (UART_TX_PAD_2) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_3) + +// Serial1 +#define PIN_SERIAL1_RX (0ul) +#define PIN_SERIAL1_TX (1ul) +#define PAD_SERIAL1_TX (UART_TX_PAD_2) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 +// Instead of using SERCOM4, and the SPI-header pins, the Mini Breakout +// uses pins 10-13 for SPI, on the unused sercom1 +#define PIN_SPI_MISO (12u) +#define PIN_SPI_MOSI (11u) +#define PIN_SPI_SCK (13u) +#define PIN_SPI_SS (10u) +#define PERIPH_SPI sercom1 +// Pad Map: 0 1 2 3 +// MOSI (TX) SCK SS MOSI (RX) +#define PAD_SPI_TX SPI_PAD_0_SCK_1 +#define PAD_SPI_RX SERCOM_RX_PAD_3 + +static const uint8_t SS = PIN_SPI_SS; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 +#define PIN_I2S_SD (9u) +#define PIN_I2S_SCK (1u) +#define PIN_I2S_FS (0u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +extern Uart Serial; +extern Uart Serial1; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR SerialUSB +// Serial has no physical pins broken out, so it's not listed as HARDWARE port +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* _VARIANT_ARDUINO_ZERO_ */ + diff --git a/sparkfun/samd/variants/SparkFun_ProRF/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_ProRF/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_ProRF/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_ProRF/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_ProRF/pins_arduino.h b/sparkfun/samd/variants/SparkFun_ProRF/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/arduino_zero/variant.cpp b/sparkfun/samd/variants/SparkFun_ProRF/variant.cpp similarity index 95% rename from sparkfun/samd/variants/arduino_zero/variant.cpp rename to sparkfun/samd/variants/SparkFun_ProRF/variant.cpp index 85ba2416..a4f41d1e 100644 --- a/sparkfun/samd/variants/arduino_zero/variant.cpp +++ b/sparkfun/samd/variants/SparkFun_ProRF/variant.cpp @@ -167,34 +167,34 @@ const PinDescription g_APinDescription[]= { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP - // 30..41 - EDBG + // 30..41 - Extra Pins // ---------------------- - // 30/31 - EDBG/UART - { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TX: SERCOM5/PAD[2] - { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // RX: SERCOM5/PAD[3] + // 30/31 - Extra UART + { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] // 34..37 - EDBG/SPI - { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3] - { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MOSI: SERCOM1/PAD[0] - { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SS: SERCOM1/PAD[2] - { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCK: SERCOM1/PAD[1] + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D12/MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D11/MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D10/SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D13/SCK: SERCOM1/PAD[1] // 38..41 - EDBG/Digital - { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] - { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 7 - { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 8 - { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 9 + { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D7: Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D8: Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D9: Pin 9 // 42 (AREF) - { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // AREF: DAC/VREFP // ---------------------- // 43 - Alternate use of A0 (DAC output) - { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // DAC/VOUT + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0: DAC/VOUT } ; const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; diff --git a/sparkfun/samd/variants/arduino_zero/variant.h b/sparkfun/samd/variants/SparkFun_ProRF/variant.h similarity index 99% rename from sparkfun/samd/variants/arduino_zero/variant.h rename to sparkfun/samd/variants/SparkFun_ProRF/variant.h index 6594bc04..26b89ed3 100644 --- a/sparkfun/samd/variants/arduino_zero/variant.h +++ b/sparkfun/samd/variants/SparkFun_ProRF/variant.h @@ -214,7 +214,7 @@ extern Uart Serial1; // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX // pins are NOT connected to anything by default. #define SERIAL_PORT_USBVIRTUAL SerialUSB -#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_MONITOR SerialUSB // Serial has no physical pins broken out, so it's not listed as HARDWARE port #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1 diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_ProRF_1W/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_ProRF_1W/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/pins_arduino.h b/sparkfun/samd/variants/SparkFun_ProRF_1W/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.cpp b/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.cpp new file mode 100644 index 00000000..bae7c6bf --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.cpp @@ -0,0 +1,188 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + Pro RF 1W Name | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 <- | PA14 | SPI1 MISO | EIC/EXTINT[14] *SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 -> | PA09 | SPI1 SCLK | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] *SERCOM2/PAD[1] TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 -> | PA08 | SPI1 MOSI | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] *SERCOM2/PAD[0] TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | E19 DIO0 | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] TCC0/WO[6] + * | 7 | 7 | PA21 | NOT_EXPOSED | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | FLASH_CS | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | E19 DIO1 | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | E19 DIO2 | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | E19 !CS | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | NOT_EXPOSED | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] (Not Connected) + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP +** +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | E19 TX/RX EN | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | E19 TXEN | + * | 31 | | PB23 | E19 RXEN | + * | 32 | | PA19 | E19 RESET | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..4 + // SPI1 + // 22..24 - SPI pins (MISO1,SCK1,MOSI1) - could also be used as digital though + // ---------------------- + { PORTA, 14, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, // MISO1: SERCOM2/PAD[2] + { PORTA, 9, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // SCLK1: SERCOM2/PAD[1] + { PORTA, 8, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // MOSI1: SERCOM2/PAD[0] + // { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + // { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + // { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + + // 5..12 + // Digital Low + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // Not exposed, but would be pin7 + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, 0, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] // Not exposed + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTB, 3, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..31 - TX / RX Enable for E19 + // ---------------------- + { PORTB, 22, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // E19 TXEN + { PORTB, 23, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // E19 RXEN + + // 32 - E19 RESET + { PORTA, 13, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // E19 RXEN + +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial( &sercom0, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.h b/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.h new file mode 100644 index 00000000..7d810e30 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_ProRF_1W/variant.h @@ -0,0 +1,251 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_SPARKFUN_SAMD21_PRO_RF_1W_ +#define _VARIANT_SPARKFUN_SAMD21_PRO_RF_1W_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (48000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (33u) +#define NUM_DIGITAL_PINS (27u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (0u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + + +// E19 Module +#define E19_CS (12u) +#define E19_RESET (32u) +#define E19_TXEN (30u) +#define E19_RXEN (31u) +#define E19_DIO0 (6u) +#define E19_DIO1 (10u) +#define E19_DIO2 (11u) +#define E19_INT E19_DIO0 +#define E19_SPI SPI + +// SRAM chip +#define FLASH_CS (8u) +#define FLASH_SPI SPI1 + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (15ul) +#define PIN_A2 (16ul) +#define PIN_A3 (17ul) +#define PIN_A4 (18ul) +// #define PIN_A5 (19ul) +// #define PIN_DAC0 (14ul) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +// static const uint8_t A5 = PIN_A5; +// static const uint8_t DAC0 = PIN_DAC0; +// #define ADC_RESOLUTION 12 + +// // Other pins +// #define PIN_ATN (38ul) +// static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ +// Serial +#define PIN_SERIAL_RX (0ul) +#define PIN_SERIAL_TX (1ul) +#define PAD_SERIAL_TX (UART_TX_PAD_2) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_3) + +// // Serial1 (EDBG) +// #define PIN_SERIAL1_RX (31ul) +// #define PIN_SERIAL1_TX (30ul) +// #define PAD_SERIAL1_TX (UART_TX_PAD_2) +// #define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (22u) +#define PIN_SPI_MOSI (23u) +#define PIN_SPI_SCK (24u) +#define PERIPH_SPI sercom4 +#define PAD_SPI_TX SPI_PAD_2_SCK_3 +#define PAD_SPI_RX SERCOM_RX_PAD_0 + +static const uint8_t SS = PIN_A2 ; // SERCOM4 last PAD is present on A2 but HW SS isn't used. Set here only for reference. +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +#define PIN_SPI1_MISO (2u) +#define PIN_SPI1_MOSI (3u) +#define PIN_SPI1_SCK (4u) +#define PERIPH_SPI1 sercom2 +#define PAD_SPI1_TX SPI_PAD_0_SCK_1 +#define PAD_SPI1_RX SERCOM_RX_PAD_2 + +// static const uint8_t SS1 = PIN_A2 ; // SERCOM4 last PAD is present on A2 but HW SS isn't used. Set here only for reference. +static const uint8_t MOSI1 = PIN_SPI1_MOSI ; +static const uint8_t MISO1 = PIN_SPI1_MISO ; +static const uint8_t SCK1 = PIN_SPI1_SCK ; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 +#define PIN_I2S_SD (9u) +#define PIN_I2S_SCK (1u) +#define PIN_I2S_FS (0u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +// extern Uart Serial; +extern Uart Serial; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR Serial + +#define SERIAL_PORT_HARDWARE Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial + +#endif /* _VARIANT_SPARKFUN_SAMD21_PRO_RF_1W_ */ + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/pins_arduino.h b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.cpp b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.cpp new file mode 100644 index 00000000..38709336 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.cpp @@ -0,0 +1,107 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + + +#include "variant.h" + + +// Pins descriptions +// ------------------------ +const PinDescription g_APinDescription[] = +{ + // 0..8 - Digital pins + // ---------------------- + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel16, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // D0/SDA + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // D1/DAC + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // D2/MOSI + { PORTA, 5, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel5, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_5 }, // D3/MISO + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // D4/SCK + { PORTA, 0, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, TCC2_CH0, EXTERNAL_INT_0 }, // D5 + { PORTA, 1, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, TCC2_CH1, EXTERNAL_INT_1 }, // D6 + { PORTA, 4, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel4,PWM0_CH0, TCC0_CH0, EXTERNAL_INT_4 }, // D7/VREFB + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel17, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // D8/SCL + + // 9/10 - I2C + // ---------------------- + { PORTA, 8, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel16, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // SDA/D0 + { PORTA, 9, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel17, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // SCL/D2 + + // 11..15 - SPI + // -------------------- + { PORTA, 7, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // SCK/D11 + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel11, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // D12 + { PORTA, 10, PIO_DIGITAL, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel18, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_10}, // D13/LED + { PORTA, 6, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // MOSI/D14 + { PORTA, 5, PIO_SERCOM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel5,PWM0_CH1, TCC0_CH1, EXTERNAL_INT_5 }, // MISO/D15 + + // 16/17 - RX/TX + // -------------------- + { PORTA, 23, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM4_CH1, TC4_CH1, EXTERNAL_INT_7 }, // RX/D16 + { PORTA, 22, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM4_CH0, TC4_CH0, EXTERNAL_INT_6 }, // TX/D17 + + // 18-21 - Flash SPI + // -------------------- + { PORTA, 16, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // Flash MOSI + { PORTA, 17, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_1 }, // Flash SCK + { PORTA, 18, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // Flash MISO + { PORTA, 19, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_3 }, // Flash SS + + // 22/23 - SWD + // -------------------- + { PORTA, 30, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_10 }, // SWCLK/D22 + { PORTA, 31, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_11 }, // SWDIO/D23 + + // 24..29, A0-A5 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0/D1/DAC + { PORTA, 6, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel6, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // A1/D2 + { PORTA, 5, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel5, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_5 }, // A2/D3 + { PORTA, 7, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel7, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // A3/D4 + { PORTA, 10, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel18, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_10 }, // A4/D13 + { PORTA, 4, PIO_ANALOG, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel4, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_4 }, // A5/D7 + + // 30..32 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // usb hOST ENABLE + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // usb/dm + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // usb/dp + + // 33..35 - Unused Pins + // ---------------------- + { PORTA, 11, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel19, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_11 }, + { PORTA, 14, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_14 }, + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 } + +}; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; + + +Uart Serial( &sercom3, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; + +void SERCOM3_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.h b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.h new file mode 100644 index 00000000..9aa3ccfa --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_Micro/variant.h @@ -0,0 +1,217 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_ZERO_ +#define _VARIANT_ARDUINO_ZERO_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (F_CPU) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (36u) +#define NUM_DIGITAL_PINS (30u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 22u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// RX and TX LEDs are not present on the board. +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (24u) +#define PIN_A1 (PIN_A0+1) +#define PIN_A2 (PIN_A0+2) +#define PIN_A3 (PIN_A0+3) +#define PIN_A4 (PIN_A0+4) +#define PIN_A5 (PIN_A0+5) +#define PIN_DAC0 PIN_A0 + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t DAC0 = PIN_DAC0; +#define ADC_RESOLUTION 12 + +/* + * Serial interfaces + */ + +// Serial +#define PIN_SERIAL_TX (17ul) // Transmit can only be on PAD0 or PAD2 +#define PIN_SERIAL_RX (16ul) // Receive can be on any pins. +#define PAD_SERIAL_TX (UART_TX_PAD_0) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_1) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MOSI (14u) +#define PIN_SPI_MISO (15u) +#define PIN_SPI_SCK (11u) +#define PIN_SPI_SS (7u) +#define PERIPH_SPI sercom0 +#define PAD_SPI_TX SPI_PAD_2_SCK_3 +#define PAD_SPI_RX SERCOM_RX_PAD_1 + +static const uint8_t SS = PIN_SPI_SS ; +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +#define PIN_SPI1_MOSI (18u) +#define PIN_SPI1_SCK (19u) +#define PIN_SPI1_MISO (20u) +#define PIN_SPI1_SS (21u) +#define PERIPH_SPI1 sercom1 +#define PAD_SPI1_TX SPI_PAD_0_SCK_1 +#define PAD_SPI1_RX SERCOM_RX_PAD_2 + +static const uint8_t FLASH_SS = PIN_SPI1_SS ; +static const uint8_t FLASH_MOSI = PIN_SPI1_MOSI ; +static const uint8_t FLASH_MISO = PIN_SPI1_MISO ; +static const uint8_t FLASH_SCK = PIN_SPI1_SCK ; + +/* + * Wire Interfaces + */ +//I2C/Qwiic Interface +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (9u) +#define PIN_WIRE_SCL (10u) +#define PERIPH_WIRE sercom2 +#define WIRE_IT_HANDLER SERCOM2_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (30ul) +#define PIN_USB_DM (31ul) +#define PIN_USB_DP (32ul) + + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; + + +extern Uart Serial; + + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR SerialUSB +#define SERIAL_PORT_HARDWARE Serial +#define SERIAL_PORT_HARDWARE_OPEN Serial + +#endif /* _VARIANT_ARDUINO_ZERO_ */ + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/pins_arduino.h b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.cpp b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.cpp new file mode 100644 index 00000000..b7fc3baa --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.cpp @@ -0,0 +1,221 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + SAMD21 Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 | PA14 | | EIC/EXTINT[14] SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 | PA09 | | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] SERCOM2/PAD[1] *TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 | PA08 | | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] SERCOM2/PAD[0] *TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] *TCC0/WO[6] + * | 7 | 7 | PA21 | | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | A5 | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | EDBG | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | EDBG_UART TX | *SERCOM5/PAD[2] + * | 31 | | PB23 | EDBG_UART RX | *SERCOM5/PAD[3] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 32 | | PA22 | EDBG_SDA | Pin 20 (SDA) + * | 33 | | PA23 | EDBG_SCL | Pin 21 (SCL) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 34 | | PA19 | EDBG_MISO | EIC/EXTINT[3] *SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] TCC0/WO[3] + * | 35 | | PA16 | EDBG_MOSI | EIC/EXTINT[0] *SERCOM1/PAD[0] SERCOM3/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | 36 | | PA18 | EDBG_SS | EIC/EXTINT[2] *SERCOM1/PAD[2] SERCOM3/PAD[2] TC3/WO[0] TCC0/WO[2] + * | 37 | | PA17 | EDBG_SCK | EIC/EXTINT[1] *SERCOM1/PAD[1] SERCOM3/PAD[1] TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 38 | ATN | PA13 | EDBG_GPIO0 | EIC/EXTINT[13] SERCOM2/PAD[1] SERCOM4/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * | 39 | | PA21 | EDBG_GPIO1 | Pin 7 + * | 40 | | PA06 | EDBG_GPIO2 | Pin 8 + * | 41 | | PA07 | EDBG_GPIO3 | Pin 9 + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * | 42 | AREF | PA03 | | EIC/EXTINT[3] *[ADC|DAC]/VREFA ADC/AIN[1] PTC/Y[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..12 + // Digital Low + { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_SERCOM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM2_CH1, NOT_ON_TIMER, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTB, 3, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..41 - Extra UART + // ---------------------- + // 30/31 - Extra UART + /*Placeholder - not broken out */ { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + /*Placeholder - not broken out */ { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] + + // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) + { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] + + // 34..37 - D10-D13 SPI + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCK: SERCOM1/PAD[1] + + // 38..41 - EDBG/Digital + /*Placeholder - not broken out */ { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 9 + + // 42 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP + + // ---------------------- + // 43 - Alternate use of A0 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // DAC/VOUT +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; +Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial1.IrqHandler(); +} + +void SERCOM5_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.h b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.h new file mode 100644 index 00000000..9846abfd --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_Qwiic_USB_Bridge/variant.h @@ -0,0 +1,227 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_ZERO_ +#define _VARIANT_ARDUINO_ZERO_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (48000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (26u) +#define NUM_DIGITAL_PINS (14u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (15ul) +#define PIN_A2 (16ul) +#define PIN_A3 (17ul) +#define PIN_A4 (18ul) +#define PIN_A5 (19ul) +#define PIN_DAC0 (14ul) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t DAC0 = PIN_DAC0; +#define ADC_RESOLUTION 12 + +// Other pins +#define PIN_ATN (38ul) +static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ +// Serial (EDBG) +#define PIN_SERIAL_RX (31ul) +#define PIN_SERIAL_TX (30ul) +#define PAD_SERIAL_TX (UART_TX_PAD_2) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_3) + +// Serial1 +#define PIN_SERIAL1_RX (0ul) +#define PIN_SERIAL1_TX (1ul) +#define PAD_SERIAL1_TX (UART_TX_PAD_2) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 +// Instead of using SERCOM4, and the SPI-header pins, the Mini Breakout +// uses pins 10-13 for SPI, on the unused sercom1 +#define PIN_SPI_MISO (12u) +#define PIN_SPI_MOSI (11u) +#define PIN_SPI_SCK (13u) +#define PIN_SPI_SS (10u) +#define PERIPH_SPI sercom1 +// Pad Map: 0 1 2 3 +// MOSI (TX) SCK SS MOSI (RX) +#define PAD_SPI_TX SPI_PAD_0_SCK_1 +#define PAD_SPI_RX SERCOM_RX_PAD_3 + +static const uint8_t SS = PIN_SPI_SS; +static const uint8_t MOSI = PIN_SPI_MOSI; +static const uint8_t MISO = PIN_SPI_MISO; +static const uint8_t SCK = PIN_SPI_SCK; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 +#define PIN_I2S_SD (9u) +#define PIN_I2S_SCK (1u) +#define PIN_I2S_FS (0u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +extern Uart Serial; +extern Uart Serial1; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR SerialUSB +// Serial has no physical pins broken out, so it's not listed as HARDWARE port +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* _VARIANT_ARDUINO_ZERO_ */ + diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/pins_arduino.h b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp new file mode 100644 index 00000000..9bbfda07 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp @@ -0,0 +1,228 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + ZERO Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 | PA14 | | EIC/EXTINT[14] SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 | PA09 | | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] SERCOM2/PAD[1] *TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 | PA08 | | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] SERCOM2/PAD[0] *TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] *TCC0/WO[6] + * | 7 | 7 | PA21 | | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | A5 | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | EDBG | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | EDBG_UART TX | *SERCOM5/PAD[2] + * | 31 | | PB23 | EDBG_UART RX | *SERCOM5/PAD[3] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 32 | | PA22 | EDBG_SDA | Pin 20 (SDA) + * | 33 | | PA23 | EDBG_SCL | Pin 21 (SCL) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 34 | | PA19 | EDBG_MISO | EIC/EXTINT[3] *SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] TCC0/WO[3] + * | 35 | | PA16 | EDBG_MOSI | EIC/EXTINT[0] *SERCOM1/PAD[0] SERCOM3/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | 36 | | PA18 | EDBG_SS | EIC/EXTINT[2] *SERCOM1/PAD[2] SERCOM3/PAD[2] TC3/WO[0] TCC0/WO[2] + * | 37 | | PA17 | EDBG_SCK | EIC/EXTINT[1] *SERCOM1/PAD[1] SERCOM3/PAD[1] TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 38 | ATN | PA13 | EDBG_GPIO0 | EIC/EXTINT[13] SERCOM2/PAD[1] SERCOM4/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * | 39 | | PA21 | EDBG_GPIO1 | Pin 7 + * | 40 | | PA06 | EDBG_GPIO2 | Pin 8 + * | 41 | | PA07 | EDBG_GPIO3 | Pin 9 + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * | 42 | AREF | PA03 | | EIC/EXTINT[3] *[ADC|DAC]/VREFA ADC/AIN[1] PTC/Y[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..12 + // Digital Low + { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, 0, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTA, 31, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..41 - Extra Pins + // ---------------------- + // 30/31 - Extra UART + { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] + + // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) + { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] + + // 34..37 - EDBG/SPI + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D12/MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D11/MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D10/SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D13/SCK: SERCOM1/PAD[1] + + // 38..41 - EDBG/Digital + { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D7: Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D8: Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D9: Pin 9 + + // 42 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // AREF: DAC/VREFP + + // ---------------------- + // 43 - Alternate use of A0 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0: DAC/VOUT + + // 44 - RGB LED + { PORTA, 30, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 44: RGB LED + + //45 + { PORTB, 3, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE } // 31/RX: SERCOM5/PAD[3] + +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; +//Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial1.IrqHandler(); +} + +//void SERCOM5_Handler() +//{ +// Serial.IrqHandler(); +//} + diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp.bak b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp.bak new file mode 100644 index 00000000..feb3c452 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.cpp.bak @@ -0,0 +1,224 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + ZERO Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 | PA14 | | EIC/EXTINT[14] SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 | PA09 | | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] SERCOM2/PAD[1] *TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 | PA08 | | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] SERCOM2/PAD[0] *TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] *TCC0/WO[6] + * | 7 | 7 | PA21 | | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | A5 | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | EDBG | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | EDBG_UART TX | *SERCOM5/PAD[2] + * | 31 | | PB23 | EDBG_UART RX | *SERCOM5/PAD[3] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 32 | | PA22 | EDBG_SDA | Pin 20 (SDA) + * | 33 | | PA23 | EDBG_SCL | Pin 21 (SCL) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 34 | | PA19 | EDBG_MISO | EIC/EXTINT[3] *SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] TCC0/WO[3] + * | 35 | | PA16 | EDBG_MOSI | EIC/EXTINT[0] *SERCOM1/PAD[0] SERCOM3/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | 36 | | PA18 | EDBG_SS | EIC/EXTINT[2] *SERCOM1/PAD[2] SERCOM3/PAD[2] TC3/WO[0] TCC0/WO[2] + * | 37 | | PA17 | EDBG_SCK | EIC/EXTINT[1] *SERCOM1/PAD[1] SERCOM3/PAD[1] TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 38 | ATN | PA13 | EDBG_GPIO0 | EIC/EXTINT[13] SERCOM2/PAD[1] SERCOM4/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * | 39 | | PA21 | EDBG_GPIO1 | Pin 7 + * | 40 | | PA06 | EDBG_GPIO2 | Pin 8 + * | 41 | | PA07 | EDBG_GPIO3 | Pin 9 + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * | 42 | AREF | PA03 | | EIC/EXTINT[3] *[ADC|DAC]/VREFA ADC/AIN[1] PTC/Y[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..12 + // Digital Low + { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, 0, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTA, 31, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..41 - Extra Pins + // ---------------------- + // 30/31 - Extra UART + { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] + + // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) + { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] + + // 34..37 - EDBG/SPI + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D12/MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D11/MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D10/SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D13/SCK: SERCOM1/PAD[1] + + // 38..41 - EDBG/Digital + { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D7: Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D8: Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D9: Pin 9 + + // 42 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // AREF: DAC/VREFP + + // ---------------------- + // 43 - Alternate use of A0 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0: DAC/VOUT + + // 44 - RGB LED + { PORTA, 30, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE } // 44: RGB LED +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; +Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial1.IrqHandler(); +} + +void SERCOM5_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.h b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.h new file mode 100644 index 00000000..c1dbf258 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_RedBoard_Turbo/variant.h @@ -0,0 +1,230 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_ZERO_ +#define _VARIANT_ARDUINO_ZERO_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (48000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (45u) +#define NUM_DIGITAL_PINS (20u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define RGB_LED (44u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define PIN_LED4 RGB_LED +#define LED_BUILTIN PIN_LED_13 + + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (15ul) +#define PIN_A2 (16ul) +#define PIN_A3 (17ul) +#define PIN_A4 (18ul) +#define PIN_A5 (19ul) +#define PIN_DAC0 (14ul) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t DAC0 = PIN_DAC0; +#define ADC_RESOLUTION 12 + +// Other pins +#define PIN_ATN (38ul) +static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ +// Serial (EDBG) +#define PIN_SERIAL_RX (31ul) +#define PIN_SERIAL_TX (30ul) +#define PAD_SERIAL_TX (UART_TX_PAD_2) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_3) + +// Serial1 +#define PIN_SERIAL1_RX (0ul) +#define PIN_SERIAL1_TX (1ul) +#define PAD_SERIAL1_TX (UART_TX_PAD_2) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 + +#define PIN_SPI_MISO (22u) +#define PIN_SPI_MOSI (23u) +#define PIN_SPI_SCK (24u) +#define PERIPH_SPI sercom4 +#define PAD_SPI_TX SPI_PAD_2_SCK_3 +#define PAD_SPI_RX SERCOM_RX_PAD_0 + +static const uint8_t SS = PIN_A2 ; // SERCOM4 last PAD is present on A2 but HW SS isn't used. Set here only for reference. +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 +#define PIN_I2S_SD (9u) +#define PIN_I2S_SCK (1u) +#define PIN_I2S_FS (0u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +// Serial has no physical pins broken out but could exist if it did =) +//extern Uart Serial; +extern Uart Serial1; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR SerialUSB +// Serial has no physical pins broken out, so it's not listed as HARDWARE port +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +// map Serial to SerialUSB +#define Serial SerialUSB + +#endif /* _VARIANT_ARDUINO_ZERO_ */ + diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/debug_scripts/variant.gdb b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/debug_scripts/variant.gdb new file mode 100644 index 00000000..3c37ffde --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/debug_scripts/variant.gdb @@ -0,0 +1,31 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +# Define 'reset' command +define reset + +info reg + +break main + +# End of 'reset' command +end + +target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..4475f951 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,211 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x2000, LENGTH = 0x00040000-0x2000 /* First 8KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..0162f077 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,212 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00040000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00008000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/openocd_scripts/arduino_zero.cfg b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/openocd_scripts/arduino_zero.cfg new file mode 100644 index 00000000..36c65c32 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/openocd_scripts/arduino_zero.cfg @@ -0,0 +1,30 @@ +# +# Arduino Zero OpenOCD script. +# +# Copyright (c) 2014-2015 Arduino LLC. All right reserved. +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# + +source [find interface/cmsis-dap.cfg] + +# chip name +set CHIPNAME at91samd21g18 +set ENDIAN little + +# choose a port here +set telnet_port 0 + +source [find target/at91samdXX.cfg] diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/pins_arduino.h b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.cpp b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.cpp new file mode 100644 index 00000000..a4f41d1e --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.cpp @@ -0,0 +1,221 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ +/* + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * + Pin number + ZERO Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital Low | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 0 | 0 -> RX | PA11 | | EIC/EXTINT[11] ADC/AIN[19] PTC/X[3] *SERCOM0/PAD[3] SERCOM2/PAD[3] TCC0/WO[3] TCC1/WO[1] + * | 1 | 1 <- TX | PA10 | | EIC/EXTINT[10] ADC/AIN[18] PTC/X[2] *SERCOM0/PAD[2] TCC0/WO[2] TCC1/WO[0] + * | 2 | 2 | PA14 | | EIC/EXTINT[14] SERCOM2/PAD[2] SERCOM4/PAD[2] TC3/WO[0] TCC0/WO[4] + * | 3 | ~3 | PA09 | | EIC/EXTINT[9] ADC/AIN[17] PTC/X[1] SERCOM0/PAD[1] SERCOM2/PAD[1] *TCC0/WO[1] TCC1/WO[3] + * | 4 | ~4 | PA08 | | EIC/NMI ADC/AIN[16] PTC/X[0] SERCOM0/PAD[0] SERCOM2/PAD[0] *TCC0/WO[0] TCC1/WO[2] + * | 5 | ~5 | PA15 | | EIC/EXTINT[15] SERCOM2/PAD[3] SERCOM4/PAD[3] *TC3/WO[1] TCC0/WO[5] + * | 6 | ~6 | PA20 | | EIC/EXTINT[4] PTC/X[8] SERCOM5/PAD[2] SERCOM3/PAD[2] *TCC0/WO[6] + * | 7 | 7 | PA21 | | EIC/EXTINT[5] PTC/X[9] SERCOM5/PAD[3] SERCOM3/PAD[3] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Digital High | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 8 | ~8 | PA06 | | EIC/EXTINT[6] ADC/AIN[6] AC/AIN[2] PTC/Y[4] SERCOM0/PAD[2] *TCC1/WO[0] + * | 9 | ~9 | PA07 | | EIC/EXTINT[7] ADC/AIN[7] AC/AIN[3] PTC/Y[5] SERCOM0/PAD[3] *TCC1/WO[1] + * | 10 | ~10 | PA18 | | EIC/EXTINT[2] PTC/X[6] +SERCOM1/PAD[2] SERCOM3/PAD[2] *TC3/WO[0] TCC0/WO[2] + * | 11 | ~11 | PA16 | | EIC/EXTINT[0] PTC/X[4] +SERCOM1/PAD[0] SERCOM3/PAD[0] *TCC2/WO[0] TCC0/WO[6] + * | 12 | ~12 | PA19 | | EIC/EXTINT[3] PTC/X[7] +SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] *TCC0/WO[3] + * | 13 | ~13 | PA17 | LED | EIC/EXTINT[1] PTC/X[5] +SERCOM1/PAD[1] SERCOM3/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Analog Connector | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 14 | A0 | PA02 | A0 | EIC/EXTINT[2] *ADC/AIN[0] DAC/VOUT PTC/Y[0] + * | 15 | A1 | PB08 | A1 | EIC/EXTINT[8] *ADC/AIN[2] PTC/Y[14] SERCOM4/PAD[0] TC4/WO[0] + * | 16 | A2 | PB09 | A2 | EIC/EXTINT[9] *ADC/AIN[3] PTC/Y[15] SERCOM4/PAD[1] TC4/WO[1] + * | 17 | A3 | PA04 | A3 | EIC/EXTINT[4] *ADC/AIN[4] AC/AIN[0] PTC/Y[2] SERCOM0/PAD[0] TCC0/WO[0] + * | 18 | A4 | PA05 | A4 | EIC/EXTINT[5] *ADC/AIN[5] AC/AIN[1] PTC/Y[5] SERCOM0/PAD[1] TCC0/WO[1] + * | 19 | A5 | PB02 | A5 | EIC/EXTINT[2] *ADC/AIN[10] PTC/Y[8] SERCOM5/PAD[0] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | Wire | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 20 | SDA | PA22 | SDA | EIC/EXTINT[6] PTC/X[10] *SERCOM3/PAD[0] SERCOM5/PAD[0] TC4/WO[0] TCC0/WO[4] + * | 21 | SCL | PA23 | SCL | EIC/EXTINT[7] PTC/X[11] *SERCOM3/PAD[1] SERCOM5/PAD[1] TC4/WO[1] TCC0/WO[5] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |SPI (Legacy ICSP) | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 22 | 1 | PA12 | MISO | EIC/EXTINT[12] SERCOM2/PAD[0] *SERCOM4/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | | 2 | | 5V0 | + * | 23 | 4 | PB10 | MOSI | EIC/EXTINT[10] *SERCOM4/PAD[2] TC5/WO[0] TCC0/WO[4] + * | 24 | 3 | PB11 | SCK | EIC/EXTINT[11] *SERCOM4/PAD[3] TC5/WO[1] TCC0/WO[5] + * | | 5 | | RESET | + * | | 6 | | GND | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | LEDs | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 25 | | PB03 | RX | + * | 26 | | PA27 | TX | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | USB | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 27 | | PA28 | USB_HOST_ENABLE | EIC/EXTINT[8] + * | 28 | | PA24 | USB_NEGATIVE | *USB/DM + * | 29 | | PA25 | USB_POSITIVE | *USB/DP + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | EDBG | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 30 | | PB22 | EDBG_UART TX | *SERCOM5/PAD[2] + * | 31 | | PB23 | EDBG_UART RX | *SERCOM5/PAD[3] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 32 | | PA22 | EDBG_SDA | Pin 20 (SDA) + * | 33 | | PA23 | EDBG_SCL | Pin 21 (SCL) + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 34 | | PA19 | EDBG_MISO | EIC/EXTINT[3] *SERCOM1/PAD[3] SERCOM3/PAD[3] TC3/WO[1] TCC0/WO[3] + * | 35 | | PA16 | EDBG_MOSI | EIC/EXTINT[0] *SERCOM1/PAD[0] SERCOM3/PAD[0] TCC2/WO[0] TCC0/WO[6] + * | 36 | | PA18 | EDBG_SS | EIC/EXTINT[2] *SERCOM1/PAD[2] SERCOM3/PAD[2] TC3/WO[0] TCC0/WO[2] + * | 37 | | PA17 | EDBG_SCK | EIC/EXTINT[1] *SERCOM1/PAD[1] SERCOM3/PAD[1] TCC2/WO[1] TCC0/WO[7] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | 38 | ATN | PA13 | EDBG_GPIO0 | EIC/EXTINT[13] SERCOM2/PAD[1] SERCOM4/PAD[1] *TCC2/WO[1] TCC0/WO[7] + * | 39 | | PA21 | EDBG_GPIO1 | Pin 7 + * | 40 | | PA06 | EDBG_GPIO2 | Pin 8 + * | 41 | | PA07 | EDBG_GPIO3 | Pin 9 + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | GND | | | + * | 42 | AREF | PA03 | | EIC/EXTINT[3] *[ADC|DAC]/VREFA ADC/AIN[1] PTC/Y[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | |32.768KHz Crystal | | | + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + * | | | PA00 | XIN32 | EIC/EXTINT[0] SERCOM1/PAD[0] TCC2/WO[0] + * | | | PA01 | XOUT32 | EIC/EXTINT[1] SERCOM1/PAD[1] TCC2/WO[1] + * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- + */ + + +#include "variant.h" + +/* + * Pins descriptions + */ +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 11, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // RX: SERCOM0/PAD[3] + { PORTA, 10, PIO_SERCOM, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // TX: SERCOM0/PAD[2] + + // 2..12 + // Digital Low + { PORTA, 14, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, + { PORTA, 9, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH1, TCC0_CH1, EXTERNAL_INT_9 }, // TCC0/WO[1] + { PORTA, 8, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM0_CH0, TCC0_CH0, EXTERNAL_INT_NMI }, // TCC0/WO[0] + { PORTA, 15, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH1, TC3_CH1, EXTERNAL_INT_15 }, // TC3/WO[1] + { PORTA, 20, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH6, TCC0_CH6, EXTERNAL_INT_4 }, // TCC0/WO[6] + { PORTA, 21, PIO_DIGITAL, (PIN_ATTR_DIGITAL), No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + + // Digital High + { PORTA, 6, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH0, TCC1_CH0, EXTERNAL_INT_6 }, // TCC1/WO[0] + { PORTA, 7, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM1_CH1, TCC1_CH1, EXTERNAL_INT_7 }, // TCC1/WO[1] + { PORTA, 18, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM3_CH0, TC3_CH0, EXTERNAL_INT_2 }, // TC3/WO[0] + { PORTA, 16, PIO_TIMER, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH0, TCC2_CH0, EXTERNAL_INT_0 }, // TCC2/WO[0] + { PORTA, 19, PIO_TIMER_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER_ALT), No_ADC_Channel, PWM0_CH3, TCC0_CH3, EXTERNAL_INT_3 }, // TCC0/WO[3] + + // 13 (LED) + { PORTA, 17, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM|PIN_ATTR_TIMER), No_ADC_Channel, PWM2_CH1, TCC2_CH1, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[0] + { PORTB, 8, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel2, PWM4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // ADC/AIN[2] + { PORTB, 9, PIO_ANALOG, (PIN_ATTR_PWM|PIN_ATTR_TIMER), ADC_Channel3, PWM4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // ADC/AIN[3] + { PORTA, 4, PIO_ANALOG, 0, ADC_Channel4, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // ADC/AIN[4] + { PORTA, 5, PIO_ANALOG, 0, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // ADC/AIN[5] + { PORTB, 2, PIO_ANALOG, 0, ADC_Channel10, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // ADC/AIN[10] + + // 20..21 I2C pins (SDA/SCL and also EDBG:SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (ICSP:MISO,SCK,MOSI) + // ---------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MISO: SERCOM4/PAD[0] + { PORTB, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // MOSI: SERCOM4/PAD[2] + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // SCK: SERCOM4/PAD[3] + + // 25..26 - RX/TX LEDS (PB03/PA27) + // -------------------- + { PORTB, 3, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + { PORTA, 27, PIO_OUTPUT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // used as output only + + // 27..29 - USB + // -------------------- + { PORTA, 28, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30..41 - Extra Pins + // ---------------------- + // 30/31 - Extra UART + { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] + + // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) + { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] + + // 34..37 - EDBG/SPI + { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D12/MISO: SERCOM1/PAD[3] + { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D11/MOSI: SERCOM1/PAD[0] + { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D10/SS: SERCOM1/PAD[2] + { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D13/SCK: SERCOM1/PAD[1] + + // 38..41 - EDBG/Digital + { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D7: Pin 7 + { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D8: Pin 8 + { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // D9: Pin 9 + + // 42 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // AREF: DAC/VREFP + + // ---------------------- + // 43 - Alternate use of A0 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0: DAC/VOUT +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TC3, TC4, TC5 } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom0, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; +Uart Serial( &sercom5, PIN_SERIAL_RX, PIN_SERIAL_TX, PAD_SERIAL_RX, PAD_SERIAL_TX ) ; +void SERCOM0_Handler() +{ + Serial1.IrqHandler(); +} + +void SERCOM5_Handler() +{ + Serial.IrqHandler(); +} + diff --git a/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.h b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.h new file mode 100644 index 00000000..26b89ed3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD21_Dev/variant.h @@ -0,0 +1,223 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_ARDUINO_ZERO_ +#define _VARIANT_ARDUINO_ZERO_ + +// The definitions here needs a SAMD core >=1.6.6 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10606 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (48000000ul) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (26u) +#define NUM_DIGITAL_PINS (20u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (15ul) +#define PIN_A2 (16ul) +#define PIN_A3 (17ul) +#define PIN_A4 (18ul) +#define PIN_A5 (19ul) +#define PIN_DAC0 (14ul) + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t DAC0 = PIN_DAC0; +#define ADC_RESOLUTION 12 + +// Other pins +#define PIN_ATN (38ul) +static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ +// Serial (EDBG) +#define PIN_SERIAL_RX (31ul) +#define PIN_SERIAL_TX (30ul) +#define PAD_SERIAL_TX (UART_TX_PAD_2) +#define PAD_SERIAL_RX (SERCOM_RX_PAD_3) + +// Serial1 +#define PIN_SERIAL1_RX (0ul) +#define PIN_SERIAL1_TX (1ul) +#define PAD_SERIAL1_TX (UART_TX_PAD_2) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_3) + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 1 + +#define PIN_SPI_MISO (22u) +#define PIN_SPI_MOSI (23u) +#define PIN_SPI_SCK (24u) +#define PERIPH_SPI sercom4 +#define PAD_SPI_TX SPI_PAD_2_SCK_3 +#define PAD_SPI_RX SERCOM_RX_PAD_0 + +static const uint8_t SS = PIN_A2 ; // SERCOM4 last PAD is present on A2 but HW SS isn't used. Set here only for reference. +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 +#define PIN_I2S_SD (9u) +#define PIN_I2S_SCK (1u) +#define PIN_I2S_FS (0u) + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +extern Uart Serial; +extern Uart Serial1; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL SerialUSB +#define SERIAL_PORT_MONITOR SerialUSB +// Serial has no physical pins broken out, so it's not listed as HARDWARE port +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* _VARIANT_ARDUINO_ZERO_ */ + diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/libarm_cortexM4lf_math.a b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/libarm_cortexM4lf_math.a new file mode 100644 index 00000000..963616ca Binary files /dev/null and b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/libarm_cortexM4lf_math.a differ diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..1bdea69a --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,216 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x00080000-0x4000 /* First 16KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + __text_start__ = .; + + KEEP(*(.sketch_boot)) + + . = ALIGN(0x4000); + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(16); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..9c0c4e06 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,214 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + __text_start__ = .; + + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(16); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/pins_arduino.h b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.cpp b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.cpp new file mode 100644 index 00000000..0d9c18c0 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.cpp @@ -0,0 +1,168 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" + +// PIN DESCRIPTIONS +const PinDescription g_APinDescription[]= +{ + // Digital Pins + // 0....16 + // ------------------------------------------------------------------------------------------------------------------------- + { PORTB, 4, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // D0 + { PORTB, 5, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // D1 + { PORTB, 6, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // D2 + { PORTB, 7, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // D3 + { PORTB, 8, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, TC4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // D4 + { PORTB, 9, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, TC4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // D5 + { PORTB, 10, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_10 }, // D6 + { PORTB, 11, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // D7 + { PORTB, 12, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, TCC3_CH0, TC4_CH0, EXTERNAL_INT_12 }, // D8 + { PORTB, 13, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, NOT_ON_PWM, TC4_CH1, EXTERNAL_INT_13 }, // D9 + { PORTA, 14, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_14 }, // D10 + { PORTA, 15, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_15 }, // D12 + { PORTA, 18, PIO_DIGITAL, PIN_ATTR_PWM_F, No_ADC_Channel, TCC1_CH2, TC3_CH0, EXTERNAL_INT_2 }, // D12 - I2C_INT + { PORTA, 23, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, TCC1_CH3, TC2_CH1, EXTERNAL_INT_13 }, // D13 + { PORTA, 19, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // D14 - 3.3V_EN + { PORTB, 22, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // D15 - FLASH WP + { PORTB, 23, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // D16 - FLASH HOLD + // ------------------------------------------------------------------------------------------------------------------------- + + // Analog Pins + // 17....27 + // ------------------------------------------------------------------------------------------------------------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A0 + { PORTB, 0, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel12, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 }, // A1 + { PORTB, 1, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel13, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 }, // A2 + { PORTB, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel14, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // A3 + { PORTB, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel15, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 }, // A4 + { PORTB, 4, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel6, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // A5 + { PORTB, 5, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel7, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, // A6 + { PORTB, 6, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel8, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_6 }, // A7 + { PORTB, 7, PIO_ANALOG, PIN_ATTR_ANALOG_ALT, ADC_Channel9, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, // A8 + { PORTB, 8, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel2, TC4_CH0, TC4_CH0, EXTERNAL_INT_8 }, // A9 + { PORTB, 9, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel3, TC4_CH1, TC4_CH1, EXTERNAL_INT_9 }, // A10 + // -------------------------------------------------------------------------------------------------------------------------- + + // DAC + // 28 + // --------------------------------------------------------------------------------------------------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, // DAC + // --------------------------------------------------------------------------------------------------------------- + + // USB/USB Host Enable + // 29....31 + // -------------------------------------------------------------------------------------------------------------------- + { PORTA, 27, PIO_DIGITAL, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // USB HOST + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_8 }, // USB DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_9 }, // USB DP + // ------------------------------------------------------------------------------------------------------------==----- + + // UART + // 32..33 + // ----------------------------------------------------------------------------------------------------------------------- + { PORTB, 31, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, TC0_CH0, EXTERNAL_INT_15 }, // 5 SER1.0 TX + { PORTB, 30, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, TC0_CH0, EXTERNAL_INT_14 }, // 6 SER1.1 RX + // ----------------------------------------------------------------------------------------------------------------------- + + // I2C pins (SDA/SCL) + // 34..35 + // ----------------------------------------------------------------------------------------------------------------------- + { PORTA, 16, PIO_SERCOM_ALT, PIN_ATTR_PWM_F, No_ADC_Channel, TCC1_CH0, TC2_CH0, EXTERNAL_INT_0 }, // SCL SER3.1 + { PORTA, 17, PIO_SERCOM_ALT, PIN_ATTR_PWM_G, No_ADC_Channel, TCC0_CH5, TC2_CH1, EXTERNAL_INT_1 }, // SDA SER3.0 + // ----------------------------------------------------------------------------------------------------------------------- + + // I2C1 (SDA1/SCL1) + // 36..37 + // ----------------------------------------------------------------------------------------------------------------------------- + { PORTA, 12, PIO_SERCOM_ALT, PIN_ATTR_PWM_G, No_ADC_Channel, TCC1_CH2, TC2_CH0, EXTERNAL_INT_12 }, // SCL1 - RX [SER4.1] + { PORTA, 13, PIO_SERCOM_ALT, PIN_ATTR_PWM_G, No_ADC_Channel, TCC1_CH3, TC2_CH1, EXTERNAL_INT_13 }, // SDA1 - TX [SER4.0] + // ----------------------------------------------------------------------------------------------------------------------------- + + // CAN BUS (CANRX/CANTX) + // 38..39 + // --------------------------------------------------------------------------------------------------------------------- + { PORTB, 14, PIO_AC_CLK, PIN_ATTR_PWM_F, No_ADC_Channel, TCC4_CH0, TC5_CH0, EXTERNAL_INT_14 }, // CAN TXO + { PORTB, 15, PIO_AC_CLK, PIN_ATTR_PWM_F, No_ADC_Channel, TCC4_CH1, TC5_CH1, EXTERNAL_INT_15 }, // CAN RXI + // --------------------------------------------------------------------------------------------------------------------- + + + // I2S (SDO, SDI, FS, SCK) + // 40....44 + // --------------------------------------------------------------------------------------------------------------------- + { PORTA, 21, PIO_DIGITAL, PIN_ATTR_PWM_F, No_ADC_Channel, TCC0_CH1, TC7_CH0, EXTERNAL_INT_5 }, // SDO + { PORTA, 22, PIO_DIGITAL, PIN_ATTR_PWM_F, No_ADC_Channel, TCC0_CH2, TC4_CH0, EXTERNAL_INT_6 }, // SDI + { PORTB, 16, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, TCC3_CH0, TC4_CH0, EXTERNAL_INT_12 }, // SCK + { PORTB, 17, PIO_DIGITAL, PIN_ATTR_PWM_F, No_ADC_Channel, TCC3_CH1, TC6_CH1, EXTERNAL_INT_12 }, // MCLK + { PORTA, 20, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_4 }, // FS + // --------------------------------------------------------------------------------------------------------------------- + + // SPI (COPI, CIPO, SCK, CS) + // 45....48 + // --------------------------------------------------------------------------------------------------------------------- + { PORTA, 4, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 },// COPI + { PORTA, 5, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 },// SCK + { PORTA, 6, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_13 },// CIPO + { PORTA, 7, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_13 },// CS + // --------------------------------------------------------------------------------------------------------------------- + + // SPI1 (COPI1, CIPO1, SCK1, CS1) + // 49....52 + // ----------------------------------------------------------------------------------------------------------------------- + { PORTA, 9, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_1 },// COPI1 SER2.0 + { PORTA, 8, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_0 },// SCK1 SER2.1 + { PORTA, 10, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 },// CIPO1 SER2.2 + { PORTA, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_3 },// CS1 SER2.3 + // ----------------------------------------------------------------------------------------------------------------------- + + // AREF + // 53 + // --------------------------------------------------------------------------------------------------------------------- + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel1, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP + // --------------------------------------------------------------------------------------------------------------------- +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TCC3, TCC4, TC0, TC1, TC2, TC3, TC4, TC5 } ; +const uint32_t GCLK_CLKCTRL_IDs[TCC_INST_NUM+TC_INST_NUM] = { TCC0_GCLK_ID, TCC1_GCLK_ID, TCC2_GCLK_ID, TCC3_GCLK_ID, TCC4_GCLK_ID, TC0_GCLK_ID, TC1_GCLK_ID, TC2_GCLK_ID, TC3_GCLK_ID, TC4_GCLK_ID, TC5_GCLK_ID } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom5, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; + +void SERCOM5_0_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM5_1_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM5_2_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM5_3_Handler() +{ + Serial1.IrqHandler(); +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.h b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.h new file mode 100644 index 00000000..41b071cc --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_MicroMod/variant.h @@ -0,0 +1,310 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_SAMD51_MICROMOD_ +#define _VARIANT_SAMD51_MICROMOD_ + +// The definitions here needs a SAMD core >=1.6.10 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10610 + +//---------------------------------------------------------------------------- +// Definitions +//---------------------------------------------------------------------------- + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (120000000ul) + +#define VARIANT_GCLK0_FREQ (120000000UL) +#define VARIANT_GCLK1_FREQ (48000000UL) +#define VARIANT_GCLK2_FREQ (100000000UL) + +//---------------------------------------------------------------------------- +// Headers +//---------------------------------------------------------------------------- + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +//---------------------------------------------------------------------------- +// Pins +//---------------------------------------------------------------------------- + +// Number of pins defined in PinDescription array +#define PINS_COUNT (53u) +#define NUM_DIGITAL_PINS (16u) +#define NUM_ANALOG_INPUTS (11u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// General Purpose Pins +#define D0 0 +#define D1 1 +#define D2 2 +#define D3 3 +#define D4 4 +#define D5 5 + +#define G0 2 +#define G1 3 +#define G2 4 +#define G3 5 +#define G4 6 +#define G5 7 +#define G6 8 +#define G7 9 +#define G8 10 +#define G9 11 +#define G11 29 + +#define PWM0 19 +#define PWM1 20 + +#define BATT_VIN 21 +#define POWER_CONTROL 12 + +#define CS 48 +#define CS1 52 +#define I2CINT 12 + +#define AUD_OUT 40 +#define AUD_IN 41 +#define AUD_BCLK 42 +#define AUD_LRCLK 44 +#define AUD_MCLK 43 + +// LEDs +//------------------------------------------- +#define PIN_LED_13 (13u) +#define PIN_LED PIN_LED_13 +#define LED_BUILTIN PIN_LED_13 +//------------------------------------------- + +// Analog pins +//------------------------------------------- +#define PIN_A0 (17ul) +#define PIN_A1 (PIN_A0 + 1) +#define PIN_A2 (PIN_A0 + 2) +#define PIN_A3 (PIN_A0 + 4) +#define PIN_A4 (PIN_A0 + 5) +#define PIN_A5 (PIN_A0 + 6) +#define PIN_A6 (PIN_A0 + 7) +#define PIN_A7 (PIN_A0 + 8) +#define PIN_A8 (PIN_A0 + 9) +#define PIN_A9 (PIN_A0 + 10) +#define PIN_A10 (PIN_A0) + +//DAC +#define PIN_DAC0 PIN_A0 + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; +static const uint8_t A6 = PIN_A6; +static const uint8_t A7 = PIN_A7; +static const uint8_t A8 = PIN_A8; +static const uint8_t A9 = PIN_A9; +static const uint8_t A10 = PIN_A10; + +static const uint8_t DAC0 = PIN_DAC0; + +#define ADC_RESOLUTION 12 +//------------------------------------------- + +// Other pins +//------------------------------------------- +#define PIN_ATN (53ul) +static const uint8_t ATN = PIN_ATN; +//------------------------------------------- + +// Serial1 +//------------------------------------------- +#define PIN_SERIAL1_RX (32ul) +#define PIN_SERIAL1_TX (33ul) +#define PAD_SERIAL1_TX (UART_TX_PAD_0) +#define PAD_SERIAL1_RX (SERCOM_RX_PAD_1) +//------------------------------------------- + +// SPI Interfaces +//------------------------------------------- +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MOSI (45u) +#define PIN_SPI_SCK (46u) +#define PIN_SPI_MISO (47u) +#define PIN_SPI_SS (48u) +#define PERIPH_SPI sercom0 +#define PAD_SPI_TX SPI_PAD_0_SCK_1 +#define PAD_SPI_RX SERCOM_RX_PAD_2 + +static const uint8_t SS = PIN_SPI_SS ; +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +// SPI1 +#define PIN_SPI1_MOSI (49u) +#define PIN_SPI1_SCK (50u) +#define PIN_SPI1_MISO (51u) +#define PIN_SPI1_SS (52u) +#define PERIPH_SPI1 sercom2 +#define PAD_SPI1_TX SPI_PAD_0_SCK_1 +#define PAD_SPI1_RX SERCOM_RX_PAD_2 +//------------------------------------------- + +static const uint8_t SS1 = PIN_SPI1_SS ; +static const uint8_t MOSI1 = PIN_SPI1_MOSI ; +static const uint8_t MISO1 = PIN_SPI1_MISO ; +static const uint8_t SCK1 = PIN_SPI1_SCK ; + +// Wire Interfaces +//------------------------------------------- +#define WIRE_INTERFACES_COUNT 2 + +#define PIN_WIRE_SCL (34u) +#define PIN_WIRE_SDA (35u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler +#define WIRE_IT_HANDLER_0 SERCOM3_0_Handler +#define WIRE_IT_HANDLER_1 SERCOM3_1_Handler +#define WIRE_IT_HANDLER_2 SERCOM3_2_Handler +#define WIRE_IT_HANDLER_3 SERCOM3_3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +#define PIN_WIRE1_SCL (36u) +#define PIN_WIRE1_SDA (37u) +#define PERIPH_WIRE1 sercom4 +#define WIRE1_IT_HANDLER SERCOM4_Handler +#define WIRE1_IT_HANDLER_0 SERCOM4_0_Handler +#define WIRE1_IT_HANDLER_1 SERCOM4_1_Handler +#define WIRE1_IT_HANDLER_2 SERCOM4_2_Handler +#define WIRE1_IT_HANDLER_3 SERCOM4_3_Handler + +static const uint8_t SDA1 = PIN_WIRE1_SDA; +static const uint8_t SCL1 = PIN_WIRE1_SCL; +//---------------------------------------------- + +// USB +//---------------------------------------------- +#define PIN_USB_HOST_ENABLE (29ul) +#define PIN_USB_DM (30ul) +#define PIN_USB_DP (31ul) +//---------------------------------------------- + +// I2S Interfaces +#define PIN_I2S_FS (44u) +//---------------------------------------------- +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 + +#define PIN_I2S_SDO (40u) +#define PIN_I2S_SDI (41u) +#define PIN_I2S_SCK (42u) +#define PIN_I2S_MCK (43u) +#define PIN_I2S_FS (44u) +//---------------------------------------------- + + +#if !defined(VARIANT_QSPI_BAUD_DEFAULT) + #define VARIANT_QSPI_BAUD_DEFAULT 5000000 +#endif + +#ifdef __cplusplus +} +#endif + +//---------------------------------------------------------------------------- +// Arduino objects - C++ only +//---------------------------------------------------------------------------- + +#ifdef __cplusplus + +// ------------------------ +// SERCOM DEFINITION +// ------------------------ +extern SERCOM sercom0; //SPI +extern SERCOM sercom1; // I2S occupies lines +extern SERCOM sercom2; //SPI1 +extern SERCOM sercom3; //I2C +extern SERCOM sercom4; //I2C1 or Serial2 +extern SERCOM sercom5; //Serial1 + +extern Uart Serial1; + +#endif +/* +* These serial port names are intended to allow libraries and architecture-neutral +* sketches to automatically default to the correct port name for a particular type +* of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +* the first hardware serial port whose RX/TX pins are not dedicated to another use. +* +* SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +* +* SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +* +* SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +* +* SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +* +* SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +* pins are NOT connected to anything by default. +*/ +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_MONITOR Serial +// Serial has no physical pins broken out, so it's not listed as HARDWARE port + +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif // SAMD51 MicroMod Processor Board + diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/libarm_cortexM4lf_math.a b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/libarm_cortexM4lf_math.a new file mode 100644 index 00000000..963616ca Binary files /dev/null and b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/libarm_cortexM4lf_math.a differ diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_with_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_with_bootloader.ld new file mode 100644 index 00000000..1bdea69a --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_with_bootloader.ld @@ -0,0 +1,216 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000+0x4000, LENGTH = 0x00080000-0x4000 /* First 16KB used by bootloader */ + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + __text_start__ = .; + + KEEP(*(.sketch_boot)) + + . = ALIGN(0x4000); + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(16); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_without_bootloader.ld b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_without_bootloader.ld new file mode 100644 index 00000000..9c0c4e06 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/linker_scripts/gcc/flash_without_bootloader.ld @@ -0,0 +1,214 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +/* Linker script to configure memory regions. + * Need modifying for a specific board. + * FLASH.ORIGIN: starting address of flash + * FLASH.LENGTH: length of flash + * RAM.ORIGIN: starting address of RAM bank 0 + * RAM.LENGTH: length of RAM bank 0 + */ +MEMORY +{ + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 + RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00030000 +} + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __ram_end__ + */ +ENTRY(Reset_Handler) + +SECTIONS +{ + .text : + { + __text_start__ = .; + + KEEP(*(.isr_vector)) + *(.text*) + + KEEP(*(.init)) + KEEP(*(.fini)) + + /* .ctors */ + *crtbegin.o(.ctors) + *crtbegin?.o(.ctors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .ctors) + *(SORT(.ctors.*)) + *(.ctors) + + /* .dtors */ + *crtbegin.o(.dtors) + *crtbegin?.o(.dtors) + *(EXCLUDE_FILE(*crtend?.o *crtend.o) .dtors) + *(SORT(.dtors.*)) + *(.dtors) + + *(.rodata*) + + KEEP(*(.eh_frame*)) + } > FLASH + + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > FLASH + + __exidx_start = .; + .ARM.exidx : + { + *(.ARM.exidx* .gnu.linkonce.armexidx.*) + } > FLASH + __exidx_end = .; + + /* To copy multiple ROM to RAM sections, + * uncomment .copy.table section and, + * define __STARTUP_COPY_MULTIPLE in startup_ARMCMx.S */ + /* + .copy.table : + { + . = ALIGN(4); + __copy_table_start__ = .; + LONG (__etext) + LONG (__data_start__) + LONG (__data_end__ - __data_start__) + LONG (__etext2) + LONG (__data2_start__) + LONG (__data2_end__ - __data2_start__) + __copy_table_end__ = .; + } > FLASH + */ + + /* To clear multiple BSS sections, + * uncomment .zero.table section and, + * define __STARTUP_CLEAR_BSS_MULTIPLE in startup_ARMCMx.S */ + /* + .zero.table : + { + . = ALIGN(4); + __zero_table_start__ = .; + LONG (__bss_start__) + LONG (__bss_end__ - __bss_start__) + LONG (__bss2_start__) + LONG (__bss2_end__ - __bss2_start__) + __zero_table_end__ = .; + } > FLASH + */ + + __etext = .; + + .data : AT (__etext) + { + __data_start__ = .; + *(vtable) + *(.data*) + + . = ALIGN(4); + /* preinit data */ + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP(*(.preinit_array)) + PROVIDE_HIDDEN (__preinit_array_end = .); + + . = ALIGN(4); + /* init data */ + PROVIDE_HIDDEN (__init_array_start = .); + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + PROVIDE_HIDDEN (__init_array_end = .); + + + . = ALIGN(4); + /* finit data */ + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + PROVIDE_HIDDEN (__fini_array_end = .); + + KEEP(*(.jcr*)) + . = ALIGN(16); + /* All data end */ + __data_end__ = .; + + } > RAM + + .bss : + { + . = ALIGN(4); + __bss_start__ = .; + *(.bss*) + *(COMMON) + . = ALIGN(4); + __bss_end__ = .; + } > RAM + + .heap (COPY): + { + __end__ = .; + PROVIDE(end = .); + *(.heap*) + __HeapLimit = .; + } > RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + *(.stack*) + } > RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(RAM) + LENGTH(RAM) ; + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + + __ram_end__ = ORIGIN(RAM) + LENGTH(RAM) -1 ; + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/pins_arduino.h b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/pins_arduino.h new file mode 100644 index 00000000..db0e40c3 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/pins_arduino.h @@ -0,0 +1,21 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +// API compatibility +#include "variant.h" + diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.cpp b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.cpp new file mode 100644 index 00000000..ba4d2247 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.cpp @@ -0,0 +1,133 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "variant.h" + +/* + * Pins descriptions + */ + +//TCC0 IOSET 6 +//TCC1 IOSET 1 +//TC0 IOSET 1 +//TC1 IOSET 1 +//TC2 IOSET 2 +//TC3 IOSET 1 +//TC4 IOSET 1 +const PinDescription g_APinDescription[]= +{ + // 0..13 - Digital pins + // ---------------------- + // 0/1 - SERCOM/UART (Serial1) + { PORTA, 13, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TC2_CH1, NOT_ON_TIMER, EXTERNAL_INT_13 }, // RX: SERCOM2/PAD[1] + { PORTA, 12, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TC2_CH0, NOT_ON_TIMER, EXTERNAL_INT_12 }, // TX: SERCOM2/PAD[2] + + // 2..12 + // Digital + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + { PORTA, 6, PIO_DIGITAL, PIN_ATTR_PWM_E, No_ADC_Channel, TC1_CH0, TC1_CH0, EXTERNAL_INT_6 }, + { PORTA, 15, PIO_TIMER_ALT, PIN_ATTR_PWM_F, No_ADC_Channel, TCC2_CH1, TC3_CH1, EXTERNAL_INT_2 }, + { PORTA, 20, PIO_TIMER_ALT, PIN_ATTR_PWM_F, No_ADC_Channel, TCC0_CH0, TC7_CH0, EXTERNAL_INT_4 }, + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + + { PORTA, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }, //pin 9 + { PORTA, 18, PIO_TIMER_ALT, PIN_ATTR_PWM_F, No_ADC_Channel, TCC1_CH2, TC3_CH0, EXTERNAL_INT_2 }, + { PORTA, 16, PIO_TIMER_ALT, PIN_ATTR_PWM_G, No_ADC_Channel, TCC1_CH0, NOT_ON_TIMER, EXTERNAL_INT_0 }, + { PORTA, 19, PIO_TIMER_ALT, PIN_ATTR_PWM_F, No_ADC_Channel, TCC1_CH3, TC3_CH1, EXTERNAL_INT_3 }, + + // 13 (LED) + { PORTA, 17, PIO_DIGITAL, PIN_ATTR_PWM_G, No_ADC_Channel, TCC0_CH3, TC4_CH1, EXTERNAL_INT_1 }, // TCC2/WO[1] + + // 14..19 - Analog pins + // -------------------- + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_2 }, + { PORTB, 8, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel2, TC4_CH0, TC4_CH0, EXTERNAL_INT_8 }, + { PORTB, 9, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel3, TC4_CH1, TC4_CH1, EXTERNAL_INT_9 }, + { PORTA, 4, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel4, TC0_CH0, TC0_CH0, EXTERNAL_INT_6 }, + { PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, ADC_Channel5, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_5 }, + { PORTB, 2, PIO_ANALOG, (PIN_ATTR_ANALOG|PIN_ATTR_PWM_E), ADC_Channel14, TC6_CH0, TC6_CH0, EXTERNAL_INT_2 }, + + // 20..21 I2C pins (SDA/SCL) + // ---------------------- + { PORTA, 22, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TC4_CH0, TC4_CH0, EXTERNAL_INT_6 }, // SDA: SERCOM3/PAD[0] + { PORTA, 23, PIO_SERCOM, PIN_ATTR_PWM_G, No_ADC_Channel, TC4_CH1, TC4_CH1, EXTERNAL_INT_7 }, // SCL: SERCOM3/PAD[1] + + // 22..24 - SPI pins (MISO,MOSI,SCK) + // ---------------------- + { PORTB, 11, PIO_SERCOM_ALT, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_11 }, // MISO: SERCOM4/PAD[3] + { PORTB, 12, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_12 }, // MOSI: SERCOM4/PAD[0] + { PORTB, 13, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_13 }, // SCK: SERCOM4/PAD[1] + + // 25..26 - RX/TX LEDS -- unused + // -------------------- + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, + + // 27..29 - USB + // -------------------- + { NOT_A_PORT, 0, PIO_NOT_A_PIN, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB Host enable DOES NOT EXIST ON THIS BOARD + { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM + { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP + + // 30 (AREF) + { PORTA, 3, PIO_ANALOG, PIN_ATTR_ANALOG, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VREFP + + // ---------------------- + // 31..32 - Alternate use of A0/A4 (DAC output) + { PORTA, 2, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel0, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VOUT0 + { PORTA, 5, PIO_ANALOG, PIN_ATTR_ANALOG, DAC_Channel1, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // DAC/VOUT1 + + // ---------------------- + // 33..36 SPI for Flash (SCK, CS, MISO, MOSI) + { PORTA, 9, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, //SCK: SERCOM0/PAD[1] + { PORTA, 10, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, //CS: SERCOM0/PAD[2] + { PORTA, 11, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, //MISO: SERCOM0/PAD[3] + { PORTA, 8, PIO_SERCOM, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, //MOSI: SERCOM0/PAD[0] +} ; + +const void* g_apTCInstances[TCC_INST_NUM+TC_INST_NUM]={ TCC0, TCC1, TCC2, TCC3, TCC4, TC0, TC1, TC2, TC3, TC4, TC5 } ; +const uint32_t GCLK_CLKCTRL_IDs[TCC_INST_NUM+TC_INST_NUM] = { TCC0_GCLK_ID, TCC1_GCLK_ID, TCC2_GCLK_ID, TCC3_GCLK_ID, TCC4_GCLK_ID, TC0_GCLK_ID, TC1_GCLK_ID, TC2_GCLK_ID, TC3_GCLK_ID, TC4_GCLK_ID, TC5_GCLK_ID } ; + +// Multi-serial objects instantiation +SERCOM sercom0( SERCOM0 ) ; +SERCOM sercom1( SERCOM1 ) ; +SERCOM sercom2( SERCOM2 ) ; +SERCOM sercom3( SERCOM3 ) ; +SERCOM sercom4( SERCOM4 ) ; +SERCOM sercom5( SERCOM5 ) ; + +Uart Serial1( &sercom2, PIN_SERIAL1_RX, PIN_SERIAL1_TX, PAD_SERIAL1_RX, PAD_SERIAL1_TX ) ; + +void SERCOM2_0_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM2_1_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM2_2_Handler() +{ + Serial1.IrqHandler(); +} +void SERCOM2_3_Handler() +{ + Serial1.IrqHandler(); +} diff --git a/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.h b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.h new file mode 100644 index 00000000..ee071781 --- /dev/null +++ b/sparkfun/samd/variants/SparkFun_SAMD51_Thing_Plus/variant.h @@ -0,0 +1,256 @@ +/* + Copyright (c) 2014-2015 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#ifndef _VARIANT_SAMD51_THING_PLUS_ +#define _VARIANT_SAMD51_THING_PLUS_ + +// The definitions here needs a SAMD core >=1.6.10 +#define ARDUINO_SAMD_VARIANT_COMPLIANCE 10610 + +/*---------------------------------------------------------------------------- + * Definitions + *----------------------------------------------------------------------------*/ + +/** Frequency of the board main oscillator */ +#define VARIANT_MAINOSC (32768ul) + +/** Master clock frequency */ +#define VARIANT_MCK (120000000ul) + +#define VARIANT_GCLK0_FREQ (120000000UL) +#define VARIANT_GCLK1_FREQ (48000000UL) +#define VARIANT_GCLK2_FREQ (100000000UL) + +/*---------------------------------------------------------------------------- + * Headers + *----------------------------------------------------------------------------*/ + +#include "WVariant.h" + +#ifdef __cplusplus +#include "SERCOM.h" +#include "Uart.h" +#endif // __cplusplus + +#ifdef __cplusplus +extern "C" +{ +#endif // __cplusplus + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +// Number of pins defined in PinDescription array +#define PINS_COUNT (36u) +#define NUM_DIGITAL_PINS (20u) +#define NUM_ANALOG_INPUTS (6u) +#define NUM_ANALOG_OUTPUTS (1u) +#define analogInputToDigitalPin(p) ((p < 6u) ? (p) + 14u : -1) + +#define digitalPinToPort(P) ( &(PORT->Group[g_APinDescription[P].ulPort]) ) +#define digitalPinToBitMask(P) ( 1 << g_APinDescription[P].ulPin ) +//#define analogInPinToBit(P) ( ) +#define portOutputRegister(port) ( &(port->OUT.reg) ) +#define portInputRegister(port) ( &(port->IN.reg) ) +#define portModeRegister(port) ( &(port->DIR.reg) ) +#define digitalPinHasPWM(P) ( g_APinDescription[P].ulPWMChannel != NOT_ON_PWM || g_APinDescription[P].ulTCChannel != NOT_ON_TIMER ) + +/* + * digitalPinToTimer(..) is AVR-specific and is not defined for SAMD + * architecture. If you need to check if a pin supports PWM you must + * use digitalPinHasPWM(..). + * + * https://github.com/arduino/Arduino/issues/1833 + */ +// #define digitalPinToTimer(P) + +// LEDs +#define PIN_LED_13 (13u) +#define PIN_LED_RXL (25u) +#define PIN_LED_TXL (26u) +#define PIN_LED PIN_LED_13 +#define PIN_LED2 PIN_LED_RXL +#define PIN_LED3 PIN_LED_TXL +#define LED_BUILTIN PIN_LED_13 + +/* + * Analog pins + */ +#define PIN_A0 (14ul) +#define PIN_A1 (PIN_A0 + 1) +#define PIN_A2 (PIN_A0 + 2) +#define PIN_A3 (PIN_A0 + 3) +#define PIN_A4 (PIN_A0 + 4) +#define PIN_A5 (PIN_A0 + 5) + +#define PIN_DAC0 (14ul) +#define PIN_DAC1 PIN_A1 + +static const uint8_t A0 = PIN_A0; +static const uint8_t A1 = PIN_A1; +static const uint8_t A2 = PIN_A2; +static const uint8_t A3 = PIN_A3; +static const uint8_t A4 = PIN_A4; +static const uint8_t A5 = PIN_A5; + +static const uint8_t DAC0 = PIN_DAC0; +static const uint8_t DAC1 = PIN_DAC1; + +#define ADC_RESOLUTION 12 + +// Other pins +#define PIN_ATN (30ul) +static const uint8_t ATN = PIN_ATN; + +/* + * Serial interfaces + */ + +// Serial1 +#define PIN_SERIAL1_RX (0ul) +#define PIN_SERIAL1_TX (1ul) +#define PAD_SERIAL1_RX SERCOM_RX_PAD_1 +#define PAD_SERIAL1_TX UART_TX_PAD_0 + +/* + * SPI Interfaces + */ +#define SPI_INTERFACES_COUNT 2 + +#define PIN_SPI_MISO (22u) +#define PIN_SPI_MOSI (23u) +#define PIN_SPI_SCK (24u) +#define PERIPH_SPI sercom4 +#define PAD_SPI_TX SPI_PAD_0_SCK_1 +#define PAD_SPI_RX SERCOM_RX_PAD_3 + +static const uint8_t SS = 9 ; // SERCOM4 last PAD is present on d9 but HW SS isn't used. Set here only for reference. +static const uint8_t MOSI = PIN_SPI_MOSI ; +static const uint8_t MISO = PIN_SPI_MISO ; +static const uint8_t SCK = PIN_SPI_SCK ; + +#define PIN_SPI1_MISO (35u) +#define PIN_SPI1_MOSI (36u) +#define PIN_SPI1_SCK (33u) +#define PERIPH_SPI1 sercom0 +#define PAD_SPI1_TX SPI_PAD_0_SCK_1 +#define PAD_SPI1_RX SERCOM_RX_PAD_3 + +static const uint8_t FLASH_SS = 34 ; // SERCOM0 last PAD is present on 34 but HW SS isn't used. Set here only for reference. +static const uint8_t FLASH_MOSI = PIN_SPI1_MOSI ; +static const uint8_t FLASH_MISO = PIN_SPI1_MISO ; +static const uint8_t FLASH_SCK = PIN_SPI1_SCK ; + +/* + * Wire Interfaces + */ +#define WIRE_INTERFACES_COUNT 1 + +#define PIN_WIRE_SDA (20u) +#define PIN_WIRE_SCL (21u) +#define PERIPH_WIRE sercom3 +#define WIRE_IT_HANDLER SERCOM3_Handler +#define WIRE_IT_HANDLER_0 SERCOM3_0_Handler +#define WIRE_IT_HANDLER_1 SERCOM3_1_Handler +#define WIRE_IT_HANDLER_2 SERCOM3_2_Handler +#define WIRE_IT_HANDLER_3 SERCOM3_3_Handler + +static const uint8_t SDA = PIN_WIRE_SDA; +static const uint8_t SCL = PIN_WIRE_SCL; + +/* + * USB + */ +#define PIN_USB_HOST_ENABLE (27ul) +#define PIN_USB_DM (28ul) +#define PIN_USB_DP (29ul) + +/* + * I2S Interfaces + */ +#define I2S_INTERFACES_COUNT 1 + +#define I2S_DEVICE 0 +#define I2S_CLOCK_GENERATOR 3 + +#define PIN_I2S_SDO (11u) +#define PIN_I2S_SDI (12u) +#define PIN_I2S_SCK PIN_SERIAL1_TX +#define PIN_I2S_FS (10u) +#define PIN_I2S_MCK PIN_SERIAL1_RX + +//QSPI Pins +//#define PIN_QSPI_SCK (34u) +//#define PIN_QSPI_CS (35u) +//#define PIN_QSPI_IO0 (36u) +//#define PIN_QSPI_IO1 (37u) +//#define PIN_QSPI_IO2 (38u) +//#define PIN_QSPI_IO3 (39u) + +//TODO: meaningful value for this +//#define VARIANT_QSPI_BAUD_DEFAULT 5000000 + +#ifdef __cplusplus +} +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + +/* ========================= + * ===== SERCOM DEFINITION + * ========================= +*/ +extern SERCOM sercom0; +extern SERCOM sercom1; +extern SERCOM sercom2; +extern SERCOM sercom3; +extern SERCOM sercom4; +extern SERCOM sercom5; + +extern Uart Serial1; + +#endif + +// These serial port names are intended to allow libraries and architecture-neutral +// sketches to automatically default to the correct port name for a particular type +// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, +// the first hardware serial port whose RX/TX pins are not dedicated to another use. +// +// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor +// +// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial +// +// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library +// +// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. +// +// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX +// pins are NOT connected to anything by default. +#define SERIAL_PORT_USBVIRTUAL Serial +#define SERIAL_PORT_MONITOR Serial +// Serial has no physical pins broken out, so it's not listed as HARDWARE port +#define SERIAL_PORT_HARDWARE Serial1 +#define SERIAL_PORT_HARDWARE_OPEN Serial1 + +#endif /* _VARIANT_FEATHER_M4_ */ + diff --git a/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.cpp b/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.cpp index da244665..b7fc3baa 100644 --- a/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.cpp +++ b/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.cpp @@ -17,7 +17,7 @@ */ /* * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- - * + Pin number + ZERO Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) + * + Pin number + SAMD21 Board pin | PIN | Label/Name | Comments (* is for default peripheral in use) * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- * | | Digital Low | | | * +------------+------------------+--------+-----------------+-------------------------------------------------------------------------------------------------------- @@ -167,24 +167,24 @@ const PinDescription g_APinDescription[]= { PORTA, 24, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DM { PORTA, 25, PIO_COM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // USB/DP - // 30..41 - EDBG + // 30..41 - Extra UART // ---------------------- - // 30/31 - EDBG/UART - { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // TX: SERCOM5/PAD[2] - { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // RX: SERCOM5/PAD[3] + // 30/31 - Extra UART + /*Placeholder - not broken out */ { PORTB, 22, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 30/TX: SERCOM5/PAD[2] + /*Placeholder - not broken out */ { PORTB, 23, PIO_SERCOM_ALT, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // 31/RX: SERCOM5/PAD[3] // 32/33 I2C (SDA/SCL and also EDBG:SDA/SCL) { PORTA, 22, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SDA: SERCOM3/PAD[0] { PORTA, 23, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCL: SERCOM3/PAD[1] - // 34..37 - EDBG/SPI + // 34..37 - D10-D13 SPI { PORTA, 19, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MISO: SERCOM1/PAD[3] { PORTA, 16, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // MOSI: SERCOM1/PAD[0] { PORTA, 18, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SS: SERCOM1/PAD[2] { PORTA, 17, PIO_SERCOM, PIN_ATTR_NONE, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // SCK: SERCOM1/PAD[1] // 38..41 - EDBG/Digital - { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] + /*Placeholder - not broken out */ { PORTA, 13, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH5, NOT_ON_TIMER, EXTERNAL_INT_13 }, // 38: EIC/EXTINT[13] *TCC2/WO[1] TCC0/WO[7] { PORTA, 21, PIO_PWM_ALT, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM0_CH7, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 7 { PORTA, 6, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH0, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 8 { PORTA, 7, PIO_PWM, (PIN_ATTR_DIGITAL|PIN_ATTR_PWM), No_ADC_Channel, PWM1_CH1, NOT_ON_TIMER, EXTERNAL_INT_NONE }, // Pin 9 diff --git a/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.h b/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.h index 4c1df671..9846abfd 100644 --- a/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.h +++ b/sparkfun/samd/variants/SparkFun_SAMD_Mini/variant.h @@ -218,7 +218,7 @@ extern Uart Serial1; // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX // pins are NOT connected to anything by default. #define SERIAL_PORT_USBVIRTUAL SerialUSB -#define SERIAL_PORT_MONITOR Serial +#define SERIAL_PORT_MONITOR SerialUSB // Serial has no physical pins broken out, so it's not listed as HARDWARE port #define SERIAL_PORT_HARDWARE Serial1 #define SERIAL_PORT_HARDWARE_OPEN Serial1