├── .github
└── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── .gitignore
├── .gitmodules
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── MooltipassMiniBLEUserManual.pdf
├── MooltipassMiniBLEUserManual_FR.pdf
├── README.md
├── _readme_assets
├── ble_architecture.png
├── ble_vaults_cards.png
├── dev_board.PNG
├── emulator_working_ubuntu.PNG
├── licenses.PNG
└── minible_front.jpg
├── scripts
├── battery_monitor
│ ├── generic_hid_device.py
│ ├── mooltipass_defines.py
│ ├── mooltipass_hid_device.py
│ ├── readme.md
│ └── start.py
├── ci
│ ├── funcs.sh
│ ├── linux
│ │ ├── after_success.sh
│ │ ├── before_install.sh
│ │ ├── install.sh
│ │ └── script.sh
│ └── osx
│ │ ├── Info.plist
│ │ ├── after_success.sh
│ │ ├── before_install.sh
│ │ ├── icon.icns
│ │ ├── install.sh
│ │ └── script.sh
├── csv_cred_generator
│ ├── fakecreds.csv
│ ├── fakecreds_500.csv
│ └── generator.py
├── keyboards
│ ├── README.md
│ ├── cldr-keyboards-37.0
│ │ ├── ICU-LICENSE
│ │ ├── apache-license.txt
│ │ ├── keyboards
│ │ │ ├── .project
│ │ │ ├── android
│ │ │ │ ├── _platform.xml
│ │ │ │ ├── af-t-k0-android-600dpi.xml
│ │ │ │ ├── af-t-k0-android-768dpi.xml
│ │ │ │ ├── af-t-k0-android.xml
│ │ │ │ ├── ar-t-k0-android-600dpi.xml
│ │ │ │ ├── ar-t-k0-android-768dpi.xml
│ │ │ │ ├── ar-t-k0-android.xml
│ │ │ │ ├── be-t-k0-android-600dpi.xml
│ │ │ │ ├── be-t-k0-android-768dpi.xml
│ │ │ │ ├── be-t-k0-android.xml
│ │ │ │ ├── bg-t-k0-android-600dpi.xml
│ │ │ │ ├── bg-t-k0-android-768dpi.xml
│ │ │ │ ├── bg-t-k0-android-var-600dpi.xml
│ │ │ │ ├── bg-t-k0-android-var-768dpi.xml
│ │ │ │ ├── bg-t-k0-android-var.xml
│ │ │ │ ├── bg-t-k0-android.xml
│ │ │ │ ├── ca-t-k0-android-600dpi.xml
│ │ │ │ ├── ca-t-k0-android-768dpi.xml
│ │ │ │ ├── ca-t-k0-android.xml
│ │ │ │ ├── cs-t-k0-android-600dpi.xml
│ │ │ │ ├── cs-t-k0-android-768dpi.xml
│ │ │ │ ├── cs-t-k0-android.xml
│ │ │ │ ├── da-t-k0-android-600dpi.xml
│ │ │ │ ├── da-t-k0-android-768dpi.xml
│ │ │ │ ├── da-t-k0-android.xml
│ │ │ │ ├── de-t-k0-android-600dpi.xml
│ │ │ │ ├── de-t-k0-android-768dpi.xml
│ │ │ │ ├── de-t-k0-android-qwerty-600dpi.xml
│ │ │ │ ├── de-t-k0-android-qwerty-768dpi.xml
│ │ │ │ ├── de-t-k0-android-qwerty.xml
│ │ │ │ ├── de-t-k0-android.xml
│ │ │ │ ├── el-t-k0-android-600dpi.xml
│ │ │ │ ├── el-t-k0-android-768dpi.xml
│ │ │ │ ├── el-t-k0-android.xml
│ │ │ │ ├── en-GB-t-k0-android-600dpi.xml
│ │ │ │ ├── en-GB-t-k0-android-768dpi.xml
│ │ │ │ ├── en-GB-t-k0-android.xml
│ │ │ │ ├── en-t-k0-android-600dpi.xml
│ │ │ │ ├── en-t-k0-android-768dpi.xml
│ │ │ │ ├── en-t-k0-android.xml
│ │ │ │ ├── eo-t-k0-android-600dpi.xml
│ │ │ │ ├── eo-t-k0-android-768dpi.xml
│ │ │ │ ├── eo-t-k0-android.xml
│ │ │ │ ├── es-US-t-k0-android-600dpi.xml
│ │ │ │ ├── es-US-t-k0-android-768dpi.xml
│ │ │ │ ├── es-US-t-k0-android.xml
│ │ │ │ ├── es-t-k0-android-600dpi.xml
│ │ │ │ ├── es-t-k0-android-768dpi.xml
│ │ │ │ ├── es-t-k0-android.xml
│ │ │ │ ├── et-t-k0-android-600dpi.xml
│ │ │ │ ├── et-t-k0-android-768dpi.xml
│ │ │ │ ├── et-t-k0-android.xml
│ │ │ │ ├── fa-t-k0-android-600dpi.xml
│ │ │ │ ├── fa-t-k0-android-768dpi.xml
│ │ │ │ ├── fa-t-k0-android.xml
│ │ │ │ ├── fi-t-k0-android-600dpi.xml
│ │ │ │ ├── fi-t-k0-android-768dpi.xml
│ │ │ │ ├── fi-t-k0-android.xml
│ │ │ │ ├── fil-t-k0-android-600dpi.xml
│ │ │ │ ├── fil-t-k0-android-768dpi.xml
│ │ │ │ ├── fil-t-k0-android.xml
│ │ │ │ ├── fr-CA-t-k0-android-600dpi.xml
│ │ │ │ ├── fr-CA-t-k0-android-768dpi.xml
│ │ │ │ ├── fr-CA-t-k0-android.xml
│ │ │ │ ├── fr-t-k0-android-600dpi.xml
│ │ │ │ ├── fr-t-k0-android-768dpi.xml
│ │ │ │ ├── fr-t-k0-android-qwertz-600dpi.xml
│ │ │ │ ├── fr-t-k0-android-qwertz-768dpi.xml
│ │ │ │ ├── fr-t-k0-android-qwertz.xml
│ │ │ │ ├── fr-t-k0-android.xml
│ │ │ │ ├── he-t-k0-android-600dpi.xml
│ │ │ │ ├── he-t-k0-android-768dpi.xml
│ │ │ │ ├── he-t-k0-android.xml
│ │ │ │ ├── hi-t-k0-android-600dpi.xml
│ │ │ │ ├── hi-t-k0-android-768dpi.xml
│ │ │ │ ├── hi-t-k0-android.xml
│ │ │ │ ├── hr-t-k0-android-600dpi.xml
│ │ │ │ ├── hr-t-k0-android-768dpi.xml
│ │ │ │ ├── hr-t-k0-android.xml
│ │ │ │ ├── hu-t-k0-android-600dpi.xml
│ │ │ │ ├── hu-t-k0-android-768dpi.xml
│ │ │ │ ├── hu-t-k0-android.xml
│ │ │ │ ├── hy-t-k0-android-600dpi.xml
│ │ │ │ ├── hy-t-k0-android-768dpi.xml
│ │ │ │ ├── hy-t-k0-android.xml
│ │ │ │ ├── id-t-k0-android-600dpi.xml
│ │ │ │ ├── id-t-k0-android-768dpi.xml
│ │ │ │ ├── id-t-k0-android.xml
│ │ │ │ ├── is-t-k0-android-600dpi.xml
│ │ │ │ ├── is-t-k0-android-768dpi.xml
│ │ │ │ ├── is-t-k0-android.xml
│ │ │ │ ├── it-t-k0-android-600dpi.xml
│ │ │ │ ├── it-t-k0-android-768dpi.xml
│ │ │ │ ├── it-t-k0-android.xml
│ │ │ │ ├── ka-t-k0-android-600dpi.xml
│ │ │ │ ├── ka-t-k0-android-768dpi.xml
│ │ │ │ ├── ka-t-k0-android.xml
│ │ │ │ ├── km-t-k0-android-600dpi.xml
│ │ │ │ ├── km-t-k0-android-768dpi.xml
│ │ │ │ ├── km-t-k0-android.xml
│ │ │ │ ├── ky-t-k0-android-600dpi.xml
│ │ │ │ ├── ky-t-k0-android-768dpi.xml
│ │ │ │ ├── ky-t-k0-android.xml
│ │ │ │ ├── lo-t-k0-android-600dpi.xml
│ │ │ │ ├── lo-t-k0-android-768dpi.xml
│ │ │ │ ├── lo-t-k0-android.xml
│ │ │ │ ├── lt-t-k0-android-600dpi.xml
│ │ │ │ ├── lt-t-k0-android-768dpi.xml
│ │ │ │ ├── lt-t-k0-android.xml
│ │ │ │ ├── lv-t-k0-android-600dpi.xml
│ │ │ │ ├── lv-t-k0-android-768dpi.xml
│ │ │ │ ├── lv-t-k0-android.xml
│ │ │ │ ├── mk-t-k0-android-600dpi.xml
│ │ │ │ ├── mk-t-k0-android-768dpi.xml
│ │ │ │ ├── mk-t-k0-android.xml
│ │ │ │ ├── mn-t-k0-android-600dpi.xml
│ │ │ │ ├── mn-t-k0-android-768dpi.xml
│ │ │ │ ├── mn-t-k0-android.xml
│ │ │ │ ├── ms-t-k0-android-600dpi.xml
│ │ │ │ ├── ms-t-k0-android-768dpi.xml
│ │ │ │ ├── ms-t-k0-android.xml
│ │ │ │ ├── nb-t-k0-android-600dpi.xml
│ │ │ │ ├── nb-t-k0-android-768dpi.xml
│ │ │ │ ├── nb-t-k0-android.xml
│ │ │ │ ├── nl-BE-t-k0-android-600dpi.xml
│ │ │ │ ├── nl-BE-t-k0-android-768dpi.xml
│ │ │ │ ├── nl-BE-t-k0-android.xml
│ │ │ │ ├── nl-t-k0-android-600dpi.xml
│ │ │ │ ├── nl-t-k0-android-768dpi.xml
│ │ │ │ ├── nl-t-k0-android.xml
│ │ │ │ ├── pl-t-k0-android-600dpi.xml
│ │ │ │ ├── pl-t-k0-android-768dpi.xml
│ │ │ │ ├── pl-t-k0-android.xml
│ │ │ │ ├── pt-PT-t-k0-android-600dpi.xml
│ │ │ │ ├── pt-PT-t-k0-android-768dpi.xml
│ │ │ │ ├── pt-PT-t-k0-android.xml
│ │ │ │ ├── pt-t-k0-android-600dpi.xml
│ │ │ │ ├── pt-t-k0-android-768dpi.xml
│ │ │ │ ├── pt-t-k0-android.xml
│ │ │ │ ├── ro-t-k0-android-600dpi.xml
│ │ │ │ ├── ro-t-k0-android-768dpi.xml
│ │ │ │ ├── ro-t-k0-android.xml
│ │ │ │ ├── ru-t-k0-android-600dpi.xml
│ │ │ │ ├── ru-t-k0-android-768dpi.xml
│ │ │ │ ├── ru-t-k0-android.xml
│ │ │ │ ├── sk-t-k0-android-600dpi.xml
│ │ │ │ ├── sk-t-k0-android-768dpi.xml
│ │ │ │ ├── sk-t-k0-android.xml
│ │ │ │ ├── sl-t-k0-android-600dpi.xml
│ │ │ │ ├── sl-t-k0-android-768dpi.xml
│ │ │ │ ├── sl-t-k0-android.xml
│ │ │ │ ├── sr-t-k0-android-600dpi.xml
│ │ │ │ ├── sr-t-k0-android-768dpi.xml
│ │ │ │ ├── sr-t-k0-android.xml
│ │ │ │ ├── sv-t-k0-android-600dpi.xml
│ │ │ │ ├── sv-t-k0-android-768dpi.xml
│ │ │ │ ├── sv-t-k0-android.xml
│ │ │ │ ├── sw-t-k0-android-600dpi.xml
│ │ │ │ ├── sw-t-k0-android-768dpi.xml
│ │ │ │ ├── sw-t-k0-android.xml
│ │ │ │ ├── th-t-k0-android-600dpi.xml
│ │ │ │ ├── th-t-k0-android-768dpi.xml
│ │ │ │ ├── th-t-k0-android.xml
│ │ │ │ ├── tr-t-k0-android-600dpi.xml
│ │ │ │ ├── tr-t-k0-android-768dpi.xml
│ │ │ │ ├── tr-t-k0-android.xml
│ │ │ │ ├── uk-t-k0-android-600dpi.xml
│ │ │ │ ├── uk-t-k0-android-768dpi.xml
│ │ │ │ ├── uk-t-k0-android.xml
│ │ │ │ ├── vi-t-k0-android-600dpi.xml
│ │ │ │ ├── vi-t-k0-android-768dpi.xml
│ │ │ │ ├── vi-t-k0-android.xml
│ │ │ │ ├── zu-t-k0-android-600dpi.xml
│ │ │ │ ├── zu-t-k0-android-768dpi.xml
│ │ │ │ └── zu-t-k0-android.xml
│ │ │ ├── chromeos
│ │ │ │ ├── _platform.xml
│ │ │ │ ├── be-t-k0-chromeos.xml
│ │ │ │ ├── bg-t-k0-chromeos-qwerty.xml
│ │ │ │ ├── bg-t-k0-chromeos.xml
│ │ │ │ ├── ca-t-k0-chromeos.xml
│ │ │ │ ├── cs-t-k0-chromeos-qwerty.xml
│ │ │ │ ├── cs-t-k0-chromeos.xml
│ │ │ │ ├── da-t-k0-chromeos.xml
│ │ │ │ ├── de-BE-t-k0-chromeos.xml
│ │ │ │ ├── de-CH-t-k0-chromeos.xml
│ │ │ │ ├── de-t-k0-chromeos-extended.xml
│ │ │ │ ├── de-t-k0-chromeos.xml
│ │ │ │ ├── el-t-k0-chromeos.xml
│ │ │ │ ├── en-CA-t-k0-chromeos.xml
│ │ │ │ ├── en-GB-t-k0-chromeos-dvorak.xml
│ │ │ │ ├── en-GB-t-k0-chromeos.xml
│ │ │ │ ├── en-t-k0-chromeos-colemak.xml
│ │ │ │ ├── en-t-k0-chromeos-dvorak.xml
│ │ │ │ ├── en-t-k0-chromeos-extended-var.xml
│ │ │ │ ├── en-t-k0-chromeos-extended.xml
│ │ │ │ ├── en-t-k0-chromeos.xml
│ │ │ │ ├── es-419-t-k0-chromeos.xml
│ │ │ │ ├── es-t-k0-chromeos.xml
│ │ │ │ ├── et-t-k0-chromeos.xml
│ │ │ │ ├── fi-t-k0-chromeos.xml
│ │ │ │ ├── fr-BE-t-k0-chromeos.xml
│ │ │ │ ├── fr-CA-t-k0-chromeos-intl.xml
│ │ │ │ ├── fr-CA-t-k0-chromeos.xml
│ │ │ │ ├── fr-CH-t-k0-chromeos.xml
│ │ │ │ ├── fr-t-k0-chromeos.xml
│ │ │ │ ├── he-t-k0-chromeos.xml
│ │ │ │ ├── hr-t-k0-chromeos.xml
│ │ │ │ ├── hu-t-k0-chromeos.xml
│ │ │ │ ├── hy-t-k0-chromeos.xml
│ │ │ │ ├── is-t-k0-chromeos.xml
│ │ │ │ ├── it-t-k0-chromeos.xml
│ │ │ │ ├── ja-t-k0-chromeos.xml
│ │ │ │ ├── ka-t-k0-chromeos.xml
│ │ │ │ ├── lt-t-k0-chromeos.xml
│ │ │ │ ├── lv-t-k0-chromeos.xml
│ │ │ │ ├── mn-t-k0-chromeos.xml
│ │ │ │ ├── nb-t-k0-chromeos.xml
│ │ │ │ ├── nl-BE-t-k0-chromeos.xml
│ │ │ │ ├── pl-t-k0-chromeos.xml
│ │ │ │ ├── pt-PT-t-k0-chromeos.xml
│ │ │ │ ├── pt-t-k0-chromeos.xml
│ │ │ │ ├── ro-t-k0-chromeos.xml
│ │ │ │ ├── ru-t-k0-chromeos-qwerty.xml
│ │ │ │ ├── ru-t-k0-chromeos.xml
│ │ │ │ ├── sk-t-k0-chromeos.xml
│ │ │ │ ├── sl-t-k0-chromeos.xml
│ │ │ │ ├── sr-t-k0-chromeos.xml
│ │ │ │ ├── sv-t-k0-chromeos.xml
│ │ │ │ ├── tr-t-k0-chromeos.xml
│ │ │ │ └── uk-t-k0-chromeos.xml
│ │ │ ├── dtd
│ │ │ │ ├── ldmlKeyboard.dtd
│ │ │ │ └── ldmlPlatform.dtd
│ │ │ ├── osx
│ │ │ │ ├── _platform.xml
│ │ │ │ ├── ar-t-k0-osx-azerty.xml
│ │ │ │ ├── ar-t-k0-osx-qwerty-var.xml
│ │ │ │ ├── ar-t-k0-osx-qwerty.xml
│ │ │ │ ├── ar-t-k0-osx-var.xml
│ │ │ │ ├── ar-t-k0-osx.xml
│ │ │ │ ├── az-t-k0-osx.xml
│ │ │ │ ├── be-t-k0-osx.xml
│ │ │ │ ├── bg-t-k0-osx-qwerty.xml
│ │ │ │ ├── bg-t-k0-osx.xml
│ │ │ │ ├── bn-t-k0-osx-qwerty.xml
│ │ │ │ ├── bn-t-k0-osx.xml
│ │ │ │ ├── bo-t-k0-osx-qwerty.xml
│ │ │ │ ├── bo-t-k0-osx.xml
│ │ │ │ ├── chr-t-k0-osx-qwerty.xml
│ │ │ │ ├── chr-t-k0-osx.xml
│ │ │ │ ├── ckb-t-k0-osx.xml
│ │ │ │ ├── cs-t-k0-osx-qwerty.xml
│ │ │ │ ├── cs-t-k0-osx.xml
│ │ │ │ ├── cy-t-k0-osx.xml
│ │ │ │ ├── da-t-k0-osx.xml
│ │ │ │ ├── de-AT-t-k0-osx.xml
│ │ │ │ ├── de-BE-t-k0-osx.xml
│ │ │ │ ├── de-CH-t-k0-osx.xml
│ │ │ │ ├── de-t-k0-osx.xml
│ │ │ │ ├── el-POLYTON-t-k0-osx.xml
│ │ │ │ ├── el-t-k0-osx.xml
│ │ │ │ ├── en-AU-t-k0-osx.xml
│ │ │ │ ├── en-CA-t-k0-osx.xml
│ │ │ │ ├── en-GB-t-k0-osx-var.xml
│ │ │ │ ├── en-GB-t-k0-osx.xml
│ │ │ │ ├── en-t-k0-osx-colemak.xml
│ │ │ │ ├── en-t-k0-osx-dvorak-qwerty.xml
│ │ │ │ ├── en-t-k0-osx-dvorak.xml
│ │ │ │ ├── en-t-k0-osx-dvorakl.xml
│ │ │ │ ├── en-t-k0-osx-dvorakr.xml
│ │ │ │ ├── en-t-k0-osx-extended-var.xml
│ │ │ │ ├── en-t-k0-osx-extended.xml
│ │ │ │ ├── en-t-k0-osx.xml
│ │ │ │ ├── es-t-k0-osx-extended.xml
│ │ │ │ ├── es-t-k0-osx.xml
│ │ │ │ ├── et-t-k0-osx.xml
│ │ │ │ ├── fa-AF-t-k0-osx.xml
│ │ │ │ ├── fa-t-k0-osx-isiri.xml
│ │ │ │ ├── fa-t-k0-osx-qwerty.xml
│ │ │ │ ├── fa-t-k0-osx.xml
│ │ │ │ ├── fi-t-k0-osx-extended-var.xml
│ │ │ │ ├── fi-t-k0-osx-extended.xml
│ │ │ │ ├── fi-t-k0-osx.xml
│ │ │ │ ├── fo-t-k0-osx.xml
│ │ │ │ ├── fr-BE-t-k0-osx.xml
│ │ │ │ ├── fr-CA-t-k0-osx.xml
│ │ │ │ ├── fr-CH-t-k0-osx.xml
│ │ │ │ ├── fr-t-k0-osx-qwerty.xml
│ │ │ │ ├── fr-t-k0-osx-var.xml
│ │ │ │ ├── fr-t-k0-osx.xml
│ │ │ │ ├── ga-t-k0-osx-extended.xml
│ │ │ │ ├── ga-t-k0-osx.xml
│ │ │ │ ├── gu-t-k0-osx-qwerty.xml
│ │ │ │ ├── gu-t-k0-osx.xml
│ │ │ │ ├── haw-t-k0-osx.xml
│ │ │ │ ├── he-t-k0-osx-qwerty.xml
│ │ │ │ ├── he-t-k0-osx-var.xml
│ │ │ │ ├── he-t-k0-osx.xml
│ │ │ │ ├── hi-t-k0-osx-qwerty.xml
│ │ │ │ ├── hi-t-k0-osx.xml
│ │ │ │ ├── hr-t-k0-osx-var.xml
│ │ │ │ ├── hr-t-k0-osx.xml
│ │ │ │ ├── hu-t-k0-osx-qwerty.xml
│ │ │ │ ├── hu-t-k0-osx.xml
│ │ │ │ ├── hy-AREVMDA-t-k0-osx.xml
│ │ │ │ ├── hy-t-k0-osx.xml
│ │ │ │ ├── is-t-k0-osx.xml
│ │ │ │ ├── it-t-k0-osx-extended.xml
│ │ │ │ ├── it-t-k0-osx.xml
│ │ │ │ ├── iu-t-k0-osx-nutaaq.xml
│ │ │ │ ├── iu-t-k0-osx-qwerty.xml
│ │ │ │ ├── iu-t-k0-osx-var.xml
│ │ │ │ ├── iu-t-k0-osx.xml
│ │ │ │ ├── ka-t-k0-osx.xml
│ │ │ │ ├── kk-t-k0-osx.xml
│ │ │ │ ├── km-t-k0-osx.xml
│ │ │ │ ├── kn-t-k0-osx-qwerty.xml
│ │ │ │ ├── kn-t-k0-osx.xml
│ │ │ │ ├── lt-t-k0-osx.xml
│ │ │ │ ├── lv-t-k0-osx.xml
│ │ │ │ ├── mi-t-k0-osx.xml
│ │ │ │ ├── mk-t-k0-osx.xml
│ │ │ │ ├── ml-t-k0-osx-qwerty.xml
│ │ │ │ ├── ml-t-k0-osx.xml
│ │ │ │ ├── ms-t-k0-osx.xml
│ │ │ │ ├── mt-t-k0-osx.xml
│ │ │ │ ├── my-t-k0-osx.xml
│ │ │ │ ├── nb-t-k0-osx-extended-var.xml
│ │ │ │ ├── nb-t-k0-osx-extended.xml
│ │ │ │ ├── nb-t-k0-osx.xml
│ │ │ │ ├── ne-t-k0-osx.xml
│ │ │ │ ├── nl-BE-t-k0-osx.xml
│ │ │ │ ├── nl-t-k0-osx.xml
│ │ │ │ ├── or-t-k0-osx-qwerty.xml
│ │ │ │ ├── or-t-k0-osx.xml
│ │ │ │ ├── pa-t-k0-osx-qwerty.xml
│ │ │ │ ├── pa-t-k0-osx.xml
│ │ │ │ ├── pl-t-k0-osx-extended.xml
│ │ │ │ ├── pl-t-k0-osx.xml
│ │ │ │ ├── ps-t-k0-osx.xml
│ │ │ │ ├── pt-PT-t-k0-osx.xml
│ │ │ │ ├── pt-t-k0-osx-extended.xml
│ │ │ │ ├── pt-t-k0-osx.xml
│ │ │ │ ├── ro-t-k0-osx-extended.xml
│ │ │ │ ├── ro-t-k0-osx.xml
│ │ │ │ ├── ru-t-k0-osx-extended.xml
│ │ │ │ ├── ru-t-k0-osx-qwerty.xml
│ │ │ │ ├── ru-t-k0-osx.xml
│ │ │ │ ├── se-t-k0-osx.xml
│ │ │ │ ├── si-t-k0-osx-qwerty.xml
│ │ │ │ ├── si-t-k0-osx.xml
│ │ │ │ ├── sk-t-k0-osx-qwerty.xml
│ │ │ │ ├── sk-t-k0-osx.xml
│ │ │ │ ├── sl-t-k0-osx.xml
│ │ │ │ ├── sr-Latn-t-k0-osx.xml
│ │ │ │ ├── sr-t-k0-osx.xml
│ │ │ │ ├── sv-t-k0-osx-extended-var.xml
│ │ │ │ ├── sv-t-k0-osx-extended.xml
│ │ │ │ ├── sv-t-k0-osx.xml
│ │ │ │ ├── te-t-k0-osx-qwerty.xml
│ │ │ │ ├── te-t-k0-osx.xml
│ │ │ │ ├── th-t-k0-osx-patta.xml
│ │ │ │ ├── th-t-k0-osx.xml
│ │ │ │ ├── tr-t-k0-osx-qwerty-var.xml
│ │ │ │ ├── tr-t-k0-osx-qwerty.xml
│ │ │ │ ├── tr-t-k0-osx.xml
│ │ │ │ ├── ug-t-k0-osx.xml
│ │ │ │ ├── uk-t-k0-osx.xml
│ │ │ │ ├── ur-t-k0-osx.xml
│ │ │ │ ├── uz-Arab-t-k0-osx.xml
│ │ │ │ └── vi-t-k0-osx.xml
│ │ │ ├── und
│ │ │ │ ├── ccp-IN-t-k0-windows.xml
│ │ │ │ ├── dz-t-k0-windows.xml
│ │ │ │ ├── lt-t-k0-osx-var.xml
│ │ │ │ ├── ug-t-k0-android-600dpi.xml
│ │ │ │ ├── ug-t-k0-android-768dpi.xml
│ │ │ │ ├── ug-t-k0-android-intl-600dpi.xml
│ │ │ │ ├── ug-t-k0-android-intl-768dpi.xml
│ │ │ │ ├── ug-t-k0-android-intl.xml
│ │ │ │ ├── ug-t-k0-android.xml
│ │ │ │ ├── ug-t-k0-osx-intl.xml
│ │ │ │ └── ug-t-k0-windows-intl.xml
│ │ │ └── windows
│ │ │ │ ├── _platform.xml
│ │ │ │ ├── ar-t-k0-windows-102key.xml
│ │ │ │ ├── ar-t-k0-windows-azerty.xml
│ │ │ │ ├── ar-t-k0-windows.xml
│ │ │ │ ├── as-t-k0-windows.xml
│ │ │ │ ├── az-Cyrl-t-k0-windows.xml
│ │ │ │ ├── az-t-k0-windows-extended.xml
│ │ │ │ ├── az-t-k0-windows.xml
│ │ │ │ ├── ba-t-k0-windows.xml
│ │ │ │ ├── be-t-k0-windows.xml
│ │ │ │ ├── bg-Latn-t-k0-windows.xml
│ │ │ │ ├── bg-t-k0-windows-legacy.xml
│ │ │ │ ├── bg-t-k0-windows-qwerty-legacy.xml
│ │ │ │ ├── bg-t-k0-windows-qwerty.xml
│ │ │ │ ├── bg-t-k0-windows.xml
│ │ │ │ ├── bm-t-k0-windows.xml
│ │ │ │ ├── bn-t-k0-windows-legacy.xml
│ │ │ │ ├── bn-t-k0-windows-qwerty.xml
│ │ │ │ ├── bn-t-k0-windows.xml
│ │ │ │ ├── bo-t-k0-windows-extended.xml
│ │ │ │ ├── bo-t-k0-windows.xml
│ │ │ │ ├── bs-Cyrl-t-k0-windows.xml
│ │ │ │ ├── bug-t-k0-windows.xml
│ │ │ │ ├── chr-t-k0-windows-phonetic.xml
│ │ │ │ ├── chr-t-k0-windows.xml
│ │ │ │ ├── ckb-t-k0-windows.xml
│ │ │ │ ├── cs-t-k0-windows-extended.xml
│ │ │ │ ├── cs-t-k0-windows-qwerty.xml
│ │ │ │ ├── cs-t-k0-windows.xml
│ │ │ │ ├── da-t-k0-windows.xml
│ │ │ │ ├── de-BE-t-k0-windows-var.xml
│ │ │ │ ├── de-BE-t-k0-windows.xml
│ │ │ │ ├── de-CH-t-k0-windows.xml
│ │ │ │ ├── de-t-k0-windows-extended.xml
│ │ │ │ ├── de-t-k0-windows.xml
│ │ │ │ ├── dsb-t-k0-windows-extended.xml
│ │ │ │ ├── dsb-t-k0-windows-legacy.xml
│ │ │ │ ├── dsb-t-k0-windows.xml
│ │ │ │ ├── dv-t-k0-windows-legacy.xml
│ │ │ │ ├── dv-t-k0-windows.xml
│ │ │ │ ├── dyu-t-k0-windows.xml
│ │ │ │ ├── dz-t-k0-windows.xml
│ │ │ │ ├── el-Latn-t-k0-windows-el220.xml
│ │ │ │ ├── el-Latn-t-k0-windows-el319.xml
│ │ │ │ ├── el-Latn-t-k0-windows.xml
│ │ │ │ ├── el-POLYTON-t-k0-windows.xml
│ │ │ │ ├── el-t-k0-windows-el220.xml
│ │ │ │ ├── el-t-k0-windows-el319.xml
│ │ │ │ ├── el-t-k0-windows.xml
│ │ │ │ ├── en-GB-t-k0-windows-extended.xml
│ │ │ │ ├── en-GB-t-k0-windows.xml
│ │ │ │ ├── en-IN-t-k0-windows.xml
│ │ │ │ ├── en-t-k0-windows-dvorak.xml
│ │ │ │ ├── en-t-k0-windows-dvorakl.xml
│ │ │ │ ├── en-t-k0-windows-dvorakr.xml
│ │ │ │ ├── en-t-k0-windows-extended.xml
│ │ │ │ ├── en-t-k0-windows-var.xml
│ │ │ │ ├── en-t-k0-windows.xml
│ │ │ │ ├── es-419-t-k0-windows.xml
│ │ │ │ ├── es-t-k0-windows-extended.xml
│ │ │ │ ├── es-t-k0-windows.xml
│ │ │ │ ├── et-t-k0-windows.xml
│ │ │ │ ├── fa-t-k0-windows-extended.xml
│ │ │ │ ├── fa-t-k0-windows.xml
│ │ │ │ ├── fi-t-k0-windows-extended.xml
│ │ │ │ ├── fi-t-k0-windows.xml
│ │ │ │ ├── fo-t-k0-windows.xml
│ │ │ │ ├── fr-BE-t-k0-windows-var.xml
│ │ │ │ ├── fr-BE-t-k0-windows.xml
│ │ │ │ ├── fr-CA-t-k0-windows-legacy.xml
│ │ │ │ ├── fr-CA-t-k0-windows-var.xml
│ │ │ │ ├── fr-CA-t-k0-windows.xml
│ │ │ │ ├── fr-CH-t-k0-windows.xml
│ │ │ │ ├── fr-t-k0-windows.xml
│ │ │ │ ├── ga-Ogam-t-k0-windows.xml
│ │ │ │ ├── ga-t-k0-windows.xml
│ │ │ │ ├── gd-t-k0-windows.xml
│ │ │ │ ├── gn-t-k0-windows.xml
│ │ │ │ ├── got-t-k0-windows.xml
│ │ │ │ ├── gu-t-k0-windows.xml
│ │ │ │ ├── ha-t-k0-windows.xml
│ │ │ │ ├── haw-t-k0-windows.xml
│ │ │ │ ├── he-t-k0-windows-extended.xml
│ │ │ │ ├── he-t-k0-windows.xml
│ │ │ │ ├── hi-t-k0-windows-legacy.xml
│ │ │ │ ├── hi-t-k0-windows.xml
│ │ │ │ ├── hu-t-k0-windows-101key.xml
│ │ │ │ ├── hu-t-k0-windows.xml
│ │ │ │ ├── hy-AREVMDA-t-k0-windows.xml
│ │ │ │ ├── hy-t-k0-windows-legacy.xml
│ │ │ │ ├── hy-t-k0-windows-phonetic.xml
│ │ │ │ ├── hy-t-k0-windows.xml
│ │ │ │ ├── ig-t-k0-windows.xml
│ │ │ │ ├── is-t-k0-windows.xml
│ │ │ │ ├── it-t-k0-windows-var.xml
│ │ │ │ ├── it-t-k0-windows.xml
│ │ │ │ ├── iu-t-k0-windows-var.xml
│ │ │ │ ├── iu-t-k0-windows.xml
│ │ │ │ ├── ja-t-k0-windows.xml
│ │ │ │ ├── jv-t-k0-windows.xml
│ │ │ │ ├── ka-t-k0-windows-legacy-var.xml
│ │ │ │ ├── ka-t-k0-windows-legacy.xml
│ │ │ │ ├── ka-t-k0-windows-qwerty.xml
│ │ │ │ ├── ka-t-k0-windows-var.xml
│ │ │ │ ├── ka-t-k0-windows.xml
│ │ │ │ ├── khb-Tale-t-k0-windows.xml
│ │ │ │ ├── khb-t-k0-windows.xml
│ │ │ │ ├── kk-t-k0-windows.xml
│ │ │ │ ├── kl-t-k0-windows.xml
│ │ │ │ ├── km-t-k0-windows-extended.xml
│ │ │ │ ├── km-t-k0-windows.xml
│ │ │ │ ├── kn-t-k0-windows.xml
│ │ │ │ ├── ko-t-k0-windows.xml
│ │ │ │ ├── ky-t-k0-windows.xml
│ │ │ │ ├── la-Ital-t-k0-windows.xml
│ │ │ │ ├── lb-t-k0-windows.xml
│ │ │ │ ├── lis-t-k0-windows-extended.xml
│ │ │ │ ├── lis-t-k0-windows.xml
│ │ │ │ ├── lo-t-k0-windows.xml
│ │ │ │ ├── lt-t-k0-windows-lt1205.xml
│ │ │ │ ├── lt-t-k0-windows-lt1582.xml
│ │ │ │ ├── lt-t-k0-windows.xml
│ │ │ │ ├── lv-t-k0-windows-extended.xml
│ │ │ │ ├── lv-t-k0-windows-qwerty.xml
│ │ │ │ ├── lv-t-k0-windows.xml
│ │ │ │ ├── man-t-k0-windows.xml
│ │ │ │ ├── mi-t-k0-windows.xml
│ │ │ │ ├── mk-t-k0-windows-legacy.xml
│ │ │ │ ├── mk-t-k0-windows.xml
│ │ │ │ ├── ml-t-k0-windows.xml
│ │ │ │ ├── mn-Mong-t-k0-windows-extended.xml
│ │ │ │ ├── mn-Mong-t-k0-windows.xml
│ │ │ │ ├── mn-Phag-t-k0-windows.xml
│ │ │ │ ├── mn-t-k0-windows.xml
│ │ │ │ ├── mr-t-k0-windows.xml
│ │ │ │ ├── mt-t-k0-windows-101key.xml
│ │ │ │ ├── mt-t-k0-windows.xml
│ │ │ │ ├── my-t-k0-windows.xml
│ │ │ │ ├── nb-t-k0-windows-extended.xml
│ │ │ │ ├── nb-t-k0-windows.xml
│ │ │ │ ├── ne-t-k0-windows.xml
│ │ │ │ ├── nl-BE-t-k0-windows-var.xml
│ │ │ │ ├── nl-BE-t-k0-windows.xml
│ │ │ │ ├── nl-t-k0-windows.xml
│ │ │ │ ├── non-t-k0-windows.xml
│ │ │ │ ├── nso-t-k0-windows.xml
│ │ │ │ ├── or-t-k0-windows.xml
│ │ │ │ ├── pa-t-k0-windows.xml
│ │ │ │ ├── pl-t-k0-windows-extended.xml
│ │ │ │ ├── pl-t-k0-windows.xml
│ │ │ │ ├── ps-t-k0-windows.xml
│ │ │ │ ├── pt-PT-t-k0-windows.xml
│ │ │ │ ├── pt-t-k0-windows-var.xml
│ │ │ │ ├── pt-t-k0-windows.xml
│ │ │ │ ├── ro-t-k0-windows-extended.xml
│ │ │ │ ├── ro-t-k0-windows-legacy.xml
│ │ │ │ ├── ro-t-k0-windows.xml
│ │ │ │ ├── ru-t-k0-windows-legacy.xml
│ │ │ │ ├── ru-t-k0-windows-phonetic.xml
│ │ │ │ ├── ru-t-k0-windows.xml
│ │ │ │ ├── sah-t-k0-windows.xml
│ │ │ │ ├── sat-Olck-t-k0-windows.xml
│ │ │ │ ├── se-FI-t-k0-windows.xml
│ │ │ │ ├── se-SE-t-k0-windows.xml
│ │ │ │ ├── se-t-k0-windows.xml
│ │ │ │ ├── si-t-k0-windows-legacy.xml
│ │ │ │ ├── si-t-k0-windows.xml
│ │ │ │ ├── sk-t-k0-windows-qwerty.xml
│ │ │ │ ├── sk-t-k0-windows.xml
│ │ │ │ ├── sl-t-k0-windows.xml
│ │ │ │ ├── so-Osma-t-k0-windows.xml
│ │ │ │ ├── sq-t-k0-windows.xml
│ │ │ │ ├── sr-Latn-t-k0-windows.xml
│ │ │ │ ├── sr-t-k0-windows.xml
│ │ │ │ ├── srb-t-k0-windows.xml
│ │ │ │ ├── sv-t-k0-windows-extended.xml
│ │ │ │ ├── sv-t-k0-windows.xml
│ │ │ │ ├── syr-t-k0-windows-qwerty.xml
│ │ │ │ ├── syr-t-k0-windows.xml
│ │ │ │ ├── ta-t-k0-windows.xml
│ │ │ │ ├── te-t-k0-windows.xml
│ │ │ │ ├── tg-t-k0-windows.xml
│ │ │ │ ├── th-t-k0-windows-patta-var.xml
│ │ │ │ ├── th-t-k0-windows-patta.xml
│ │ │ │ ├── th-t-k0-windows-var.xml
│ │ │ │ ├── th-t-k0-windows.xml
│ │ │ │ ├── tk-t-k0-windows.xml
│ │ │ │ ├── tmh-t-k0-windows-extended.xml
│ │ │ │ ├── tmh-t-k0-windows.xml
│ │ │ │ ├── tn-t-k0-windows.xml
│ │ │ │ ├── tr-t-k0-windows-legacy.xml
│ │ │ │ ├── tr-t-k0-windows.xml
│ │ │ │ ├── tt-t-k0-windows-legacy.xml
│ │ │ │ ├── tt-t-k0-windows.xml
│ │ │ │ ├── tzm-t-k0-windows.xml
│ │ │ │ ├── ug-t-k0-windows-legacy.xml
│ │ │ │ ├── ug-t-k0-windows.xml
│ │ │ │ ├── uk-t-k0-windows-extended.xml
│ │ │ │ ├── uk-t-k0-windows.xml
│ │ │ │ ├── ur-t-k0-windows.xml
│ │ │ │ ├── uz-t-k0-windows.xml
│ │ │ │ ├── vi-t-k0-windows.xml
│ │ │ │ ├── wo-t-k0-windows.xml
│ │ │ │ ├── yo-t-k0-windows.xml
│ │ │ │ ├── zh-HK-t-k0-windows.xml
│ │ │ │ ├── zh-Hant-t-k0-windows.xml
│ │ │ │ ├── zh-MO-t-k0-windows.xml
│ │ │ │ ├── zh-SG-t-k0-windows.xml
│ │ │ │ └── zh-t-k0-windows.xml
│ │ ├── readme.html
│ │ └── unicode-license.txt
│ ├── cldr_parser.py
│ ├── iso_to_hid_lut.py
│ ├── mini_keyboard.py
│ └── mini_mooltipass_coms.py
├── lib
│ └── ok.sh
├── oled_parameter_set
│ ├── generic_hid_device.py
│ ├── mooltipass_defines.py
│ ├── mooltipass_hid_device.py
│ ├── readme.md
│ └── start.py
├── python_framework
│ ├── FreeSans.ttf
│ ├── _install_reqs.sh
│ ├── bluetooth_scan.py
│ ├── bundle.img
│ ├── fullframe.bmp
│ ├── generic_hid_device.py
│ ├── greyscale.png
│ ├── icon_test.bmp
│ ├── label_printer.py
│ ├── miniblebundle.img
│ ├── mooltipass_defines.py
│ ├── mooltipass_hid_device.py
│ ├── mooltipass_tool.py
│ ├── multi_device_recondition.py
│ ├── randombytes.bin
│ ├── requirements.txt
│ └── udelays.py
├── smc_decode
│ ├── README.md
│ ├── REF-ACR38x-CCID-6.05.pdf
│ ├── reader-card-alignment.jpeg
│ ├── simplecrypt.py
│ └── smc_decode.py
└── uart_spy
│ ├── _run.bat
│ ├── command_defines.py
│ └── uart_spy.py
├── source_code
├── aux_mcu
│ ├── ATBTLC1000-BluSDK-Example-Profiles-Application-User's-Guide.pdf
│ ├── Device_Startup
│ │ ├── samd21e18a_flash.ld
│ │ ├── samd21e18a_sram.ld
│ │ ├── startup_samd21.c
│ │ └── system_samd21.c
│ ├── Makefile
│ ├── Makefile.bootloader
│ ├── aux_mcu.atsln
│ ├── aux_mcu.componentinfo.xml
│ ├── aux_mcu.cproj
│ ├── aux_mcu_ext.atsln
│ ├── aux_mcu_ext.cproj
│ ├── bootloader.atsln
│ ├── bootloader.componentinfo.xml
│ ├── bootloader.cproj
│ ├── openocd_aux.cfg
│ └── src
│ │ ├── ASF
│ │ ├── common
│ │ │ ├── boards
│ │ │ │ └── board.h
│ │ │ ├── services
│ │ │ │ └── serial
│ │ │ │ │ ├── sam0_usart
│ │ │ │ │ └── usart_serial.h
│ │ │ │ │ └── serial.h
│ │ │ └── utils
│ │ │ │ ├── interrupt.h
│ │ │ │ ├── interrupt
│ │ │ │ ├── interrupt_sam_nvic.c
│ │ │ │ └── interrupt_sam_nvic.h
│ │ │ │ └── parts.h
│ │ ├── common2
│ │ │ └── services
│ │ │ │ └── delay
│ │ │ │ ├── delay.h
│ │ │ │ └── sam0
│ │ │ │ ├── systick_counter.c
│ │ │ │ └── systick_counter.h
│ │ ├── sam0
│ │ │ ├── boards
│ │ │ │ └── samd21_xplained_pro
│ │ │ │ │ ├── board_init.c
│ │ │ │ │ └── samd21_xplained_pro.h
│ │ │ ├── drivers
│ │ │ │ ├── extint
│ │ │ │ │ ├── extint.h
│ │ │ │ │ ├── extint_callback.c
│ │ │ │ │ ├── extint_callback.h
│ │ │ │ │ └── extint_sam_d_r_h
│ │ │ │ │ │ └── extint.c
│ │ │ │ ├── port
│ │ │ │ │ ├── port.c
│ │ │ │ │ ├── port.h
│ │ │ │ │ └── quick_start
│ │ │ │ │ │ └── qs_port_basic.h
│ │ │ │ ├── sercom
│ │ │ │ │ ├── sercom.c
│ │ │ │ │ ├── sercom.h
│ │ │ │ │ ├── sercom_interrupt.c
│ │ │ │ │ ├── sercom_interrupt.h
│ │ │ │ │ ├── sercom_pinout.h
│ │ │ │ │ └── usart
│ │ │ │ │ │ ├── quick_start
│ │ │ │ │ │ └── qs_usart_basic_use.h
│ │ │ │ │ │ ├── quick_start_callback
│ │ │ │ │ │ └── qs_usart_callback.h
│ │ │ │ │ │ ├── quick_start_dma
│ │ │ │ │ │ └── qs_usart_dma_use.h
│ │ │ │ │ │ ├── quick_start_lin
│ │ │ │ │ │ └── qs_lin.h
│ │ │ │ │ │ ├── usart.c
│ │ │ │ │ │ ├── usart.h
│ │ │ │ │ │ ├── usart_interrupt.c
│ │ │ │ │ │ └── usart_interrupt.h
│ │ │ │ ├── system
│ │ │ │ │ ├── clock
│ │ │ │ │ │ ├── clock.h
│ │ │ │ │ │ ├── clock_samd21_r21_da_ha1
│ │ │ │ │ │ │ ├── clock.c
│ │ │ │ │ │ │ ├── clock_config_check.h
│ │ │ │ │ │ │ ├── clock_feature.h
│ │ │ │ │ │ │ └── gclk.c
│ │ │ │ │ │ └── gclk.h
│ │ │ │ │ ├── interrupt
│ │ │ │ │ │ ├── system_interrupt.c
│ │ │ │ │ │ ├── system_interrupt.h
│ │ │ │ │ │ └── system_interrupt_samd21
│ │ │ │ │ │ │ └── system_interrupt_features.h
│ │ │ │ │ ├── pinmux
│ │ │ │ │ │ ├── pinmux.c
│ │ │ │ │ │ ├── pinmux.h
│ │ │ │ │ │ └── quick_start
│ │ │ │ │ │ │ └── qs_pinmux_basic.h
│ │ │ │ │ ├── power
│ │ │ │ │ │ └── power_sam_d_r_h
│ │ │ │ │ │ │ └── power.h
│ │ │ │ │ ├── reset
│ │ │ │ │ │ └── reset_sam_d_r_h
│ │ │ │ │ │ │ └── reset.h
│ │ │ │ │ ├── system.c
│ │ │ │ │ └── system.h
│ │ │ │ └── tc
│ │ │ │ │ ├── tc.h
│ │ │ │ │ ├── tc_interrupt.c
│ │ │ │ │ ├── tc_interrupt.h
│ │ │ │ │ └── tc_sam_d_r_h
│ │ │ │ │ └── tc.c
│ │ │ └── utils
│ │ │ │ ├── cmsis
│ │ │ │ └── samd21
│ │ │ │ │ ├── include
│ │ │ │ │ ├── component
│ │ │ │ │ │ ├── ac.h
│ │ │ │ │ │ ├── adc.h
│ │ │ │ │ │ ├── dac.h
│ │ │ │ │ │ ├── dmac.h
│ │ │ │ │ │ ├── dsu.h
│ │ │ │ │ │ ├── eic.h
│ │ │ │ │ │ ├── evsys.h
│ │ │ │ │ │ ├── gclk.h
│ │ │ │ │ │ ├── hmatrixb.h
│ │ │ │ │ │ ├── i2s.h
│ │ │ │ │ │ ├── mtb.h
│ │ │ │ │ │ ├── nvmctrl.h
│ │ │ │ │ │ ├── pac.h
│ │ │ │ │ │ ├── pm.h
│ │ │ │ │ │ ├── port.h
│ │ │ │ │ │ ├── rtc.h
│ │ │ │ │ │ ├── sercom.h
│ │ │ │ │ │ ├── sysctrl.h
│ │ │ │ │ │ ├── tc.h
│ │ │ │ │ │ ├── tcc.h
│ │ │ │ │ │ ├── tcc_lighting.h
│ │ │ │ │ │ ├── usb.h
│ │ │ │ │ │ └── wdt.h
│ │ │ │ │ ├── instance
│ │ │ │ │ │ ├── ac.h
│ │ │ │ │ │ ├── ac1.h
│ │ │ │ │ │ ├── adc.h
│ │ │ │ │ │ ├── dac.h
│ │ │ │ │ │ ├── dmac.h
│ │ │ │ │ │ ├── dsu.h
│ │ │ │ │ │ ├── eic.h
│ │ │ │ │ │ ├── evsys.h
│ │ │ │ │ │ ├── gclk.h
│ │ │ │ │ │ ├── i2s.h
│ │ │ │ │ │ ├── mtb.h
│ │ │ │ │ │ ├── nvmctrl.h
│ │ │ │ │ │ ├── pac0.h
│ │ │ │ │ │ ├── pac1.h
│ │ │ │ │ │ ├── pac2.h
│ │ │ │ │ │ ├── pm.h
│ │ │ │ │ │ ├── port.h
│ │ │ │ │ │ ├── rtc.h
│ │ │ │ │ │ ├── sbmatrix.h
│ │ │ │ │ │ ├── sercom0.h
│ │ │ │ │ │ ├── sercom1.h
│ │ │ │ │ │ ├── sercom2.h
│ │ │ │ │ │ ├── sercom3.h
│ │ │ │ │ │ ├── sercom4.h
│ │ │ │ │ │ ├── sercom5.h
│ │ │ │ │ │ ├── sysctrl.h
│ │ │ │ │ │ ├── tc3.h
│ │ │ │ │ │ ├── tc4.h
│ │ │ │ │ │ ├── tc5.h
│ │ │ │ │ │ ├── tc6.h
│ │ │ │ │ │ ├── tc7.h
│ │ │ │ │ │ ├── tcc0.h
│ │ │ │ │ │ ├── tcc1.h
│ │ │ │ │ │ ├── tcc2.h
│ │ │ │ │ │ ├── usb.h
│ │ │ │ │ │ └── wdt.h
│ │ │ │ │ ├── pio
│ │ │ │ │ │ ├── samd21e15a.h
│ │ │ │ │ │ ├── samd21e15b.h
│ │ │ │ │ │ ├── samd21e15bu.h
│ │ │ │ │ │ ├── samd21e15l.h
│ │ │ │ │ │ ├── samd21e16a.h
│ │ │ │ │ │ ├── samd21e16b.h
│ │ │ │ │ │ ├── samd21e16bu.h
│ │ │ │ │ │ ├── samd21e16l.h
│ │ │ │ │ │ ├── samd21e17a.h
│ │ │ │ │ │ ├── samd21e18a.h
│ │ │ │ │ │ ├── samd21g15a.h
│ │ │ │ │ │ ├── samd21g15b.h
│ │ │ │ │ │ ├── samd21g15l.h
│ │ │ │ │ │ ├── samd21g16a.h
│ │ │ │ │ │ ├── samd21g16b.h
│ │ │ │ │ │ ├── samd21g16l.h
│ │ │ │ │ │ ├── samd21g17a.h
│ │ │ │ │ │ ├── samd21g17au.h
│ │ │ │ │ │ ├── samd21g18a.h
│ │ │ │ │ │ ├── samd21g18au.h
│ │ │ │ │ │ ├── samd21j15a.h
│ │ │ │ │ │ ├── samd21j15b.h
│ │ │ │ │ │ ├── samd21j16a.h
│ │ │ │ │ │ ├── samd21j16b.h
│ │ │ │ │ │ ├── samd21j17a.h
│ │ │ │ │ │ └── samd21j18a.h
│ │ │ │ │ ├── samd21.h
│ │ │ │ │ ├── samd21e15a.h
│ │ │ │ │ ├── samd21e15b.h
│ │ │ │ │ ├── samd21e15bu.h
│ │ │ │ │ ├── samd21e15l.h
│ │ │ │ │ ├── samd21e16a.h
│ │ │ │ │ ├── samd21e16b.h
│ │ │ │ │ ├── samd21e16bu.h
│ │ │ │ │ ├── samd21e16l.h
│ │ │ │ │ ├── samd21e17a.h
│ │ │ │ │ ├── samd21e18a.h
│ │ │ │ │ ├── samd21g15a.h
│ │ │ │ │ ├── samd21g15b.h
│ │ │ │ │ ├── samd21g15l.h
│ │ │ │ │ ├── samd21g16a.h
│ │ │ │ │ ├── samd21g16b.h
│ │ │ │ │ ├── samd21g16l.h
│ │ │ │ │ ├── samd21g17a.h
│ │ │ │ │ ├── samd21g17au.h
│ │ │ │ │ ├── samd21g18a.h
│ │ │ │ │ ├── samd21g18au.h
│ │ │ │ │ ├── samd21j15a.h
│ │ │ │ │ ├── samd21j15b.h
│ │ │ │ │ ├── samd21j16a.h
│ │ │ │ │ ├── samd21j16b.h
│ │ │ │ │ ├── samd21j17a.h
│ │ │ │ │ └── samd21j18a.h
│ │ │ │ │ └── source
│ │ │ │ │ ├── gcc
│ │ │ │ │ └── startup_samd21.c
│ │ │ │ │ ├── system_samd21.c
│ │ │ │ │ └── system_samd21.h
│ │ │ │ ├── compiler.h
│ │ │ │ ├── header_files
│ │ │ │ └── io.h
│ │ │ │ ├── linker_scripts
│ │ │ │ └── samd21
│ │ │ │ │ └── gcc
│ │ │ │ │ └── samd21j18a_flash.ld
│ │ │ │ ├── make
│ │ │ │ └── Makefile.sam.in
│ │ │ │ ├── preprocessor
│ │ │ │ ├── mrecursion.h
│ │ │ │ ├── mrepeat.h
│ │ │ │ ├── preprocessor.h
│ │ │ │ ├── stringz.h
│ │ │ │ └── tpaste.h
│ │ │ │ ├── status_codes.h
│ │ │ │ ├── stdio
│ │ │ │ ├── read.c
│ │ │ │ ├── stdio_serial
│ │ │ │ │ └── stdio_serial.h
│ │ │ │ └── write.c
│ │ │ │ └── syscalls
│ │ │ │ └── gcc
│ │ │ │ └── syscalls.c
│ │ └── thirdparty
│ │ │ ├── CMSIS
│ │ │ ├── ATMEL-disclaimer.txt
│ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf
│ │ │ ├── Include
│ │ │ │ ├── arm_math.h
│ │ │ │ ├── core_cm0plus.h
│ │ │ │ ├── core_cmFunc.h
│ │ │ │ └── core_cmInstr.h
│ │ │ ├── Lib
│ │ │ │ ├── GCC
│ │ │ │ │ └── libarm_cortexM0l_math.a
│ │ │ │ └── license.txt
│ │ │ └── README.txt
│ │ │ └── wireless
│ │ │ └── ble_sdk
│ │ │ ├── ble_services
│ │ │ ├── battery
│ │ │ │ ├── battery.c
│ │ │ │ └── battery.h
│ │ │ ├── ble_mgr
│ │ │ │ ├── ble_manager.c
│ │ │ │ └── ble_manager.h
│ │ │ └── device_infomation
│ │ │ │ ├── device_info.c
│ │ │ │ └── device_info.h
│ │ │ ├── inc
│ │ │ ├── at_ble_api.h
│ │ │ ├── at_ble_errno.h
│ │ │ ├── at_ble_trace.h
│ │ │ ├── platform.h
│ │ │ └── profiles.h
│ │ │ ├── lib
│ │ │ └── cm0p
│ │ │ │ └── gcc
│ │ │ │ └── libble_sdk.a
│ │ │ ├── services
│ │ │ ├── console
│ │ │ │ ├── console_serial.h
│ │ │ │ └── sam0
│ │ │ │ │ └── console_serial.c
│ │ │ ├── serial
│ │ │ │ └── uart
│ │ │ │ │ ├── sam0
│ │ │ │ │ └── serial_drv.c
│ │ │ │ │ └── serial_drv.h
│ │ │ ├── serial_fifo
│ │ │ │ ├── serial_fifo.c
│ │ │ │ └── serial_fifo.h
│ │ │ └── timer
│ │ │ │ ├── sam0
│ │ │ │ └── timer_hw.c
│ │ │ │ └── timer_hw.h
│ │ │ ├── src
│ │ │ └── platform.c
│ │ │ └── utils
│ │ │ └── ble_utils.h
│ │ ├── CLOCKS
│ │ ├── driver_clocks.c
│ │ └── driver_clocks.h
│ │ ├── COMMS
│ │ ├── comms_aux_mcu_defines.h
│ │ ├── comms_bootloader_msg.h
│ │ ├── comms_hid_msgs.c
│ │ ├── comms_hid_msgs.h
│ │ ├── comms_hid_msgs_debug.h
│ │ ├── comms_main_mcu.c
│ │ ├── comms_main_mcu.h
│ │ ├── comms_raw_hid.c
│ │ └── comms_raw_hid.h
│ │ ├── DMA
│ │ ├── dma.c
│ │ └── dma.h
│ │ ├── LOGIC
│ │ ├── logic.c
│ │ ├── logic.h
│ │ ├── logic_battery.c
│ │ ├── logic_battery.h
│ │ ├── logic_bluetooth.c
│ │ ├── logic_bluetooth.h
│ │ ├── logic_keyboard.c
│ │ ├── logic_keyboard.h
│ │ ├── logic_rng.c
│ │ ├── logic_rng.h
│ │ ├── logic_sleep.c
│ │ └── logic_sleep.h
│ │ ├── PLATFORM
│ │ ├── platform_io.c
│ │ └── platform_io.h
│ │ ├── SECURITY
│ │ ├── fuses.c
│ │ └── fuses.h
│ │ ├── TIMER
│ │ ├── driver_timer.c
│ │ └── driver_timer.h
│ │ ├── USB
│ │ ├── udc.c
│ │ ├── udc.h
│ │ ├── usb.c
│ │ ├── usb.h
│ │ ├── usb_descriptors.c
│ │ ├── usb_descriptors.h
│ │ └── usb_utils.h
│ │ ├── asf.h
│ │ ├── atmel_notes.txt
│ │ ├── bootloader.c
│ │ ├── config
│ │ ├── conf_board.h
│ │ ├── conf_clocks.h
│ │ ├── conf_console.h
│ │ ├── conf_extint.h
│ │ ├── conf_serialdrv.h
│ │ ├── conf_timer.h
│ │ └── user_board.h
│ │ ├── debug.c
│ │ ├── debug.h
│ │ ├── defines.h
│ │ ├── device_info_struct.h
│ │ ├── fido2
│ │ ├── cose_key.h
│ │ ├── ctap.c
│ │ ├── ctap.h
│ │ ├── ctap_errors.h
│ │ ├── ctap_parse.c
│ │ ├── ctap_parse.h
│ │ ├── ctaphid.c
│ │ ├── ctaphid.h
│ │ ├── solo_compat_layer.c
│ │ └── solo_compat_layer.h
│ │ ├── main.c
│ │ ├── main.h
│ │ └── platform_defines.h
├── aux_mcu_v2
│ ├── CMakeLists.txt
│ ├── boards
│ │ └── stephanelectronics
│ │ │ └── minible_v2
│ │ │ ├── Kconfig
│ │ │ ├── Kconfig.defconfig
│ │ │ ├── Kconfig.minible_v2
│ │ │ ├── board.cmake
│ │ │ ├── board.yml
│ │ │ ├── minible_v2_nrf52833-pinctrl.dtsi
│ │ │ ├── minible_v2_nrf52833.dts
│ │ │ ├── minible_v2_nrf52833.yaml
│ │ │ ├── minible_v2_nrf52833_defconfig
│ │ │ └── pre_dt_board.cmake
│ ├── prj.conf
│ └── src
│ │ └── main.c
├── main_mcu
│ ├── Device_Startup
│ │ ├── samd21g18a_flash.ld
│ │ └── samd21g18a_sram.ld
│ ├── Makefile
│ ├── Makefile.bootloader
│ ├── Makefile.emu
│ ├── bootloader.atsln
│ ├── bootloader.componentinfo.xml
│ ├── bootloader.cproj
│ ├── debian
│ │ ├── compat
│ │ ├── control
│ │ ├── copyright
│ │ ├── rules
│ │ └── source
│ │ │ └── format
│ ├── emu_assets
│ │ ├── betatester_releases
│ │ │ ├── bundle_not_numbered.img
│ │ │ └── bundle_numbered_with_white_silkscreen.img
│ │ ├── miniblebundle.img
│ │ └── readme.md
│ ├── mini_ble.atsln
│ ├── mini_ble.componentinfo.xml
│ ├── mini_ble.cproj
│ ├── mini_ble_ext.atsln
│ ├── mini_ble_ext.cproj
│ ├── minible_emu.pro
│ ├── minible_emu.pro.user.32ebb7e
│ ├── openocd.cfg
│ └── src
│ │ ├── ACCELEROMETER
│ │ ├── acc_wrapper.h
│ │ ├── lis2dh12.c
│ │ ├── lis2dh12.h
│ │ ├── lis2hh12.c
│ │ └── lis2hh12.h
│ │ ├── ASF
│ │ ├── common
│ │ │ ├── boards
│ │ │ │ └── board.h
│ │ │ └── utils
│ │ │ │ ├── interrupt.h
│ │ │ │ ├── interrupt
│ │ │ │ ├── interrupt_sam_nvic.c
│ │ │ │ └── interrupt_sam_nvic.h
│ │ │ │ └── parts.h
│ │ ├── common2
│ │ │ └── boards
│ │ │ │ └── user_board
│ │ │ │ ├── init.c
│ │ │ │ └── user_board.h
│ │ ├── sam0
│ │ │ ├── drivers
│ │ │ │ └── system
│ │ │ │ │ ├── clock
│ │ │ │ │ ├── clock.h
│ │ │ │ │ ├── clock_samd21_r21_da_ha1
│ │ │ │ │ │ ├── clock.c
│ │ │ │ │ │ ├── clock_config_check.h
│ │ │ │ │ │ ├── clock_feature.h
│ │ │ │ │ │ └── gclk.c
│ │ │ │ │ └── gclk.h
│ │ │ │ │ ├── interrupt
│ │ │ │ │ ├── system_interrupt.c
│ │ │ │ │ ├── system_interrupt.h
│ │ │ │ │ └── system_interrupt_samd21
│ │ │ │ │ │ └── system_interrupt_features.h
│ │ │ │ │ ├── pinmux
│ │ │ │ │ ├── pinmux.c
│ │ │ │ │ ├── pinmux.h
│ │ │ │ │ └── quick_start
│ │ │ │ │ │ └── qs_pinmux_basic.h
│ │ │ │ │ ├── power
│ │ │ │ │ └── power_sam_d_r_h
│ │ │ │ │ │ └── power.h
│ │ │ │ │ ├── reset
│ │ │ │ │ └── reset_sam_d_r_h
│ │ │ │ │ │ └── reset.h
│ │ │ │ │ ├── system.c
│ │ │ │ │ └── system.h
│ │ │ └── utils
│ │ │ │ ├── cmsis
│ │ │ │ └── samd21
│ │ │ │ │ ├── include
│ │ │ │ │ ├── component
│ │ │ │ │ │ ├── ac.h
│ │ │ │ │ │ ├── adc.h
│ │ │ │ │ │ ├── dac.h
│ │ │ │ │ │ ├── dmac.h
│ │ │ │ │ │ ├── dsu.h
│ │ │ │ │ │ ├── eic.h
│ │ │ │ │ │ ├── evsys.h
│ │ │ │ │ │ ├── gclk.h
│ │ │ │ │ │ ├── hmatrixb.h
│ │ │ │ │ │ ├── i2s.h
│ │ │ │ │ │ ├── mtb.h
│ │ │ │ │ │ ├── nvmctrl.h
│ │ │ │ │ │ ├── pac.h
│ │ │ │ │ │ ├── pm.h
│ │ │ │ │ │ ├── port.h
│ │ │ │ │ │ ├── rtc.h
│ │ │ │ │ │ ├── sercom.h
│ │ │ │ │ │ ├── sysctrl.h
│ │ │ │ │ │ ├── tc.h
│ │ │ │ │ │ ├── tcc.h
│ │ │ │ │ │ ├── tcc_lighting.h
│ │ │ │ │ │ ├── usb.h
│ │ │ │ │ │ └── wdt.h
│ │ │ │ │ ├── instance
│ │ │ │ │ │ ├── ac.h
│ │ │ │ │ │ ├── ac1.h
│ │ │ │ │ │ ├── adc.h
│ │ │ │ │ │ ├── dac.h
│ │ │ │ │ │ ├── dmac.h
│ │ │ │ │ │ ├── dsu.h
│ │ │ │ │ │ ├── eic.h
│ │ │ │ │ │ ├── evsys.h
│ │ │ │ │ │ ├── gclk.h
│ │ │ │ │ │ ├── i2s.h
│ │ │ │ │ │ ├── mtb.h
│ │ │ │ │ │ ├── nvmctrl.h
│ │ │ │ │ │ ├── pac0.h
│ │ │ │ │ │ ├── pac1.h
│ │ │ │ │ │ ├── pac2.h
│ │ │ │ │ │ ├── pm.h
│ │ │ │ │ │ ├── port.h
│ │ │ │ │ │ ├── rtc.h
│ │ │ │ │ │ ├── sbmatrix.h
│ │ │ │ │ │ ├── sercom0.h
│ │ │ │ │ │ ├── sercom1.h
│ │ │ │ │ │ ├── sercom2.h
│ │ │ │ │ │ ├── sercom3.h
│ │ │ │ │ │ ├── sercom4.h
│ │ │ │ │ │ ├── sercom5.h
│ │ │ │ │ │ ├── sysctrl.h
│ │ │ │ │ │ ├── tc3.h
│ │ │ │ │ │ ├── tc4.h
│ │ │ │ │ │ ├── tc5.h
│ │ │ │ │ │ ├── tc6.h
│ │ │ │ │ │ ├── tc7.h
│ │ │ │ │ │ ├── tcc0.h
│ │ │ │ │ │ ├── tcc1.h
│ │ │ │ │ │ ├── tcc2.h
│ │ │ │ │ │ ├── usb.h
│ │ │ │ │ │ └── wdt.h
│ │ │ │ │ ├── pio
│ │ │ │ │ │ ├── samd21e15a.h
│ │ │ │ │ │ ├── samd21e15b.h
│ │ │ │ │ │ ├── samd21e15bu.h
│ │ │ │ │ │ ├── samd21e15l.h
│ │ │ │ │ │ ├── samd21e16a.h
│ │ │ │ │ │ ├── samd21e16b.h
│ │ │ │ │ │ ├── samd21e16bu.h
│ │ │ │ │ │ ├── samd21e16l.h
│ │ │ │ │ │ ├── samd21e17a.h
│ │ │ │ │ │ ├── samd21e18a.h
│ │ │ │ │ │ ├── samd21g15a.h
│ │ │ │ │ │ ├── samd21g15b.h
│ │ │ │ │ │ ├── samd21g15l.h
│ │ │ │ │ │ ├── samd21g16a.h
│ │ │ │ │ │ ├── samd21g16b.h
│ │ │ │ │ │ ├── samd21g16l.h
│ │ │ │ │ │ ├── samd21g17a.h
│ │ │ │ │ │ ├── samd21g17au.h
│ │ │ │ │ │ ├── samd21g18a.h
│ │ │ │ │ │ ├── samd21g18au.h
│ │ │ │ │ │ ├── samd21j15a.h
│ │ │ │ │ │ ├── samd21j15b.h
│ │ │ │ │ │ ├── samd21j16a.h
│ │ │ │ │ │ ├── samd21j16b.h
│ │ │ │ │ │ ├── samd21j17a.h
│ │ │ │ │ │ └── samd21j18a.h
│ │ │ │ │ ├── samd21.h
│ │ │ │ │ ├── samd21e15a.h
│ │ │ │ │ ├── samd21e15b.h
│ │ │ │ │ ├── samd21e15bu.h
│ │ │ │ │ ├── samd21e15l.h
│ │ │ │ │ ├── samd21e16a.h
│ │ │ │ │ ├── samd21e16b.h
│ │ │ │ │ ├── samd21e16bu.h
│ │ │ │ │ ├── samd21e16l.h
│ │ │ │ │ ├── samd21e17a.h
│ │ │ │ │ ├── samd21e18a.h
│ │ │ │ │ ├── samd21g15a.h
│ │ │ │ │ ├── samd21g15b.h
│ │ │ │ │ ├── samd21g15l.h
│ │ │ │ │ ├── samd21g16a.h
│ │ │ │ │ ├── samd21g16b.h
│ │ │ │ │ ├── samd21g16l.h
│ │ │ │ │ ├── samd21g17a.h
│ │ │ │ │ ├── samd21g17au.h
│ │ │ │ │ ├── samd21g18a.h
│ │ │ │ │ ├── samd21g18au.h
│ │ │ │ │ ├── samd21j15a.h
│ │ │ │ │ ├── samd21j15b.h
│ │ │ │ │ ├── samd21j16a.h
│ │ │ │ │ ├── samd21j16b.h
│ │ │ │ │ ├── samd21j17a.h
│ │ │ │ │ └── samd21j18a.h
│ │ │ │ │ └── source
│ │ │ │ │ ├── gcc
│ │ │ │ │ └── startup_samd21.c
│ │ │ │ │ ├── system_samd21.c
│ │ │ │ │ └── system_samd21.h
│ │ │ │ ├── compiler.h
│ │ │ │ ├── header_files
│ │ │ │ └── io.h
│ │ │ │ ├── linker_scripts
│ │ │ │ └── samd21
│ │ │ │ │ └── gcc
│ │ │ │ │ └── samd21g18a_flash.ld
│ │ │ │ ├── make
│ │ │ │ └── Makefile.sam.in
│ │ │ │ ├── preprocessor
│ │ │ │ ├── mrecursion.h
│ │ │ │ ├── mrepeat.h
│ │ │ │ ├── preprocessor.h
│ │ │ │ ├── stringz.h
│ │ │ │ └── tpaste.h
│ │ │ │ ├── status_codes.h
│ │ │ │ └── syscalls
│ │ │ │ └── gcc
│ │ │ │ └── syscalls.c
│ │ └── thirdparty
│ │ │ └── CMSIS
│ │ │ ├── ATMEL-disclaimer.txt
│ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf
│ │ │ ├── Include
│ │ │ ├── arm_math.h
│ │ │ ├── core_cm0plus.h
│ │ │ ├── core_cmFunc.h
│ │ │ └── core_cmInstr.h
│ │ │ ├── Lib
│ │ │ ├── GCC
│ │ │ │ └── libarm_cortexM0l_math.a
│ │ │ └── license.txt
│ │ │ └── README.txt
│ │ ├── CLOCKS
│ │ ├── driver_clocks.c
│ │ └── driver_clocks.h
│ │ ├── COMMS
│ │ ├── comms_aux_mcu.c
│ │ ├── comms_aux_mcu.h
│ │ ├── comms_aux_mcu_defines.h
│ │ ├── comms_bootloader_msg.h
│ │ ├── comms_hid_defines.h
│ │ ├── comms_hid_msgs.c
│ │ ├── comms_hid_msgs.h
│ │ ├── comms_hid_msgs_debug.c
│ │ ├── comms_hid_msgs_debug.h
│ │ └── comms_hid_msgs_debug_defines.h
│ │ ├── CRYPTO
│ │ ├── monocypher-ed25519.c
│ │ ├── monocypher-ed25519.h
│ │ ├── monocypher.c
│ │ └── monocypher.h
│ │ ├── DMA
│ │ ├── dma.c
│ │ └── dma.h
│ │ ├── EMU
│ │ ├── asf.h
│ │ ├── dataflash.c
│ │ ├── dbflash.c
│ │ ├── dma.c
│ │ ├── driver_sercom.c
│ │ ├── emu_aux_mcu.c
│ │ ├── emu_aux_mcu.h
│ │ ├── emu_dataflash.h
│ │ ├── emu_oled.cpp
│ │ ├── emu_oled.h
│ │ ├── emu_smartcard.cpp
│ │ ├── emu_smartcard.h
│ │ ├── emu_storage.cpp
│ │ ├── emu_storage.h
│ │ ├── emulator.cpp
│ │ ├── emulator.h
│ │ ├── emulator_ui.cpp
│ │ ├── emulator_ui.h
│ │ ├── fuses.c
│ │ ├── lis2hh12.c
│ │ ├── mp2710.c
│ │ ├── platform_io.c
│ │ ├── qt_metacall_helper.h
│ │ └── smartcard_lowlevel.c
│ │ ├── FILESYSTEM
│ │ ├── custom_bitstream.c
│ │ ├── custom_bitstream.h
│ │ ├── custom_fs.c
│ │ ├── custom_fs.h
│ │ ├── custom_fs_defines.h
│ │ ├── custom_fs_emergency_font.c
│ │ ├── custom_fs_emergency_font.h
│ │ └── text_ids.h
│ │ ├── FLASH
│ │ ├── dataflash.c
│ │ ├── dataflash.h
│ │ ├── dbflash.c
│ │ └── dbflash.h
│ │ ├── GUI
│ │ ├── gui_carousel.c
│ │ ├── gui_carousel.h
│ │ ├── gui_dispatcher.c
│ │ ├── gui_dispatcher.h
│ │ ├── gui_menu.c
│ │ ├── gui_menu.h
│ │ ├── gui_prompts.c
│ │ └── gui_prompts.h
│ │ ├── I2C
│ │ ├── driver_i2c.c
│ │ ├── driver_i2c.h
│ │ ├── mp2710.c
│ │ ├── mp2710.h
│ │ ├── pcf85263a.c
│ │ └── pcf85263a.h
│ │ ├── INPUTS
│ │ ├── inputs.c
│ │ └── inputs.h
│ │ ├── LOGIC
│ │ ├── logic_accelerometer.c
│ │ ├── logic_accelerometer.h
│ │ ├── logic_aux_mcu.c
│ │ ├── logic_aux_mcu.h
│ │ ├── logic_bluetooth.c
│ │ ├── logic_bluetooth.h
│ │ ├── logic_database.c
│ │ ├── logic_database.h
│ │ ├── logic_device.c
│ │ ├── logic_device.h
│ │ ├── logic_encryption.c
│ │ ├── logic_encryption.h
│ │ ├── logic_fido2.c
│ │ ├── logic_fido2.h
│ │ ├── logic_gui.c
│ │ ├── logic_gui.h
│ │ ├── logic_power.c
│ │ ├── logic_power.h
│ │ ├── logic_security.c
│ │ ├── logic_security.h
│ │ ├── logic_smartcard.c
│ │ ├── logic_smartcard.h
│ │ ├── logic_user.c
│ │ └── logic_user.h
│ │ ├── NODEMGMT
│ │ ├── nodemgmt.c
│ │ ├── nodemgmt.h
│ │ └── nodemgmt_defines.h
│ │ ├── OLED
│ │ ├── mooltipass_graphics_bundle.c
│ │ ├── mooltipass_graphics_bundle.h
│ │ ├── oled_wrapper.h
│ │ ├── sh1122.c
│ │ ├── sh1122.h
│ │ ├── ssd1363.c
│ │ └── ssd1363.h
│ │ ├── PLATFORM
│ │ ├── platform_io.c
│ │ └── platform_io.h
│ │ ├── RNG
│ │ ├── rng.c
│ │ └── rng.h
│ │ ├── SECURITY
│ │ ├── fuses.c
│ │ └── fuses.h
│ │ ├── SERCOM
│ │ ├── driver_sercom.c
│ │ └── driver_sercom.h
│ │ ├── SE_SMARTCARD
│ │ ├── se_smartcard_wrapper.h
│ │ ├── smartcard_highlevel.c
│ │ ├── smartcard_highlevel.h
│ │ ├── smartcard_lowlevel.c
│ │ └── smartcard_lowlevel.h
│ │ ├── TIMER
│ │ ├── driver_timer.c
│ │ └── driver_timer.h
│ │ ├── asf.h
│ │ ├── boot_functions.c
│ │ ├── bootloader.c
│ │ ├── config
│ │ ├── conf_board.h
│ │ └── conf_clocks.h
│ │ ├── debug_minible.c
│ │ ├── debug_minible.h
│ │ ├── debug_minible_v2.c
│ │ ├── debug_minible_v2.h
│ │ ├── debug_wrapper.h
│ │ ├── defines.h
│ │ ├── fido2_values_defines.h
│ │ ├── functional_testing.c
│ │ ├── functional_testing.h
│ │ ├── main.c
│ │ ├── main.h
│ │ ├── platform_defines.h
│ │ ├── utils.c
│ │ └── utils.h
└── packs
│ ├── CMSIS
│ └── include
│ │ ├── arm_common_tables.h
│ │ ├── arm_const_structs.h
│ │ ├── arm_math.h
│ │ ├── cmsis_armcc.h
│ │ ├── cmsis_armclang.h
│ │ ├── cmsis_compiler.h
│ │ ├── cmsis_gcc.h
│ │ ├── core_armv8mbl.h
│ │ ├── core_armv8mml.h
│ │ ├── core_cm0.h
│ │ ├── core_cm0plus.h
│ │ ├── core_cm23.h
│ │ ├── core_cm3.h
│ │ ├── core_cm33.h
│ │ ├── core_cm4.h
│ │ ├── core_cm7.h
│ │ ├── core_sc000.h
│ │ ├── core_sc300.h
│ │ └── tz_context.h
│ └── samd21a
│ └── include
│ ├── component-version.h
│ ├── component
│ ├── ac.h
│ ├── adc.h
│ ├── dac.h
│ ├── dmac.h
│ ├── dsu.h
│ ├── eic.h
│ ├── evsys.h
│ ├── gclk.h
│ ├── hmatrixb.h
│ ├── i2s.h
│ ├── mtb.h
│ ├── nvmctrl.h
│ ├── pac.h
│ ├── pm.h
│ ├── port.h
│ ├── rtc.h
│ ├── sercom.h
│ ├── sysctrl.h
│ ├── tc.h
│ ├── tcc.h
│ ├── usb.h
│ └── wdt.h
│ ├── instance
│ ├── ac.h
│ ├── adc.h
│ ├── dac.h
│ ├── dmac.h
│ ├── dsu.h
│ ├── eic.h
│ ├── evsys.h
│ ├── gclk.h
│ ├── i2s.h
│ ├── mtb.h
│ ├── nvmctrl.h
│ ├── pac0.h
│ ├── pac1.h
│ ├── pac2.h
│ ├── pm.h
│ ├── port.h
│ ├── ptc.h
│ ├── rtc.h
│ ├── sbmatrix.h
│ ├── sercom0.h
│ ├── sercom1.h
│ ├── sercom2.h
│ ├── sercom3.h
│ ├── sercom4.h
│ ├── sercom5.h
│ ├── sysctrl.h
│ ├── tc3.h
│ ├── tc4.h
│ ├── tc5.h
│ ├── tc6.h
│ ├── tc7.h
│ ├── tcc0.h
│ ├── tcc1.h
│ ├── tcc2.h
│ ├── usb.h
│ └── wdt.h
│ ├── pio
│ ├── samd21e15a.h
│ ├── samd21e16a.h
│ ├── samd21e17a.h
│ ├── samd21e18a.h
│ ├── samd21g15a.h
│ ├── samd21g16a.h
│ ├── samd21g17a.h
│ ├── samd21g17au.h
│ ├── samd21g18a.h
│ ├── samd21g18au.h
│ ├── samd21j15a.h
│ ├── samd21j16a.h
│ ├── samd21j17a.h
│ └── samd21j18a.h
│ ├── sam.h
│ ├── samd21.h
│ ├── samd21e15a.h
│ ├── samd21e16a.h
│ ├── samd21e17a.h
│ ├── samd21e18a.h
│ ├── samd21g15a.h
│ ├── samd21g16a.h
│ ├── samd21g17a.h
│ ├── samd21g17au.h
│ ├── samd21g18a.h
│ ├── samd21g18au.h
│ ├── samd21j15a.h
│ ├── samd21j16a.h
│ ├── samd21j17a.h
│ ├── samd21j18a.h
│ └── system_samd21.h
├── wiki
└── images
│ ├── aux_main_prot
│ ├── aux_main_prot1.png
│ └── aux_main_prot2.png
│ ├── emulator_tuto
│ ├── 0_qt_options.png
│ ├── 1_project_configuration.PNG
│ ├── 2_compilation_start.PNG
│ ├── 3_missing_bundle.PNG
│ ├── 3_missing_bundle_ubuntu.PNG
│ ├── 4_emulator_working.PNG
│ └── 4_emulator_working_ubuntu.PNG
│ ├── minible_highlevel.png
│ └── minible_update_guide
│ ├── ble_about_tab_fw_version.png
│ ├── ble_bundle_version.png
│ ├── ble_dev_tab_new_upload.png
│ ├── ble_dev_tab_oneclick.PNG
│ ├── ble_dev_tab_upload.png
│ ├── ble_dev_tab_upload_flash.png
│ ├── ble_dev_tab_upload_flash_new.png
│ ├── firmware_file_update.png
│ ├── minible_update_with_password.png
│ └── update_file_win.png
└── windows_bt_debugging.md
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ''
5 | labels: 'being clarified'
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Expected behavior
11 |
12 | ### Actual behavior
13 |
14 | ### Step by step guide to reproduce the problem
15 |
16 | ### Firmware Version
17 | AUX MCU version:
18 | Main MCU version:
19 | Bundle version:
20 |
21 | ### Moolticute Version - If Involved
22 |
23 | ### Operating System
24 | Mention if you are using either:
25 | - Windows 7/10
26 | - Debian Based distribution
27 | - Other Linux distribution
28 | - MacOS
29 |
30 | Other operating systems are not supported.
31 |
32 | ### Mooltipass Extension
33 | - If you're creating an issue to report a website incompatibility, please use the "Report incompatibilities with this website" item in the extension menu.
34 | - If you're creating an issue to report a problem with our extension, please create another issue here:
35 | https://github.com/mooltipass/extension/issues
36 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ''
5 | labels: ''
6 | assignees: ''
7 |
8 | ---
9 |
10 | ### Missing feature
11 |
12 | ### Justification
13 | Tell us why you would like to see this feature added.
14 |
15 | ### Workarounds
16 | Are there any workarounds you currently have in place because the feature is missing?
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | source_code/aux_mcu/Debug/
2 | source_code/aux_mcu/Release/
3 | source_code/aux_mcu_v2/build/
4 | source_code/main_mcu/Debug/
5 | source_code/main_mcu/Debug_V5/
6 | source_code/main_mcu/Debug_V6/
7 | source_code/main_mcu/Debug_V7/
8 | source_code/main_mcu/Release/
9 | source_code/main_mcu/Release_V5/
10 | source_code/main_mcu/Release_V6/
11 | source_code/main_mcu/Release_V7/
12 | source_code/main_mcu/V2_Release_V1dev/
13 | source_code/main_mcu/V2_Debug_V1dev/
14 | source_code/main_mcu/.vs/*
15 | source_code/aux_mcu/.vs/*
16 | scripts/battery_monitor/*.txt
17 | *Thumbs.db
18 | *~
19 | *.pyc
20 | source_code/main_mcu/minible_emu.pro.user
21 | source_code/build-*
22 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "source_code/main_mcu/src/BearSSL"]
2 | path = source_code/main_mcu/src/BearSSL
3 | url = https://www.bearssl.org/git/BearSSL
4 | [submodule "source_code/aux_mcu/src/tinycbor"]
5 | path = source_code/aux_mcu/src/tinycbor
6 | url = https://github.com/intel/tinycbor
7 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | sudo: required
2 | services:
3 | - docker
4 | dist: trusty
5 | os:
6 | - linux
7 | #- osx
8 | language: cpp
9 |
10 | before_install:
11 | - git fetch --tags && git fetch
12 | - ./scripts/ci/$TRAVIS_OS_NAME/before_install.sh
13 |
14 | install:
15 | - ./scripts/ci/$TRAVIS_OS_NAME/install.sh
16 |
17 | script:
18 | - ./scripts/ci/$TRAVIS_OS_NAME/script.sh
19 |
20 | after_success:
21 | - ./scripts/ci/$TRAVIS_OS_NAME/after_success.sh
22 |
23 | #only watch master and tagged release
24 | branches:
25 | only:
26 | - /^v.*$/
27 | - master
28 | - /^testing-v.*$/
29 |
--------------------------------------------------------------------------------
/MooltipassMiniBLEUserManual.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/MooltipassMiniBLEUserManual.pdf
--------------------------------------------------------------------------------
/MooltipassMiniBLEUserManual_FR.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/MooltipassMiniBLEUserManual_FR.pdf
--------------------------------------------------------------------------------
/_readme_assets/ble_architecture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/ble_architecture.png
--------------------------------------------------------------------------------
/_readme_assets/ble_vaults_cards.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/ble_vaults_cards.png
--------------------------------------------------------------------------------
/_readme_assets/dev_board.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/dev_board.PNG
--------------------------------------------------------------------------------
/_readme_assets/emulator_working_ubuntu.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/emulator_working_ubuntu.PNG
--------------------------------------------------------------------------------
/_readme_assets/licenses.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/licenses.PNG
--------------------------------------------------------------------------------
/_readme_assets/minible_front.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/_readme_assets/minible_front.jpg
--------------------------------------------------------------------------------
/scripts/battery_monitor/mooltipass_defines.py:
--------------------------------------------------------------------------------
1 | # Timeout for reading data in ms
2 | USB_READ_TIMEOUT = 10000
3 |
4 | # Device VID & PID
5 | USB_VID = 0x1209
6 | USB_PID = 0x4321
7 |
8 | # TLV Field indexes
9 | LEN_INDEX = 0x00
10 | CMD_INDEX = 0x01
11 | DATA_INDEX = 0x02
12 |
13 | # Field Indexes
14 | PREV_ADDRESS_INDEX = 0x02
15 | NEXT_ADDRESS_INDEX = 0x04
16 | NEXT_CHILD_INDEX = 0x06
17 | SERVICE_INDEX = 0x08
18 | DESC_INDEX = 6
19 | LOGIN_INDEX = 37
20 |
21 | # Sizes
22 | NODE_SIZE = 132
23 | DEVICE_PASSWORD_SIZE = 62
24 | MINI_DEVICE_PASSWORD_SIZE = 16
25 | UID_REQUEST_KEY_SIZE = 16
26 | UID_KEY_SIZE = 6
27 | AES_KEY_SIZE = 32
28 | AES_BLOCK_SIZE = 16
29 |
30 | # Ack / Nack defines
31 | CMD_HID_ACK = 0x01
32 | CMD_HID_NACK = 0x00
33 |
34 | # New Command IDs
35 | CMD_PING = 0x0001
36 | CMD_ID_RETRY = 0x0002
37 | CMD_ID_GET_STATUS = 0x0011
38 |
39 | # New Debug Command IDs
40 | CMD_DBG_MESSAGE = 0x8000
41 | CMD_DBG_OPEN_DISP_BUFFER = 0x8001
42 | CMD_DBG_SEND_TO_DISP_BUFFER = 0x8002
43 | CMD_DBG_CLOSE_DISP_BUFFER = 0x8003
44 | CMD_DBG_ERASE_DATA_FLASH = 0x8004
45 | CMD_DBG_IS_DATA_FLASH_READY = 0x8005
46 | CMD_DBG_DATAFLASH_WRITE_256B = 0x8006
47 | CMD_DBG_REBOOT_TO_BOOTLOADER = 0x8007
48 | CMD_DBG_GET_ACC_32_SAMPLES = 0x8008
49 | CMD_DBG_FLASH_AUX_MCU = 0x8009
50 | CMD_DBG_GET_PLAT_INFO = 0x800A
51 | CMD_DBG_REINDEX_BUNDLE = 0x800B
52 | CMD_DBG_SET_OLED_PARAMS = 0x800C
53 | CMD_DBG_GET_BATTERY_STATUS = 0x800D
--------------------------------------------------------------------------------
/scripts/battery_monitor/readme.md:
--------------------------------------------------------------------------------
1 | This is a tool to experiment with the different OLED screen parameters
2 |
--------------------------------------------------------------------------------
/scripts/ci/linux/after_success.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5 | source $SCRIPTDIR/../funcs.sh
6 |
7 | VERSION="$(get_version .)"
8 |
9 | #Only build if the commit we are building is for the last tag
10 | if [ "$(git rev-list -n 1 $VERSION)" != "$(git rev-parse HEAD)" ]; then
11 | echo "Not uploading package"
12 | exit 0
13 | fi
14 |
15 | # Debian package
16 | docker exec minible-deb bash /scripts/build_source.sh $VERSION xenial
17 | docker exec minible-deb bash /scripts/build_source.sh $VERSION bionic
18 | docker exec minible-deb bash /scripts/build_source.sh $VERSION jammy
19 | docker exec minible-deb bash /scripts/build_source.sh $VERSION impish
20 | docker exec minible-deb bash /scripts/build_source.sh $VERSION focal
21 |
22 | #prepare files to upload volume
23 | mkdir -p $HOME/uploads
24 | cp -v \
25 | output/*.{exe,img} \
26 | $HOME/uploads/
27 |
28 | EXE_FILE="$(ls $HOME/uploads/*.exe 2> /dev/null | head -n 1)"
29 |
30 | docker run -t --name minible-upload -d \
31 | -v $HOME/uploads:/uploads \
32 | -e "GITHUB_LOGIN=${GITHUB_LOGIN}" \
33 | -e "GITHUB_TOKEN=${GITHUB_TOKEN}" \
34 | mooltipass/minible-upload
35 |
36 | for f in $HOME/uploads/*
37 | do
38 | ff=$(basename $f)
39 | echo uploading $ff
40 | if [ -f $HOME/uploads/$ff ]
41 | then
42 | docker exec minible-upload bash -c "/scripts/upload.sh $VERSION $ff"
43 | fi
44 | done
45 |
--------------------------------------------------------------------------------
/scripts/ci/linux/before_install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5 | source $SCRIPTDIR/../funcs.sh
6 |
7 | # Docker
8 | docker pull mooltipass/minible-win-builder
9 | docker pull mooltipass/minible-launchpad
10 | docker pull mooltipass/minible-upload
11 |
12 | #setup the source dir for ubuntu deb
13 | rm -fr $HOME/build-debs && mkdir -p $HOME/build-debs
14 | echo -e $LAUNCHPAD_GPG_PUB > $HOME/build-debs/gpgkey_pub.asc
15 | echo -e $LAUNCHPAD_GPG_PRIV > $HOME/build-debs/gpgkey_sec.asc
16 | echo "$LAUNCHPAD_GPG_PASS" > $HOME/build-debs/passphrase.txt
17 | echo -e $LAUNCHPAD_SSH_KEY > $HOME/build-debs/ssh_launchpad.key
18 |
--------------------------------------------------------------------------------
/scripts/ci/linux/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | docker run -t --name miniblebuilder -d \
5 | -v $(pwd):/minible \
6 | mooltipass/minible-win-builder
7 |
8 | docker run -t --name minible-deb -d \
9 | -v $HOME/build-debs:/minible \
10 | mooltipass/minible-launchpad
11 |
12 | docker ps
13 |
--------------------------------------------------------------------------------
/scripts/ci/linux/script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5 | source $SCRIPTDIR/../funcs.sh
6 |
7 | #copy source for debian package
8 | make_version . deb
9 | cp -R . $HOME/build-debs/minible-${DEB_VERSION}
10 |
11 | # Windows build
12 | make_version . windows
13 | docker exec miniblebuilder /bin/bash /scripts/build.sh
14 |
15 |
--------------------------------------------------------------------------------
/scripts/ci/osx/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleIconFile
6 | icon.icns
7 | CFBundlePackageType
8 | APPL
9 | CFBundleGetInfoString
10 | Created by Qt/QMake
11 | CFBundleSignature
12 | ????
13 | CFBundleExecutable
14 | moolticute
15 | CFBundleIdentifier
16 | com.mooltipass.moolticute
17 | NOTE
18 | This file was generated by Qt/QMake.
19 | NSPrincipalClass
20 | NSApplication
21 | NSHighResolutionCapable
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/scripts/ci/osx/before_install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | #try to fix travis osx issue: https://github.com/travis-ci/travis-ci/issues/6522
4 | if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then
5 | rvm get head || true
6 | fi
7 |
8 | rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install6
9 |
10 | npm install npm
11 | mv node_modules npm
12 | npm/.bin/npm --version
13 | nvm install v6.12.3
14 | nvm use 6.12.3
15 | npm/.bin/npm --version
16 | node --version
17 |
18 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
19 | source $SCRIPTDIR/../funcs.sh
20 |
21 | osx_setup_netrc $HOME
22 |
23 | #create certificate from env
24 | echo $CODESIGN_OSX_CERT| base64 -D > $HOME/cert.p12
25 |
--------------------------------------------------------------------------------
/scripts/ci/osx/icon.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/ci/osx/icon.icns
--------------------------------------------------------------------------------
/scripts/ci/osx/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | echo "install.sh"
5 |
6 | brew update > /dev/null
7 | brew install qt5 jq lftp
8 |
--------------------------------------------------------------------------------
/scripts/ci/osx/script.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | set -ev
3 |
4 | SCRIPTDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5 | source $SCRIPTDIR/../funcs.sh
6 |
7 | mkdir build
8 | pushd build
9 |
10 | QTDIR="/usr/local/opt/qt5"
11 | PATH="$QTDIR/bin:$PATH"
12 | LDFLAGS=-L$QTDIR/lib
13 | CPPFLAGS=-I$QTDIR/include
14 |
15 | make_version .. macos
16 |
17 | qmake ../Moolticute.pro
18 |
19 | # Compund exit codes of make and the tests.
20 | make && ./tests/tests
21 |
22 | popd
23 |
--------------------------------------------------------------------------------
/scripts/csv_cred_generator/generator.py:
--------------------------------------------------------------------------------
1 | import random
2 | import string
3 |
4 | def get_random_string(length):
5 | letters = string.ascii_lowercase
6 | result_str = ''.join(random.choice(letters) for i in range(length))
7 | return result_str
8 |
9 | nb_creds = input("Number of credentials (default 1000): ")
10 |
11 | if nb_creds == "":
12 | nb_creds = 1000
13 | else:
14 | nb_creds = int(nb_creds)
15 |
16 | f = open("fakecreds.csv", "w")
17 | for i in range(nb_creds):
18 | f.write(get_random_string(1) + "service_" + get_random_string(5) + ",login_" + get_random_string(5) + ",pass_" + get_random_string(5)+"\n")
19 | f.close()
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | keyboards
4 | CLDR Keyboard mapping
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/android/_platform.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/chromeos/_platform.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/dtd/ldmlPlatform.dtd:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/osx/_platform.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/windows/_platform.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/scripts/keyboards/cldr-keyboards-37.0/keyboards/windows/ga-Ogam-t-k0-windows.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/scripts/keyboards/iso_to_hid_lut.py:
--------------------------------------------------------------------------------
1 |
2 | iso_to_hid_dic = { "E00": 0x35, \
3 | "E01": 0x1E, \
4 | "E02": 0x1F, \
5 | "E03": 0x20, \
6 | "E04": 0x21, \
7 | "E05": 0x22, \
8 | "E06": 0x23, \
9 | "E07": 0x24, \
10 | "E08": 0x25, \
11 | "E09": 0x26, \
12 | "E10": 0x27, \
13 | "E11": 0x2D, \
14 | "E12": 0x2E, \
15 | "E13": 0x2A, \
16 | "D00": 0x2B, \
17 | "D01": 0x14, \
18 | "D02": 0x1A, \
19 | "D03": 0x08, \
20 | "D04": 0x15, \
21 | "D05": 0x17, \
22 | "D06": 0x1C, \
23 | "D07": 0x18, \
24 | "D08": 0x0C, \
25 | "D09": 0x12, \
26 | "D10": 0x13, \
27 | "D11": 0x2F, \
28 | "D12": 0x30, \
29 | "D13": 0x32, \
30 | "C00": 0x39, \
31 | "C01": 0x04, \
32 | "C02": 0x16, \
33 | "C03": 0x07, \
34 | "C04": 0x09, \
35 | "C05": 0x0A, \
36 | "C06": 0x0B, \
37 | "C07": 0x0D, \
38 | "C08": 0x0E, \
39 | "C09": 0x0F, \
40 | "C10": 0x33, \
41 | "C11": 0x34, \
42 | "C12": 0x31, \
43 | "C13": 0x2B, \
44 | "B00": 0x64, \
45 | "B01": 0x1D, \
46 | "B02": 0x1B, \
47 | "B03": 0x06, \
48 | "B04": 0x19, \
49 | "B05": 0x05, \
50 | "B06": 0x11, \
51 | "B07": 0x10, \
52 | "B08": 0x36, \
53 | "B09": 0x37, \
54 | "B10": 0x38, \
55 | "B11": 0xE5, \
56 | "A03": 0x2C, \
57 | }
--------------------------------------------------------------------------------
/scripts/oled_parameter_set/mooltipass_defines.py:
--------------------------------------------------------------------------------
1 | # Timeout for reading data in ms
2 | USB_READ_TIMEOUT = 10000
3 |
4 | # Device VID & PID
5 | USB_VID = 0x1209
6 | USB_PID = 0x4321
7 |
8 | # TLV Field indexes
9 | LEN_INDEX = 0x00
10 | CMD_INDEX = 0x01
11 | DATA_INDEX = 0x02
12 |
13 | # Field Indexes
14 | PREV_ADDRESS_INDEX = 0x02
15 | NEXT_ADDRESS_INDEX = 0x04
16 | NEXT_CHILD_INDEX = 0x06
17 | SERVICE_INDEX = 0x08
18 | DESC_INDEX = 6
19 | LOGIN_INDEX = 37
20 |
21 | # Sizes
22 | NODE_SIZE = 132
23 | DEVICE_PASSWORD_SIZE = 62
24 | MINI_DEVICE_PASSWORD_SIZE = 16
25 | UID_REQUEST_KEY_SIZE = 16
26 | UID_KEY_SIZE = 6
27 | AES_KEY_SIZE = 32
28 | AES_BLOCK_SIZE = 16
29 |
30 | # Ack / Nack defines
31 | CMD_HID_ACK = 0x01
32 | CMD_HID_NACK = 0x00
33 |
34 | # New Command IDs
35 | CMD_PING = 0x0001
36 |
37 | # New Debug Command IDs
38 | CMD_DBG_MESSAGE = 0x8000
39 | CMD_DBG_OPEN_DISP_BUFFER = 0x8001
40 | CMD_DBG_SEND_TO_DISP_BUFFER = 0x8002
41 | CMD_DBG_CLOSE_DISP_BUFFER = 0x8003
42 | CMD_DBG_ERASE_DATA_FLASH = 0x8004
43 | CMD_DBG_IS_DATA_FLASH_READY = 0x8005
44 | CMD_DBG_DATAFLASH_WRITE_256B = 0x8006
45 | CMD_DBG_REBOOT_TO_BOOTLOADER = 0x8007
46 | CMD_DBG_GET_ACC_32_SAMPLES = 0x8008
47 | CMD_DBG_FLASH_AUX_MCU = 0x8009
48 | CMD_DBG_GET_PLAT_INFO = 0x800A
49 | CMD_DBG_REINDEX_BUNDLE = 0x800B
50 | CMD_DBG_SET_OLED_PARAMS = 0x800C
--------------------------------------------------------------------------------
/scripts/oled_parameter_set/readme.md:
--------------------------------------------------------------------------------
1 | This is a tool to experiment with the different OLED screen parameters
2 |
--------------------------------------------------------------------------------
/scripts/python_framework/FreeSans.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/FreeSans.ttf
--------------------------------------------------------------------------------
/scripts/python_framework/_install_reqs.sh:
--------------------------------------------------------------------------------
1 | sudo apt update
2 | sudo apt-get install -y python3-pip libgmp-dev libmpfr-dev libmpc-dev git libatlas-base-dev libopenjp2-7 libtiff5 bluetooth libbluetooth-dev < /dev/null
3 | sudo python3 -m pip install -r requirements.txt
4 | sudo python3 -m pip install pybluez
--------------------------------------------------------------------------------
/scripts/python_framework/bundle.img:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/bundle.img
--------------------------------------------------------------------------------
/scripts/python_framework/fullframe.bmp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/fullframe.bmp
--------------------------------------------------------------------------------
/scripts/python_framework/greyscale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/greyscale.png
--------------------------------------------------------------------------------
/scripts/python_framework/miniblebundle.img:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/miniblebundle.img
--------------------------------------------------------------------------------
/scripts/python_framework/multi_device_recondition.py:
--------------------------------------------------------------------------------
1 | from mooltipass_hid_device import *
2 | from datetime import datetime
3 | import threading
4 | import time
5 | import sys
6 | import os
7 | waiting_for_disconnect = False
8 |
9 |
10 | def device_connect_try_and_recondition():
11 | global waiting_for_disconnect
12 |
13 | # Temporary device constructor
14 | mooltipass_device = mooltipass_hid_device()
15 |
16 | # Try to connect to a new device
17 | if mooltipass_device.connect(False) == False:
18 | return
19 |
20 | # Receive status message
21 | print("Connected to a new USB device")
22 | time.sleep(3)
23 |
24 | # While loop
25 | while True:
26 | # Start reconditioning
27 | nb_secs = mooltipass_device.recondition()
28 |
29 | # Check for length
30 | if nb_secs > 2500:
31 | print(str(datetime.now().strftime("%H:%M")) + " Reconditioning completed with " + str(nb_secs) + " seconds, stopping there")
32 | break
33 | else:
34 | print(str(datetime.now().strftime("%H:%M")) + " Reconditioning completed with " + str(nb_secs) + " seconds, continuing....")
35 |
36 | # Tell the device to switch off after disconnect
37 | mooltipass_device.device.sendHidMessageWaitForAck(mooltipass_device.getPacketForCommand(0x0039, None), True)
38 |
39 | # Enable tutorial
40 | device_settings = mooltipass_device.device.sendHidMessageWaitForAck(mooltipass_device.getPacketForCommand(CMD_ID_GET_DEVICE_SETTINGS, None), True)
41 | device_settings["data"] = list(device_settings["data"])
42 | device_settings["data"][16] = 0xFF
43 | mooltipass_device.device.sendHidMessageWaitForAck(mooltipass_device.getPacketForCommand(CMD_ID_SET_DEVICE_SETTINGS, device_settings["data"]), True)
44 |
45 | # Wait for disconnection (do not change the order below!)
46 | print("Please disconnect device")
47 | mooltipass_device.waitForDisconnect()
48 | waiting_for_disconnect = True
49 | time.sleep(2)
50 | waiting_for_disconnect = False
51 |
52 | def main():
53 | while True:
54 | if waiting_for_disconnect == False:
55 | threading.Thread(name="Device connection try thread", target=device_connect_try_and_recondition, daemon=True).start()
56 | time.sleep(4)
57 |
58 | if __name__ == "__main__":
59 | main()
60 |
--------------------------------------------------------------------------------
/scripts/python_framework/randombytes.bin:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/python_framework/randombytes.bin
--------------------------------------------------------------------------------
/scripts/python_framework/requirements.txt:
--------------------------------------------------------------------------------
1 | python-resize-image
2 | pyusb
3 | python-barcode
4 | brother_ql
--------------------------------------------------------------------------------
/scripts/smc_decode/REF-ACR38x-CCID-6.05.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/smc_decode/REF-ACR38x-CCID-6.05.pdf
--------------------------------------------------------------------------------
/scripts/smc_decode/reader-card-alignment.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/scripts/smc_decode/reader-card-alignment.jpeg
--------------------------------------------------------------------------------
/scripts/uart_spy/_run.bat:
--------------------------------------------------------------------------------
1 | @echo off
2 | @start realterm.exe baud=3000000 portquit=17 display=2 cols=140 rows=80
3 | @exit
--------------------------------------------------------------------------------
/source_code/aux_mcu/ATBTLC1000-BluSDK-Example-Profiles-Application-User's-Guide.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/aux_mcu/ATBTLC1000-BluSDK-Example-Profiles-Application-User's-Guide.pdf
--------------------------------------------------------------------------------
/source_code/aux_mcu/Device_Startup/system_samd21.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup.
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #include "samd21.h"
31 |
32 | /**
33 | * Initial system clock frequency. The System RC Oscillator (RCSYS) provides
34 | * the source for the main clock at chip startup.
35 | */
36 | #define __SYSTEM_CLOCK (1000000)
37 |
38 | uint32_t SystemCoreClock = __SYSTEM_CLOCK;/*!< System Clock Frequency (Core Clock)*/
39 |
40 | /**
41 | * Initialize the system
42 | *
43 | * @brief Setup the microcontroller system.
44 | * Initialize the System and update the SystemCoreClock variable.
45 | */
46 | void SystemInit(void)
47 | {
48 | // Keep the default device state after reset
49 | SystemCoreClock = __SYSTEM_CLOCK;
50 | return;
51 | }
52 |
53 | /**
54 | * Update SystemCoreClock variable
55 | *
56 | * @brief Updates the SystemCoreClock with current core Clock
57 | * retrieved from cpu registers.
58 | */
59 | void SystemCoreClockUpdate(void)
60 | {
61 | // Not implemented
62 | SystemCoreClock = __SYSTEM_CLOCK;
63 | return;
64 | }
65 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/aux_mcu.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "aux_mcu", "aux_mcu.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Release|ARM = Release|ARM
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/aux_mcu.componentinfo.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/aux_mcu_ext.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "aux_mcu", "aux_mcu_ext.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Release|ARM = Release|ARM
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/bootloader.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "bootloader", "bootloader.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Release|ARM = Release|ARM
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/openocd_aux.cfg:
--------------------------------------------------------------------------------
1 | #interface cmsis-dap
2 | source [find interface/cmsis-dap.cfg]
3 | transport select swd
4 | cmsis_dap_vid_pid 0x03eb 0x2141
5 |
6 | # chip name
7 | set CHIPNAME at91samd21e18a
8 |
9 | source [find target/at91samdXX.cfg]
10 |
11 | reset_config srst_only srst_nogate connect_assert_srst
12 |
13 | init
14 | reset
15 | halt
16 |
17 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/boards/samd21_xplained_pro/board_init.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM D21 Xplained Pro board initialization
5 | *
6 | * Copyright (c) 2013-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | /*
34 | * Support and FAQ: visit Microchip Support
35 | */
36 |
37 | #include
38 | #include
39 | #include
40 | #include
41 |
42 | #if defined(__GNUC__)
43 | void board_init(void) WEAK __attribute__((alias("system_board_init")));
44 | #elif defined(__ICCARM__)
45 | void board_init(void);
46 | # pragma weak board_init=system_board_init
47 | #endif
48 |
49 | void system_board_init(void);
50 | void system_board_init(void)
51 | {
52 | }
53 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/drivers/sercom/sercom_interrupt.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Serial Peripheral Interface Driver
5 | *
6 | * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | /*
34 | * Support and FAQ: visit Microchip Support
35 | */
36 | #ifndef SERCOM_INTERRUPT_H_INCLUDED
37 | #define SERCOM_INTERRUPT_H_INCLUDED
38 |
39 | #include "sercom.h"
40 | #include
41 |
42 | #ifdef __cplusplus
43 | extern "C" {
44 | #endif
45 |
46 | /* Look-up table for device instances */
47 | extern void *_sercom_instances[SERCOM_INST_NUM];
48 |
49 | typedef void (*sercom_handler_t)(uint8_t instance);
50 |
51 | enum system_interrupt_vector _sercom_get_interrupt_vector(
52 | Sercom *const sercom_instance);
53 |
54 | void _sercom_set_handler(
55 | const uint8_t instance,
56 | const sercom_handler_t interrupt_handler);
57 |
58 | #ifdef __cplusplus
59 | }
60 | #endif
61 |
62 | #endif /* SERCOM_INTERRUPT_H_INCLUDED */
63 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/drivers/system/clock/clock.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Clock Driver
5 | *
6 | * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | /*
34 | * Support and FAQ: visit Microchip Support
35 | */
36 | #ifndef SYSTEM_CLOCK_H_INCLUDED
37 | #define SYSTEM_CLOCK_H_INCLUDED
38 |
39 | #include
40 | #include
41 | #include
42 |
43 | #endif /* SYSTEM_CLOCK_H_INCLUDED */
44 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac0.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC0
5 | *
6 | * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 |
34 | #ifndef _SAMD21_PAC0_INSTANCE_
35 | #define _SAMD21_PAC0_INSTANCE_
36 |
37 | /* ========== Register definition for PAC0 peripheral ========== */
38 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
39 | #define REG_PAC0_WPCLR (0x40000000U) /**< \brief (PAC0) Write Protection Clear */
40 | #define REG_PAC0_WPSET (0x40000004U) /**< \brief (PAC0) Write Protection Set */
41 | #else
42 | #define REG_PAC0_WPCLR (*(RwReg *)0x40000000U) /**< \brief (PAC0) Write Protection Clear */
43 | #define REG_PAC0_WPSET (*(RwReg *)0x40000004U) /**< \brief (PAC0) Write Protection Set */
44 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
45 |
46 | /* ========== Instance parameters for PAC0 peripheral ========== */
47 | #define PAC0_WPROT_DEFAULT_VAL 0x00000000 // PAC protection mask at reset
48 |
49 | #endif /* _SAMD21_PAC0_INSTANCE_ */
50 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac1.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC1
5 | *
6 | * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 |
34 | #ifndef _SAMD21_PAC1_INSTANCE_
35 | #define _SAMD21_PAC1_INSTANCE_
36 |
37 | /* ========== Register definition for PAC1 peripheral ========== */
38 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
39 | #define REG_PAC1_WPCLR (0x41000000U) /**< \brief (PAC1) Write Protection Clear */
40 | #define REG_PAC1_WPSET (0x41000004U) /**< \brief (PAC1) Write Protection Set */
41 | #else
42 | #define REG_PAC1_WPCLR (*(RwReg *)0x41000000U) /**< \brief (PAC1) Write Protection Clear */
43 | #define REG_PAC1_WPSET (*(RwReg *)0x41000004U) /**< \brief (PAC1) Write Protection Set */
44 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
45 |
46 | /* ========== Instance parameters for PAC1 peripheral ========== */
47 | #define PAC1_WPROT_DEFAULT_VAL 0x00000002 // PAC protection mask at reset
48 |
49 | #endif /* _SAMD21_PAC1_INSTANCE_ */
50 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/utils/cmsis/samd21/include/instance/pac2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC2
5 | *
6 | * Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 |
34 | #ifndef _SAMD21_PAC2_INSTANCE_
35 | #define _SAMD21_PAC2_INSTANCE_
36 |
37 | /* ========== Register definition for PAC2 peripheral ========== */
38 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
39 | #define REG_PAC2_WPCLR (0x42000000U) /**< \brief (PAC2) Write Protection Clear */
40 | #define REG_PAC2_WPSET (0x42000004U) /**< \brief (PAC2) Write Protection Set */
41 | #else
42 | #define REG_PAC2_WPCLR (*(RwReg *)0x42000000U) /**< \brief (PAC2) Write Protection Clear */
43 | #define REG_PAC2_WPSET (*(RwReg *)0x42000004U) /**< \brief (PAC2) Write Protection Set */
44 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
45 |
46 | /* ========== Instance parameters for PAC2 peripheral ========== */
47 | #define PAC2_WPROT_DEFAULT_VAL 0x00800000 // PAC protection mask at reset
48 |
49 | #endif /* _SAMD21_PAC2_INSTANCE_ */
50 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/utils/cmsis/samd21/source/system_samd21.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup
5 | *
6 | * Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | /*
34 | * Support and FAQ: visit Microchip Support
35 | */
36 |
37 | #ifndef _SYSTEM_SAMD21_H_INCLUDED_
38 | #define _SYSTEM_SAMD21_H_INCLUDED_
39 |
40 | #ifdef __cplusplus
41 | extern "C" {
42 | #endif
43 |
44 | #include
45 |
46 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
47 |
48 | void SystemInit(void);
49 | void SystemCoreClockUpdate(void);
50 |
51 | #ifdef __cplusplus
52 | }
53 | #endif
54 |
55 | #endif /* SYSTEM_SAMD21_H_INCLUDED */
56 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/sam0/utils/preprocessor/preprocessor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Preprocessor utils.
5 | *
6 | * Copyright (c) 2012-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | /*
34 | * Support and FAQ: visit Microchip Support
35 | */
36 |
37 | #ifndef _PREPROCESSOR_H_
38 | #define _PREPROCESSOR_H_
39 |
40 | #include "tpaste.h"
41 | #include "stringz.h"
42 | #include "mrepeat.h"
43 | #include "mrecursion.h"
44 |
45 | #endif // _PREPROCESSOR_H_
46 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/ATMEL-disclaimer.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Only the CMSIS required parts for ASF are included here, go to the below
3 | * address for the full package:
4 | * http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php
5 | *
6 | * The library file thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a was generated by ATMEL, which
7 | * is support -mfloat-abi=softfp compiler flag, and this is also the default selection for device that
8 | * have FPU module and enabled.
9 | * If customer want to use -mfloat-abi=hard compiler flag, the project compile/link flag and link library
10 | * should be manual modified. The library thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a is used for
11 | * -mfloat-abi=hard configration.
12 | *
13 | * __CORTEX_SC is not defined for cortex-m0+, and may cause compiler warning, so the include file
14 | * thirdparty/CMSIS/Include/core_cmInstr.h was modified to void such warning.
15 | * Modified from:
16 | * #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
17 | * to:
18 | * #if (__CORTEX_M >= 0x03) || ((defined(__CORTEX_SC)) && (__CORTEX_SC >= 300))
19 | *
20 | */
21 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/Lib/license.txt:
--------------------------------------------------------------------------------
1 | All pre-build libraries contained in the folders "ARM" and "GCC"
2 | are guided by the following license:
3 |
4 | Copyright (C) 2009-2014 ARM Limited.
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 | - Neither the name of ARM nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without
16 | specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 | POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/CMSIS/README.txt:
--------------------------------------------------------------------------------
1 | * -------------------------------------------------------------------
2 | * Copyright (C) 2011-2014 ARM Limited. All rights reserved.
3 | *
4 | * Date: 17 February 2014
5 | * Revision: V4.00
6 | *
7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS)
8 | * Title: Release Note for CMSIS
9 | *
10 | * -------------------------------------------------------------------
11 |
12 |
13 | NOTE - Open the index.html file to access CMSIS documentation
14 |
15 |
16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
18 | and reduces time-to-market for new embedded applications.
19 |
20 | CMSIS is released under the terms of the end user license agreement ("CMSIS_END_USER_LICENCE_AGREEMENT.pdf").
21 | Any user of the software package is bound to the terms and conditions of the end user license agreement.
22 |
23 |
24 | You will find the following sub-directories:
25 |
26 | Documentation - Contains CMSIS documentation.
27 |
28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the
29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
30 |
31 | Include - CMSIS Core Support and CMSIS DSP Include Files.
32 |
33 | Lib - CMSIS DSP Libraries.
34 |
35 | RTOS - CMSIS RTOS API template header file.
36 |
37 | Driver - CMSIS Peripheral Driver Interface.
38 |
39 | Pack - CMSIS Software Packs.
40 | Mechanism to install software, device support, APIs, and example projects.
41 |
42 | SVD - CMSIS SVD Schema files and Conversion Utility.
43 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/wireless/ble_sdk/lib/cm0p/gcc/libble_sdk.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/aux_mcu/src/ASF/thirdparty/wireless/ble_sdk/lib/cm0p/gcc/libble_sdk.a
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/wireless/ble_sdk/services/console/console_serial.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file console_serial.h
3 | *
4 | * \brief Serial Console functionalities
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | */
32 |
33 | #ifndef COSOLE_SERIAL_H
34 | #define COSOLE_SERIAL_H
35 |
36 | void serial_console_init(void);
37 | uint8_t getchar_timeout(uint32_t timeout);
38 | #endif /* COSOLE_SERIAL_H */
39 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/wireless/ble_sdk/services/console/sam0/console_serial.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file console_serial.c
3 | *
4 | * \brief Serial Console functionalities
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | */
32 |
33 | /* === INCLUDES ============================================================ */
34 |
35 | #include
36 | #include "console_serial.h"
37 | #include "conf_console.h"
38 | #include "usart.h"
39 | #include "platform.h"
40 | #include "timer_hw.h"
41 | /* === TYPES =============================================================== */
42 |
43 | /**
44 | * Configure console.
45 | */
46 | void serial_console_init(void)
47 | {
48 | }
49 |
50 | uint8_t getchar_timeout(uint32_t timeout)
51 | {
52 | return 0;
53 | }
54 |
55 | /* EOF */
56 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/ASF/thirdparty/wireless/ble_sdk/services/timer/timer_hw.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file timer_hw.h
3 | *
4 | * \brief Handles timer functionalities
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | */
32 |
33 | #ifndef __TIMER_HW_H__
34 | #define __TIMER_HW_H__
35 |
36 | #define STACK_HW_TIMERS 2
37 |
38 | typedef void (*hw_timer_callback_t)(void);
39 | typedef void (*platform_hw_timer_callback_t)(void *);
40 |
41 | void hw_timer_init(void);
42 | void hw_timer_register_callback(hw_timer_callback_t cb_ptr);
43 | void hw_timer_start(uint32_t timer_val_s);
44 | void hw_timer_start_ms(uint32_t timer_val_ms);
45 | void hw_timer_stop(void);
46 |
47 | void *platform_create_hw_timer(platform_hw_timer_callback_t bus_tc_cb_ptr);
48 | void platform_start_bus_timer(void *timer_handle, uint32_t ms);
49 | void platform_delete_bus_timer(void *timer_handle);
50 | void platform_stop_bus_timer(void *timer_handle);
51 | void platform_stop_stack_timers(void);
52 |
53 | #ifdef BTLC_REINIT_SUPPORT
54 | void platform_reset_hw_timer(void);
55 | #endif
56 |
57 | #endif /* __TIMER_HW_H__ */
58 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/CLOCKS/driver_clocks.h:
--------------------------------------------------------------------------------
1 | /*! \file driver_clocks.h
2 | * \brief Platform clocks related functions
3 | * Created: 10/11/2017
4 | * Author: Mathieu Stephan
5 | */
6 |
7 | #ifndef CLOCKS_POWER_H_
8 | #define CLOCKS_POWER_H_
9 |
10 | /* Prototypes */
11 | void clocks_map_gclk_to_peripheral_clock(uint32_t gclk_id, uint32_t peripheral_clk_id);
12 | void clocks_start_48MDFLL(void);
13 |
14 |
15 | #endif /* CLOCKS_POWER_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_aux_mcu_defines.h:
--------------------------------------------------------------------------------
1 | /*! \file comms_aux_mcu_defines.h
2 | * \brief Defines for aux mcu comms
3 | * Created: 09/05/2018
4 | * Author: Mathieu Stephan
5 | */
6 |
7 |
8 | #ifndef COMMS_AUX_MCU_DEFINES_H_
9 | #define COMMS_AUX_MCU_DEFINES_H_
10 |
11 | // AUX MCU Message payload length
12 | #define AUX_MCU_MSG_PAYLOAD_LENGTH 552
13 |
14 | // HID payload size
15 | #define HID_PAYLOAD_SIZE 64
16 |
17 | #define SHA256_OUTPUT_LENGTH 32
18 |
19 | //FIDO2 related lengths/sizes
20 | #define FIDO2_RPID_LEN 252 //RP ID length
21 | #define FIDO2_USER_HANDLE_LEN 64 //User id length
22 | #define FIDO2_USER_NAME_LEN 65 //User name length
23 | #define FIDO2_DISPLAY_NAME_LEN 65 //Display name length
24 | #define FIDO2_CLIENT_DATA_HASH_LEN (SHA256_OUTPUT_LENGTH) //Client data hash length
25 | #define FIDO2_RPID_HASH_LEN (SHA256_OUTPUT_LENGTH) //RP ID hash length
26 | #define FIDO2_CREDENTIAL_ID_LENGTH 16 //Credential ID length
27 | #define FIDO2_PUB_KEY_X_LEN 32 //Public key X part length
28 | #define FIDO2_PUB_KEY_Y_LEN 32 //Public key Y part length
29 | #define FIDO2_ATTEST_SIG_LEN 64 //Attested signature length
30 | #define FIDO2_AAGUID_LEN 16 //AAGUID length
31 | #define FIDO2_ENC_PUB_KEY_LEN 100 //Encryped public key length
32 | #define FIDO2_PRIV_KEY_LEN 32 //Private key length
33 | #define FIDO2_ALLOW_LIST_MAX_SIZE (ALLOW_LIST_MAX_SIZE) //Max length of allow list
34 |
35 | #endif /* COMMS_AUX_MCU_DEFINES_H_ */
36 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_bootloader_msg.h:
--------------------------------------------------------------------------------
1 | /*! \file comms_bootloader_msg.h
2 | * \brief Typedefs for bootloader messages
3 | * Created: 09/05/2018
4 | * Author: Mathieu Stephan
5 | */
6 |
7 | #ifndef COMMS_BOOTLOADER_MSG_H_
8 | #define COMMS_BOOTLOADER_MSG_H_
9 |
10 | #ifndef BOOTLOADER
11 | #include
12 | #else
13 | #include "sam.h"
14 | #endif
15 | #include "comms_main_mcu.h"
16 |
17 | /* Defines */
18 | #define BOOTLOADER_START_PROGRAMMING_COMMAND 0x0000
19 | #define BOOTLOADER_WRITE_COMMAND 0x0001
20 | #define BOOTLOADER_START_APP_COMMAND 0x0002
21 |
22 | /* Typedefs */
23 | /* 0x0000: enter programming command */
24 | typedef struct
25 | {
26 | uint32_t image_length;
27 | uint32_t crc;
28 | } aux_mcu_bootloader_programming_command_contents_t;
29 |
30 | /* 0x0001: write command */
31 | typedef struct
32 | {
33 | uint32_t size;
34 | uint32_t crc;
35 | uint32_t address;
36 | union
37 | {
38 | uint8_t payload[512];
39 | uint16_t payload_as_uint16_t[512/2];
40 | };
41 | } aux_mcu_bootloader_write_command_contents_t;
42 |
43 | typedef struct
44 | {
45 | uint16_t command;
46 | union
47 | {
48 | aux_mcu_bootloader_programming_command_contents_t programming_command;
49 | aux_mcu_bootloader_write_command_contents_t write_command;
50 | };
51 | } aux_mcu_bootloader_message_t;
52 |
53 |
54 | #endif /* COMMS_BOOTLOADER_MSG_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_hid_msgs.c:
--------------------------------------------------------------------------------
1 | /*! \file comms_hid_msgs.h
2 | * \brief HID communications
3 | * Created: 06/03/2018
4 | * Author: Mathieu Stephan
5 | */
6 | #include
7 | #include
8 | #include "comms_hid_msgs.h"
9 |
10 |
11 | /*! \fn comms_hid_msgs_parse(hid_message_t* rcv_msg, uint16_t supposed_payload_length, hid_message_t* send_msg)
12 | * \brief Parse an incoming message from USB or BLE
13 | * \param rcv_msg Received message
14 | * \param msg_length Supposed payload length
15 | * \param send_msg Where to write a possible reply
16 | * \return something >= 0 if an answer needs to be sent, otherwise -1
17 | */
18 | int16_t comms_hid_msgs_parse(hid_message_t* rcv_msg, uint16_t supposed_payload_length, hid_message_t* send_msg)
19 | {
20 | /* Check correct payload length */
21 | if ((supposed_payload_length != rcv_msg->payload_length) || (supposed_payload_length > sizeof(rcv_msg->payload)))
22 | {
23 | /* Silent error */
24 | return -1;
25 | }
26 |
27 | /* By default: copy the same CMD identifier for TX message */
28 | send_msg->message_type = rcv_msg->message_type;
29 |
30 | /* Switch on command id */
31 | switch (rcv_msg->message_type)
32 | {
33 | case HID_CMD_ID_PING:
34 | {
35 | /* Simple ping: copy the message contents */
36 | memcpy((void*)send_msg->payload, (void*)rcv_msg->payload, rcv_msg->payload_length);
37 | send_msg->payload_length = rcv_msg->payload_length;
38 | return send_msg->payload_length;
39 | }
40 |
41 | default: break;
42 | }
43 |
44 | return -1;
45 | }
46 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_hid_msgs.h:
--------------------------------------------------------------------------------
1 | /*! \file comms_hid_msgs.h
2 | * \brief HID communications
3 | * Created: 06/03/2018
4 | * Author: Mathieu Stephan
5 | */
6 |
7 |
8 | #ifndef COMMS_HID_MSGS_H_
9 | #define COMMS_HID_MSGS_H_
10 |
11 | #include "comms_aux_mcu_defines.h"
12 |
13 | /* Defines */
14 | #define HID_1BYTE_NACK 0x00
15 | #define HID_1BYTE_ACK 0x01
16 |
17 | /* Command defines */
18 | #define HID_CMD_ID_PING 0x0001
19 | #define HID_CMD_GET_DEVICE_STATUS 0x0011
20 |
21 | /* Debug command defines */
22 | #define HID_CMD_ID_DEBUG_MSG 0x8000
23 |
24 | /* Typedefs */
25 | typedef struct
26 | {
27 | uint16_t message_type;
28 | uint16_t payload_length;
29 | union
30 | {
31 | uint8_t payload[AUX_MCU_MSG_PAYLOAD_LENGTH-sizeof(uint16_t)-sizeof(uint16_t)];
32 | uint16_t payload_as_uint16[(AUX_MCU_MSG_PAYLOAD_LENGTH-sizeof(uint16_t)-sizeof(uint16_t))/2];
33 | uint32_t payload_as_uint32[(AUX_MCU_MSG_PAYLOAD_LENGTH-sizeof(uint16_t)-sizeof(uint16_t))/4];
34 | };
35 | } hid_message_t;
36 |
37 | /* Prototypes */
38 | int16_t comms_hid_msgs_parse(hid_message_t* rcv_msg, uint16_t supposed_payload_length, hid_message_t* send_msg);
39 |
40 |
41 | #endif /* COMMS_HID_MSGS_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_hid_msgs_debug.h:
--------------------------------------------------------------------------------
1 | /*! \file comms_hid_msgs_debug.h
2 | * \brief HID debug communications
3 | * Created: 06/03/2018
4 | * Author: Mathieu Stephan
5 | */
6 |
7 |
8 | #ifndef COMMS_HID_MSGS_DEBUG_H_
9 | #define COMMS_HID_MSGS_DEBUG_H_
10 |
11 | #include "comms_hid_msgs.h"
12 |
13 | /* Defines */
14 | #define HID_MESSAGE_START_CMD_ID_DBG 0x8000
15 | // Command IDs
16 | #define HID_CMD_ID_DBG_MSG 0x8000
17 | #define HID_CMD_ID_OPEN_DISP_BUFFER 0x8001
18 | #define HID_CMD_ID_SEND_TO_DISP_BUFFER 0x8002
19 | #define HID_CMD_ID_CLOSE_DISP_BUFFER 0x8003
20 | #define HID_CMD_ID_ERASE_DATA_FLASH 0x8004
21 | #define HID_CMD_ID_IS_DATA_FLASH_READY 0x8005
22 | #define HID_CMD_ID_DATAFLASH_WRITE_256B 0x8006
23 | #define HID_CMD_ID_START_BOOTLOADER 0x8007
24 | #define HID_CMD_ID_GET_ACC_32_SAMPLES 0x8008
25 | #define HID_CMD_ID_FLASH_AUX_MCU 0x8009
26 | #define HID_CMD_ID_GET_DBG_PLAT_INFO 0x800A
27 | #define HID_CMD_ID_REINDEX_BUNDLE 0x800B
28 | #define HID_CMD_ID_SET_OLED_PARAMS 0x800C
29 | #define HID_CMD_ID_GET_BATTERY_STATUS 0x800D
30 |
31 | /* Prototypes */
32 | int16_t comms_hid_msgs_parse_debug(hid_message_t* rcv_msg, uint16_t supposed_payload_length, hid_message_t* send_msg);
33 |
34 |
35 | #endif /* COMMS_HID_MSGS_DEBUG_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/COMMS/comms_raw_hid.h:
--------------------------------------------------------------------------------
1 | /*
2 | * comms_usb.h
3 | *
4 | * Created: 23/08/2018 21:52:22
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef COMMS_USB_H_
10 | #define COMMS_USB_H_
11 |
12 | #include "defines.h"
13 | #include "comms_main_mcu.h"
14 |
15 | /* Type defs */
16 | typedef struct
17 | {
18 | struct
19 | {
20 | uint8_t payload_len:6;
21 | uint8_t ack_flag_or_req:1;
22 | uint8_t flip_bit:1;
23 | } byte0;
24 | struct
25 | {
26 | uint8_t total_packets:4;
27 | uint8_t packet_id:4;
28 | } byte1;
29 | uint8_t payload[62];
30 | } moolticute_comms_hid_packet_t;
31 |
32 | typedef struct
33 | {
34 | union
35 | {
36 | moolticute_comms_hid_packet_t mtc_hid_packet;
37 | uint32_t raw_packet_uint32[64/4];
38 | uint8_t raw_packet[64];
39 | };
40 | } hid_packet_t;
41 |
42 | /* Prototypes */
43 | void comms_raw_hid_send_packet(hid_interface_te hid_interface, hid_packet_t* packet, BOOL wait_send, uint16_t payload_size);
44 | void comms_raw_hid_send_hid_message(hid_interface_te hid_interface, aux_mcu_message_t* message);
45 | void comms_raw_hid_recv_callback(hid_interface_te hid_interface, uint16_t recv_bytes);
46 | hid_packet_t* comms_raw_hid_get_send_buffer(hid_interface_te hid_interface);
47 | void comms_raw_hid_connection_set_callback(hid_interface_te hid_interface);
48 | uint8_t* comms_raw_hid_get_recv_buffer(hid_interface_te hid_interface);
49 | void comms_raw_hid_arm_packet_receive(hid_interface_te hid_interface);
50 | void comms_raw_hid_set_idle_config(uint8_t interface, uint8_t val);
51 | void comms_raw_hid_set_protocol(uint8_t interface, uint8_t val);
52 | void comms_raw_hid_send_callback(hid_interface_te hid_interface);
53 | void comms_raw_hid_update_device_status_cache(uint8_t* buffer);
54 | uint8_t* comms_raw_hid_get_idle_config(uint8_t interface);
55 | uint8_t* comms_raw_hid_get_protocol(uint8_t interface);
56 | comms_usb_ret_te comms_usb_communication_routine(void);
57 | void comms_usb_debug_printf(const char *fmt, ...);
58 | void comms_usb_clear_enumerated(void);
59 | BOOL comms_usb_is_enumerated(void);
60 |
61 |
62 | #endif /* COMMS_USB_H_ */
63 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/DMA/dma.h:
--------------------------------------------------------------------------------
1 | /*
2 | * dma.h
3 | *
4 | * Created: 29/05/2017 09:18:00
5 | * Author: stephan
6 | */
7 |
8 |
9 | #ifndef DMA_H_
10 | #define DMA_H_
11 |
12 | #include "platform_defines.h"
13 | #include "comms_main_mcu.h"
14 | #include "defines.h"
15 |
16 | /* Global vars */
17 | extern volatile aux_mcu_message_t dma_main_mcu_fido_blectrl_rng_message;
18 | extern volatile aux_mcu_message_t dma_main_mcu_temp_rcv_message;
19 | extern volatile aux_mcu_message_t dma_main_mcu_usb_rcv_message;
20 | extern volatile aux_mcu_message_t dma_main_mcu_ble_rcv_message;
21 | extern volatile aux_mcu_message_t dma_main_mcu_other_message;
22 | extern volatile BOOL dma_main_mcu_fido_blectrl_rng_msg_received;
23 | extern volatile BOOL dma_main_mcu_other_msg_received;
24 | extern volatile BOOL dma_main_mcu_usb_msg_received;
25 | extern volatile BOOL dma_main_mcu_ble_msg_received;
26 |
27 | /* Prototypes */
28 | void dma_main_mcu_init_tx_transfer(void* spi_data_p, void* datap, uint16_t size);
29 | uint16_t dma_main_mcu_get_remaining_bytes_for_rx_transfer(void);
30 | void* dma_get_pointer_to_message_being_sent_to_main_mcu(void);
31 | BOOL dma_main_mcu_check_and_clear_dma_transfer_flag(void);
32 | void dma_wait_for_main_mcu_packet_sent(void);
33 | void dma_main_mcu_init_rx_transfer(void);
34 | void dma_main_mcu_disable_transfer(void);
35 | void dma_init(void);
36 |
37 |
38 | #endif /* DMA_H_ */
39 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/LOGIC/logic.c:
--------------------------------------------------------------------------------
1 | /*! \file logic.c
2 | * \brief General logic handling
3 | * Created: 06/09/2018
4 | * Author: Mathieu Stephan
5 | */
6 | #include "comms_main_mcu.h"
7 | #include "defines.h"
8 | #include "logic.h"
9 | /* Boolean to know if BLE is enabled */
10 | BOOL logic_ble_enabled = FALSE;
11 | /* If no comms signal unavailable */
12 | BOOL logic_no_comms_unavailable = FALSE;
13 | /* Flags to enable bluetooth */
14 | BOOL logic_bluetooth_to_be_enabled = FALSE;
15 | /* Device information for bluetooth */
16 | dis_device_information_t logic_dis_device_information;
17 |
18 |
19 | void logic_set_bluetooth_to_be_enabled(dis_device_information_t* device_information_pt)
20 | {
21 | memcpy(&logic_dis_device_information, device_information_pt, sizeof(logic_dis_device_information));
22 | logic_dis_device_information.custom_device_name[MEMBER_ARRAY_SIZE(dis_device_information_t,custom_device_name)-1] = 0;
23 | logic_bluetooth_to_be_enabled = TRUE;
24 | }
25 |
26 | BOOL logic_get_and_clear_bluetooth_to_be_enabled(dis_device_information_t** dis_device_info_pt_pt)
27 | {
28 | BOOL return_value = logic_bluetooth_to_be_enabled;
29 | *dis_device_info_pt_pt = &logic_dis_device_information;
30 | logic_bluetooth_to_be_enabled = FALSE;
31 | return return_value;
32 | }
33 |
34 | void logic_set_ble_enabled(void)
35 | {
36 | logic_ble_enabled = TRUE;
37 | }
38 |
39 | void logic_set_ble_disabled(void)
40 | {
41 | logic_ble_enabled = FALSE;
42 | }
43 |
44 | BOOL logic_is_ble_enabled(void)
45 | {
46 | return logic_ble_enabled;
47 | }
48 |
49 | void logic_set_nocomms_unavailable(void)
50 | {
51 | logic_no_comms_unavailable = TRUE;
52 | }
53 |
54 | BOOL logic_is_no_comms_unavailable(void)
55 | {
56 | return logic_no_comms_unavailable;
57 | }
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/LOGIC/logic.h:
--------------------------------------------------------------------------------
1 | /*! \file logic.h
2 | * \brief General logic handling
3 | * Created: 06/09/2018
4 | * Author: Mathieu Stephan
5 | */
6 |
7 |
8 |
9 | #ifndef LOGIC_H_
10 | #define LOGIC_H_
11 |
12 | /* Includes */
13 | #include "comms_main_mcu.h"
14 | #include "logic.h"
15 |
16 | /* Prototypes */
17 | BOOL logic_get_and_clear_bluetooth_to_be_enabled(dis_device_information_t** dis_device_info_pt_pt);
18 | void logic_set_bluetooth_to_be_enabled(dis_device_information_t* device_information_pt);
19 | void logic_set_nocomms_unavailable(void);
20 | BOOL logic_is_no_comms_unavailable(void);
21 | void logic_set_ble_disabled(void);
22 | void logic_set_ble_enabled(void);
23 | BOOL logic_is_ble_enabled(void);
24 |
25 |
26 | #endif /* LOGIC_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/LOGIC/logic_rng.c:
--------------------------------------------------------------------------------
1 | /*! \file logic_rng.c
2 | * \brief Logic for random number generation
3 | * Created: 15/12/2019
4 | * Author: Mathieu Stephan
5 | */
6 | #include "comms_main_mcu.h"
7 | #include "logic_rng.h"
8 | #include "defines.h"
9 | /* Buffer containing our random numbers */
10 | uint8_t logic_rng_buffer[32];
11 | /* Number of bytes available in our buffer */
12 | uint16_t logic_rng_bytes_available = 0;
13 |
14 |
15 | /*! \fn logic_rng_get_uint16(void)
16 | * \brief Get a random uint16
17 | * \return A random uint16_t
18 | */
19 | uint16_t logic_rng_get_uint16(void)
20 | {
21 | /* Check if we have enough in stock */
22 | if (logic_rng_bytes_available < 2)
23 | {
24 | comms_main_mcu_get_32_rng_bytes_from_main_mcu(logic_rng_buffer);
25 | logic_rng_bytes_available = 32;
26 | }
27 |
28 | /* Prepare answer and send it */
29 | uint16_t return_val = logic_rng_buffer[sizeof(logic_rng_buffer) - logic_rng_bytes_available];
30 | logic_rng_bytes_available--;
31 | return_val = (return_val << 8) & 0xFF00;
32 | return_val |= logic_rng_buffer[sizeof(logic_rng_buffer) - logic_rng_bytes_available];
33 | logic_rng_bytes_available--;
34 | return return_val;
35 | }
36 |
37 | /*! \fn logic_rng_get_uint8(void)
38 | * \brief Get a random uint8
39 | * \return A random uint8_t
40 | */
41 | uint8_t logic_rng_get_uint8(void)
42 | {
43 | /* Check if we have enough in stock */
44 | if (logic_rng_bytes_available < 1)
45 | {
46 | comms_main_mcu_get_32_rng_bytes_from_main_mcu(logic_rng_buffer);
47 | logic_rng_bytes_available = 32;
48 | }
49 |
50 | uint8_t return_val = logic_rng_buffer[sizeof(logic_rng_buffer) - logic_rng_bytes_available];
51 | logic_rng_bytes_available--;
52 | return return_val;
53 | }
54 |
55 | /*! \fn logic_rng_get_random_bytes(uint8_t* buffer, uint16_t nb_bytes)
56 | * \brief Get random bytes
57 | * \param buffer Buffer where to store the random bytes
58 | * \param nb_bytes Number of bytes to store
59 | */
60 | void logic_rng_get_random_bytes(uint8_t* buffer, uint16_t nb_bytes)
61 | {
62 | for (uint16_t i = 0; i < nb_bytes; i++)
63 | {
64 | buffer[i] = logic_rng_get_uint8();
65 | }
66 | }
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/LOGIC/logic_rng.h:
--------------------------------------------------------------------------------
1 | /*! \file logic_rng.h
2 | * \brief Logic for random number generation
3 | * Created: 15/12/2019
4 | * Author: Mathieu Stephan
5 | */
6 |
7 |
8 | #ifndef LOGIC_RNG_H_
9 | #define LOGIC_RNG_H_
10 |
11 | /* Prototypes */
12 | void logic_rng_get_random_bytes(uint8_t* buffer, uint16_t nb_bytes);
13 | uint16_t logic_rng_get_uint16(void);
14 | uint8_t logic_rng_get_uint8(void);
15 |
16 |
17 | #endif /* LOGIC_RNG_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/LOGIC/logic_sleep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * logic_sleep.h
3 | *
4 | * Created: 30/07/2019 20:09:48
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef LOGIC_SLEEP_H_
10 | #define LOGIC_SLEEP_H_
11 |
12 | #include "defines.h"
13 |
14 | /* defines */
15 | #define BT_NB_MS_BEFORE_DEASSERTING_WAKEUP 10000
16 |
17 | /* debug defines */
18 | #define DEBUG_SLEEP_LOG_DISABLED
19 | #if defined DEBUG_SLEEP_LOG_DISABLED
20 | #define DBG_SLP_LOG(...)
21 | #else
22 | #ifndef USB_PRINTF
23 | #define DBG_SLP_LOG platform_io_uart_debug_printf
24 | #else
25 | #define DBG_SLP_LOG comms_usb_debug_printf
26 | #endif
27 | #endif
28 |
29 | /* Prototypes */
30 | void logic_sleep_set_full_platform_sleep_requested(void);
31 | BOOL logic_sleep_is_full_platform_sleep_requested(void);
32 | void logic_sleep_wakeup_main_mcu_if_needed(void);
33 | void logic_sleep_ble_signal_to_sleep(void);
34 | void logic_sleep_routine_ble_call(void);
35 |
36 |
37 | #endif /* LOGIC_SLEEP_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/SECURITY/fuses.h:
--------------------------------------------------------------------------------
1 | /*! \file fuses.h
2 | * \brief Functions dedicated to fuse checks
3 | * Created: 20/06/2018
4 | * Author: Mathieu Stephan
5 | */
6 | #ifndef FUSES_H_
7 | #define FUSES_H_
8 |
9 | #include "defines.h"
10 |
11 | /* Prototypes */
12 | RET_TYPE fuses_check_program(BOOL flash_fuses);
13 |
14 |
15 |
16 | #endif /* FUSES_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/USB/usb_utils.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016, Alex Taradov
3 | * All rights reserved.
4 | *
5 | * Redistribution and use in source and binary forms, with or without
6 | * modification, are permitted provided that the following conditions are met:
7 | *
8 | * 1. Redistributions of source code must retain the above copyright notice,
9 | * this list of conditions and the following disclaimer.
10 | * 2. Redistributions in binary form must reproduce the above copyright
11 | * notice, this list of conditions and the following disclaimer in the
12 | * documentation and/or other materials provided with the distribution.
13 | * 3. The name of the author may not be used to endorse or promote products
14 | * derived from this software without specific prior written permission.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | #ifndef _USB_UTILS_H_
30 | #define _USB_UTILS_H_
31 |
32 | /*- Definitions -------------------------------------------------------------*/
33 | #define PACK __attribute__((packed))
34 | #define INLINE static inline __attribute__((always_inline))
35 | #define LIMIT(a, b) (((a) > (b)) ? (b) : (a))
36 |
37 | #endif // _USB_UTILS_H_
38 |
39 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/atmel_notes.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/aux_mcu/src/atmel_notes.txt
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/config/conf_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM D21 Xplained Pro board configuration.
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 |
34 | #ifndef CONF_BOARD_H_INCLUDED
35 | #define CONF_BOARD_H_INCLUDED
36 |
37 | #endif /* CONF_BOARD_H_INCLUDED */
38 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/config/conf_console.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM D21 Console configuration.
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 |
34 | #ifndef CONF_CONSOLE_H_INCLUDED
35 | #define CONF_CONSOLE_H_INCLUDED
36 |
37 | #endif /* CONF_CONSOLE_H_INCLUDED */
38 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/config/conf_extint.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM D21 External Interrupt Driver Configuration Header
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | #ifndef CONF_EXTINT_H_INCLUDED
34 | #define CONF_EXTINT_H_INCLUDED
35 |
36 | #include
37 |
38 | #define EXTINT_CLOCK_SOURCE GCLK_GENERATOR_0
39 |
40 |
41 | void button_cb(void);
42 |
43 | /* Button Initialize */
44 | static inline void button_init(void)
45 | {
46 | }
47 |
48 | /**
49 | * \brief Read the current state of the button pin
50 | *
51 | */
52 | static inline uint8_t button_0_input_level(void)
53 | {
54 | return 0;
55 | }
56 |
57 | #endif
58 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/config/conf_timer.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Timer Driver Configuration Header
5 | *
6 | * Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Subject to your compliance with these terms, you may use Microchip
13 | * software and any derivatives exclusively with Microchip products.
14 | * It is your responsibility to comply with third party license terms applicable
15 | * to your use of third party software (including open source software) that
16 | * may accompany Microchip software.
17 | *
18 | * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES,
19 | * WHETHER EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE,
20 | * INCLUDING ANY IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY,
21 | * AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MICROCHIP BE
22 | * LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, INCIDENTAL OR CONSEQUENTIAL
23 | * LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND WHATSOEVER RELATED TO THE
24 | * SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS BEEN ADVISED OF THE
25 | * POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE FULLEST EXTENT
26 | * ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN ANY WAY
27 | * RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
28 | * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
29 | *
30 | * \asf_license_stop
31 | *
32 | */
33 | #ifndef CONF_TIMER_H_INCLUDED
34 | #define CONF_TIMER_H_INCLUDED
35 |
36 | #include "asf.h"
37 |
38 | #define TMRID0 TC4
39 | #define TMRID1 TC5
40 | #define CONF_TC_MODULE TC3
41 |
42 | #define STACK_TIMER0 TMRID0
43 | #define STACK_TIMER1 TMRID1
44 | #define APP_TIMER CONF_TC_MODULE
45 |
46 | #define TC_COUNT_1SEC (48000000ul/1024ul)
47 | struct tc_module tc_instance;
48 |
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/config/user_board.h:
--------------------------------------------------------------------------------
1 | /*
2 | * user_board.h
3 | *
4 | * Created: 02/06/2019 21:37:39
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef USER_BOARD_H_
10 | #define USER_BOARD_H_
11 |
12 |
13 |
14 |
15 |
16 | #endif /* USER_BOARD_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/debug.h:
--------------------------------------------------------------------------------
1 | /*
2 | * debug.h
3 | *
4 | * Created: 25/05/2019 22:53:26
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef DEBUG_H_
10 | #define DEBUG_H_
11 |
12 | void debug_tx_band_send(uint16_t frequency_index, uint16_t payload_type, uint16_t payload_length);
13 | void debug_dtm_rx(uint16_t frequency_index);
14 | void debug_tx_stop_continuous_tone(void);
15 | void debug_init_trace_buffer(void);
16 |
17 | #endif /* DEBUG_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/defines.h:
--------------------------------------------------------------------------------
1 | /*! \file defines.h
2 | * \brief Generic type defines
3 | * Created: 22/08/2018
4 | * Author: Mathieu Stephan
5 | */
6 | #ifndef DEFINES_H_
7 | #define DEFINES_H_
8 |
9 | #include
10 |
11 | /* Macros */
12 | #define XSTR(x) STR(x)
13 | #define STR(x) #x
14 | #define ARRAY_SIZE(x) (sizeof((x)) / sizeof((x)[0]))
15 | #define MEMBER_SIZE(type, member) sizeof(((type*)0)->member)
16 | #define MEMBER_ARRAY_SIZE(type, member) (sizeof(((type*)0)->member) / sizeof(((type*)0)->member[0]))
17 | #define MEMBER_SUB_ARRAY_SIZE(type, member) (sizeof(((type*)0)->member[0]) / sizeof(((type*)0)->member[0][0]))
18 |
19 | /* Standard defines */
20 | #define FALSE 0
21 | #define TRUE (!FALSE)
22 | #define BOOTLOADER_FLAG 0xDEADBEEF
23 |
24 | /* Debugging defines */
25 | #define DEBUG_STACK_TRACKING_COOKIE 0x5D
26 |
27 | /* Enums */
28 | typedef enum {LF_EN_MASK = 0x01, LF_ENT_KEY_MASK = 0x02, LF_LOGIN_MASK = 0x04, LF_WIN_L_SEND_MASK = 0x08, LF_CTRL_ALT_DEL_MASK = 0x10} lock_feature_te;
29 | typedef enum {USB_INTERFACE = 0, BLE_INTERFACE = 1, CTAP_INTERFACE = 2, NB_HID_INTERFACES} hid_interface_te;
30 | typedef enum {COMMS_USB_NO_RET = 0, COMMS_USB_TIMEOUT} comms_usb_ret_te;
31 | typedef enum {RETURN_NOK = -1, RETURN_OK = 0} ret_type_te;
32 |
33 | /* Typedefs */
34 | typedef void (*void_function_ptr_type_t)(void);
35 | typedef uint16_t cust_char_t;
36 | typedef ret_type_te RET_TYPE;
37 | typedef uint32_t nat_type_t;
38 | typedef int32_t BOOL;
39 |
40 | #endif /* DEFINES_H_ */
41 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/device_info_struct.h:
--------------------------------------------------------------------------------
1 | /*
2 | * device_info_struct.h
3 | *
4 | * Created: 31/03/2022 21:32:03
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef DEVICE_INFO_STRUCT_H_
10 | #define DEVICE_INFO_STRUCT_H_
11 |
12 | #include
13 |
14 | typedef struct
15 | {
16 | uint8_t mac_address[6];
17 | uint8_t fw_major;
18 | uint8_t fw_minor;
19 | uint32_t serial_number;
20 | uint16_t bundle_version;
21 | uint8_t custom_device_name[22+1];
22 | } dis_device_information_t;
23 |
24 | #endif /* DEVICE_INFO_STRUCT_H_ */
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/fido2/cose_key.h:
--------------------------------------------------------------------------------
1 | // Copyright 2019 SoloKeys Developers
2 | //
3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be
6 | // copied, modified, or distributed except according to those terms.
7 | #ifndef _COSE_KEY_H
8 | #define _COSE_KEY_H
9 |
10 | #define COSE_KEY_LABEL_KTY 1
11 | #define COSE_KEY_LABEL_ALG 3
12 | #define COSE_KEY_LABEL_CRV -1
13 | #define COSE_KEY_LABEL_X -2
14 | #define COSE_KEY_LABEL_Y -3
15 |
16 | #define COSE_KEY_KTY_OKP 1
17 | #define COSE_KEY_KTY_EC2 2
18 | #define COSE_KEY_CRV_P256 1
19 | #define COSE_KEY_CRV_ED25519 6
20 |
21 | #define COSE_ALG_ES256 -7
22 | #define COSE_ALG_EDDSA -8
23 | #define COSE_ALG_ECDH_ES_HKDF_256 -25
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/fido2/ctap_parse.h:
--------------------------------------------------------------------------------
1 | // Copyright 2019 SoloKeys Developers
2 | //
3 | // Licensed under the Apache License, Version 2.0, or the MIT license , at your option. This file may not be
6 | // copied, modified, or distributed except according to those terms.
7 | #ifndef _CTAP_PARSE_H
8 | #define _CTAP_PARSE_H
9 |
10 |
11 | #define check_ret(r) _check_ret(r,__LINE__, __FILE__);\
12 | if ((r) != CborNoError) return CTAP2_ERR_CBOR_PARSING;
13 |
14 | #define check_retr(r) _check_ret(r,__LINE__, __FILE__);\
15 | if ((r) != CborNoError) return r;
16 |
17 |
18 | extern void _check_ret(CborError ret, int line, const char * filename);
19 |
20 |
21 | const char * cbor_value_get_type_string(const CborValue *value);
22 |
23 |
24 | uint8_t parse_user(CTAP_makeCredential * MC, CborValue * val);
25 | uint8_t parse_pub_key_cred_param(CborValue * val, uint8_t * cred_type, int32_t * alg_type);
26 | uint8_t parse_pub_key_cred_params(CTAP_makeCredential * MC, CborValue * val);
27 | uint8_t parse_fixed_byte_string(CborValue * map, uint8_t * dst, unsigned int len);
28 | uint8_t parse_rp_id(struct rpId * rp, CborValue * val);
29 | uint8_t parse_rp(struct rpId * rp, CborValue * val);
30 | uint8_t parse_options(CborValue * val, uint8_t * rk, uint8_t * uv, uint8_t *uvPresent, uint8_t * up, uint8_t *upPresent);
31 |
32 | uint8_t parse_allow_list(CTAP_getAssertion * GA, CborValue * it);
33 | uint8_t parse_cose_key(CborValue * it, COSE_key * cose);
34 |
35 |
36 | uint8_t ctap_parse_make_credential(CTAP_makeCredential * MC, CborEncoder * encoder, uint8_t * request, int length);
37 | uint8_t ctap_parse_get_assertion(CTAP_getAssertion * GA, uint8_t * request, int length);
38 | uint8_t parse_credential_descriptor(CborValue * arr, CTAP_credentialDescriptor * cred);
39 | uint8_t parse_verify_exclude_list(CborValue * val);
40 |
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/fido2/solo_compat_layer.c:
--------------------------------------------------------------------------------
1 | #include "driver_timer.h"
2 | #include "solo_compat_layer.h"
3 | #include "comms_raw_hid.h"
4 | #include "platform_defines.h"
5 |
6 | uint32_t millis(void)
7 | {
8 | return timer_get_systick();
9 | }
10 |
11 | void usbhid_send(uint8_t * msg)
12 | {
13 | hid_packet_t* send_buf_ptr = comms_raw_hid_get_send_buffer(CTAP_INTERFACE);
14 |
15 | memcpy(send_buf_ptr, msg, USB_RAWHID_RX_SIZE);
16 |
17 | //comms_usb_debug_printf("Output buffer3:\n");
18 | //comms_usb_debug_printf("0x%02x 0x%02x 0x%02x 0x%02x\n", msg[0], msg[1], msg[2], msg[3]);
19 | //comms_usb_debug_printf("0x%02x 0x%02x 0x%02x 0x%02x\n", msg[4], msg[5], msg[6], msg[7]);
20 | //comms_usb_debug_printf("0x%02x 0x%02x 0x%02x 0x%02x\n", msg[8], msg[9], msg[10], msg[11]);
21 | //comms_usb_debug_printf("0x%02x 0x%02x 0x%02x 0x%02x\n", msg[12], msg[13], msg[14], msg[15]);
22 |
23 | comms_raw_hid_send_packet(CTAP_INTERFACE, send_buf_ptr, TRUE, USB_RAWHID_RX_SIZE);
24 | }
25 |
26 | void ctaphid_write_block(uint8_t * data)
27 | {
28 | usbhid_send(data);
29 | }
30 |
31 | void device_wink()
32 | {
33 | //TODO: 0x0ptr
34 | //main_mcu message to flash something on display?
35 | }
36 |
37 | #if defined DEBUG_LOG_DISABLED
38 |
39 | void dump_hex(uint8_t * buf, uint32_t size)
40 | {
41 | }
42 |
43 | #else
44 |
45 | void dump_hex(uint8_t * buf, uint32_t size)
46 | {
47 | uint32_t i;
48 | char tmp[50];
49 | uint32_t offset = 0;
50 | uint32_t byteno = 0;
51 |
52 | platform_io_uart_debug_printf("DATA [len: %d]", size);
53 |
54 | for (i = 0; i < size; ++i) {
55 | if ((i > 0) && (i % 16) == 0) {
56 | tmp[offset] = '\0';
57 | platform_io_uart_debug_printf("[%03X]: %s", byteno, tmp);
58 | offset = 0;
59 | byteno += 16;
60 | }
61 | offset += sprintf(&tmp[offset], "%02X ", buf[i]);
62 | }
63 | tmp[offset] = '\0';
64 | platform_io_uart_debug_printf("[%03X]: %s", byteno, tmp);
65 | }
66 |
67 | #endif
68 |
69 | int timestamp(void)
70 | {
71 | return millis();
72 | }
73 |
74 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/fido2/solo_compat_layer.h:
--------------------------------------------------------------------------------
1 | #include "platform_defines.h"
2 | #include "platform_io.h"
3 | #include "stdarg.h"
4 | #include "stdint.h"
5 | #include "ctap.h"
6 |
7 | uint32_t millis(void);
8 | void usbhid_send(uint8_t * msg);
9 | void ctaphid_write_block(uint8_t * data);
10 | void device_wink(void);
11 |
12 | void device_set_status(uint32_t status);
13 | int timestamp(void);
14 |
15 | void dump_hex(uint8_t * buf, uint32_t size);
16 | #define dump_hex1(tag,data,len) dump_hex(data, len);
17 |
18 | #if !defined DEBUG_LOG_DISABLED
19 | #define printf1(tag,fmt, ...) platform_io_uart_debug_printf(fmt, ##__VA_ARGS__)
20 | #define printf2(tag,fmt, ...) platform_io_uart_debug_printf(fmt, ##__VA_ARGS__)
21 | #define printf3(tag,fmt, ...) platform_io_uart_debug_printf(fmt, ##__VA_ARGS__)
22 |
23 | #else
24 | #define printf1(tag,fmt, ...)
25 | #define printf2(tag,fmt, ...)
26 | #define printf3(tag,fmt, ...)
27 | #endif
28 |
29 | #define TAG_HID 0
30 | #define TAG_ERR 0
31 | #define TAG_TIME 0
32 |
33 |
--------------------------------------------------------------------------------
/source_code/aux_mcu/src/main.h:
--------------------------------------------------------------------------------
1 | /*
2 | * main.h
3 | *
4 | * Created: 22/08/2018 15:32:12
5 | * Author: limpkin
6 | */
7 |
8 |
9 | #ifndef MAIN_H_
10 | #define MAIN_H_
11 |
12 | #include "platform_defines.h"
13 |
14 |
15 | /* Prototypes */
16 | void main_standby_sleep(BOOL startup_run);
17 | uint32_t main_check_stack_usage(void);
18 | void main_init_stack_tracking(void);
19 | void main_set_bootloader_flag(void);
20 | void main_platform_init(void);
21 |
22 |
23 | #endif /* MAIN_H_ */
24 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.20.0)
2 | list(APPEND BOARD_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
3 | find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
4 |
5 | project(aux_mcu_v2)
6 |
7 | target_sources(app PRIVATE src/main.c)
8 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/Kconfig:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | config BOARD_ENABLE_DCDC
4 | bool "DCDC mode"
5 | select SOC_DCDC_NRF52X
6 | default y
7 | depends on BOARD_MINIBLE_V2
8 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/Kconfig.defconfig:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | if BOARD_MINIBLE_V2
4 |
5 | config BT_CTLR
6 | default BT
7 |
8 | endif # BOARD_MINIBLE_V2
9 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/Kconfig.minible_v2:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | config BOARD_MINIBLE_V2
4 | select SOC_NRF52833_QDAA
5 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/board.cmake:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | board_runner_args(nrfjprog "--nrf-family=NRF52")
4 | board_runner_args(jlink "--device=nRF52833_xxAA" "--speed=4000")
5 | board_runner_args(pyocd "--target=nrf52833" "--frequency=4000000")
6 | include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
7 | include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
8 | include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
9 | include(${ZEPHYR_BASE}/boards/common/openocd-nrf5.board.cmake)
10 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/board.yml:
--------------------------------------------------------------------------------
1 | board:
2 | name: minible_v2
3 | vendor: stephanelectronics
4 | socs:
5 | - name: nrf52833
6 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/minible_v2_nrf52833-pinctrl.dtsi:
--------------------------------------------------------------------------------
1 | /*
2 | * SPDX-License-Identifier: Apache-2.0
3 | */
4 |
5 | &pinctrl {
6 | uart0_default: uart0_default {
7 | group1 {
8 | psels = ,
9 | ;
10 | };
11 | };
12 |
13 | uart0_sleep: uart0_sleep {
14 | group1 {
15 | psels = ,
16 | ;
17 | low-power-enable;
18 | };
19 | };
20 |
21 | uart1_default: uart1_default {
22 | group1 {
23 | psels = ,
24 | ,
25 | ,
26 | ;
27 | };
28 | };
29 |
30 | uart1_sleep: uart1_sleep {
31 | group1 {
32 | psels = ,
33 | ,
34 | ,
35 | ;
36 | low-power-enable;
37 | };
38 | };
39 | };
40 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/minible_v2_nrf52833.yaml:
--------------------------------------------------------------------------------
1 | identifier: stephanelectronics/minible_v2
2 | name: MINIBLE_V2-NRF52833
3 | type: mcu
4 | arch: arm
5 | toolchain:
6 | - zephyr
7 | - gnuarmemb
8 | - xtools
9 | supported:
10 | - usb_device
11 | - ble
12 | - gpio
13 | - watchdog
14 | - counter
15 | vendor: stephanelectronics
16 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/minible_v2_nrf52833_defconfig:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | # Enable MPU
4 | CONFIG_ARM_MPU=y
5 |
6 | # Enable hardware stack protection
7 | CONFIG_HW_STACK_PROTECTION=y
8 |
9 | # Enable PINCTRL:
10 | CONFIG_PINCTRL=y
11 |
12 | # enable GPIO
13 | CONFIG_GPIO=y
14 |
15 | # enable uart driver
16 | CONFIG_SERIAL=y
17 |
18 | # enable console
19 | CONFIG_CONSOLE=y
20 | CONFIG_UART_CONSOLE=y
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/boards/stephanelectronics/minible_v2/pre_dt_board.cmake:
--------------------------------------------------------------------------------
1 | # SPDX-License-Identifier: Apache-2.0
2 |
3 | # Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
4 | # - power@40000000 & clock@40000000 & bprot@40000000
5 | # - acl@4001e000 & flash-controller@4001e000
6 | list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
7 |
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/prj.conf:
--------------------------------------------------------------------------------
1 | CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
2 | CONFIG_NRFX_UARTE1=y
--------------------------------------------------------------------------------
/source_code/aux_mcu_v2/src/main.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Copyright (c) 2016 Intel Corporation
3 | *
4 | * SPDX-License-Identifier: Apache-2.0
5 | */
6 |
7 | #include
8 | #include
9 | #include
10 | #include
11 |
12 | /* 1000 msec = 1 sec */
13 | #define SLEEP_TIME_MS 1000
14 |
15 | /* The devicetree node identifier for the "led0" alias. */
16 | #define LED0_NODE DT_ALIAS(led0)
17 |
18 | // see https://github.com/Delsian/nrf_sdk/blob/master/examples/peripheral/experimental_libuarte/main.c
19 |
20 | /*
21 | * A build error on this line means your board is unsupported.
22 | * See the sample documentation for information on how to fix this.
23 | */
24 | static const struct gpio_dt_spec led = GPIO_DT_SPEC_GET(LED0_NODE, gpios);
25 |
26 | int main(void)
27 | {
28 | int ret;
29 | bool led_state = true;
30 |
31 | if (!gpio_is_ready_dt(&led)) {
32 | return 0;
33 | }
34 |
35 | ret = gpio_pin_configure_dt(&led, GPIO_OUTPUT_ACTIVE);
36 | if (ret < 0) {
37 | return 0;
38 | }
39 |
40 | while (1) {
41 | ret = gpio_pin_toggle_dt(&led);
42 | if (ret < 0) {
43 | return 0;
44 | }
45 |
46 | led_state = !led_state;
47 | printf("LED state: %s\n", led_state ? "ON" : "OFF");
48 | k_msleep(SLEEP_TIME_MS);
49 | }
50 | return 0;
51 | }
52 |
--------------------------------------------------------------------------------
/source_code/main_mcu/bootloader.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "bootloader", "bootloader.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug_V6|ARM = Debug_V6|ARM
11 | Release_V6|ARM = Release_V6|ARM
12 | Debug_V7|ARM = Debug_V7|ARM
13 | Release_V7|ARM = Release_V7|ARM
14 | EndGlobalSection
15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V6|ARM.ActiveCfg = Debug_V6|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V6|ARM.Build.0 = Debug_V6|ARM
18 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V6|ARM.ActiveCfg = Release_V6|ARM
19 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V6|ARM.Build.0 = Release_V6|ARM
20 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V7|ARM.ActiveCfg = Debug_V7|ARM
21 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V7|ARM.Build.0 = Debug_V7|ARM
22 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V7|ARM.ActiveCfg = Release_V7|ARM
23 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V7|ARM.Build.0 = Release_V7|ARM
24 | EndGlobalSection
25 | GlobalSection(SolutionProperties) = preSolution
26 | HideSolutionNode = FALSE
27 | EndGlobalSection
28 | EndGlobal
29 |
--------------------------------------------------------------------------------
/source_code/main_mcu/debian/compat:
--------------------------------------------------------------------------------
1 | 9
2 |
--------------------------------------------------------------------------------
/source_code/main_mcu/debian/control:
--------------------------------------------------------------------------------
1 | Source: minible
2 | Section: utils
3 | Priority: optional
4 | Maintainer: Mooltipass Team
5 | Build-Depends: debhelper (>=9), tar (>=1.27.1), gzip (>=1.6), build-essential, pkg-config, qtbase5-dev
6 | Standards-Version: 3.9.7
7 | Homepage: https://www.themooltipass.com/
8 | Vcs-Git: https://github.com/mooltipass/minible.git
9 | Vcs-Browser: https://github.com/mooltipass/minible
10 |
11 | Package: minible
12 | Architecture: any
13 | Depends: ${shlibs:Depends}, ${misc:Depends}, libqt5core5a, libqt5gui5, libqt5network5, libqt5widgets5, libqt5dbus5
14 | Description: Mooltipass Mini BLE Device Emulator
15 | This tool starts a Mooltipass Mini BLE device emulator inside your OS.
16 | It'll be able to connect with moolticute(d) in order to test the complete
17 | mooltipass ecosystem.
18 |
--------------------------------------------------------------------------------
/source_code/main_mcu/debian/copyright:
--------------------------------------------------------------------------------
1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2 | Upstream-Name: moolticute
3 | Source: https://github.com/mooltipass/moolticute
4 |
5 | Files: *
6 | Copyright: 2017-2020 Mooltipass Team
7 | License: GPL-3.0+
8 |
9 | Files: debian/*
10 | Copyright: 2017-2020 Mooltipass Team
11 | License: GPL-3.0+
12 |
13 | License: GPL-3.0+
14 | This program is free software: you can redistribute it and/or modify
15 | it under the terms of the GNU General Public License as published by
16 | the Free Software Foundation, either version 3 of the License, or
17 | (at your option) any later version.
18 | .
19 | This package is distributed in the hope that it will be useful,
20 | but WITHOUT ANY WARRANTY; without even the implied warranty of
21 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 | GNU General Public License for more details.
23 | .
24 | You should have received a copy of the GNU General Public License
25 | along with this program. If not, see .
26 | .
27 | On Debian systems, the complete text of the GNU General
28 | Public License version 3 can be found in "/usr/share/common-licenses/GPL-3".
29 |
30 |
31 |
--------------------------------------------------------------------------------
/source_code/main_mcu/debian/rules:
--------------------------------------------------------------------------------
1 | #!/usr/bin/make -f
2 |
3 | %:
4 | dh $@
5 |
6 |
--------------------------------------------------------------------------------
/source_code/main_mcu/debian/source/format:
--------------------------------------------------------------------------------
1 | 3.0 (native)
2 |
--------------------------------------------------------------------------------
/source_code/main_mcu/emu_assets/betatester_releases/bundle_not_numbered.img:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/emu_assets/betatester_releases/bundle_not_numbered.img
--------------------------------------------------------------------------------
/source_code/main_mcu/emu_assets/betatester_releases/bundle_numbered_with_white_silkscreen.img:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/emu_assets/betatester_releases/bundle_numbered_with_white_silkscreen.img
--------------------------------------------------------------------------------
/source_code/main_mcu/emu_assets/miniblebundle.img:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/emu_assets/miniblebundle.img
--------------------------------------------------------------------------------
/source_code/main_mcu/emu_assets/readme.md:
--------------------------------------------------------------------------------
1 | this folder contains assets used by the mini ble device emulator
2 |
--------------------------------------------------------------------------------
/source_code/main_mcu/mini_ble.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "mini_ble", "mini_ble.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug_V5|ARM = Debug_V5|ARM
11 | Debug_V6|ARM = Debug_V6|ARM
12 | Debug_V7|ARM = Debug_V7|ARM
13 | Release_V5|ARM = Release_V5|ARM
14 | Release_V6|ARM = Release_V6|ARM
15 | Release_V7|ARM = Release_V7|ARM
16 | V2_Debug_V1dev|ARM = V2_Debug_V1dev|ARM
17 | V2_Release_V1dev|ARM = V2_Release_V1dev|ARM
18 | EndGlobalSection
19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
20 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V5|ARM.ActiveCfg = Debug_V5|ARM
21 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V5|ARM.Build.0 = Debug_V5|ARM
22 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V6|ARM.ActiveCfg = Debug_V6|ARM
23 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V6|ARM.Build.0 = Debug_V6|ARM
24 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V7|ARM.ActiveCfg = Debug_V7|ARM
25 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug_V7|ARM.Build.0 = Debug_V7|ARM
26 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V5|ARM.ActiveCfg = Release_V5|ARM
27 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V5|ARM.Build.0 = Release_V5|ARM
28 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V6|ARM.ActiveCfg = Release_V6|ARM
29 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V6|ARM.Build.0 = Release_V6|ARM
30 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V7|ARM.ActiveCfg = Release_V7|ARM
31 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release_V7|ARM.Build.0 = Release_V7|ARM
32 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.V2_Debug_V1dev|ARM.ActiveCfg = V2_Debug_V1dev|ARM
33 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.V2_Debug_V1dev|ARM.Build.0 = V2_Debug_V1dev|ARM
34 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.V2_Release_V1dev|ARM.ActiveCfg = V2_Release_V1dev|ARM
35 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.V2_Release_V1dev|ARM.Build.0 = V2_Release_V1dev|ARM
36 | EndGlobalSection
37 | GlobalSection(SolutionProperties) = preSolution
38 | HideSolutionNode = FALSE
39 | EndGlobalSection
40 | EndGlobal
41 |
--------------------------------------------------------------------------------
/source_code/main_mcu/mini_ble_ext.atsln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Atmel Studio Solution File, Format Version 11.00
4 | VisualStudioVersion = 14.0.23107.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "mini_ble", "mini_ble_ext.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|ARM = Debug|ARM
11 | Release|ARM = Release|ARM
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM
15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM
16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM
17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/source_code/main_mcu/openocd.cfg:
--------------------------------------------------------------------------------
1 | #interface cmsis-dap
2 | source [find interface/cmsis-dap.cfg]
3 | transport select swd
4 | cmsis_dap_vid_pid 0x03eb 0x2141
5 |
6 | # chip name
7 | set CHIPNAME at91samd21g18a
8 |
9 | source [find target/at91samdXX.cfg]
10 |
11 | reset_config srst_only srst_nogate connect_assert_srst
12 |
13 | init
14 | reset
15 | halt
16 |
17 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/common2/boards/user_board/init.c:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board initialization template
5 | *
6 | */
7 | /*
8 | * Support and FAQ: visit Atmel Support
9 | */
10 |
11 | #include
12 | #include
13 | #include
14 |
15 | #if defined(__GNUC__)
16 | void board_init(void) WEAK __attribute__((alias("system_board_init")));
17 | #elif defined(__ICCARM__)
18 | void board_init(void);
19 | # pragma weak board_init=system_board_init
20 | #endif
21 |
22 | void system_board_init(void)
23 | {
24 | /* This function is meant to contain board-specific initialization code
25 | * for, e.g., the I/O pins. The initialization can rely on application-
26 | * specific board configuration, found in conf_board.h.
27 | */
28 | }
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/common2/boards/user_board/user_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board definition template
5 | *
6 | */
7 |
8 | /* This file is intended to contain definitions and configuration details for
9 | * features and devices that are available on the board, e.g., frequency and
10 | * startup time for an external crystal, external memory devices, LED and USART
11 | * pins.
12 | */
13 | /*
14 | * Support and FAQ: visit Atmel Support
15 | */
16 |
17 | #ifndef USER_BOARD_H
18 | #define USER_BOARD_H
19 |
20 | #include
21 |
22 | #ifdef __cplusplus
23 | extern "C" {
24 | #endif
25 |
26 | /**
27 | * \ingroup group_common_boards
28 | * \defgroup user_board_group User board
29 | *
30 | * @{
31 | */
32 |
33 | void system_board_init(void);
34 |
35 | /** Name string macro */
36 | #define BOARD_NAME "USER_BOARD"
37 |
38 | /** @} */
39 |
40 | #ifdef __cplusplus
41 | }
42 | #endif
43 |
44 | #endif // USER_BOARD_H
45 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/sam0/drivers/system/clock/clock.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief SAM Clock Driver
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 | #ifndef SYSTEM_CLOCK_H_INCLUDED
47 | #define SYSTEM_CLOCK_H_INCLUDED
48 |
49 | #include
50 | #include
51 | #include
52 |
53 | #endif /* SYSTEM_CLOCK_H_INCLUDED */
54 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/sam0/utils/preprocessor/preprocessor.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Preprocessor utils.
5 | *
6 | * Copyright (C) 2012-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef _PREPROCESSOR_H_
48 | #define _PREPROCESSOR_H_
49 |
50 | #include "tpaste.h"
51 | #include "stringz.h"
52 | #include "mrepeat.h"
53 | #include "mrecursion.h"
54 |
55 | #endif // _PREPROCESSOR_H_
56 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/thirdparty/CMSIS/ATMEL-disclaimer.txt:
--------------------------------------------------------------------------------
1 | /*
2 | * Only the CMSIS required parts for ASF are included here, go to the below
3 | * address for the full package:
4 | * http://www.arm.com/products/processors/cortex-m/cortex-microcontroller-software-interface-standard.php
5 | *
6 | * The library file thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math_softfp.a was generated by ATMEL, which
7 | * is support -mfloat-abi=softfp compiler flag, and this is also the default selection for device that
8 | * have FPU module and enabled.
9 | * If customer want to use -mfloat-abi=hard compiler flag, the project compile/link flag and link library
10 | * should be manual modified. The library thirdparty/CMSIS/Lib/GCC/libarm_cortexM4lf_math.a is used for
11 | * -mfloat-abi=hard configration.
12 | *
13 | * __CORTEX_SC is not defined for cortex-m0+, and may cause compiler warning, so the include file
14 | * thirdparty/CMSIS/Include/core_cmInstr.h was modified to void such warning.
15 | * Modified from:
16 | * #if (__CORTEX_M >= 0x03) || (__CORTEX_SC >= 300)
17 | * to:
18 | * #if (__CORTEX_M >= 0x03) || ((defined(__CORTEX_SC)) && (__CORTEX_SC >= 300))
19 | *
20 | */
21 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/src/ASF/thirdparty/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/src/ASF/thirdparty/CMSIS/Lib/GCC/libarm_cortexM0l_math.a
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/thirdparty/CMSIS/Lib/license.txt:
--------------------------------------------------------------------------------
1 | All pre-build libraries contained in the folders "ARM" and "GCC"
2 | are guided by the following license:
3 |
4 | Copyright (C) 2009-2014 ARM Limited.
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 | - Redistributions of source code must retain the above copyright
10 | notice, this list of conditions and the following disclaimer.
11 | - Redistributions in binary form must reproduce the above copyright
12 | notice, this list of conditions and the following disclaimer in the
13 | documentation and/or other materials provided with the distribution.
14 | - Neither the name of ARM nor the names of its contributors may be used
15 | to endorse or promote products derived from this software without
16 | specific prior written permission.
17 |
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 | POSSIBILITY OF SUCH DAMAGE.
29 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/ASF/thirdparty/CMSIS/README.txt:
--------------------------------------------------------------------------------
1 | * -------------------------------------------------------------------
2 | * Copyright (C) 2011-2014 ARM Limited. All rights reserved.
3 | *
4 | * Date: 17 February 2014
5 | * Revision: V4.00
6 | *
7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS)
8 | * Title: Release Note for CMSIS
9 | *
10 | * -------------------------------------------------------------------
11 |
12 |
13 | NOTE - Open the index.html file to access CMSIS documentation
14 |
15 |
16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all
17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects
18 | and reduces time-to-market for new embedded applications.
19 |
20 | CMSIS is released under the terms of the end user license agreement ("CMSIS_END_USER_LICENCE_AGREEMENT.pdf").
21 | Any user of the software package is bound to the terms and conditions of the end user license agreement.
22 |
23 |
24 | You will find the following sub-directories:
25 |
26 | Documentation - Contains CMSIS documentation.
27 |
28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the
29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors.
30 |
31 | Include - CMSIS Core Support and CMSIS DSP Include Files.
32 |
33 | Lib - CMSIS DSP Libraries.
34 |
35 | RTOS - CMSIS RTOS API template header file.
36 |
37 | Driver - CMSIS Peripheral Driver Interface.
38 |
39 | Pack - CMSIS Software Packs.
40 | Mechanism to install software, device support, APIs, and example projects.
41 |
42 | SVD - CMSIS SVD Schema files and Conversion Utility.
43 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/CLOCKS/driver_clocks.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file driver_clocks.h
18 | * \brief Platform clocks related functions
19 | * Created: 10/11/2017
20 | * Author: Mathieu Stephan
21 | */
22 |
23 | #ifndef CLOCKS_POWER_H_
24 | #define CLOCKS_POWER_H_
25 |
26 | /* Prototypes */
27 | void clocks_map_gclk_to_peripheral_clock(uint32_t gclk_id, uint32_t peripheral_clk_id);
28 | void clocks_start_48MDFLL(void);
29 |
30 |
31 | #endif /* CLOCKS_POWER_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/COMMS/comms_bootloader_msg.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file comms_bootloader_msg.h
18 | * \brief Typedefs for bootloader messages
19 | * Created: 09/05/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 | #ifndef COMMS_BOOTLOADER_MSG_H_
24 | #define COMMS_BOOTLOADER_MSG_H_
25 |
26 | #include
27 |
28 | /* Defines */
29 | #define BOOTLOADER_START_PROGRAMMING_COMMAND 0x0000
30 | #define BOOTLOADER_WRITE_COMMAND 0x0001
31 | #define BOOTLOADER_START_APP_COMMAND 0x0002
32 |
33 | /* Typedefs */
34 | /* 0x0000: enter programming command */
35 | typedef struct
36 | {
37 | uint32_t image_length;
38 | uint32_t crc;
39 | } aux_mcu_bootloader_programming_command_contents_t;
40 |
41 | /* 0x0001: write command */
42 | typedef struct
43 | {
44 | uint32_t size;
45 | uint32_t crc;
46 | uint32_t address;
47 | uint8_t payload[512];
48 | } aux_mcu_bootloader_write_command_contents_t;
49 |
50 | typedef struct
51 | {
52 | uint16_t command;
53 | union
54 | {
55 | aux_mcu_bootloader_programming_command_contents_t programming_command;
56 | aux_mcu_bootloader_write_command_contents_t write_command;
57 | };
58 | } aux_mcu_bootloader_message_t;
59 |
60 |
61 | #endif /* COMMS_BOOTLOADER_MSG_H_ */
62 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/COMMS/comms_hid_msgs.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file comms_hid_msgs.h
18 | * \brief HID communications
19 | * Created: 06/03/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef COMMS_HID_MSGS_H_
25 | #define COMMS_HID_MSGS_H_
26 |
27 | #include "comms_aux_mcu_defines.h"
28 |
29 | /* Prototypes */
30 | void comms_hid_msgs_parse(hid_message_t* rcv_msg, uint16_t supposed_payload_length, msg_restrict_type_te answer_restrict_type, BOOL is_message_from_usb);
31 | void comms_hid_msgs_update_message_fields(aux_mcu_message_t* message_pt, BOOL usb_hid_message, uint16_t message_type, uint16_t hid_payload_size);
32 | aux_mcu_message_t* comms_hid_msgs_get_empty_hid_packet(BOOL usb_hid_message, uint16_t message_type, uint16_t hid_payload_size);
33 | void comms_hid_msgs_update_message_payload_length_fields(aux_mcu_message_t* message_pt, uint16_t hid_payload_size);
34 | void comms_hid_msgs_send_ack_nack_message(BOOL usb_hid_message, uint16_t message_type, BOOL ack_message);
35 | uint16_t comms_hid_msgs_fill_get_status_message_answer(uint16_t* msg_array_uint16);
36 |
37 | #endif /* COMMS_HID_MSGS_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/COMMS/comms_hid_msgs_debug.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file comms_hid_msgs_debug.h
18 | * \brief HID debug communications
19 | * Created: 06/03/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef COMMS_HID_MSGS_DEBUG_H_
25 | #define COMMS_HID_MSGS_DEBUG_H_
26 |
27 | #include "comms_hid_defines.h"
28 |
29 | /* Prototypes */
30 | void comms_hid_msgs_parse_debug(hid_message_t* rcv_msg, uint16_t supposed_payload_length, msg_restrict_type_te answer_restrict_type, BOOL is_message_from_usb);
31 | #ifdef DEBUG_USB_PRINTF_ENABLED
32 | void comms_hid_msgs_debug_printf(const char *fmt, ...);
33 | #else
34 | #define comms_hid_msgs_debug_printf(...) ()
35 | #endif
36 |
37 |
38 | #endif /* COMMS_HID_MSGS_DEBUG_H_ */
39 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/COMMS/comms_hid_msgs_debug_defines.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2020 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file comms_hid_msgs_debug_defines.h
18 | * \brief Defines for aux debug HID comms
19 | * Created: 20/05/2020
20 | * Author: Mathieu Stephan
21 | */
22 | #ifndef COMMS_HID_MSGS_DEBUG_DEFINES_H_
23 | #define COMMS_HID_MSGS_DEBUG_DEFINES_H_
24 |
25 | /* Defines */
26 | #define HID_MESSAGE_START_CMD_ID_DBG 0x8000
27 |
28 | // Command IDs
29 | #define HID_CMD_ID_DBG_MSG 0x8000
30 | #define HID_CMD_ID_OPEN_DISP_BUFFER 0x8001
31 | #define HID_CMD_ID_SEND_TO_DISP_BUFFER 0x8002
32 | #define HID_CMD_ID_CLOSE_DISP_BUFFER 0x8003
33 | #define HID_CMD_ID_ERASE_DATA_FLASH 0x8004
34 | #define HID_CMD_ID_IS_DATA_FLASH_READY 0x8005
35 | #define HID_CMD_ID_DATAFLASH_WRITE_256B 0x8006
36 | #define HID_CMD_ID_START_BOOTLOADER 0x8007
37 | #define HID_CMD_ID_GET_ACC_32_SAMPLES 0x8008
38 | #define HID_CMD_ID_FLASH_AUX_MCU 0x8009
39 | #define HID_CMD_ID_GET_DBG_PLAT_INFO 0x800A
40 | #define HID_CMD_ID_REINDEX_BUNDLE 0x800B
41 | #define HID_CMD_ID_SET_OLED_PARAMS 0x800C
42 | #define HID_CMD_ID_GET_BATTERY_STATUS 0x800D
43 | #define HID_CMD_ID_FLASH_AUX_AND_MAIN 0x800E
44 | #define HID_CMD_ID_GET_TIMESTAMP 0x800F
45 | #define HID_CMD_ID_SET_PLAT_UNIQUE_DATA 0x8010
46 |
47 | #endif /* COMMS_HID_MSGS_DEBUG_DEFINES_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/DMA/dma.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*
18 | * dma.h
19 | *
20 | * Created: 29/05/2017 09:18:00
21 | * Author: stephan
22 | */
23 |
24 |
25 | #ifndef DMA_H_
26 | #define DMA_H_
27 |
28 | #include "platform_defines.h"
29 |
30 | /* Prototypes */
31 | void dma_oled_init_transfer(Sercom* sercom, void* datap, uint16_t size, uint16_t dma_trigger);
32 | void dma_acc_init_transfer(Sercom* sercom, void* datap, uint16_t size, uint8_t* read_cmd);
33 | uint32_t dma_compute_crc32_from_spi(Sercom* sercom, uint32_t size);
34 | void dma_aux_mcu_init_tx_transfer(Sercom* sercom, void* datap, uint16_t size);
35 | void dma_aux_mcu_init_rx_transfer(Sercom* sercom, void* datap, uint16_t size);
36 | void dma_custom_fs_init_transfer(Sercom* sercom, void* datap, uint16_t size);
37 | BOOL dma_aux_mcu_wait_for_current_packet_reception_and_clear_flag(void);
38 | uint16_t dma_aux_mcu_get_remaining_bytes_for_rx_transfer(void);
39 | BOOL dma_custom_fs_check_and_clear_dma_transfer_flag(void);
40 | BOOL dma_aux_mcu_check_and_clear_dma_transfer_flag(void);
41 | BOOL dma_oled_check_and_clear_dma_transfer_flag(void);
42 | BOOL dma_acc_check_and_clear_dma_transfer_flag(void);
43 | BOOL dma_aux_mcu_is_rx_transfer_already_init(void);
44 | BOOL dma_aux_mcu_check_dma_transfer_flag(void);
45 | void dma_wait_for_aux_mcu_packet_sent(void);
46 | BOOL dma_acc_check_dma_transfer_flag(void);
47 | void dma_aux_mcu_disable_transfer(void);
48 | void dma_set_custom_fs_flag_done(void);
49 | void dma_acc_disable_transfer(void);
50 | void dma_reset(void);
51 | void dma_init(void);
52 |
53 |
54 | #endif /* DMA_H_ */
55 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/asf.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include
3 |
4 | typedef struct {} Sercom;
5 | typedef union {
6 | struct {
7 | uint32_t SECOND:6;
8 | uint32_t MINUTE:6;
9 | uint32_t HOUR:5;
10 | uint32_t DAY:5;
11 | uint32_t MONTH:4;
12 | uint32_t YEAR:6;
13 | } bit;
14 |
15 | uint32_t reg;
16 | } RTC_MODE2_CLOCK_Type;
17 |
18 | extern Sercom sercom_array[6];
19 |
20 | #define SERCOM0 (&sercom_array[0])
21 | #define SERCOM1 (&sercom_array[1])
22 | #define SERCOM2 (&sercom_array[2])
23 | #define SERCOM3 (&sercom_array[3])
24 | #define SERCOM4 (&sercom_array[4])
25 | #define SERCOM5 (&sercom_array[5])
26 | #define NVMCTRL_ROW_SIZE (256)
27 |
28 | void cpu_irq_enter_critical(void);
29 | void cpu_irq_leave_critical(void);
30 |
31 | static inline uint16_t swap16(uint16_t v) {
32 | return (v<<8)|(v>>8);
33 | }
34 |
35 | extern struct emu_port_t {
36 | struct {
37 | struct {
38 | uint32_t reg;
39 | } OUTCLR, OUTSET;
40 | } Group[2];
41 | } *PORT;
42 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/dbflash.c:
--------------------------------------------------------------------------------
1 | #include "dbflash.h"
2 | #include "emu_storage.h"
3 |
4 | #include
5 | #include
6 |
7 | void dbflash_write_data_pattern_to_flash(spi_flash_descriptor_t* descriptor_pt, uint16_t pageNumber, uint16_t offset, uint16_t dataSize, uint8_t pattern)
8 | {
9 | char *tmp = malloc(dataSize);
10 | memset(tmp, pattern, dataSize);
11 | dbflash_write_data_to_flash(descriptor_pt, pageNumber, offset, dataSize, tmp);
12 | free(tmp);
13 | }
14 |
15 | void dbflash_read_data_from_flash(spi_flash_descriptor_t* descriptor_pt, uint16_t pageNumber, uint16_t offset, uint16_t dataSize, void *data)
16 | {
17 | emu_dbflash_read(pageNumber * BYTES_PER_PAGE + offset, data, dataSize);
18 | }
19 |
20 | void dbflash_write_data_to_flash(spi_flash_descriptor_t* descriptor_pt, uint16_t pageNumber, uint16_t offset, uint16_t dataSize, void *data)
21 | {
22 | emu_dbflash_write(pageNumber * BYTES_PER_PAGE + offset, data, dataSize);
23 | }
24 |
25 | void dbflash_page_erase(spi_flash_descriptor_t* descriptor_pt, uint16_t pageNumber)
26 | {
27 | char *tmp = malloc(BYTES_PER_PAGE);
28 | memset(tmp, 0xFF, BYTES_PER_PAGE);
29 | dbflash_write_data_to_flash(descriptor_pt, pageNumber, 0, BYTES_PER_PAGE, tmp);
30 | free(tmp);
31 | }
32 |
33 | static BOOL initialized = FALSE;
34 |
35 | RET_TYPE dbflash_check_presence(spi_flash_descriptor_t* descriptor_pt)
36 | {
37 | if(!initialized) {
38 | initialized = TRUE;
39 | emu_dbflash_open();
40 | }
41 |
42 | return RETURN_OK;
43 | }
44 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/driver_sercom.c:
--------------------------------------------------------------------------------
1 | #include "driver_sercom.h"
2 | #include "platform_defines.h"
3 | #include "emu_oled.h"
4 |
5 | Sercom sercom_array[6];
6 |
7 | void sercom_spi_init(Sercom* sercom_pt, uint32_t sercom_baud_div, spi_mode_te mode, spi_hss_te hss, spi_miso_pad_te miso_pad, spi_mosi_sck_ss_pad_te mosi_sck_ss_pad, BOOL receiver_enabled){}
8 |
9 | void sercom_spi_send_single_byte_without_receive_wait(Sercom* sercom_pt, uint8_t data){
10 | if(sercom_pt == OLED_SERCOM) {
11 | emu_oled_byte(data);
12 | }
13 | }
14 | uint8_t sercom_spi_send_single_byte(Sercom* sercom_pt, uint8_t data) {
15 | if(sercom_pt == OLED_SERCOM) {
16 | emu_oled_byte(data);
17 | }
18 | return 0;
19 | }
20 | void sercom_spi_wait_for_transmit_complete(Sercom* sercom_pt) {
21 | if(sercom_pt == OLED_SERCOM) {
22 | emu_oled_flush();
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_aux_mcu.h:
--------------------------------------------------------------------------------
1 | #ifndef EMU_AUX_MCU_H
2 | #define EMU_AUX_MCU_H
3 |
4 | void emu_send_aux(char *data, int size);
5 | int emu_rcv_aux(char *data, int size);
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_dataflash.h:
--------------------------------------------------------------------------------
1 | #ifndef EMU_DATAFLASH_H
2 | #define EMU_DATAFLASH_H
3 |
4 | #ifdef __cplusplus
5 | extern "C" {
6 | #endif
7 |
8 | void emu_dataflash_init(const char *path);
9 |
10 | #ifdef __cplusplus
11 | }
12 | #endif
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_oled.h:
--------------------------------------------------------------------------------
1 | #ifndef _EMU_OLED_H
2 | #define _EMU_OLED_H
3 | #include
4 |
5 | #ifdef __cplusplus
6 |
7 | #include
8 | #include
9 |
10 | class OLEDWidget: public QWidget {
11 | public:
12 | QImage display;
13 | bool display_on = true;
14 | OLEDWidget();
15 | ~OLEDWidget();
16 |
17 | void update_display(const uint8_t *fb);
18 | void set_display_on(bool on);
19 |
20 | protected:
21 | virtual void paintEvent(QPaintEvent *);
22 | virtual void wheelEvent(QWheelEvent *evt);
23 | virtual void mousePressEvent(QMouseEvent *evt);
24 | virtual void mouseReleaseEvent(QMouseEvent *evt);
25 | virtual void keyPressEvent(QKeyEvent *evt);
26 | virtual void keyReleaseEvent(QKeyEvent *evt);
27 | };
28 |
29 | extern "C" {
30 | #endif
31 |
32 | void emu_oled_byte(uint8_t data);
33 | void emu_oled_flush(void);
34 |
35 | #ifdef __cplusplus
36 | }
37 | #endif
38 |
39 |
40 | #endif
41 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_smartcard.cpp:
--------------------------------------------------------------------------------
1 | #include "emu_smartcard.h"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | static QMutex smc_mutex;
8 | static emu_smartcard_t card;
9 | static bool card_present = false;
10 | static QFile smartcardFile;
11 |
12 | struct emu_smartcard_t *emu_open_smartcard()
13 | {
14 | smc_mutex.lock();
15 | if(card_present) {
16 | return &card;
17 |
18 | } else {
19 | smc_mutex.unlock();
20 | return NULL;
21 | }
22 | }
23 |
24 | void emu_close_smartcard(BOOL written)
25 | {
26 | if(written) {
27 | smartcardFile.seek(0);
28 | smartcardFile.write((char*)&card, sizeof(card));
29 | smartcardFile.flush();
30 | }
31 | smc_mutex.unlock();
32 | }
33 |
34 | bool emu_insert_smartcard(QString filePath)
35 | {
36 | QMutexLocker locker(&smc_mutex);
37 | smartcardFile.close();
38 |
39 | memset(&card, 0, sizeof(card));
40 |
41 | smartcardFile.setFileName(filePath);
42 | if(!smartcardFile.exists() || !smartcardFile.open(QIODevice::ReadWrite))
43 | return false;
44 |
45 | smartcardFile.read((char*)&card.storage, sizeof(card.storage));
46 | card_present = true;
47 |
48 | return true;
49 | }
50 |
51 | bool emu_insert_new_smartcard(QString filePath, int smartcard_type)
52 | {
53 | QMutexLocker locker(&smc_mutex);
54 | smartcardFile.close();
55 |
56 | memset(&card, 0, sizeof(card));
57 |
58 | card_present = true;
59 | emu_init_smartcard(&card.storage, smartcard_type);
60 |
61 | if(!filePath.isEmpty()) {
62 | smartcardFile.setFileName(filePath);
63 | if(!smartcardFile.open(QIODevice::ReadWrite))
64 | return false;
65 |
66 | smartcardFile.write((char*)&card.storage, sizeof(card.storage));
67 | smartcardFile.flush();
68 | }
69 |
70 | card_present = true;
71 | return true;
72 | }
73 |
74 | void emu_remove_smartcard() {
75 | QMutexLocker locker(&smc_mutex);
76 | smartcardFile.close();
77 | card_present = false;
78 | }
79 |
80 | void emu_reset_smartcard() {
81 | QMutexLocker locker(&smc_mutex);
82 | card.unlocked = FALSE;
83 | }
84 |
85 | bool emu_is_smartcard_inserted()
86 | {
87 | return card_present;
88 | }
89 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_smartcard.h:
--------------------------------------------------------------------------------
1 | #ifndef EMU_SMARTCARD_H
2 | #define EMU_SMARTCARD_H
3 | #include
4 | #include "defines.h"
5 |
6 | #ifdef __cplusplus
7 | #include
8 | extern "C" {
9 | #endif
10 |
11 | /* this is not an accurate model of the card, but it works for our purposes */
12 | struct emu_smartcard_storage_t {
13 | uint8_t smc[1568];
14 | uint8_t fuses[3];
15 | uint8_t type;
16 | };
17 |
18 | struct emu_smartcard_t {
19 | struct emu_smartcard_storage_t storage;
20 | BOOL unlocked;
21 | };
22 |
23 | // NULL means no card present
24 | struct emu_smartcard_t *emu_open_smartcard(void);
25 | void emu_close_smartcard(BOOL written);
26 |
27 | enum { EMU_SMARTCARD_REGULAR, EMU_SMARTCARD_INVALID, EMU_SMARTCARD_BROKEN };
28 | void emu_init_smartcard(struct emu_smartcard_storage_t *smartcard, int smartcard_type);
29 | void emu_reset_smartcard();
30 |
31 | #ifdef __cplusplus
32 |
33 | bool emu_insert_smartcard(QString filePath);
34 | bool emu_insert_new_smartcard(QString filePath, int smartcard_type = EMU_SMARTCARD_REGULAR);
35 | void emu_remove_smartcard();
36 | bool emu_is_smartcard_inserted();
37 |
38 |
39 | }
40 | #endif
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_storage.cpp:
--------------------------------------------------------------------------------
1 | #include "emu_storage.h"
2 |
3 | #include
4 | #include
5 | #include
6 |
7 | static QFile eeprom("eeprom.bin");
8 | static QFile dbflash("dbflash.bin");
9 | static bool emu_open_flash(QFile & flashFile)
10 | {
11 | if(!flashFile.open(QIODevice::ReadWrite)) {
12 | qWarning() << "Failed to open emulated flash" << flashFile.fileName();
13 | abort();
14 | }
15 |
16 | return flashFile.size() > 0;
17 | }
18 |
19 | static void emu_extend_flash(QFile & flashFile, int size)
20 | {
21 | if(flashFile.size() < size) {
22 | flashFile.seek(flashFile.size());
23 | int extend_size = size - flashFile.size();
24 | flashFile.write(QByteArray(extend_size, '\xff'));
25 | }
26 |
27 | flashFile.flush();
28 | }
29 |
30 | static void emu_flash_read(QFile & flashFile, int offset, uint8_t *buf, int length)
31 | {
32 | if(flashFile.isOpen()) {
33 | emu_extend_flash(flashFile, offset+length);
34 | flashFile.seek(offset);
35 | flashFile.read((char*)buf, length);
36 |
37 | } else {
38 | memset(buf, 0xff, length);
39 | }
40 | }
41 |
42 | static void emu_flash_write(QFile & flashFile, int offset, uint8_t *buf, int length)
43 | {
44 | if(flashFile.isOpen()) {
45 | emu_extend_flash(flashFile, offset+length);
46 | flashFile.seek(offset);
47 | flashFile.write((char*)buf, length);
48 | flashFile.flush();
49 | }
50 | }
51 |
52 | BOOL emu_eeprom_open()
53 | {
54 | return emu_open_flash(eeprom);
55 | }
56 |
57 | void emu_eeprom_read(int offset, uint8_t *buf, int length)
58 | {
59 | return emu_flash_read(eeprom, offset, buf, length);
60 | }
61 |
62 | void emu_eeprom_write(int offset, uint8_t *buf, int length)
63 | {
64 | return emu_flash_write(eeprom, offset, buf, length);
65 | }
66 |
67 | BOOL emu_dbflash_open()
68 | {
69 | return emu_open_flash(dbflash);
70 | }
71 |
72 | void emu_dbflash_read(int offset, uint8_t *buf, int length)
73 | {
74 | return emu_flash_read(dbflash, offset, buf, length);
75 | }
76 |
77 | void emu_dbflash_write(int offset, uint8_t *buf, int length)
78 | {
79 | return emu_flash_write(dbflash, offset, buf, length);
80 | }
81 |
82 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emu_storage.h:
--------------------------------------------------------------------------------
1 | #ifndef EMU_STORAGE_H
2 | #define EMU_STORAGE_H
3 | #include
4 | #include "defines.h"
5 |
6 | #ifdef __cplusplus
7 | extern "C" {
8 | #endif
9 |
10 | BOOL emu_eeprom_open(void);
11 | void emu_eeprom_read(int offset, uint8_t *buf, int length);
12 | void emu_eeprom_write(int offset, uint8_t *buf, int length);
13 |
14 | BOOL emu_dbflash_open(void);
15 | void emu_dbflash_read(int offset, uint8_t *buf, int length);
16 | void emu_dbflash_write(int offset, uint8_t *buf, int length);
17 |
18 | #ifdef __cplusplus
19 | }
20 | #endif
21 |
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emulator.h:
--------------------------------------------------------------------------------
1 | #ifndef _EMULATOR_H
2 | #define _EMULATOR_H
3 | #include
4 | #include "defines.h"
5 |
6 | #ifdef __cplusplus
7 |
8 | class QMutex;
9 | extern QMutex irq_mutex;
10 |
11 | class OLEDWidget;
12 | extern OLEDWidget *oled;
13 |
14 | extern "C" {
15 | #endif
16 |
17 | void emu_appexit_test(void);
18 | void emu_send_hid(char *data, int size);
19 | int emu_rcv_hid(char *data, int size);
20 |
21 | int emu_get_battery_level(void);
22 | BOOL emu_get_usb_charging(void);
23 | void emu_charger_enable(BOOL en);
24 |
25 | BOOL emu_get_systick(uint32_t *value);
26 |
27 | BOOL emu_get_lefthanded(void);
28 |
29 | int emu_get_failure_flags(void);
30 | /* Keep this in sync with EmuWindow::createFailuresUi */
31 | enum {
32 | EMU_FAIL_SMARTCARD_INSECURE=1,
33 | EMU_FAIL_DBFLASH_FULL=2,
34 | EMU_FAIL_EEPROM_FULL=4,
35 | };
36 |
37 | #ifdef __cplusplus
38 | }
39 | #endif
40 |
41 | #endif
42 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/emulator_ui.h:
--------------------------------------------------------------------------------
1 | #ifndef EMULATOR_UI_H
2 | #define EMULATOR_UI_H
3 |
4 | #include
5 |
6 | class EmuWindow: public QWidget {
7 | public:
8 | EmuWindow();
9 |
10 | private:
11 | QWidget *createSmartcardUi();
12 | QWidget *createBatteryUi();
13 | QWidget *createChargerUi();
14 | QWidget *createAccelerometerUi();
15 | QWidget *createFailuresUi();
16 | };
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/fuses.c:
--------------------------------------------------------------------------------
1 | #include "fuses.h"
2 | RET_TYPE fuses_check_program(BOOL flash_fuses) { return RETURN_OK; }
3 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/lis2hh12.c:
--------------------------------------------------------------------------------
1 | #include "lis2hh12.h"
2 | #include
3 | #include
4 | #include
5 | #include
6 | #include "emulator.h"
7 |
8 | static int urandom = -1;
9 |
10 | BOOL lis2hh12_check_data_received_flag_and_arm_other_transfer(accelerometer_descriptor_t* descriptor_pt, BOOL arm_other_transfer)
11 | {
12 | int16_t base_x = emu_get_lefthanded() ? 16384 : -16384;
13 | int16_t base_y = 0;
14 | int16_t base_z = 0;
15 | (void)arm_other_transfer;
16 | for (uint16_t i = 0; i < MEMBER_ARRAY_SIZE(acc_single_fifo_read_t, acc_data_array); i++)
17 | {
18 | descriptor_pt->fifo_read.acc_data_array[i].acc_x = base_x + ((uint16_t)rand() & 0x000F);
19 | descriptor_pt->fifo_read.acc_data_array[i].acc_y = base_y + ((uint16_t)rand() & 0x000F);
20 | descriptor_pt->fifo_read.acc_data_array[i].acc_z = base_z + ((uint16_t)rand() & 0x000F);
21 | }
22 | return TRUE;
23 | }
24 |
25 | RET_TYPE lis2hh12_check_presence_and_configure(accelerometer_descriptor_t* descriptor_pt){srand ((unsigned int) time (NULL));return RETURN_OK; }
26 | /*
27 | void lis2hh12_send_command(accelerometer_descriptor_t* descriptor_pt, uint8_t* data, uint32_t length){}
28 | void lis2hh12_manual_acc_data_read(accelerometer_descriptor_t* descriptor_pt, acc_data_t* data_pt){}
29 | void lis2hh12_deassert_ncs_and_go_to_sleep(accelerometer_descriptor_t* descriptor_pt){}
30 | void lis2hh12_sleep_exit_and_dma_arm(accelerometer_descriptor_t* descriptor_pt){}
31 | int16_t lis2hh12_get_temperature(accelerometer_descriptor_t* descriptor_pt){}
32 | void lis2hh12_dma_arm(accelerometer_descriptor_t* descriptor_pt){}
33 | void lis2hh12_reset(accelerometer_descriptor_t* descriptor_pt){}
34 | */
35 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/mp2710.c:
--------------------------------------------------------------------------------
1 | #include "mp2710.h"
--------------------------------------------------------------------------------
/source_code/main_mcu/src/EMU/qt_metacall_helper.h:
--------------------------------------------------------------------------------
1 | #ifndef _QT_METACALL_HELPER
2 | #define _QT_METACALL_HELPER
3 |
4 | #include
5 | #include
6 | #include
7 | // https://github.com/KubaO/stackoverflown/tree/master/questions/metacall-21646467
8 | namespace detail {
9 | template
10 | struct FEvent : QEvent {
11 | using Fun = typename std::decay::type;
12 | const QObject *const obj;
13 | Fun fun;
14 | template
15 | FEvent(const QObject *_obj, Fun &&_fun) : QEvent(QEvent::None), obj(_obj), fun(std::forward(_fun)) {}
16 | ~FEvent() { fun(); }
17 | }; }
18 |
19 | template
20 | static void postToObject(F &&fun, QObject *obj) {
21 | Q_ASSERT(obj);
22 | QCoreApplication::postEvent(obj, new detail::FEvent(obj, std::forward(fun)));
23 | }
24 |
25 | #endif
26 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/FILESYSTEM/custom_fs_emergency_font.h:
--------------------------------------------------------------------------------
1 | #include
2 | extern const uint8_t custom_fs_emergency_font_file[2729];
--------------------------------------------------------------------------------
/source_code/main_mcu/src/I2C/driver_i2c.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file driver_i2c.h
18 | * \brief Low level driver i2c comms
19 | * Created: 07/07/2024
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef I2C_H_
25 | #define I2C_H_
26 |
27 | #include "defines.h"
28 | #include "asf.h"
29 |
30 | /* Enums */
31 | typedef enum {I2C_FAST_MODE = 0, I2C_FAST_MODEPLUS = 1, I2C_HS_MODE = 2} i2c_speed_mode_te;
32 |
33 | /* Prototypes */
34 | void sercom_i2c_read_array_from_device(Sercom* sercom_pt, uint8_t addr_7b, uint8_t reg_addr, uint8_t* data, uint32_t data_length);
35 | RET_TYPE sercom_i2c_host_write_array_to_device(Sercom* sercom_pt, uint8_t addr_7b, uint8_t* data, uint32_t data_length);
36 | RET_TYPE sercom_i2c_host_write_register_in_device(Sercom* sercom_pt, uint8_t addr_7b, uint8_t reg_addr, uint8_t data);
37 | uint8_t sercom_i2c_read_register_from_device(Sercom* sercom_pt, uint8_t addr_7b, uint8_t reg_addr);
38 | RET_TYPE sercom_i2c_host_write_byte_to_device(Sercom* sercom_pt, uint8_t addr_7b, uint8_t data);
39 | void sercom_i2c_host_init(Sercom* sercom_pt, i2c_speed_mode_te speed_mode);
40 | RET_TYPE sercom_i2c_check_for_errors(Sercom* sercom_pt);
41 | BOOL sercom_i2c_get_error_flag(void);
42 |
43 |
44 | #endif /* I2C_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/I2C/mp2710.c:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file mp2710.h
18 | * \brief Driver for the MP2710
19 | * Created: 13/10/2024
20 | * Author: Mathieu Stephan
21 | */
22 | #include "platform_defines.h"
23 | #ifdef MINIBLE_V2
24 |
25 | #include "driver_i2c.h"
26 | #include "mp2710.h"
27 |
28 |
29 | /*! \fn mp2710_init(void)
30 | * \brief Initialize the MP2710
31 | * \return Initialization status
32 | */
33 | RET_TYPE mp2710_init(void)
34 | {
35 | /* Try setting the battery discharge current limit to 200+200mA */
36 | if (sercom_i2c_host_write_register_in_device(I2C_SERCOM, MP2710_ADDR, 0x0D, 0x01) != RETURN_OK)
37 | {
38 | return RETURN_NOK;
39 | }
40 |
41 | /* Check for written value */
42 | if (sercom_i2c_read_register_from_device(I2C_SERCOM, MP2710_ADDR, 0x0D) != 0x01)
43 | {
44 | return RETURN_NOK;
45 | }
46 |
47 | /* Return success */
48 | return RETURN_OK;
49 | }
50 |
51 | /*! \fn mp2710_get_operation_status_register(void)
52 | * \brief Get the MP2710 operation status register
53 | * \return The status register
54 | */
55 | uint8_t mp2710_get_operation_status_register(void)
56 | {
57 | return sercom_i2c_read_register_from_device(I2C_SERCOM, MP2710_ADDR, 0x08);
58 | }
59 |
60 | /*! \fn mp2710_get_operation_fault_register(void)
61 | * \brief Get the MP2710 operation fault register
62 | * \return The status register
63 | */
64 | uint8_t mp2710_get_operation_fault_register(void)
65 | {
66 | return sercom_i2c_read_register_from_device(I2C_SERCOM, MP2710_ADDR, 0x09);
67 | }
68 |
69 | #endif
--------------------------------------------------------------------------------
/source_code/main_mcu/src/I2C/mp2710.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file mp2710.h
18 | * \brief Driver for the MP2710
19 | * Created: 13/10/2024
20 | * Author: Mathieu Stephan
21 | */
22 | #include "platform_defines.h"
23 |
24 | #if !defined(MP2710_H_) && defined(MINIBLE_V2)
25 | #define MP2710_H_
26 |
27 | /* Defines */
28 | #define MP2710_ADDR 0x08
29 |
30 | /* Prototypes */
31 | uint8_t mp2710_get_operation_status_register(void);
32 | uint8_t mp2710_get_operation_fault_register(void);
33 | RET_TYPE mp2710_init(void);
34 |
35 |
36 | #endif /* MP2710_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/I2C/pcf85263a.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file pcf85263a.h
18 | * \brief Driver for the pcf85263a
19 | * Created: 05/11/2024
20 | * Author: Mathieu Stephan
21 | */
22 | #include "platform_defines.h"
23 |
24 | #if !defined(PCF85263A_H_) && defined(MINIBLE_V2)
25 | #define PCF85263A_H_
26 |
27 | /* Defines */
28 | #define PCF85263A_ADDR 0x51
29 |
30 | /* Macros */
31 | #define DDIGITS_TO_U8(X) (((X) >> 4)*10 + ((X) & 0x0F))
32 |
33 | /* Structures */
34 | typedef struct
35 | {
36 | uint8_t hundredth_seconds;
37 | uint8_t seconds;
38 | uint8_t minutes;
39 | uint8_t hours;
40 | uint8_t days;
41 | uint8_t week_days;
42 | uint8_t months;
43 | uint8_t years;
44 | } pcf85263a_time_structure_t;
45 |
46 | /* Prototypes */
47 | void pcf85263a_get_time(pcf85263a_time_structure_t* time_struct_pt);
48 | RET_TYPE pcf85263a_init(void);
49 |
50 |
51 | #endif /* PCF85263A_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/INPUTS/inputs.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file inputs.h
18 | * \brief Scroll wheel driver
19 | * Created: 20/02/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef INPUTS_H_
25 | #define INPUTS_H_
26 | #include "defines.h"
27 |
28 | /* Defines */
29 | // How many ms is considered as a long press
30 | #define LONG_PRESS_MS 1000
31 |
32 | /* Prototypes */
33 | wheel_action_ret_te inputs_get_wheel_action(BOOL wait_for_action, BOOL ignore_incdec);
34 | void inputs_set_wheel_debounce_value(uint16_t debounce_value);
35 | void inputs_set_inputs_invert_bool(BOOL invert_bool);
36 | RET_TYPE inputs_get_last_returned_action(void);
37 | det_ret_type_te inputs_is_wheel_clicked(void);
38 | int16_t inputs_get_wheel_increment(void);
39 | BOOL inputs_raw_is_wheel_released(void);
40 | void inputs_clear_detections(void);
41 | void inputs_scan(void);
42 |
43 |
44 | #endif /* INPUTS_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_aux_mcu.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_aux_mcu.h
18 | * \brief Aux MCU logic
19 | * Created: 09/05/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 | #ifndef LOGIC_AUX_MCU_H_
24 | #define LOGIC_AUX_MCU_H_
25 |
26 | #include "defines.h"
27 |
28 | /* Prototypes */
29 | void logic_aux_mcu_update_aux_mcu_of_new_battery_level(uint16_t battery_level_pct);
30 | RET_TYPE logic_aux_mcu_flash_firmware_update(BOOL connect_to_usb_if_needed);
31 | void logic_aux_mcu_set_usb_enumerated_bool(BOOL usb_enumerated);
32 | void logic_aux_mcu_set_ble_enabled_bool(BOOL ble_enabled);
33 | void logic_aux_mcu_disable_ble(BOOL wait_for_disabled);
34 | void logic_aux_mcu_enable_ble(BOOL wait_for_enabled);
35 | BOOL logic_aux_mcu_is_usb_just_enumerated(void);
36 | uint32_t logic_aux_mcu_get_ble_chip_id(void);
37 | BOOL logic_aux_mcu_is_usb_enumerated(void);
38 | BOOL logic_aux_mcu_is_ble_enabled(void);
39 |
40 | #endif /* LOGIC_AUX_MCU_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_bluetooth.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_bluetooth.h
18 | * \brief General logic for bluetooth
19 | * Created: 07/03/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef LOGIC_BLUETOOTH_H_
25 | #define LOGIC_BLUETOOTH_H_
26 |
27 | #include "defines.h"
28 |
29 | /* Enums */
30 | typedef enum {BT_STATE_CONNECTED = 0, BT_STATE_OFF, BT_STATE_ON} bt_state_te;
31 |
32 | /* Prototypes */
33 | void logic_bluetooth_set_do_not_lock_device_after_disconnect_flag(BOOL flag);
34 | BOOL logic_bluetooth_get_do_not_lock_device_after_disconnect_flag(void);
35 | platform_type_te logic_bluetooth_get_connected_to_platform_type(void);
36 | BOOL logic_bluetooth_get_and_clear_too_many_failed_connections(void);
37 | void logic_bluetooth_set_too_many_failed_connections(void);
38 | void logic_bluetooth_get_unit_mac_address(uint8_t* buffer);
39 | void logic_bluetooth_disconnect_from_current_device(void);
40 | void logic_bluetooth_set_connected_state(BOOL state);
41 | bt_state_te logic_bluetooth_get_state(void);
42 |
43 |
44 | #endif /* LOGIC_BLUETOOTH_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_fido2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2020 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_fido2.h
18 | * \brief FIDO2 general logic
19 | * Created: 19/01/2020
20 | * Author: 0x0ptr
21 | */
22 | #ifndef LOGIC_FIDO2_H_
23 | #define LOGIC_FIDO2_H_
24 |
25 | #include "comms_aux_mcu.h"
26 | #include "defines.h"
27 |
28 | #ifdef EMULATOR_BUILD
29 | #ifdef WIN32
30 | #define cpu_to_be32 __builtin_bswap32
31 | #else
32 | #define cpu_to_be32 htonl
33 | #endif
34 | #endif
35 |
36 | /* Enums */
37 | typedef enum
38 | {
39 | FIDO2_SUCCESS = 0,
40 | FIDO2_OPERATION_DENIED = 1,
41 | FIDO2_USER_NOT_PRESENT = 2,
42 | FIDO2_STORAGE_EXHAUSTED = 3,
43 | FIDO2_NO_CREDENTIALS = 4,
44 | } fido2_return_code_te;
45 |
46 | /* Prototypes */
47 | void logic_fido2_process_make_credential(fido2_make_credential_req_message_t* request);
48 | void logic_fido2_process_get_assertion(fido2_get_assertion_req_message_t* request);
49 | void logic_fido2_process_exclude_list_item(fido2_auth_cred_req_message_t* request);
50 |
51 | #endif /* FIDO2_H_ */
52 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_gui.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_gui.h
18 | * \brief General logic for GUI
19 | * Created: 11/05/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef LOGIC_GUI_H_
25 | #define LOGIC_GUI_H_
26 |
27 | #include "nodemgmt.h"
28 | #include "defines.h"
29 |
30 |
31 | /* Prototypes */
32 | void logic_gui_display_login_password_TOTP(child_cred_node_t* child_node, BOOL display_totp_only);
33 | void logic_gui_disable_bluetooth(BOOL display_notification);
34 | void logic_gui_enable_bluetooth(void);
35 | void logic_gui_clone_card(void);
36 | void logic_gui_change_pin(void);
37 | void logic_gui_erase_user(void);
38 |
39 | /* Defines */
40 | #define LOGIC_GUI_DISP_CRED_NUM_LINES_MAX (3) // Max number of lines to display for credentials
41 | #define LOGIC_GUI_CRED_SHOW_NB_DISP_CFG (2) // Number of display cfg (2 or 3 lines)
42 | #define LOGIC_GUI_TOTP_STR_LEN (30) // Length of TOTP string generated
43 | #define LOGIC_GUI_TOTP_MAX_TIMESTEP (100) // Maximum number for the timestep
44 | #define LOGIC_GUI_TOTP_SEC_NUM_DIG (2) // Number of digits for seconds remaining for TOTP display
45 | #endif /* LOGIC_GUI_H_ */
46 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_security.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_security.c
18 | * \brief General logic for security (credentials etc)
19 | * Created: 16/02/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef LOGIC_SECURITY_H_
25 | #define LOGIC_SECURITY_H_
26 |
27 | #include "defines.h"
28 |
29 | /* Prototypes */
30 | BOOL logic_security_should_leave_management_mode(void);
31 | void logic_security_set_management_mode(BOOL from_usb);
32 | void logic_security_smartcard_unlocked_actions(void);
33 | BOOL logic_security_is_smc_inserted_unlocked(void);
34 | BOOL logic_security_is_management_mode_set(void);
35 | void logic_security_clear_management_mode(void);
36 | void logic_security_clear_security_bools(void);
37 |
38 |
39 | #endif /* LOGIC_SECURITY_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/LOGIC/logic_smartcard.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file logic_smartcard.h
18 | * \brief General logic for smartcard operations
19 | * Created: 16/02/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 |
25 | #ifndef LOGIC_SMARTCARD_H_
26 | #define LOGIC_SMARTCARD_H_
27 |
28 | #include "defines.h"
29 |
30 | /* Prototypes */
31 | new_pinreturn_type_te logic_smartcard_ask_for_new_pin(volatile uint16_t* new_pin, uint16_t message_id);
32 | valid_card_det_return_te logic_smartcard_valid_card_unlock(BOOL hash_allow_flag, BOOL fast_mode);
33 | RET_TYPE logic_smartcard_remove_card_and_reauth_user(BOOL display_notification);
34 | cloning_ret_te logic_smartcard_clone_card(volatile uint16_t* pincode);
35 | unlock_ret_type_te logic_smartcard_user_unlock_process(void);
36 | RET_TYPE logic_smartcard_handle_inserted(void);
37 | void logic_smartcard_handle_removed(void);
38 |
39 |
40 |
41 | #endif /* LOGIC_SMARTCARD_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/NODEMGMT/nodemgmt_defines.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2020 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file nodemgmt_defines.h
18 | * \brief Defines for structs that may be used in other.h files
19 | * Created: 20/05/2020
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef NODEMGMT_DEFINES_H_
25 | #define NODEMGMT_DEFINES_H_
26 |
27 | /* Defines */
28 | #define TOTP_SECRET_MAX_LEN 64
29 | #define SERVICE_NAME_MAX_LEN 126
30 | #define LOGIN_NAME_MAX_LEN 64
31 |
32 | // Bluetooth bonding information
33 | typedef struct
34 | {
35 | uint16_t zero_to_be_valid;
36 | uint8_t address_resolv_type;
37 | uint8_t mac_address[6];
38 | uint8_t auth_type;
39 | uint8_t peer_ltk_key[16];
40 | uint16_t peer_ltk_ediv;
41 | uint8_t peer_ltk_random_nb[8];
42 | uint16_t peer_ltk_key_size;
43 | uint8_t peer_csrk_key[16];
44 | uint8_t peer_irk_key[16];
45 | uint8_t peer_irk_resolv_type;
46 | uint8_t peer_irk_address[6];
47 | uint8_t peer_irk_reserved;
48 | uint8_t host_ltk_key[16];
49 | uint16_t host_ltk_ediv;
50 | uint8_t host_ltk_random_nb[8];
51 | uint16_t host_ltk_key_size;
52 | uint8_t host_csrk_key[16];
53 | uint8_t reserved[10];
54 | } nodemgmt_bluetooth_bonding_information_t;
55 |
56 | #endif /* NODEMGMT_DEFINES_H_ */
57 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/OLED/mooltipass_graphics_bundle.h:
--------------------------------------------------------------------------------
1 | /*
2 | * mooltipass_graphics_bundle.h
3 | *
4 | * Created: 25/04/2017 10:26:04
5 | * Author: stephan
6 | */
7 |
8 |
9 | #ifndef MOOLTIPASS_GRAPHICS_BUNDLE_H_
10 | #define MOOLTIPASS_GRAPHICS_BUNDLE_H_
11 |
12 | #include "platform_defines.h"
13 | extern const uint8_t mooltipass_bundle[134200];
14 |
15 | #endif /* MOOLTIPASS_GRAPHICS_BUNDLE_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/OLED/ssd1363.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/src/OLED/ssd1363.c
--------------------------------------------------------------------------------
/source_code/main_mcu/src/PLATFORM/platform_io.c:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/src/PLATFORM/platform_io.c
--------------------------------------------------------------------------------
/source_code/main_mcu/src/RNG/rng.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file rng.h
18 | * \brief Random number generator
19 | * Created: 27/01/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef RNG_H_
25 | #define RNG_H_
26 |
27 | #include "defines.h"
28 |
29 | /* Prototypes */
30 | void rng_fill_array(uint8_t* array, uint16_t nb_bytes);
31 | uint16_t rng_get_random_uint16_t(void);
32 | uint8_t rng_get_random_uint8_t(void);
33 | void rng_feed_from_acc_read(void);
34 |
35 |
36 | #endif /* RNG_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/SECURITY/fuses.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file fuses.h
18 | * \brief Functions dedicated to fuse checks
19 | * Created: 20/06/2018
20 | * Author: Mathieu Stephan
21 | */
22 | #ifndef FUSES_H_
23 | #define FUSES_H_
24 |
25 | #include "defines.h"
26 |
27 | /* Prototypes */
28 | RET_TYPE fuses_check_program(BOOL flash_fuses);
29 |
30 |
31 |
32 | #endif /* FUSES_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/SERCOM/driver_sercom.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file driver_sercom.h
18 | * \brief Low level driver for SERCOM
19 | * Created: 10/11/2017
20 | * Author: Mathieu Stephan
21 | */
22 | #ifndef DRIVER_SERCOM_H_
23 | #define DRIVER_SERCOM_H_
24 |
25 | #include "defines.h"
26 | #include "asf.h"
27 |
28 | /* Enums */
29 | typedef enum {SPI_HSS_DISABLE = 0, SPI_HSS_ENABLE = 1} spi_hss_te;
30 | typedef enum {SPI_MODE0, SPI_MODE1, SPI_MODE2, SPI_MODE3} spi_mode_te;
31 | typedef enum {MISO_PAD0 = 0, MISO_PAD1 = 1, MISO_PAD2 = 2, MISO_PAD3 = 3} spi_miso_pad_te;
32 | typedef enum {MOSI_P0_SCK_P1_SS_P2 = 0, MOSI_P2_SCK_P3_SS_P1 = 1, MOSI_P3_SCK_P1_SS_P2 = 2, MOSI_P0_SCK_P3_SS_P1 = 3} spi_mosi_sck_ss_pad_te;
33 |
34 | /* Prototypes */
35 | void sercom_spi_init(Sercom* sercom_pt, uint32_t sercom_baud_div, spi_mode_te mode, spi_hss_te hss, spi_miso_pad_te miso_pad, spi_mosi_sck_ss_pad_te mosi_sck_ss_pad, BOOL receiver_enabled);
36 | void sercom_spi_send_single_byte_without_receive_wait(Sercom* sercom_pt, uint8_t data);
37 | uint8_t sercom_spi_send_single_byte(Sercom* sercom_pt, uint8_t data);
38 | void sercom_spi_wait_for_transmit_complete(Sercom* sercom_pt);
39 |
40 | #endif /* DRIVER_SERCOM_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/SE_SMARTCARD/smartcard_highlevel.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/source_code/main_mcu/src/SE_SMARTCARD/smartcard_highlevel.h
--------------------------------------------------------------------------------
/source_code/main_mcu/src/config/conf_board.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief User board configuration template
5 | *
6 | * Copyright (C) 2013-2015 Atmel Corporation. All rights reserved.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * Redistribution and use in source and binary forms, with or without
13 | * modification, are permitted provided that the following conditions are met:
14 | *
15 | * 1. Redistributions of source code must retain the above copyright notice,
16 | * this list of conditions and the following disclaimer.
17 | *
18 | * 2. Redistributions in binary form must reproduce the above copyright notice,
19 | * this list of conditions and the following disclaimer in the documentation
20 | * and/or other materials provided with the distribution.
21 | *
22 | * 3. The name of Atmel may not be used to endorse or promote products derived
23 | * from this software without specific prior written permission.
24 | *
25 | * 4. This software may only be redistributed and used in connection with an
26 | * Atmel microcontroller product.
27 | *
28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
38 | * POSSIBILITY OF SUCH DAMAGE.
39 | *
40 | * \asf_license_stop
41 | *
42 | */
43 | /*
44 | * Support and FAQ: visit Atmel Support
45 | */
46 |
47 | #ifndef CONF_BOARD_H
48 | #define CONF_BOARD_H
49 |
50 | #endif // CONF_BOARD_H
51 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/debug_minible.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file debug_minible.h
18 | * \brief Debug functions for our platform
19 | * Created: 21/04/2018
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef DEBUG_H_
25 | #define DEBUG_H_
26 |
27 | #include "platform_defines.h"
28 | #ifdef MINIBLE_V1
29 |
30 | /* bitmap defines */
31 | #define TEST_PATTERN__BITMAP_ID 794
32 |
33 | /* Prototypes */
34 | void debug_array_to_hex_u8string(uint8_t* array, uint8_t* string, uint16_t length);
35 | void debug_always_bluetooth_enable_and_click_to_send_cred(void);
36 | void debug_test_pattern_display(void);
37 | void debug_battery_recondition(void);
38 | void debug_kickstarter_video(void);
39 | void debug_mcu_and_aux_info(void);
40 | void debug_debug_animation(void);
41 | void debug_setup_dev_card(void);
42 | void debug_smartcard_test(void);
43 | void debug_battery_repair(void);
44 | void debug_rf_freq_sweep(void);
45 | void debug_nimh_charging(void);
46 | void debug_language_test(void);
47 | void debug_test_battery(void);
48 | void debug_test_prompts(void);
49 | void debug_debug_screen(void);
50 | void debug_glyph_scroll(void);
51 | void debug_reset_device(void);
52 | void debug_nimh_status(void);
53 | void debug_atbtlc_info(void);
54 | void debug_glyphs_show(void);
55 | void debug_debug_menu(void);
56 | void debug_stack_info(void);
57 | void debug_rf_dtm_rx(void);
58 |
59 | #ifndef MINIBLE_V2
60 | void debug_smartcard_info(void);
61 | #else
62 | #define debug_smartcard_info(...)
63 | #endif
64 |
65 | #endif /* MINIBLE_V1 */
66 | #endif /* DEBUG_H_ */
67 |
--------------------------------------------------------------------------------
/source_code/main_mcu/src/debug_minible_v2.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file debug_minible_v2.h
18 | * \brief Debug functions for our platform
19 | * Created: 30/10/2024
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef DEBUG_MINIBLE_V2_H_
25 | #define DEBUG_MINIBLE_V2_H_
26 |
27 | #include "platform_defines.h"
28 | #ifdef MINIBLE_V2
29 |
30 | /* Prototypes */
31 | void debug_accelerometer_battery_display(void);
32 | void debug_debug_menu(void);
33 |
34 |
35 | #endif /* MINIBLE_V2 */
36 | #endif /* DEBUG_MINIBLE_V2_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/debug_wrapper.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2024 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file debug_wrapper.h
18 | * \brief Wrapper for our debug functions
19 | * Created: 30/10/2024
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 | #ifndef DEBUG_WRAPPER_H_
25 | #define DEBUG_WRAPPER_H_
26 | #include "platform_defines.h"
27 |
28 | /* Function defines */
29 | #if defined(MINIBLE_V1)
30 | #include "debug_minible.h"
31 | #elif defined(MINIBLE_V2)
32 | #include "debug_minible_v2.h"
33 | #endif
34 |
35 |
36 | #endif /* DEBUG_WRAPPER_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/functional_testing.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*! \file functional_testing.h
18 | * \brief File dedicated to the functional testing function
19 | * Created: 18/05/2019
20 | * Author: Mathieu Stephan
21 | */
22 |
23 |
24 |
25 | #ifndef FUNCTIONAL_TESTING_H_
26 | #define FUNCTIONAL_TESTING_H_
27 |
28 | #include "defines.h"
29 |
30 | /* Prototypes */
31 | void functional_testing_start(BOOL clear_first_boot_flag);
32 | void functional_rf_testing_start(void);
33 |
34 |
35 | #endif /* FUNCTIONAL_TESTING_H_ */
--------------------------------------------------------------------------------
/source_code/main_mcu/src/main.h:
--------------------------------------------------------------------------------
1 | /*
2 | * This file is part of the Mooltipass Project (https://github.com/mooltipass).
3 | * Copyright (c) 2019 Stephan Mathieu
4 | *
5 | * This program is free software: you can redistribute it and/or modify
6 | * it under the terms of the GNU General Public License as published by
7 | * the Free Software Foundation, version 3.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program. If not, see .
16 | */
17 | /*
18 | * main.h
19 | *
20 | * Created: 17/03/2018 15:32:12
21 | * Author: limpkin
22 | */
23 |
24 |
25 | #ifndef MAIN_H_
26 | #define MAIN_H_
27 |
28 | #include "platform_defines.h"
29 | #include "oled_wrapper.h"
30 | #include "acc_wrapper.h"
31 |
32 |
33 | /* Prototypes */
34 | void main_create_virtual_wheel_movement(void);
35 | uint32_t main_check_stack_usage(void);
36 | void main_init_stack_tracking(void);
37 | void main_platform_init(void);
38 | void main_standby_sleep(void);
39 | void main_reboot(void);
40 |
41 | /* Global vars to access descriptors */
42 | extern accelerometer_descriptor_t plat_acc_descriptor;
43 | extern spi_flash_descriptor_t dataflash_descriptor;
44 | extern spi_flash_descriptor_t dbflash_descriptor;
45 | extern oled_descriptor_t plat_oled_descriptor;
46 |
47 | /* Global vars for developer features */
48 | #ifdef SPECIAL_DEVELOPER_CARD_FEATURE
49 | extern BOOL special_dev_card_inserted;
50 | #endif
51 |
52 | #endif /* MAIN_H_ */
53 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/component-version.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Component version header file
5 | *
6 | * Copyright (c) 2018 Atmel Corporation, a wholly owned subsidiary of Microchip Technology Inc.
7 | *
8 | * \license_start
9 | *
10 | * \page License
11 | *
12 | * Licensed under the Apache License, Version 2.0 (the "License");
13 | * you may not use this file except in compliance with the License.
14 | * You may obtain a copy of the License at
15 | *
16 | * http://www.apache.org/licenses/LICENSE-2.0
17 | *
18 | * Unless required by applicable law or agreed to in writing, software
19 | * distributed under the License is distributed on an "AS IS" BASIS,
20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21 | * See the License for the specific language governing permissions and
22 | * limitations under the License.
23 | *
24 | * \license_stop
25 | *
26 | */
27 |
28 | #ifndef _COMPONENT_VERSION_H_INCLUDED
29 | #define _COMPONENT_VERSION_H_INCLUDED
30 |
31 | #define COMPONENT_VERSION_MAJOR 1
32 | #define COMPONENT_VERSION_MINOR 3
33 |
34 | //
35 | // The COMPONENT_VERSION define is composed of the major and the minor version number.
36 | //
37 | // The last four digits of the COMPONENT_VERSION is the minor version with leading zeros.
38 | // The rest of the COMPONENT_VERSION is the major version.
39 | //
40 | #define COMPONENT_VERSION 10003
41 |
42 | //
43 | // The build number does not refer to the component, but to the build number
44 | // of the device pack that provides the component.
45 | //
46 | #define BUILD_NUMBER 304
47 |
48 | //
49 | // The COMPONENT_VERSION_STRING is a string (enclosed in ") that can be used for logging or embedding.
50 | //
51 | #define COMPONENT_VERSION_STRING "1.3"
52 |
53 | //
54 | // The COMPONENT_DATE_STRING contains a timestamp of when the pack was generated.
55 | //
56 | // The COMPONENT_DATE_STRING is written out using the following strftime pattern.
57 | //
58 | // "%Y-%m-%d %H:%M:%S"
59 | //
60 | //
61 | #define COMPONENT_DATE_STRING "2018-05-23 09:26:19"
62 |
63 | #endif/* #ifndef _COMPONENT_VERSION_H_INCLUDED */
64 |
65 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/instance/pac0.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC0
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #ifndef _SAMD21_PAC0_INSTANCE_
31 | #define _SAMD21_PAC0_INSTANCE_
32 |
33 | /* ========== Register definition for PAC0 peripheral ========== */
34 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
35 | #define REG_PAC0_WPCLR (0x40000000) /**< \brief (PAC0) Write Protection Clear */
36 | #define REG_PAC0_WPSET (0x40000004) /**< \brief (PAC0) Write Protection Set */
37 | #else
38 | #define REG_PAC0_WPCLR (*(RwReg *)0x40000000UL) /**< \brief (PAC0) Write Protection Clear */
39 | #define REG_PAC0_WPSET (*(RwReg *)0x40000004UL) /**< \brief (PAC0) Write Protection Set */
40 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
41 |
42 | /* ========== Instance parameters for PAC0 peripheral ========== */
43 | #define PAC0_WPROT_DEFAULT_VAL 0x00000000 // PAC protection mask at reset
44 |
45 | #endif /* _SAMD21_PAC0_INSTANCE_ */
46 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/instance/pac1.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC1
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #ifndef _SAMD21_PAC1_INSTANCE_
31 | #define _SAMD21_PAC1_INSTANCE_
32 |
33 | /* ========== Register definition for PAC1 peripheral ========== */
34 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
35 | #define REG_PAC1_WPCLR (0x41000000) /**< \brief (PAC1) Write Protection Clear */
36 | #define REG_PAC1_WPSET (0x41000004) /**< \brief (PAC1) Write Protection Set */
37 | #else
38 | #define REG_PAC1_WPCLR (*(RwReg *)0x41000000UL) /**< \brief (PAC1) Write Protection Clear */
39 | #define REG_PAC1_WPSET (*(RwReg *)0x41000004UL) /**< \brief (PAC1) Write Protection Set */
40 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
41 |
42 | /* ========== Instance parameters for PAC1 peripheral ========== */
43 | #define PAC1_WPROT_DEFAULT_VAL 0x00000002 // PAC protection mask at reset
44 |
45 | #endif /* _SAMD21_PAC1_INSTANCE_ */
46 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/instance/pac2.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PAC2
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #ifndef _SAMD21_PAC2_INSTANCE_
31 | #define _SAMD21_PAC2_INSTANCE_
32 |
33 | /* ========== Register definition for PAC2 peripheral ========== */
34 | #if (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
35 | #define REG_PAC2_WPCLR (0x42000000) /**< \brief (PAC2) Write Protection Clear */
36 | #define REG_PAC2_WPSET (0x42000004) /**< \brief (PAC2) Write Protection Set */
37 | #else
38 | #define REG_PAC2_WPCLR (*(RwReg *)0x42000000UL) /**< \brief (PAC2) Write Protection Clear */
39 | #define REG_PAC2_WPSET (*(RwReg *)0x42000004UL) /**< \brief (PAC2) Write Protection Set */
40 | #endif /* (defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */
41 |
42 | /* ========== Instance parameters for PAC2 peripheral ========== */
43 | #define PAC2_WPROT_DEFAULT_VAL 0x00800000 // PAC protection mask at reset
44 |
45 | #endif /* _SAMD21_PAC2_INSTANCE_ */
46 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/instance/ptc.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Instance description for PTC
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #ifndef _SAMD21_PTC_INSTANCE_
31 | #define _SAMD21_PTC_INSTANCE_
32 |
33 | /* ========== Instance parameters for PTC peripheral ========== */
34 | #define PTC_GCLK_ID 34 // Index of Generic Clock
35 |
36 | #endif /* _SAMD21_PTC_INSTANCE_ */
37 |
--------------------------------------------------------------------------------
/source_code/packs/samd21a/include/system_samd21.h:
--------------------------------------------------------------------------------
1 | /**
2 | * \file
3 | *
4 | * \brief Low-level initialization functions called upon chip startup
5 | *
6 | * Copyright (c) 2018 Microchip Technology Inc.
7 | *
8 | * \asf_license_start
9 | *
10 | * \page License
11 | *
12 | * SPDX-License-Identifier: Apache-2.0
13 | *
14 | * Licensed under the Apache License, Version 2.0 (the "License"); you may
15 | * not use this file except in compliance with the License.
16 | * You may obtain a copy of the Licence at
17 | *
18 | * http://www.apache.org/licenses/LICENSE-2.0
19 | *
20 | * Unless required by applicable law or agreed to in writing, software
21 | * distributed under the License is distributed on an AS IS BASIS, WITHOUT
22 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 | * See the License for the specific language governing permissions and
24 | * limitations under the License.
25 | *
26 | * \asf_license_stop
27 | *
28 | */
29 |
30 | #ifndef _SYSTEM_SAMD21_H_INCLUDED_
31 | #define _SYSTEM_SAMD21_H_INCLUDED_
32 |
33 | #ifdef __cplusplus
34 | extern "C" {
35 | #endif
36 |
37 | #include
38 |
39 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
40 |
41 | void SystemInit(void);
42 | void SystemCoreClockUpdate(void);
43 |
44 | #ifdef __cplusplus
45 | }
46 | #endif
47 |
48 | #endif /* SYSTEM_SAMD21_H_INCLUDED */
49 |
--------------------------------------------------------------------------------
/wiki/images/aux_main_prot/aux_main_prot1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/aux_main_prot/aux_main_prot1.png
--------------------------------------------------------------------------------
/wiki/images/aux_main_prot/aux_main_prot2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/aux_main_prot/aux_main_prot2.png
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/0_qt_options.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/0_qt_options.png
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/1_project_configuration.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/1_project_configuration.PNG
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/2_compilation_start.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/2_compilation_start.PNG
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/3_missing_bundle.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/3_missing_bundle.PNG
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/3_missing_bundle_ubuntu.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/3_missing_bundle_ubuntu.PNG
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/4_emulator_working.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/4_emulator_working.PNG
--------------------------------------------------------------------------------
/wiki/images/emulator_tuto/4_emulator_working_ubuntu.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/emulator_tuto/4_emulator_working_ubuntu.PNG
--------------------------------------------------------------------------------
/wiki/images/minible_highlevel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_highlevel.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_about_tab_fw_version.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_about_tab_fw_version.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_bundle_version.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_bundle_version.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_dev_tab_new_upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_dev_tab_new_upload.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_dev_tab_oneclick.PNG:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_dev_tab_oneclick.PNG
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_dev_tab_upload.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_dev_tab_upload.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_dev_tab_upload_flash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_dev_tab_upload_flash.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/ble_dev_tab_upload_flash_new.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/ble_dev_tab_upload_flash_new.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/firmware_file_update.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/firmware_file_update.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/minible_update_with_password.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/minible_update_with_password.png
--------------------------------------------------------------------------------
/wiki/images/minible_update_guide/update_file_win.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mooltipass/minible/97e313307f2b729470cc81774c05cc4c97544120/wiki/images/minible_update_guide/update_file_win.png
--------------------------------------------------------------------------------
/windows_bt_debugging.md:
--------------------------------------------------------------------------------
1 | Low Level Bluetooth LE Debugging on Windows
2 | ===========================================
3 |
4 | Inspired from https://social.msdn.microsoft.com/Forums/vstudio/en-US/f6a42282-28c2-4e4f-a66a-5e174404456d/bluetooth-le-hid-device-collection-error?forum=wdk
5 |
6 | Requirements Installation
7 | -------------------------
8 | 1) Windows Driver Kit : https://docs.microsoft.com/en-us/windows-hardware/drivers/download-the-wdk
9 | 2) Frontline Protocol Analysis System: http://www.fte.com/support/CPAS-download.aspx?demo=Sodera%20LE&iid=SLE
10 |
11 | Capture File Generation
12 | -----------------------
13 | 1) Start an administrator command prompt: type `cmd` in the windows menu, right click on "command prompt" and select "Run as Administrator"
14 | 2) `logman create trace "bth_hci" -ow -o c:\bth_hci.etl -p {8a1f9517-3a8c-4a9e-a018-4f17a200f277} 0xffffffffffffffff 0xff -nb 16 16 -bs 1024 -mode Circular -f bincirc -max 4096 -ets`
15 | 3) reproduce your issue
16 | 4) `logman stop "bth_hci" -ets`
17 | 5) a file named "bth_hci.etl" will be stored in C:
18 | 6) `"C:\Program Files (x86)\Windows Kits\10\Tools\x64\Bluetooth\BETLParse\btetlparse.exe" C:\bth_hci.etl`
19 | 7) a file named "bth_hci.cfa" will be stored in C:
20 |
21 | Capture File Viewing
22 | --------------------
23 | 1) Start "Viewer" in the "Frontline" menu in Windows' menu
24 | 2) Open bth_hci.cfa
25 | 3) In the "View" menu, select "Frame Display"
26 |
--------------------------------------------------------------------------------