diff --git a/.bonsai/Bonsai.config b/.bonsai/Bonsai.config new file mode 100644 index 0000000..d9fd009 --- /dev/null +++ b/.bonsai/Bonsai.config @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.bonsai/NuGet.config b/.bonsai/NuGet.config new file mode 100644 index 0000000..8f58394 --- /dev/null +++ b/.bonsai/NuGet.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index ac75f2c..b28d5b5 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -2,6 +2,13 @@ "version": 1, "isRoot": true, "tools": { + "docfx": { + "version": "2.78.5", + "commands": [ + "docfx" + ], + "rollForward": false + }, "harp.toolkit": { "version": "0.2.2", "commands": [ diff --git a/.editorconfig b/.editorconfig index 514c50b..c9a9d0d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,27 +1,46 @@ -# To learn more about .editorconfig see https://aka.ms/editorconfigdocs -############################### -# Core EditorConfig Options # -############################### -# All files +root = true + [*] indent_style = space -# XML project files -[*.{csproj,vcxproj,vcxproj.filters,proj,projitems,shproj,bonsai}] +#-------------------------------------------------------------------------------------------------- +# XML, JSON, and web files +#-------------------------------------------------------------------------------------------------- +[*.{xml,csproj,vcxproj,vcxproj.filters,shproj,props,targets,config,nuspec,resx,vsixmanifest,wxs,vstemplate,slnx}] indent_size = 2 -# XML config files -[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +[*.json] indent_size = 2 -# Code files -[*.{cs,csx}] +[*.{html,css}] +indent_size = 2 + +#-------------------------------------------------------------------------------------------------- +# C++ +#-------------------------------------------------------------------------------------------------- +[*.{c,cpp,h,hpp,ixx}] indent_size = 4 +charset = utf-8-bom +trim_trailing_whitespace = true insert_final_newline = true + +#-------------------------------------------------------------------------------------------------- +# C# +#-------------------------------------------------------------------------------------------------- +[*.{cs,csx}] +indent_size = 4 charset = utf-8-bom -############################### -# .NET Coding Conventions # -############################### -[*.{cs}] -# Organize usings -dotnet_sort_system_directives_first = true \ No newline at end of file +trim_trailing_whitespace = true +insert_final_newline = true + +# Language keyword vs full type name +# Predefined for members, etc does not create a message because the explicitly sized types are conveient in interop scenarios where the bit size matters. +dotnet_style_predefined_type_for_locals_parameters_members = true:none +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Instantiate argument exceptions correctly +dotnet_diagnostic.CA2208.severity = warning + +# Don't complain about not using modern collection syntax +dotnet_style_prefer_collection_expression = never +csharp_style_prefer_range_operator = false diff --git a/.gitattributes b/.gitattributes index cc4d38c..dd82528 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,44 @@ +# Auto detect text files and normalize line endings * text=auto -*.cs text + +# Scripts +*.cmd text eol=crlf +*.sh text eol=lf +*.ps1 text + +# Config +*.gitignore text +*.gitattributes text +*.gitmodules text eol=lf +*.editorconfig text +*.git-blame-ignore-revs text +*.sln text +*.proj text +*.props text +*.targets text *.csproj text +*.wixproj text +*.config text +*.json text +*.xml text +*.yml text + +# Code +*.manifest text +*.vsixmanifest text +*.vstemplate text +*.resx text +*.cs text +*.bonsai text +*.wxs text + +# Documents +LICENSE text +*.md text diff=markdown +*.rtf diff=astextplain + +# Graphics +*.png binary +*.ico binary +*.gif binary +*.svg text diff --git a/.github/workflows/Harp.Behavior.yml b/.github/workflows/Harp.Behavior.yml index 6ec6f5d..1712d44 100644 --- a/.github/workflows/Harp.Behavior.yml +++ b/.github/workflows/Harp.Behavior.yml @@ -1,3 +1,17 @@ +# ======================================================================================================================================================================= +# Harp.Behavior CI/CD +# ======================================================================================================================================================================= +# Index: +# * Build firmware +# * Build interface +# * Build documentation +# * Render workflow images +# * Publish packages to GitHub +# * Publish packages to NuGet.org +# * Publish documentation +# ======================================================================================================================================================================= +# Note that this is a generic workflow meant for all Harp devices. Minor local modifications are fine, see https://github.com/bonsai-rx/prefect for more information. +# ======================================================================================================================================================================= name: Harp.Behavior on: push: @@ -7,6 +21,10 @@ on: release: types: [published] workflow_dispatch: + inputs: + publish-documentation: + description: "Publish documentation to GitHub Pages?" + default: "false" env: DOTNET_NOLOGO: true DOTNET_CLI_TELEMETRY_OPTOUT: true @@ -14,6 +32,13 @@ env: ContinuousIntegrationBuild: true AVR_TOOLCHAIN_URL: https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/SoftwareTools/avr8-gnu-toolchain-3.6.2.1778-win32.any.x86.zip jobs: + # ===================================================================================================================================================================== + # Build firmware + # ___ _ _ _ __ _ + # | _ )_ _(_) |__| | / _(_)_ _ _ ____ __ ____ _ _ _ ___ + # | _ \ || | | / _` | | _| | '_| ' \ V V / _` | '_/ -_) + # |___/\_,_|_|_\__,_| |_| |_|_| |_|_|_\_/\_/\__,_|_| \___| + # ===================================================================================================================================================================== build-firmware: strategy: fail-fast: false @@ -40,7 +65,7 @@ jobs: # ----------------------------------------------------------------------- Build firmware - name: Build firmware - working-directory: Firmware/Behavior + working-directory: firmware/Behavior id: build shell: bash run: make all FIRMWARE_VERSION=${{env.CiBuildVersion}} HARDWARE_VERSION=${{matrix.hardware-target}} PREVIEW_VERSION=${{env.CiFirmwarePreviewVersion}} @@ -52,25 +77,43 @@ jobs: with: name: Firmware-hw${{matrix.hardware-target}} if-no-files-found: error - path: Firmware/Behavior/bin/*.hex + path: firmware/Behavior/bin/*.hex # ----------------------------------------------------------------------- Upload release assets - name: Upload release assets if: github.event_name == 'release' - run: gh release upload --repo ${{github.repository}} ${{github.event.release.tag_name}} Firmware/Behavior/bin/*.hex --clobber + run: gh release upload --repo ${{github.repository}} ${{github.event.release.tag_name}} firmware/Behavior/bin/*.hex --clobber env: GH_TOKEN: ${{github.token}} + # ===================================================================================================================================================================== + # Build interface + # ___ _ _ _ _ _ __ + # | _ )_ _(_) |__| | (_)_ _| |_ ___ _ _ / _|__ _ __ ___ + # | _ \ || | | / _` | | | ' \ _/ -_) '_| _/ _` / _/ -_) + # |___/\_,_|_|_\__,_| |_|_||_\__\___|_| |_| \__,_\__\___| + # ===================================================================================================================================================================== build-interface: strategy: fail-fast: false matrix: - configuration: ['Release'] + platform: + - name: Windows x64 + os: windows-latest + - name: Linux x64 + os: ubuntu-latest + - name: macOS x64 + os: macos-latest + configuration: ['debug', 'release'] include: - - configuration: Release + - platform: + os: windows-latest + configuration: release collect-packages: true - name: Build Interface - runs-on: windows-latest + name: Build Interface (${{ matrix.platform.name }} ${{ matrix.configuration }}) + runs-on: ${{ matrix.platform.os }} + outputs: + need-workflow-image-render: ${{ steps.configure-build.outputs.need-workflow-image-render }} steps: # ----------------------------------------------------------------------- Checkout - name: Checkout @@ -92,7 +135,7 @@ jobs: # ----------------------------------------------------------------------- Regenerate - name: Run generators - run: dotnet harp.toolkit generate interface -o Interface/${{github.workflow}} + run: dotnet harp.toolkit generate interface -o software/${{github.workflow}} - name: Verify pre-generated code was up-to-date id: verify-dist @@ -102,14 +145,14 @@ jobs: # ----------------------------------------------------------------------- Build interface package - name: Restore interface - run: dotnet restore Interface + run: dotnet restore software - name: Build interface - run: dotnet build Interface --no-restore --configuration ${{matrix.configuration}} + run: dotnet build software --no-restore --configuration ${{matrix.configuration}} - name: Pack interface id: pack - run: dotnet pack Interface --no-restore --no-build --configuration ${{matrix.configuration}} + run: dotnet pack software --no-restore --no-build --configuration ${{matrix.configuration}} # ----------------------------------------------------------------------- Collect artifacts - name: Collect NuGet packages @@ -118,21 +161,182 @@ jobs: with: name: Packages if-no-files-found: error - path: Interface/bin/${{matrix.configuration}}/** + path: artifacts/package/${{matrix.configuration}}/** # ----------------------------------------------------------------------- Upload release assets - name: Upload release assets - if: github.event_name == 'release' && matrix.configuration == 'Release' - run: gh release upload --repo ${{github.repository}} ${{github.event.release.tag_name}} Interface/bin/${{matrix.configuration}}/** --clobber + if: matrix.collect-packages && steps.pack.outcome == 'success' && github.event_name == 'release' + run: gh release upload --repo ${{github.repository}} ${{github.event.release.tag_name}} artifacts/package/${{matrix.configuration}}/** --clobber env: GH_TOKEN: ${{github.token}} - publish-packages-nuget-org: - name: Publish packages to NuGet.org + # ===================================================================================================================================================================== + # Build documentation + # ___ _ _ _ _ _ _ _ + # | _ )_ _(_) |__| | __| |___ __ _ _ _ __ ___ _ _| |_ __ _| |_(_)___ _ _ + # | _ \ || | | / _` | / _` / _ \/ _| || | ' \/ -_) ' \ _/ _` | _| / _ \ ' \ + # |___/\_,_|_|_\__,_| \__,_\___/\__|\_,_|_|_|_\___|_||_\__\__,_|\__|_\___/_||_| + # ===================================================================================================================================================================== + build-documentation: + name: Build documentation runs-on: ubuntu-latest + steps: + # ----------------------------------------------------------------------- Checkout + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + # ----------------------------------------------------------------------- Set up tools + - name: Set up .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x + + - name: Set up .NET tools + run: dotnet tool restore + + # ----------------------------------------------------------------------- Configure build + - name: Configure build + id: configure-build + uses: bonsai-rx/configure-build@v1 + + # ----------------------------------------------------------------------- Restore + - name: Restore + run: dotnet restore software + + # ----------------------------------------------------------------------- Build metadata + - name: Build metadata + id: build-metadata + run: dotnet docfx metadata docs/docfx.json --noRestore + + # ----------------------------------------------------------------------- Build documentation + - name: Build documentation + id: build-documentation + run: dotnet docfx build docs/docfx.json + + # ----------------------------------------------------------------------- Collect artifacts + - name: Collect documentation metadata + uses: actions/upload-artifact@v4 + if: steps.build-metadata.outcome == 'success' && always() + with: + name: DocumentationMetadata + if-no-files-found: error + path: artifacts/docs/api/ + + - name: Collect documentation artifact + uses: actions/upload-artifact@v4 + if: steps.build-documentation.outcome == 'success' && always() + with: + name: DocumentationWebsite + if-no-files-found: error + path: artifacts/docs/site/ + + # ===================================================================================================================================================================== + # Render workflow images + # ___ _ _ __ _ _ + # | _ \___ _ _ __| |___ _ _ __ __ _____ _ _| |__/ _| |_____ __ __ (_)_ __ __ _ __ _ ___ ___ + # | / -_) ' \/ _` / -_) '_| \ V V / _ \ '_| / / _| / _ \ V V / | | ' \/ _` / _` / -_|_-< + # |_|_\___|_||_\__,_\___|_| \_/\_/\___/_| |_\_\_| |_\___/\_/\_/ |_|_|_|_\__,_\__, \___/__/ + # |___/ + # ===================================================================================================================================================================== + workflow-images: + name: Render workflow images + runs-on: windows-latest + needs: build-interface + if: needs.build-interface.outputs.need-workflow-image-render == 'true' + steps: + # ----------------------------------------------------------------------- Checkout + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + # ----------------------------------------------------------------------- Download built packages + - name: Download packages for rendering + uses: actions/download-artifact@v4 + with: + name: Packages + path: artifacts/packages/ + + # ----------------------------------------------------------------------- Set up Bonsai environments + - name: Set up Bonsai environments + uses: bonsai-rx/setup-bonsai@v1 + with: + environment-paths: '**/.bonsai/' + inject-packages: artifacts/packages/*.nupkg + + # ----------------------------------------------------------------------- Render + - name: Render images + id: render + run: pwsh ./docs/export-images.ps1 -OutputFolder artifacts/docs/site/ -Verbose + + # ----------------------------------------------------------------------- Collect artifacts + - name: Collect images + uses: actions/upload-artifact@v4 + if: steps.render.outcome == 'success' && always() + with: + name: DocumentationWorkflowImages + if-no-files-found: error + path: artifacts/docs/site/ + + # ===================================================================================================================================================================== + # Publish packages to GitHub + # ___ _ _ _ _ _ _ ___ _ _ _ _ _ + # | _ \_ _| |__| (_)__| |_ _ __ __ _ __| |____ _ __ _ ___ ___ | |_ ___ / __(_) |_| || |_ _| |__ + # | _/ || | '_ \ | (_-< ' \ | '_ \/ _` / _| / / _` / _` / -_|_-< | _/ _ \ | (_ | | _| __ | || | '_ \ + # |_| \_,_|_.__/_|_/__/_||_| | .__/\__,_\__|_\_\__,_\__, \___/__/ \__\___/ \___|_|\__|_||_|\_,_|_.__/ + # |_| |___/ + # ===================================================================================================================================================================== + publish-github: + name: Publish packages to GitHub + runs-on: ubuntu-latest + needs: build-interface permissions: # Needed to attach files to releases contents: write + # Needed to upload to GitHub Packages + packages: write + if: github.event_name == 'push' || github.event_name == 'release' + steps: + # ----------------------------------------------------------------------- Set up .NET + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x + + # ----------------------------------------------------------------------- Download built packages + - name: Download built packages + uses: actions/download-artifact@v4 + with: + name: Packages + path: artifacts/packages/ + + # ----------------------------------------------------------------------- Upload release assets + - name: Upload release assets + if: github.event_name == 'release' + run: gh release upload --repo ${{github.repository}} ${{github.event.release.tag_name}} artifacts/packages/* --clobber + env: + GH_TOKEN: ${{github.token}} + + # ----------------------------------------------------------------------- Push to GitHub Packages + - name: Push to GitHub Packages + run: dotnet nuget push "artifacts/packages/*.nupkg" --skip-duplicate --no-symbols --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/${{github.repository_owner}} + env: + # This is a workaround for https://github.com/NuGet/Home/issues/9775 + DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER: 0 + + # ===================================================================================================================================================================== + # Publish packages to NuGet.org + # ___ _ _ _ _ _ _ _ _ ___ _ + # | _ \_ _| |__| (_)__| |_ _ __ __ _ __| |____ _ __ _ ___ ___ | |_ ___ | \| |_ _ / __|___| |_ ___ _ _ __ _ + # | _/ || | '_ \ | (_-< ' \ | '_ \/ _` / _| / / _` / _` / -_|_-< | _/ _ \ | .` | || | (_ / -_) _|_/ _ \ '_/ _` | + # |_| \_,_|_.__/_|_/__/_||_| | .__/\__,_\__|_\_\__,_\__, \___/__/ \__\___/ |_|\_|\_,_|\___\___|\__(_)___/_| \__, | + # |_| |___/ |___/ + # ===================================================================================================================================================================== + publish-packages-nuget-org: + name: Publish packages to NuGet.org + runs-on: ubuntu-latest environment: public-release needs: [build-firmware, build-interface] if: github.event_name == 'release' @@ -156,3 +360,57 @@ jobs: env: # This is a workaround for https://github.com/NuGet/Home/issues/9775 DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER: 0 + + + # ===================================================================================================================================================================== + # Publish documentation + # ___ _ _ _ _ _ _ _ _ + # | _ \_ _| |__| (_)__| |_ __| |___ __ _ _ _ __ ___ _ _| |_ __ _| |_(_)___ _ _ + # | _/ || | '_ \ | (_-< ' \ / _` / _ \/ _| || | ' \/ -_) ' \ _/ _` | _| / _ \ ' \ + # |_| \_,_|_.__/_|_/__/_||_| \__,_\___/\__|\_,_|_|_|_\___|_||_\__\__,_|\__|_\___/_||_| + # ===================================================================================================================================================================== + publish-documentation: + name: Publish documentation + runs-on: ubuntu-latest + # Publishing is not strictly necessary here, but if we're going to do a public release we want to wait to publish the docs until it goes out + needs: [build-documentation, workflow-images, publish-packages-nuget-org] + permissions: + # Both required by actions/deploy-pages + pages: write + id-token: write + environment: + # Intentionally not using the "default" github-pages environment as it's not compatible with this workflow + name: documentation-website + url: ${{steps.publish.outputs.page_url}} + # Only run if the workflow isn't dying and build-documentation was successful and either A) we're releasing or B) we have continuous deployment enabled + if: | + !cancelled() && !failure() && needs.build-documentation.result == 'success' + && (github.event_name == 'release' + || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish-documentation == 'true') + || (vars.CONTINUOUS_DOCUMENTATION && github.event_name != 'pull_request') + ) + steps: + # ----------------------------------------------------------------------- Download documentation website components + # It is intentional that we use two independent download steps here as it ensures that workflow images are permitted + # to overwrite any conflicts in the docfx output but not the other way around. + - name: Download documentation website + uses: actions/download-artifact@v4 + with: + name: DocumentationWebsite + + - name: Download workflow images + if: ${{needs.workflow-images.result == 'success'}} + uses: actions/download-artifact@v4 + with: + name: DocumentationWorkflowImages + + # ----------------------------------------------------------------------- Collect artifacts + - name: Upload final documentation website artifact + uses: actions/upload-pages-artifact@v3 + with: + path: '.' + + # ----------------------------------------------------------------------- Publish to GitHub Pages + - name: Publish to GitHub Pages + id: publish + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore index 00cb6ad..373ef07 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,5 @@ - -desktop.ini - -# Visual studio files -.vs -.suo -.nuget -bin -obj -Debug -Release -packages -*.componentinfo.xml \ No newline at end of file +.bonsai/Bonsai.exe* +.bonsai/Packages/ +.bonsai/Settings/ +.vs/ +/artifacts/ \ No newline at end of file diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..61eb2dc --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "docs/harp-docfx"] + path = docs/harp-docfx + url = https://github.com/harp-tech/docfx-tools diff --git a/Assets/README.md b/Assets/README.md deleted file mode 100644 index 71cd2cc..0000000 --- a/Assets/README.md +++ /dev/null @@ -1,12 +0,0 @@ -### Licensing -Copyright Filipe Carvalho 2020 - -Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License. - -#### You are free to: -*Share* — copy and redistribute the material in any medium or format. - -*Adapt* — remix, transform, and build upon the material for any purpose, even commercially. - -#### Under the following terms: -*Attribution* — You must give appropriate credit, provide a link to the license, and indicate if changes were made. You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. \ No newline at end of file diff --git a/Interface/Directory.Build.props b/Interface/Directory.Build.props deleted file mode 100644 index 7510aaf..0000000 --- a/Interface/Directory.Build.props +++ /dev/null @@ -1,20 +0,0 @@ - - - enable - 11.2.6 - - - - $(WarningsAsErrors);CS7035 - $(NoWarn);CS1591 - - - 0 - 42.42.42-dev$(DevVersion) - $(CiBuildVersion) - - - - - - \ No newline at end of file diff --git a/Interface/Harp.Behavior.nsi b/Interface/Harp.Behavior.nsi deleted file mode 100644 index 9202852..0000000 --- a/Interface/Harp.Behavior.nsi +++ /dev/null @@ -1,156 +0,0 @@ -!define MUI_VERBOSE 1 -!include "FileFunc.nsh" - -!define CompanyName "harp-tech" -!define DeviceName "Harp.Behavior" -!define AppName "${DeviceName}.App" -!define AppNameNoSpaces "${DeviceName}.App" - -; --- If a PRERELEASE is passed with -DPRERELEASE=..., include it in display/file names. -!ifdef PRERELEASE - !define APP_PRERELEASE_TEXT "-${PRERELEASE}" -!else - !define APP_PRERELEASE_TEXT "" -!endif - -!define AppVersion "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}${APP_PRERELEASE_TEXT}" -!define APP_NUMERIC_VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}" -!define /date YEAR "%Y" -!define OUT_FILE_NAME "${AppNameNoSpaces}.v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}${APP_PRERELEASE_TEXT}-win-${ARCHITECTURE}" - -; NSIS input defaults to artifacts publish layout (CI/build_app.sh pass NSIS_INPUT_DIR explicitly) -!ifndef NSIS_INPUT_DIR - !define NSIS_INPUT_DIR ".\artifacts\publish\win-${ARCHITECTURE}" -!endif - -Unicode true -Name "${AppName} v${AppVersion}" -Icon "${DeviceName}.Design\Assets\logo.ico" - -;-------------------------------- -;Include Modern UI - !include "MUI2.nsh" -;-------------------------------- - -OutFile ".\artifacts\${OUT_FILE_NAME}.exe" -InstallDir "$LOCALAPPDATA\${CompanyName}\${AppName}" -RequestExecutionLevel user - -;-------------------------------- -;Version information - VIProductVersion "${APP_NUMERIC_VERSION}.0" - VIAddVersionKey "ProductName" "${AppName}" - VIAddVersionKey "CompanyName" "${CompanyName}" - VIAddVersionKey "FileDescription" "${AppName}" - VIAddVersionKey "FileVersion" "${APP_NUMERIC_VERSION}" - VIAddVersionKey "ProductVersion" "${APP_NUMERIC_VERSION}" - VIAddVersionKey "LegalCopyright" "© ${YEAR} ${CompanyName}" - VIAddVersionKey "LegalTrademarks" "${CompanyName}" - VIAddVersionKey "OriginalFilename" "${OUT_FILE_NAME}" - -;-------------------------------- -;Variables - Var StartMenuFolder -;-------------------------------- -;Interface Settings - !define MUI_ABORTWARNING - !define MUI_HEADERIMAGE - !define MUI_HEADERIMAGE_BITMAP "${DeviceName}.Design\Assets\logo.png" - !define MUI_HEADERIMAGE_RIGHT -;-------------------------------- -;Pages - - !insertmacro MUI_PAGE_WELCOME - ;!insertmacro MUI_PAGE_LICENSE "${NSISDIR}/Contrib/Modern UI 2/Pages/License.nsh" - !insertmacro MUI_PAGE_COMPONENTS - ;!insertmacro MUI_PAGE_DIRECTORY - - ;Start Menu Folder Page Configuration - !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" - !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\${CompanyName}\${AppName}" - !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" - - !define MUI_STARTMENUPAGE_DEFAULTFOLDER "${CompanyName}\${AppName}" - - !insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder - - !insertmacro MUI_PAGE_INSTFILES - - !insertmacro MUI_UNPAGE_CONFIRM - !insertmacro MUI_UNPAGE_INSTFILES - -;-------------------------------- -;Languages - !insertmacro MUI_LANGUAGE "English" -;-------------------------------- - -;Installer Sections -Section "${AppName} v${AppVersion}" FirstSection - !define ARP "Software\Microsoft\Windows\CurrentVersion\Uninstall\${AppName}" - SetOutPath "$INSTDIR" - - ; Include everything from the output folder - File /r `${NSIS_INPUT_DIR}\*.*` - - ; Get estimated size installed - ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 - IntFmt $0 "0x%08X" $0 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "EstimatedSize" "$0" - - # Registry information for add/remove programs - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "DisplayName" "${CompanyName} - ${AppName}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "InstallLocation" "$\"$INSTDIR$\"" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "DisplayIcon" "$\"$INSTDIR\logo.ico$\"" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "Publisher" "${CompanyName}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "DisplayVersion" "${AppVersion}" - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "VersionMajor" ${VERSION_MAJOR} - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "VersionMinor" ${VERSION_MINOR} - # There is no option for modifying or repairing the install - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "NoModify" 1 - WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" "NoRepair" 1 - - ;Store installation folder - WriteRegStr HKCU "Software\${CompanyName}\${AppName}" "" $INSTDIR - - ;Create uninstaller - WriteUninstaller "$INSTDIR\Uninstall.exe" - - !insertmacro MUI_STARTMENU_WRITE_BEGIN Application - - ;Create shortcuts - CreateDirectory "$SMPROGRAMS\$StartMenuFolder" - CreateShortcut "$SMPROGRAMS\$StartMenuFolder\${AppName}.lnk" "$INSTDIR\${AppName}.exe" "" "$INSTDIR\${AppName}.exe" 0 - CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 - - !insertmacro MUI_STARTMENU_WRITE_END - -SectionEnd - -;-------------------------------- -;Uninstaller Section - -Section "Uninstall" - - Delete "$INSTDIR\Uninstall.exe" - - Delete "$INSTDIR\*.*" - - RMDir /r "$INSTDIR" - - !insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder - - Delete "$SMPROGRAMS\$StartMenuFolder\Uninstall.lnk" - Delete "$SMPROGRAMS\$StartMenuFolder\${AppName}.lnk" - RMDir "$SMPROGRAMS\$StartMenuFolder" - - DeleteRegKey /ifempty HKCU "Software\${CompanyName}\${AppName}" - DeleteRegKey /ifempty HKCU "Software\${CompanyName}" - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${CompanyName} ${AppName}" - - -SectionEnd - -; !insertmacro SECTION_BEGIN -; File /r `./bin/Release/net10.0/win-${ARCHITECTURE}/publish/*.*` -; !insertmacro SECTION_END diff --git a/Interface/Harp.Behavior/Harp.Behavior.csproj b/Interface/Harp.Behavior/Harp.Behavior.csproj deleted file mode 100644 index 89a92cb..0000000 --- a/Interface/Harp.Behavior/Harp.Behavior.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - harp-tech - Copyright © harp-tech and Contributors - true - snupkg - Bonsai Library containing interfaces for data acquisition and control of Harp Behavior devices. - true - Dependency;BonsaiLibrary - Harp Behavior Bonsai Rx - https://harp-tech.org - true - icon.png - LICENSE - README.md - ..\bin\$(Configuration) - net472;net8.0 - true - 9.0 - - - - - - - - - - - - - - diff --git a/Assets/LICENSE b/docs/LICENSE similarity index 100% rename from Assets/LICENSE rename to docs/LICENSE diff --git a/README.md b/docs/README.md similarity index 97% rename from README.md rename to docs/README.md index 9125f63..9bb07b8 100644 --- a/README.md +++ b/docs/README.md @@ -1,7 +1,7 @@ ## Harp Behavior This is a multi-purpose device tailored to behavioral experiments. It allows control of pokes, RGB LEDs, LEDs, cameras, servo motors and a quadrature counter. -![HarpBehavior](./Assets/pcb.png) +![HarpBehavior](./images/pcb.png) ### Key Features ### diff --git a/docs/apidoc/Harp_Behavior_AnalogData.md b/docs/apidoc/Harp_Behavior_AnalogData.md new file mode 100644 index 0000000..f032bd0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_AnalogData.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.AnalogData +--- + +### Visualize Analog Data + +:::workflow +![Visualize Analog Data](../workflows/acquireanalogdata-visualizedata.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera0Frame.md b/docs/apidoc/Harp_Behavior_Camera0Frame.md new file mode 100644 index 0000000..c4c9d99 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera0Frame.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera0Frame +--- + +### Visualize Frame Events + +:::workflow +![Visualize Frame Events](../workflows/triggercameras-visualizeframes.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Camera0Frequency.md b/docs/apidoc/Harp_Behavior_Camera0Frequency.md new file mode 100644 index 0000000..fbd1549 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Camera0Frequency.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Camera0Frequency +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md b/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md new file mode 100644 index 0000000..0bf41e1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateCamera0FrequencyPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateCamera0FrequencyPayload +--- + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md b/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md new file mode 100644 index 0000000..71a18c7 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateDisableServosPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateDisableServosPayload +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md new file mode 100644 index 0000000..fc04043 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableEncodersPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableEncodersPayload +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotation-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md new file mode 100644 index 0000000..e70c245 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableSerialTimestampPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableSerialTimestampPayload +--- + +### Stream Timestamps + +:::workflow +![Stream Timestamps](../workflows/routesignals-serialtimestamp.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md b/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md new file mode 100644 index 0000000..2593876 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEnableServosPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEnableServosPayload +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md b/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md new file mode 100644 index 0000000..133b0ec --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEncoderModePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEncoderModePayload +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotation-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md b/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md new file mode 100644 index 0000000..9fe4cea --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEncoderResetPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEncoderResetPayload +--- + +### Reset the Encoder + +:::workflow +![Reset the Encoder](../workflows/trackrotation-reset.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md b/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md new file mode 100644 index 0000000..6892c4b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateEventEnablePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateEventEnablePayload +--- + +### Select Active Events + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md new file mode 100644 index 0000000..67433b3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed0CurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed0CurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/configureleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md b/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md new file mode 100644 index 0000000..bc5b88c --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateLed0MaxCurrentPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateLed0MaxCurrentPayload +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/configureleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md new file mode 100644 index 0000000..593f56b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort0IRPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort0IRPayload +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/routesignals-mimicir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md b/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md new file mode 100644 index 0000000..2c966d0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateMimicPort0ValvePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateMimicPort0ValvePayload +--- + +### Mimic Valves + +:::workflow +![Mimic Valves](../workflows/routesignals-mimicvalve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md b/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md new file mode 100644 index 0000000..01a263d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputClearPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputClearPayload +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md b/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md new file mode 100644 index 0000000..0f18918 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputPulseEnablePayload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreateOutputPulseEnablePayload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md b/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md new file mode 100644 index 0000000..f2c9461 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputSetPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputSetPayload +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md b/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md new file mode 100644 index 0000000..6817861 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateOutputTogglePayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateOutputTogglePayload +--- + +### Toggle Outputs + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md b/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md new file mode 100644 index 0000000..0d16be9 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePokeInputFilterPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePokeInputFilterPayload +--- + +### Configure Input Filter + +:::workflow +![Configure Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md new file mode 100644 index 0000000..7dec333 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseDO0Payload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreatePulseDO0Payload +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md new file mode 100644 index 0000000..01b1103 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePulseSupplyPort0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePulseSupplyPort0Payload +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md new file mode 100644 index 0000000..869d266 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmDutyCycleDO0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmDutyCycleDO0Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md new file mode 100644 index 0000000..14645f1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmFrequencyDO0Payload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmFrequencyDO0Payload +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md b/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md new file mode 100644 index 0000000..3aa0cb3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmStartPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmStartPayload +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md b/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md new file mode 100644 index 0000000..97413a3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreatePwmStopPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreatePwmStopPayload +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md b/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md new file mode 100644 index 0000000..591b4df --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateRgbAllPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateRgbAllPayload +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/configureleds-rgbcolors.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md new file mode 100644 index 0000000..13a3221 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor2PeriodPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateServoMotor2PeriodPayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md b/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md new file mode 100644 index 0000000..0e72f03 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateServoMotor2PulsePayload.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.CreateServoMotor2PulsePayload +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md b/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md new file mode 100644 index 0000000..8418f22 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateStartCamerasPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateStartCamerasPayload +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md b/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md new file mode 100644 index 0000000..d719d26 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_CreateStopCamerasPayload.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.CreateStopCamerasPayload +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Device.md b/docs/apidoc/Harp_Behavior_Device.md new file mode 100644 index 0000000..995494b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Device.md @@ -0,0 +1,22 @@ +--- +uid: Harp.Behavior.Device +--- + +Use the [Harp device pattern](https://harp-tech.org/articles/operators.html#device-pattern) to initialize the device, log data, and send commands to and receive messages from the Behavior board. + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: + +Check out the following in-depth guides to learn how to access the device functionality with the `Harp.Behavior` package: + +- [Control Digital Outputs](../articles/control-digital-outputs.md) +- [Control Poke Peripheral](../articles/control-poke.md) +- [Acquire Analog Data](../articles/acquire-analog-data.md) +- [Generate PWM](../articles/generate-pwm.md) +- [Configure LEDs](../articles/configure-leds.md) +- [Track Rotation](../articles/track-rotation.md) +- [Trigger Cameras](../articles/trigger-cameras.md) +- [Drive Servos](../articles/drive-servos.md) +- [Route Signals](../articles/route-signals.md) +- [Advanced Configuration](../articles/advanced-configuration.md) diff --git a/docs/apidoc/Harp_Behavior_DeviceDataWriter.md b/docs/apidoc/Harp_Behavior_DeviceDataWriter.md new file mode 100644 index 0000000..54e7473 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DeviceDataWriter.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DeviceDataWriter +--- + +### Harp Device Pattern + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_DigitalInputState.md b/docs/apidoc/Harp_Behavior_DigitalInputState.md new file mode 100644 index 0000000..38f2bba --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DigitalInputState.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DigitalInputState +--- + +### Visualize Poke Events + +:::workflow +![Visualize Poke Events](../workflows/controlpoke-visualizeevents.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_DisableServos.md b/docs/apidoc/Harp_Behavior_DisableServos.md new file mode 100644 index 0000000..5f2c0c4 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_DisableServos.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.DisableServos +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableEncoders.md b/docs/apidoc/Harp_Behavior_EnableEncoders.md new file mode 100644 index 0000000..47c144c --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableEncoders.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableEncoders +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotation-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md b/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md new file mode 100644 index 0000000..2d4fd5e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableSerialTimestamp.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableSerialTimestamp +--- + +### Stream Timestamps + +:::workflow +![Stream Timestamps](../workflows/routesignals-serialtimestamp.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EnableServos.md b/docs/apidoc/Harp_Behavior_EnableServos.md new file mode 100644 index 0000000..017d431 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EnableServos.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EnableServos +--- + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EncoderMode.md b/docs/apidoc/Harp_Behavior_EncoderMode.md new file mode 100644 index 0000000..ce1faf9 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EncoderMode.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EncoderMode +--- + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotation-enable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EncoderReset.md b/docs/apidoc/Harp_Behavior_EncoderReset.md new file mode 100644 index 0000000..4218c46 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EncoderReset.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EncoderReset +--- + +### Reset the Encoder + +:::workflow +![Reset the Encoder](../workflows/trackrotation-reset.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_EventEnable.md b/docs/apidoc/Harp_Behavior_EventEnable.md new file mode 100644 index 0000000..865a2d0 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_EventEnable.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.EventEnable +--- + +### Select Active Events + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led0Current.md b/docs/apidoc/Harp_Behavior_Led0Current.md new file mode 100644 index 0000000..22fdd1b --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led0Current.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led0Current +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/configureleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md b/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md new file mode 100644 index 0000000..efef19d --- /dev/null +++ b/docs/apidoc/Harp_Behavior_Led0MaxCurrent.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.Led0MaxCurrent +--- + +### Configure LED Current + +:::workflow +![Configure LED Current](../workflows/configureleds-current.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort0IR.md b/docs/apidoc/Harp_Behavior_MimicPort0IR.md new file mode 100644 index 0000000..b84eb06 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort0IR.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort0IR +--- + +### Mimic Poke Inputs + +:::workflow +![Mimic Poke Inputs](../workflows/routesignals-mimicir.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_MimicPort0Valve.md b/docs/apidoc/Harp_Behavior_MimicPort0Valve.md new file mode 100644 index 0000000..d5bd2f1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_MimicPort0Valve.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.MimicPort0Valve +--- + +### Mimic Valves + +:::workflow +![Mimic Valves](../workflows/routesignals-mimicvalve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputClear.md b/docs/apidoc/Harp_Behavior_OutputClear.md new file mode 100644 index 0000000..696cc23 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputClear.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputClear +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputPulseEnable.md b/docs/apidoc/Harp_Behavior_OutputPulseEnable.md new file mode 100644 index 0000000..96861f3 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputPulseEnable.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.OutputPulseEnable +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputSet.md b/docs/apidoc/Harp_Behavior_OutputSet.md new file mode 100644 index 0000000..028d2bf --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputSet.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputSet +--- + +### Set and Clear Outputs + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_OutputToggle.md b/docs/apidoc/Harp_Behavior_OutputToggle.md new file mode 100644 index 0000000..9b494ab --- /dev/null +++ b/docs/apidoc/Harp_Behavior_OutputToggle.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.OutputToggle +--- + +### Toggle Outputs + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PokeInputFilter.md b/docs/apidoc/Harp_Behavior_PokeInputFilter.md new file mode 100644 index 0000000..f3a0241 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PokeInputFilter.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PokeInputFilter +--- + +### Configure Input Filter + +:::workflow +![Configure Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseDO0.md b/docs/apidoc/Harp_Behavior_PulseDO0.md new file mode 100644 index 0000000..7710c63 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseDO0.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.PulseDO0 +--- + +### Pulse Outputs + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +### Generate PWM Bursts + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md b/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md new file mode 100644 index 0000000..98d0554 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PulseSupplyPort0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PulseSupplyPort0 +--- + +### Deliver Rewards + +:::workflow +![Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md new file mode 100644 index 0000000..a84abf1 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmDutyCycleDO0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmDutyCycleDO0 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md b/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md new file mode 100644 index 0000000..7b89e46 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmFrequencyDO0.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmFrequencyDO0 +--- + +### Configure PWM + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmStart.md b/docs/apidoc/Harp_Behavior_PwmStart.md new file mode 100644 index 0000000..8098cf6 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmStart.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmStart +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_PwmStop.md b/docs/apidoc/Harp_Behavior_PwmStop.md new file mode 100644 index 0000000..50bf67e --- /dev/null +++ b/docs/apidoc/Harp_Behavior_PwmStop.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.PwmStop +--- + +### Start and Stop PWM + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_RgbAll.md b/docs/apidoc/Harp_Behavior_RgbAll.md new file mode 100644 index 0000000..22ab8f5 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_RgbAll.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.RgbAll +--- + +### Set RGB Colors + +:::workflow +![Set RGB Colors](../workflows/configureleds-rgbcolors.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor2Period.md b/docs/apidoc/Harp_Behavior_ServoMotor2Period.md new file mode 100644 index 0000000..8b52717 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor2Period.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.ServoMotor2Period +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md b/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md new file mode 100644 index 0000000..c19c925 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_ServoMotor2Pulse.md @@ -0,0 +1,15 @@ +--- +uid: Harp.Behavior.ServoMotor2Pulse +--- + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +### Adjust the Position + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_StartCameras.md b/docs/apidoc/Harp_Behavior_StartCameras.md new file mode 100644 index 0000000..e4b3203 --- /dev/null +++ b/docs/apidoc/Harp_Behavior_StartCameras.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.StartCameras +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/apidoc/Harp_Behavior_StopCameras.md b/docs/apidoc/Harp_Behavior_StopCameras.md new file mode 100644 index 0000000..0a070bb --- /dev/null +++ b/docs/apidoc/Harp_Behavior_StopCameras.md @@ -0,0 +1,9 @@ +--- +uid: Harp.Behavior.StopCameras +--- + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: diff --git a/docs/articles/acquire-analog-data.md b/docs/articles/acquire-analog-data.md new file mode 100644 index 0000000..0777a89 --- /dev/null +++ b/docs/articles/acquire-analog-data.md @@ -0,0 +1,66 @@ +## Acquire Analog Data + +The Behavior board has two analog inputs: **ADC0** is located on the **ADC** terminal and **ADC1** is located on the **Input** terminal. Refer to the [connections](./connections.md) article to set up the hardware connection. + +This article covers how to visualize the analog input streams and extract a single channel in Bonsai. + +The complete workflow is shown below: + +:::workflow +![Acquire Analog Data](../workflows/acquireanalogdata-toplevel.bonsai) +::: + +> [!NOTE] +> Hardware version 1.0 only has one ADC. + +> [!WARNING] +> You can find and add these operators to the workflow from the Bonsai [Toolbox](https://bonsai-rx.org/docs/articles/editor.html?tabs=mouse-controls#toolbox). Make sure to use the device-specific versions, e.g. `Device (Harp.Behavior)` instead of `Device (Harp)`. If correctly selected, the names of these operators in the workflow panel will change to reflect either the name of the device or the selected register/payload. + +### Visualize Analog Data + +The analog stream is enabled by default and sampled at 1 kHz, so visualizing it only requires decoding the [`AnalogData`] events: + +:::workflow +![Analog Data Visualize](../workflows/acquireanalogdata-visualizedata.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. This will listen to [`HarpMessages`] broadcast from the [`PublishSubject`] named `Behavior Events` in the Harp device pattern. +- Insert a [`Parse`] operator and configure the `Register` property to `AnalogData`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying all the analog data payloads. + +To visualize only one of the input channels: + +- Right-click on the [`Parse`] operator, hold down the Alt key, and select the "Output (Harp.Behavior.AnalogDataPayload)" > "AnalogInput0" from the context menu. This will create a `AnalogInput0` node on a separate branch. +- Insert a [`VisualizerWindow`] operator. This will open a second window displaying only the selected channel. + +Run the workflow and vary the voltage at the analog inputs. The first visualizer displays the three payload values: + +```text +AnalogDataPayload { AnalogInput0 = 13, Encoder = 0, AnalogInput = 13 } +AnalogDataPayload { AnalogInput0 = 15, Encoder = 0, AnalogInput = 14 } +``` +and the second displays the `AnalogInput0` value on its own. + +```text +12 +13 +``` + +> [!NOTE] +> Both analog inputs accept voltages from 0 to 5 V, which are subsequently digitized by an onboard 12-bit analog-to-digital (ADC) converter. + +> [!NOTE] +> The `Encoder` value is not an analog voltage reading, it is a [quadrature encoder counter](track-rotation.md) that is sampled on the same 1 kHz tick so that position and analog data share the same timestamps. + +> [!NOTE] +> If nothing appears, the analog events may have been disabled by an earlier [`EventEnable`](advanced-configuration.md#select-active-events) write. Write a payload that includes `AnalogData` to re-enable them. + +[!INCLUDE [](version-footer.md)] + + +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`AnalogData`]: xref:Harp.Behavior.AnalogData diff --git a/docs/articles/advanced-configuration.md b/docs/articles/advanced-configuration.md new file mode 100644 index 0000000..83411a3 --- /dev/null +++ b/docs/articles/advanced-configuration.md @@ -0,0 +1,36 @@ +## Advanced Configuration + +This article covers device-wide configuration that goes beyond a single peripheral or output — settings that affect which data the Behavior board broadcasts. + +The complete workflow is shown below: + +:::workflow +![Advanced Configuration](../workflows/advancedconfiguration-toplevel.bonsai) +::: + +### Select Active Events + +The [`EventEnable`] register selects which event streams the device broadcasts. All events are enabled by default; write a new selection to silence the streams you don't need. + +:::workflow +![Select Active Events](../workflows/advancedconfiguration-eventenable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EventEnablePayload`. + - `EventEnable` - Select `PortDI` and `PortDIO` to keep only the poke and DIO events. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A — the device stops broadcasting [`AnalogData`](acquire-analog-data.md) and camera frame events, and keeps the [poke events](control-poke.md). + +> [!WARNING] +> [`EventEnable`] writes the whole selection at once: any event **not** selected in the payload is disabled, including the 1 kHz analog stream and the camera frame events. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`EventEnable`]: xref:Harp.Behavior.EventEnable diff --git a/docs/articles/behavior-gui.md b/docs/articles/behavior-gui.md new file mode 100644 index 0000000..17644f1 --- /dev/null +++ b/docs/articles/behavior-gui.md @@ -0,0 +1,19 @@ +## Behavior GUI + +The Behavior GUI is a standalone visual interface for configuring and testing the device without using Bonsai. + +Before beginning, [install the GUI](installation.md#software-packages), follow the hardware setup [guide](connections.md), and connect the USB cable to the computer. Launch "Harp.Behavior.App" from the Windows Start menu. + +![Behavior GUI](../images/behavior-GUI.png) + +> [!NOTE] +> This is a pre-release version of the app, there have been changes since [then](https://github.com/harp-tech/device.behavior/pull/32), but binaries have not been generated. Remember to update the screenshots and add numbered labels for the new version. + +1) Select the port for the device, and press "Connect". The device details will display on the right side if it is successfully connected. +2) Select the tab for the register group that you want to control. +3) Change the values to test outputs, LEDs, cameras, and servos, and observe the output on the connected periperals. + +> [!WARNING] +> Only one program can access the device's COM port at a time. Close the GUI before starting a Bonsai workflow that uses the device. + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/behavior-overview.md b/docs/articles/behavior-overview.md new file mode 100644 index 0000000..c0a9bf9 --- /dev/null +++ b/docs/articles/behavior-overview.md @@ -0,0 +1,51 @@ +## Behavior + +![Harp Behavior](../images/OEPS-BehaviorBoard.jpg){width=450} + +### Key Features + +- 3 poke ports, each combining an infrared beam input, an LED driver, a 12 V valve driver, and a general-purpose digital line. +- Timed pulses and PWM (up to 10 kHz with configurable duty cycle) on every digital output. +- Camera triggering, servo motor control, and quadrature encoder counting on the general-purpose outputs and ports. +- Configurable LED drive current (up to 100 mA) with a settable maximum limit. + +### Specs + +- Poke ports: 3 (IR input, LED, 12 V valve, digital IO per port) +- General-purpose digital outputs: 4 (5 V, with pulse and PWM support) +- PWM frequency: 1 Hz – 10 kHz, duty cycle 1 – 99% +- Analog inputs: 2 (12-bit, sampled at 1 kHz) +- Digital inputs: 1 (**DI3**, 5 V) +- LED outputs: 2 current-controlled (2 – 100 mA) + 2 RGB +- Camera triggers: 2 (on **DO0**/**DO1**, 2 – 600 Hz) +- Servo outputs: 2 (on **DO2**/**DO3**, period and pulse width in µs) +- Quadrature encoder inputs: 1 (on Port 2, read at 1 kHz) +- Output pulse duration: 1 – 65535 ms +- Timestamp resolution: 32 µs +- Synchronization frequency: 1 Hz +- Synchronization accuracy: 22 ± 16 µs (between clock generator and this device) + +### Hardware + +| Version | Notes | +| ------- | ----- | +| 2.0 | | +| 1.2 | | +| 1.1 | | + +> [!WARNING] +> **TODO**: Fill in what changed between hardware revisions 1.1, 1.2, and 2.0 (e.g. second analog input, connector changes). The repository records only the current 2.0 design files. + +### Firmware + +| Version | Notes | +| ------- | ----- | +| 3.4 | | +| 3.3 | | +| 3.2 | | +| 3.1 | | + +> [!WARNING] +> **TODO**: The firmware notes above were derived from commit messages between release tags — verify them against the release notes on the [releases page](https://github.com/harp-tech/device.behavior/releases), and extend the table with older releases if needed. + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/configure-leds.md b/docs/articles/configure-leds.md new file mode 100644 index 0000000..23905e9 --- /dev/null +++ b/docs/articles/configure-leds.md @@ -0,0 +1,114 @@ +## Configure LEDs + +The Behavior board drives two kinds of light output: two standard current-controlled LEDs on the **L0** and **L1** terminals and up to two WS2812-type addressable RGB LEDs on the **RGB** connector. Refer to the [connections](./connections.md) article to set up the LED on **L0** or the **RGB** connector, which we will use for the rest of these examples. + +This article covers configuring LED drive current, setting RGB colors, and turning on both kinds of LED output in Bonsai. + +The complete workflow is shown below: + +:::workflow +![Configure LEDs](../workflows/configureleds-toplevel.bonsai) +::: + +> [!WARNING] +> The RGB section has not been tested as I do not have the hardware yet. There is also supposedly a regression introduced in firmware 3.4 which prevents the [`RgbAll`], [`Rgb0`], and [`Rgb1`] registers from updating the LED colors — the LEDs stay at their default colors (RGB0 green, RGB1 blue). + +### Configure LED Current + +The **L0** and **L1** outputs drive standard single-color LEDs with a configurable constant current, so no series resistor is needed. Each output has a working current register ([`Led0Current`], 2 – 100 mA) and a protection limit ([`Led0MaxCurrent`], 5 – 100 mA); writes above the limit are rejected by the device. + +:::workflow +![Configure LED Current](../workflows/configureleds-current.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Led0MaxCurrentPayload`. + - `Led0MaxCurrent` - Set the maximum allowed current according to the rating of the LED in mA (e.g. 20). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Led0CurrentPayload`. + - `Led0Current` - Set the working current in mA (e.g. 10). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to configure the LED 0 drive current, then switch the output on as shown in the next section. + +### Turn LEDs On and Off + +Once the drive current is configured, the **L0** and **L1** outputs are switched like any other digital output, for instance through the [`OutputSet`](control-digital-outputs.md) and [`OutputClear`](control-digital-outputs.md) registers: + +:::workflow +![Turn LEDs On and Off](../workflows/configureleds-ledonoff.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `Led0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `Led0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press S to light the LED and D to turn it off. See [Control Digital Outputs](control-digital-outputs.md) for other methods to control the LED. + +### Set RGB Colors + +The **RGB** connector drives WS2812-type addressable LEDs — often sold as "NeoPixel" LEDs, rings, or strips. The two LEDs form a serial chain on a single data line: RGB0 is the first LED in the chain and RGB1 the second. Plain and analog RGB LEDs have no data input and do not work on this connector; drive those from the [L0/L1 outputs](#configure-led-current) instead. + +The [`RgbAll`] register writes the color of both RGB LEDs in one command. Each channel takes an intensity from 0 to 255. To write one LED at a time, use [`Rgb0`] or [`Rgb1`] instead. + +:::workflow +![Set RGB Colors](../workflows/configureleds-rgbcolors.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `RgbAllPayload`. + - `Red0` - Set to 255 to make RGB0 red. + - `Blue1` - Set to 255 to make RGB1 blue. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press F to load the colors. If the LEDs are currently on, the new colors take effect immediately. + +### Turn RGB LEDs On and Off + +The RGB LEDs are switched like any other digital output, for instance through the [`OutputSet`](control-digital-outputs.md) and [`OutputClear`](control-digital-outputs.md) registers: + +:::workflow +![Turn RGB LEDs On and Off](../workflows/configureleds-rgbonoff.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `G`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `Rgb0` and `Rgb1`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `H`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `Rgb0` and `Rgb1`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press G to light both RGB LEDs and H to turn them off. See [Control Digital Outputs](control-digital-outputs.md) for other methods to control the LED. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`RgbAll`]: xref:Harp.Behavior.RgbAll +[`Rgb0`]: xref:Harp.Behavior.Rgb0 +[`Rgb1`]: xref:Harp.Behavior.Rgb1 +[`Led0Current`]: xref:Harp.Behavior.Led0Current +[`Led1Current`]: xref:Harp.Behavior.Led1Current +[`Led0MaxCurrent`]: xref:Harp.Behavior.Led0MaxCurrent diff --git a/docs/articles/connections.md b/docs/articles/connections.md new file mode 100644 index 0000000..12d840c --- /dev/null +++ b/docs/articles/connections.md @@ -0,0 +1,47 @@ +## Ports and Connections + +This article will cover the ports on the Behavior board, as well as how to connect the device to peripherals and external devices. + +### Ports + +![Harp Behavior Device Pinout](../images/behavior-devicepinout.svg){width=600} + +**12V PWR (Barrel Jack)** - This port powers the Behavior board and requires a 12 V power supply. + +**USB (Mini-B/USB-C)** - This port connects the device to the control computer running [Bonsai](harp-bonsai.md) or the [GUI](./behavior-gui.md). The connector type depends on the [hardware version](./behavior-overview.md) of the board. + +**CLKIN (Stereo Jack)** - This [Harp](https://harp-tech.org/articles/about.html) clock input accepts a clock output from any compatible Harp clock generator or synchronizer (e.g. [Harp Timestamp Generator](https://github.com/harp-tech/device.timestampgeneratorgen3)) for synchronization with other connected devices. + +**STATE** - This status LED cycles on and off with a period of: +- 2 seconds when it's communicating with Bonsai +- 4 seconds when in standby +- 100 milliseconds when a catastrophic error occurs + +**P0, P1, P2 (RJ45)** - These specialized poke ports interface directly with the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral for poke detection and reward delivery. Alternatively, use the [Breakout](./peripherals/peripherals-portbreakout.md) extension board to interface with other peripherals and accessories. + +**ADC (Screw Terminal)** - This connector carries the first analog input (**AD0**), a 5 V supply pin and two ground connections. + +**Output (Screw Terminal)** - These general-purpose 5 V digital outputs can be used to communicate with external devices. **DO0**/**DO1** can generate [camera triggers](trigger-cameras.md) and **DO2**/**DO3** can drive [servo motors](drive-servos.md); all four support [PWM](generate-pwm.md). + +**Input (Screw Terminal)** - This connector carries the second analog input (**AD1**), the digital input **DI3** and one ground connection. + +**RGB (3-pin Flick Lock)** - Connector for up to two WS2812-type (Neopixels) addressable RGB LEDs, driven as a serial chain on a single data line. Colors are set with the [RGB registers](configure-leds.md#set-rgb-colors). + +**L0, L1 (Screw Terminal)** - These connectors control two regular current-controlled LED outputs. Each terminal pair is marked **A** (anode — the LED's long leg) and **K** (cathode — the short leg). The drive current is [configurable](configure-leds.md) from 2 to 100 mA. + +> [!NOTE] +> Depending on the [hardware version](./behavior-overview.md) of your device, some of the ports above may be different. Always check the printed label on the PCB. + +### Connections + +> [!NOTE] +> Work in progress! + +#### Connect a Nose Poke + +[placeholder - connection-poke.svg] + +1. Connect the [Mice Poke](./peripherals/peripherals-micepoke.md) peripheral to port **P0**, **P1**, or **P2** with an RJ45 cable. +2. Refer to the [Control Poke Peripheral](control-poke.md) article to configure the Mice Poke peripheral in Bonsai. + +[!INCLUDE [](version-footer.md)] diff --git a/docs/articles/control-digital-outputs.md b/docs/articles/control-digital-outputs.md new file mode 100644 index 0000000..f684a8e --- /dev/null +++ b/docs/articles/control-digital-outputs.md @@ -0,0 +1,110 @@ +## Control Digital Outputs + +The Behavior board has four general-purpose digital outputs **DO0** – **DO3** on the **Output** screw terminal. Refer to the [connections](./connections.md) article to set up a digital output on **DO0**, which we will use for the rest of these examples. + +This article covers how to set, clear, toggle, and pulse any of these outputs in Bonsai. + +The complete workflow is shown below: + +:::workflow +![Control Digital Outputs](../workflows/controldigitaloutputs-toplevel.bonsai) +::: + +> [!NOTE] +> You can use the [Breakout](./peripherals/peripherals-portbreakout.md) extension board to adapt the poke ports as regular digital input/output pins if you need more digital outputs. Refer to the [Control Poke Peripheral](control-poke.md) article for more information on controlling those pins. + +### Set and Clear Outputs + +The [`OutputSet`] and [`OutputClear`] registers turn output lines on and off. Each bit in the payload selects one output line, so a single command can drive several outputs at once. + +:::workflow +![Set and Clear Outputs](../workflows/controldigitaloutputs-setclear.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press A to set the **DO0** line high and S to set it low. + +### Toggle Outputs + +The [`OutputToggle`] register inverts the current state of the selected output lines. + +:::workflow +![Toggle Outputs](../workflows/controldigitaloutputs-toggle.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputTogglePayload`. + - `OutputToggle` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press D repeatedly — the **DO0** line inverts its state on every press. + +> [!TIP] +> The [`OutputState`] register works like the other output registers but writes **all** output lines at once: selected lines are set and every other line is cleared. Use it to drive the whole output bank to a known state in one command. + +### Pulse Outputs + +Instead of pairing a set command with a delayed clear command, the device can time pulses itself. When an output is selected in the [`OutputPulseEnable`] register, every set command starts a pulse whose duration comes from that output's pulse-duration register (e.g. [`PulseDO0`] for **DO0**, in milliseconds). + +:::workflow +![Pulse Outputs](../workflows/controldigitaloutputs-pulse.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputPulseEnablePayload`. + - `OutputPulseEnable` - Select `DO0` to enable pulse mode on **DO0**. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseDO0Payload`. + - `PulseDO0` - Set the pulse duration to 500 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to configure the pulse, then send a set command with A from [Set and Clear Outputs](#set-and-clear-outputs) — the **DO0** line goes high for 500 ms and returns low on its own. + +> [!TIP] +> The poke valve outputs (`SupplyPort0`–`SupplyPort2`) boot with pulse mode already enabled and a default duration of 15 ms — see [Deliver Rewards on Poke](control-poke.md#deliver-rewards-on-poke). All other outputs boot with pulse mode disabled and stay on until cleared. + +### Alternative: Set Outputs with Timer + +You can replace [`KeyDown`] with other operators to set outputs with other triggers in Bonsai, for instance a [`Timer`]. + +:::workflow +![Set Outputs Timer](../workflows/controldigitaloutputs-timer.bonsai) +::: + +- Insert a [`Timer`] operator and set the `DueTime` property to the number of seconds to wait before setting the output (e.g. 2 seconds). +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and the **DO0** line goes high after 2 seconds and turns off automatically if pulse mode is enabled. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`Timer`]: xref:Bonsai.Reactive.Timer +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`OutputSet`]: xref:Harp.Behavior.OutputSet +[`OutputClear`]: xref:Harp.Behavior.OutputClear +[`OutputToggle`]: xref:Harp.Behavior.OutputToggle +[`OutputState`]: xref:Harp.Behavior.OutputState +[`OutputPulseEnable`]: xref:Harp.Behavior.OutputPulseEnable +[`PulseDO0`]: xref:Harp.Behavior.PulseDO0 diff --git a/docs/articles/control-poke.md b/docs/articles/control-poke.md new file mode 100644 index 0000000..ff6cbd1 --- /dev/null +++ b/docs/articles/control-poke.md @@ -0,0 +1,124 @@ +## Control Poke Peripheral + +The [Mice Poke](./peripherals/peripherals-micepoke.md) is a specialized nose poke peripheral for the Behavior board which combines an infrared beam sensor for poke detection, cue LEDs, and a solenoid valve for reward delivery. Refer to the [connections](./connections.md) article to set up the hardware connection on poke port **P0**, which we will use for the rest of these examples. + +This article covers how to visualize poke events, debounce noisy inputs, drive the cue LED, and deliver rewards with the Mice Poke peripheral in Bonsai. + +The complete workflow is shown below: + +:::workflow +![Detect Pokes](../workflows/controlpoke-toplevel.bonsai) +::: + +> [!NOTE] +> You can use the [Breakout](./peripherals/peripherals-portbreakout.md) extension board to adapt the poke ports as regular digital input/output pins to interface with other external devices or accessories. + +### Visualize Poke Events + +Beam breaks in the Mice Poke peripheral are reported as digital input events. The three poke ports **P0 - P2** are represented as `DIPort0` - `DIPort2` in the digital input [`DigitalInputState`] event register. + +:::workflow +![Detect Pokes Visualize Events](../workflows/controlpoke-visualizeevents.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. This will listen to [`HarpMessages`] broadcast from the [`PublishSubject`] named `Behavior Events` in the Harp device pattern. +- Insert a [`Parse`] operator and configure the `Register` property to `Timestamped`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and block the infrared beam on the Mice Poke peripheral. The visualizer will display: + +```text +DIPort0@3.213504 +None@3.513823 +``` + +The first value is the payload, listing the digital inputs that are currently active, and the second value is the timestamp on the device clock. Both beam breaks and beam restores generate an event, so `None` marks the moment the poke was exited. + +### Configure Input Filter + +A single poke can generate a burst of rapid transitions, for example, when the snout hovers at the edge of the infrared beam. The [`PokeInputFilter`] register sets a refractory period, in milliseconds. After each reported transition, further transitions on that port are ignored for the set time, so one poke reads as one entry and one exit. + +:::workflow +![Detect Pokes Input Filter](../workflows/controlpoke-inputfilter.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PokeInputFilterPayload`. + - `PokeInputFilter` - Set the filter time to 5 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A — rapid repeated transitions within 5 ms of a poke event no longer generate events. Set the value to 0 to disable the filter. The default filter time is 1 ms. + +> [!TIP] +> The filter is blind to the cause of a transition, so values much longer than the animal's fastest re-entry will also ignore genuine consecutive pokes. + +### Drive the Poke LED + +Each poke port carries an LED drive line (`DOPort0` - `DOPort2`). The LED is controlled like any other digital output. For instance, you can turn it on and off with the [`OutputSet`] and [`OutputClear`] registers: + +:::workflow +![Detect Pokes Drive LED](../workflows/controlpoke-driveled.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `DOPort0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputClearPayload`. + - `OutputClear` - Select `DOPort0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, then press S to turn the **P0** poke LED on and D to turn it off. See [Control Digital Outputs](control-digital-outputs.md) for other methods to control the LED. + +### Deliver Rewards on Poke + +Each poke port carries a 12 V valve drive line for a solenoid valve that gates reward delivery. The valve outputs (`SupplyPort0`–`SupplyPort2`) boot with [pulse mode](control-digital-outputs.md#pulse-outputs) already enabled. The workflow below configures the pulse duration, then closes the loop in Bonsai where every poke at **P0** immediately triggers a reward at the same port. The reward volume is calibrated by adjusting the pulse duration. + +:::workflow +![Detect Pokes Deliver Rewards](../workflows/controlpoke-valve.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseSupplyPort0Payload`. + - `PulseSupplyPort0` - Set the valve opening duration in ms (e.g. 15, the boot default). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`Parse`] operator and configure the `Register` property to `DigitalInputState`. +- Insert a [`HasFlag`] operator and set the `Value` property to `DIPort0`. +- Insert a [`Condition`] operator, leaving its inner workflow at the default. Only beam-break events at **P0** pass through; beam restores and events from other ports are filtered out. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputSetPayload`. + - `OutputSet` - Select `SupplyPort0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to set the pulse duration, then block the infrared beam on the **P0** poke. The valve will opens for 15 ms and close on its own, delivering one reward per poke. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`DigitalInputState`]: xref:Harp.Behavior.DigitalInputState +[`PokeInputFilter`]: xref:Harp.Behavior.PokeInputFilter +[`OutputSet`]: xref:Harp.Behavior.OutputSet +[`OutputClear`]: xref:Harp.Behavior.OutputClear +[`PulseSupplyPort0`]: xref:Harp.Behavior.PulseSupplyPort0 +[`HasFlag`]: xref:Bonsai.Expressions.HasFlagBuilder +[`Condition`]: xref:Bonsai.Reactive.Condition diff --git a/docs/articles/drive-servos.md b/docs/articles/drive-servos.md new file mode 100644 index 0000000..f0a0017 --- /dev/null +++ b/docs/articles/drive-servos.md @@ -0,0 +1,79 @@ +## Drive Servos + +The outputs **DO2** and **DO3** can drive standard hobby servo motors — for instance to move a lick spout or a door in and out of reach. Each servo has a period register ([`ServoMotor2Period`]) and a pulse-width register ([`ServoMotor2Pulse`]), both in microseconds, and the [`EnableServos`] and [`DisableServos`] registers switch the pulse train. The examples below use the servo on **DO2**. + +The complete workflow is shown below: + +:::workflow +![Drive Servos](../workflows/driveservos-toplevel.bonsai) +::: + +### Configure the Servo + +:::workflow +![Configure the Servo](../workflows/driveservos-configure.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PeriodPayload`. + - `ServoMotor2Period` - Set the period of the servo pulse train in µs (e.g. 20000 for the standard 50 Hz servo frame). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PulsePayload`. + - `ServoMotor2Pulse` - Set the pulse width in µs (e.g. 1500 for the center position of a standard servo). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to load the servo configuration. Check your servo's datasheet for its period and pulse-width range. + +### Enable and Disable Servos + +:::workflow +![Enable and Disable Servos](../workflows/driveservos-enabledisable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableServosPayload`. + - `EnableServos` - Select `ServoOutput2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `DisableServosPayload`. + - `DisableServos` - Select `ServoOutput2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press S to start driving the servo and D to stop. The servo moves to the position set by the pulse width and holds it while enabled. + +### Adjust the Position + +While the servo is enabled, writing a new pulse width moves it immediately: + +:::workflow +![Adjust the Position](../workflows/driveservos-position.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `ServoMotor2PulsePayload`. + - `ServoMotor2Pulse` - Set a new pulse width in µs (e.g. 2000). +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, enable the servo with S, then press F — the servo moves to the new position. + +> [!WARNING] +> **DO2** and **DO3** share their hardware timers with the [PWM generator](generate-pwm.md). Don't run PWM and a servo on the same output at the same time. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`ServoMotor2Period`]: xref:Harp.Behavior.ServoMotor2Period +[`ServoMotor2Pulse`]: xref:Harp.Behavior.ServoMotor2Pulse +[`EnableServos`]: xref:Harp.Behavior.EnableServos +[`DisableServos`]: xref:Harp.Behavior.DisableServos diff --git a/docs/articles/generate-pwm.md b/docs/articles/generate-pwm.md new file mode 100644 index 0000000..ce61cd9 --- /dev/null +++ b/docs/articles/generate-pwm.md @@ -0,0 +1,88 @@ +## Generate PWM + +The four general-purpose outputs **DO0** – **DO3** can generate hardware-timed pulse-width modulation (PWM) signals. The PWM signal can be tested with either a speaker (where the frequency controls the pitch) or a LED (where the duty cycles controls the brightness). Refer to the [connections](./connections.md) article to set up either accessory on **DO0**, which we will use for the rest of these examples. + +This article covers how to configure the frequency and duty cycle, as well as how to generate and stop the PWM in Bonsai. + +The complete workflow is shown below: + +:::workflow +![Generate PWM](../workflows/generatepwm-toplevel.bonsai) +::: + +### Configure PWM + +Each output has its own [`PwmFrequencyDO0`] and [`PwmDutyCycleDO0`] registers. + +:::workflow +![Configure PWM](../workflows/generatepwm-configure.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmFrequencyDO0Payload`. + - `PwmFrequencyDO0` - Set the PWM frequency in Hz (e.g. 1000). Valid values are 1 to 10000. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmDutyCycleDO0Payload`. + - `PwmDutyCycleDO0` - Set the duty cycle in percent (e.g. 50). Valid values are 1 to 99. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to configure a 1 kHz, 50% duty cycle waveform on **DO0**. Frequency and duty cycle can also be re-written while the PWM signal is running. + +### Start and Stop PWM + +The [`PwmStart`] and [`PwmStop`] registers start and stop the waveform on any combination of outputs. + +:::workflow +![Start and Stop PWM](../workflows/generatepwm-startstop.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmStartPayload`. + - `PwmStart` - Select `PwmDO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PwmStopPayload`. + - `PwmStop` - Select `PwmDO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press A to configure, then press S to start and D to stop the waveform on **DO0**. + +### Generate PWM Bursts + +To generate a PWM train of fixed duration, enable the [pulse function](control-digital-outputs.md#pulse-outputs) on the output with the [`OutputPulseEnable`] register and configure the duration in the [`PulseDO0`] register. + +:::workflow +![Generate PWM Bursts](../workflows/generatepwm-pulseenable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `OutputPulseEnablePayload`. + - `OutputPulseEnable` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `PulseDO0Payload`. + - `PulseDO0` - Set the burst duration to 100 ms. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press F once to configure the pulse, then press S. The PWM runs for 100 ms and stops on its own, which translates to either a short beep With a speaker, or a brief flash with an LED. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`PwmFrequencyDO0`]: xref:Harp.Behavior.PwmFrequencyDO0 +[`PwmDutyCycleDO0`]: xref:Harp.Behavior.PwmDutyCycleDO0 +[`PwmStart`]: xref:Harp.Behavior.PwmStart +[`PwmStop`]: xref:Harp.Behavior.PwmStop +[`OutputPulseEnable`]: xref:Harp.Behavior.OutputPulseEnable +[`PulseDO0`]: xref:Harp.Behavior.PulseDO0 diff --git a/docs/articles/harp-bonsai.md b/docs/articles/harp-bonsai.md new file mode 100644 index 0000000..010675a --- /dev/null +++ b/docs/articles/harp-bonsai.md @@ -0,0 +1,48 @@ +## Bonsai + +Bonsai is a visual reactive programming language for building interactive experiments and processing data streams in real time. It supports a growing ecosystem of hardware and software packages that are commonly used in neuroscience. This article will cover how to set up the Behavior board in Bonsai. + +>[!TIP] +> More information on Bonsai can be found in the official [documentation](https://bonsai-rx.org/docs/). + +### First Steps + +We will use a simple example to connect and test the device in Bonsai. This example visualizes the analog input stream that the Behavior board broadcasts at 1 kHz. We revisit this example in more detail in the "Bonsai Workflows" section. + +Before beginning: +- Connect the [USB](connections.md) cable to the computer. +- Launch "Bonsai" from the Windows Start menu. +- Hover over the workflow cell below, and click on the "Copy" icon on the top right. +- Paste the workflow into Bonsai. + +:::workflow +![Behavior First Steps](../workflows/behavior-firststeps.bonsai) +::: + +> [!TIP] +> The [Harp device pattern](https://harp-tech.org/articles/operators.html#device-pattern) will initialize the device, log data, and provide hooks to send commands as well as receive messages from the Behavior board using the [Harp communication protocol](https://harp-tech.org/protocol/BinaryProtocol-8bit.html). If your workflow does not look like the one above, make sure that the [Harp.Behavior](./installation.md#software-packages) package is installed. + +- Click on the [`Behavior (Device)`] operator and set the `PortName` property to the communications port for the device (e.g. COM8). +- Click on the [`BehaviorDataWriter (DeviceDataWriter)`] operator and set the `Path` property for the name and location of the save file (e.g. `Data\Behavior.harp`). +- Press the "Start" button in Bonsai to run the workflow. + +A [visualizer](xref:Bonsai.Design.VisualizerWindow) will automatically open when the workflow starts, displaying the parsed [`AnalogData`] events streaming from the device: + +```text +AnalogInput0: 12 +Encoder: 0 +AnalogInput1: 8 +``` + +The device is ready to use! If, instead, an error appears in Bonsai, check out the [troubleshooting](troubleshooting.md) section. + +Next, we suggest going through the "Bonsai Workflows" section if you are not familiar with using Harp devices in Bonsai. + +Alternatively, if you have experience with Harp devices, you can check the [register table](xref:Harp.Behavior) in the reference to access the device functionality directly. + +[!INCLUDE [](version-footer.md)] + + +[`Behavior (Device)`]: xref:Harp.Behavior.Device +[`BehaviorDataWriter (DeviceDataWriter)`]: xref:Harp.Behavior.DeviceDataWriter +[`AnalogData`]: xref:Harp.Behavior.AnalogData diff --git a/docs/articles/installation.md b/docs/articles/installation.md new file mode 100644 index 0000000..2a742b4 --- /dev/null +++ b/docs/articles/installation.md @@ -0,0 +1,61 @@ +## Installation + +This page covers the software you'll need to interact with the Behavior board, as well as how to update the firmware on the device. + +## Software Packages + +These steps are only required the first time you connect the device to a new computer, and you can install just the packages for the functionality you need. + +# [Bonsai](#tab/bonsai) + +[Bonsai](https://bonsai-rx.org/) is a visual reactive programming language that provides flexible and comprehensive control of the Behavior board. + +![Bonsai Package Manager](../images/bonsai-packagemanager.png){width=600} + +- Download and install [Bonsai](https://bonsai-rx.org/docs/articles/installation.html). +- Launch Bonsai and install the `Harp.Behavior` package by searching for it in the [Bonsai package manager](https://bonsai-rx.org/docs/articles/packages.html). +- (Optional) Install the `Bonsai.Windows.Input` package to follow along with the examples in this user guide. + +# [harp-python](#tab/harp-python) + +The [harp-python](https://pypi.org/project/harp-python/) library is a Python package for [loading and manipulating](logging-analysis.md) binary data collected from Harp devices. Install it in a Python environment with: + +```cmd +pip install harp-python +``` + +# [GUI](#tab/gui) + +The [Behavior GUI](behavior-gui.md) is a standalone graphical application for configuring and testing the device without using Bonsai. + +![Behavior GUI](../images/behavior-GUI.png){width=600} + +- Download and install the [Behavior GUI](https://github.com/fchampalimaud/device.behavior/releases). + +*** + +## Firmware + +New features are added and bugs are fixed with firmware updates which are published on the [release page](https://github.com/harp-tech/device.behavior/releases) in the Behavior repository. Each firmware release is tagged with a `fw` version prefix (e.g. `fw3.3-harp1.15`), and the `.hex` files can be found in the "Assets" section. Download the file that matches the hardware (`hw`) version of your device. + +>[!TIP] +> The hardware version is printed on the PCB silkscreen (e.g. `harp behavior v2.0`). + +To update the firmware, use the device setup tool in Bonsai: + +[placeholder - installation-firmwareupdate.png] + +1. Add the [`Device`] operator in Bonsai. +2. Double-click on the [`Device`] node while the workflow is not running. +3. Select the COM port for the device. +4. Click "Bootloader". +5. Click "Open". +6. Select the downloaded `.hex` file. +7. Click "Update". + +After the update, the device will reboot with the new firmware and go through the [startup LED sequence](troubleshooting.md#indicator-lights). + +[!INCLUDE [](version-footer.md)] + + +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/logging-analysis.md b/docs/articles/logging-analysis.md new file mode 100644 index 0000000..fc4cc0c --- /dev/null +++ b/docs/articles/logging-analysis.md @@ -0,0 +1,53 @@ +## Logging and Analysis + +This article covers how data from the device is logged to disk, and how to read and plot the logged data with `harp-python`. + +### Log Data + +Data from the device is logged by the [`DeviceDataWriter`] operator in the Harp device pattern, which saves raw data from all device registers in the Harp binary format to the folder set in its `Path` property: + +:::workflow +![Harp Device Pattern](../workflows/harp-devicepattern.bonsai) +::: + +While the workflow is running, registers are logged as the device produces messages (events and command echoes). Two properties of the [`Device`] operator are also important for logging: + +- `DumpRegisters` - Enabled by default, this property logs a read of every register when the device initializes, capturing the initial state of the device at the start of the experiment. +- `Heartbeat` - Disabled by default, enable it to regularly log the device's hardware timestamp. The Behavior board's own 1 kHz [`AnalogData`](acquire-analog-data.md) stream can perform the same function while it is enabled. + +> [!WARNING] +> The register dump can be used as an approximate start time for the workflow or experiment, but keep in mind that other devices in the workflow may initialize at a different time. + +### Analyze Data + +The `harp-python` library imports data stored in the Harp binary format as [pandas](https://pandas.pydata.org/) DataFrames, which can then be analyzed with any `pandas` compatible plotting or analysis library. + +The following example demonstrates how to read and plot data from the [`DigitalInputState`](control-poke.md) register. + +> [!NOTE] +> This example requires a Python environment with [harp-python](installation.md#software-packages) and [`matplotlib`](https://matplotlib.org/) installed. + +```python +# Import the dependencies +import harp +import matplotlib.pyplot as plt + +# Create a device object by loading the saved folder +device = harp.create_reader("./Data/Behavior.harp") + +# Read data from a specific register +digital_input_state_df = device.DigitalInputState.read() + +# Inspect DataFrame +print(digital_input_state_df.head()) + +# Plot the poke beam states over time +digital_input_state_df.plot() +plt.show() +``` + +[!INCLUDE [](version-footer.md)] + + +[`DeviceDataWriter`]: xref:Harp.Behavior.DeviceDataWriter +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/peripherals/peripherals-micepoke.md b/docs/articles/peripherals/peripherals-micepoke.md new file mode 100644 index 0000000..5f6b35f --- /dev/null +++ b/docs/articles/peripherals/peripherals-micepoke.md @@ -0,0 +1,46 @@ +## Mice Poke + +The Harp Mice Poke is a nose-poke peripheral for the Behavior board. It detects pokes with an infrared beam, drives onboard cue LEDs, and controls a solenoid valve for reward delivery. + +!["Mice Poke With Water Valve"](../../images/OEPS-MicePokeWaterValve.jpg){width=450} + +### Key Features + +- Infrared beam poke detection. +- Control of 2 onboard LEDs, with the option of connecting an external LED. +- 12 V solenoid valve control for reward delivery. + +### Ports + +- RJ45 connector: Connects to a Behavior board [poke port](../connections.md) with a straight-through cable for direct control. +- Screw terminals: Alternative interface for operating the Mice Poke with other external devices. Contains the following pins: + - 1x 5V supply (+5V) + - 3x Ground (GND) + - 1x External LED drive (LED) + - 1x Infrared detector output (IR_PHT) + - 1x Infrared emitter (IR_LED) + - 1x Digital Input / Output (DIO1) + - 1x 12 V solenoid valve + - 1x solenoid valve return + +> [!NOTE] +> Depending on the [hardware version](../behavior-overview.md), some of the ports above may be different. Always check the printed label on the PCB. + +### Hardware + +| Version | Compatible Behavior | Notes | +| ------- | ------------------- | ----- | +| 1.4 | > 1.0 | | +| 1.3 | > 1.0 | | +| 1.2 | > 1.0 | | + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Mice Poke](https://github.com/harp-tech/peripheral.micepoke) repository. + + +> [!NOTE] +> Three variants are available from the Open Ephys store, choose the right variant for your needs: +> - OEPS-3007 - PCB only +> - OEPS-3008 - Includes mice poke enclosure, no water valve +> - OEPS-3010 - Includes mice poke enclosure and water valve + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/peripherals-portbreakout.md b/docs/articles/peripherals/peripherals-portbreakout.md new file mode 100644 index 0000000..c048ece --- /dev/null +++ b/docs/articles/peripherals/peripherals-portbreakout.md @@ -0,0 +1,41 @@ +## Breakout + +The Breakout is an interface peripheral for the Behavior board that makes the pins of the Behavior board [poke ports](../connections.md) available on screw terminals without building a custom cable. + +!["Breakout board"](../../images/OEPS-Breakout.png){width=450} + +### Key Features + +- Allows the control of a 12V valve (e.g. Lee LHD series) (v1.1 only). +- Allows the use of the Behavior board serial TX instead of the valve return pin, with the logic level selected by the onboard jumper (v2.x only). + +### Ports + +- 1x Digital Input (DI) +- 1x Digital Input / Output (DIO) +- 1x Digital Output (DO) +- 1x 5V supply (+5V) +- 1x Ground (GND) +- 1x 12V supply (+12V) (v1.1 only) +- 1x Supply return (compatible for +5V and +12V) (SUP_RTN) (v1.1 only) +- 1x Serial TX (v2.x only) + +For connection with a quadrature encoder: + +| Quadrature encoder pin | Breakout board pin | +|--------------------- |------------------ | +| A | DI | +| B | DIO | +| Supply | +5V | +| Ground | GND | + +### Hardware + +| Version | Compatible Behavior Board | Notes | +| ------- | ------------------- | ----- | +| 2.x | > 2.0 | | +| 1.1 | > 1.2 | | + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Breakout](https://github.com/harp-tech/peripheral.portbreakout) repository. + +[!INCLUDE [](../version-footer.md)] diff --git a/docs/articles/peripherals/toc.yml b/docs/articles/peripherals/toc.yml new file mode 100644 index 0000000..59e79f3 --- /dev/null +++ b/docs/articles/peripherals/toc.yml @@ -0,0 +1,4 @@ +- name: Mice Poke + href: peripherals-micepoke.md +- name: Breakout + href: peripherals-portbreakout.md diff --git a/docs/articles/read-digital-inputs.md b/docs/articles/read-digital-inputs.md new file mode 100644 index 0000000..513329a --- /dev/null +++ b/docs/articles/read-digital-inputs.md @@ -0,0 +1,44 @@ +## Read Digital Inputs + +The Behavior board has one general-purpose 5 V digital input, **DI3**, located on the **Input** screw terminal. Refer to the [connections](./connections.md) article to set up the hardware connection. + +The complete workflow is shown below: + +:::workflow +![Read Digital Inputs](../workflows/readdigitalinputs-toplevel.bonsai) +::: + +> [!NOTE] +> You can use the [Breakout](./peripherals/peripherals-portbreakout.md) extension board to adapt the poke ports as regular digital input/output pins if you need more digital inputs. Refer to the [Control Poke Peripheral](control-poke.md) article for more information on controlling those pins. + +### Visualize Digital Input Events + +:::workflow +![Read Digital Inputs Visualize](../workflows/controlpoke-visualizeevents.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. This will listen to [`HarpMessages`] broadcast from the [`PublishSubject`] named `Behavior Events` in the Harp device pattern. +- Insert a [`Parse`] operator and configure the `Register` property to `Timestamped`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and drive the **DI3** line high. The visualizer will display: + +```text +DI3@12.001504 +None@12.301823 +``` + +The first value is the payload, listing the digital inputs that are currently active, and the second value is the timestamp on the device clock. Both rising and falling edges generate an event, so `None` marks the moment the line returned low. + +> [!NOTE] +> The [`PokeInputFilter`](control-poke.md#configure-input-filter) debounce applies only to the poke port inputs — **DI3** events are not filtered. + +[!INCLUDE [](version-footer.md)] + + +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`PublishSubject`]: xref:Bonsai.Reactive.PublishSubject +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`HarpMessages`]: xref:Bonsai.Harp.HarpMessage +[`DigitalInputState`]: xref:Harp.Behavior.DigitalInputState diff --git a/docs/articles/route-signals.md b/docs/articles/route-signals.md new file mode 100644 index 0000000..49f0299 --- /dev/null +++ b/docs/articles/route-signals.md @@ -0,0 +1,78 @@ +## Route Signals + +The Behavior can route some of its signals to other hardware without a round-trip through the computer. The mimic registers ([`MimicPort0IR`], [`MimicPort0Valve`], and their Port 1/2 counterparts) copy a poke's infrared or valve state onto a digital output, and the [`EnableSerialTimestamp`] register streams the device clock over the Port 2 serial line. The examples below use Port 0 and the **DO0**/**DO2** outputs. + +> [!WARNING] +> Only use `DO0` and `DO2` as mimic targets. In the current firmware, selecting `DIO0`–`DIO2` does not drive the DIO line, and selecting `DIO0`, `DIO2`, `DO1`, or `DO3` erroneously reconfigures the poke infrared inputs and stops poke detection on all ports until the device is reset. + +The complete workflow is shown below: + +:::workflow +![Route Signals](../workflows/routesignals-toplevel.bonsai) +::: + +### Mimic Poke Inputs + +When a mimic target is set for a poke's infrared beam, the target output follows the beam state in hardware — useful for triggering external equipment directly from a poke. + +:::workflow +![Mimic Poke Inputs](../workflows/routesignals-mimicir.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0IRPayload`. + - `MimicPort0IR` - Select `DO0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0IRPayload`. + - `MimicPort0IR` - Select `None`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press A, and block the Port 0 infrared beam — **DO0** follows the beam state. Press S to remove the routing. + +### Mimic Valves + +The valve state can be routed the same way, for instance to record reward delivery on an external acquisition system: + +:::workflow +![Mimic Valves](../workflows/routesignals-mimicvalve.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `MimicPort0ValvePayload`. + - `MimicPort0Valve` - Select `DO2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press D, then open the Port 0 valve with [`OutputSet`](control-digital-outputs.md) — **DO2** follows the valve state, including [timed pulses](control-digital-outputs.md#pulse-outputs). + +### Stream Timestamps + +The [`EnableSerialTimestamp`] register enables a serial transmission of the device clock on the Port 2 connector: at the start of every second, the current Harp timestamp is sent as 4 bytes (32-bit seconds, least significant byte first) at 1000 bps. External equipment can decode this stream to align its own data with the Harp clock. + +:::workflow +![Stream Timestamps](../workflows/routesignals-serialtimestamp.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `F`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableSerialTimestampPayload`. + - `EnableSerialTimestamp` - Select `TimestampPort2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press F — the timestamp stream starts on the Port 2 serial line at the next second boundary. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`MimicPort0IR`]: xref:Harp.Behavior.MimicPort0IR +[`MimicPort0Valve`]: xref:Harp.Behavior.MimicPort0Valve +[`EnableSerialTimestamp`]: xref:Harp.Behavior.EnableSerialTimestamp diff --git a/docs/articles/toc.yml b/docs/articles/toc.yml new file mode 100644 index 0000000..03c928c --- /dev/null +++ b/docs/articles/toc.yml @@ -0,0 +1,36 @@ +- name: Introduction +- name: Overview + href: ../index.md +- name: Specs +- name: Behavior + href: behavior-overview.md +- name: Peripherals + href: ./peripherals/toc.yml +- name: Getting Started +- name: Ports and Connections + href: connections.md +- name: Installation + href: installation.md +- name: Behavior GUI + href: behavior-gui.md +- name: Bonsai + href: harp-bonsai.md +- name: Bonsai Workflows +- name: Acquire Analog Data + href: acquire-analog-data.md +- name: Read Digital Inputs + href: read-digital-inputs.md +- name: Control Digital Outputs + href: control-digital-outputs.md +- name: Generate PWM + href: generate-pwm.md +- name: Configure LEDs + href: configure-leds.md +- name: Control Poke Peripheral + href: control-poke.md +- name: Data Management +- name: Logging and Analysis + href: logging-analysis.md +- name: Troubleshooting +- name: Errors + href: troubleshooting.md diff --git a/docs/articles/track-rotation.md b/docs/articles/track-rotation.md new file mode 100644 index 0000000..69a38ce --- /dev/null +++ b/docs/articles/track-rotation.md @@ -0,0 +1,76 @@ +## Track Rotation + +Port 2 of the Behavior board can read a quadrature encoder — for instance from a running wheel — instead of a nose poke. The counter is enabled with the [`EnableEncoders`] register, its reading mode is selected with [`EncoderMode`], and its value is streamed in the `Encoder` field of the 1 kHz [`AnalogData`](acquire-analog-data.md) events. This article covers enabling, visualizing, and resetting the encoder. + +The complete workflow is shown below: + +:::workflow +![Track Rotation](../workflows/trackrotation-toplevel.bonsai) +::: + +### Enable the Encoder + +:::workflow +![Enable the Encoder](../workflows/trackrotation-enable.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EncoderModePayload`. + - `EncoderMode` - Select `Position` to stream the accumulated count, or `Displacement` to stream the change since the previous sample. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EnableEncodersPayload`. + - `EnableEncoders` - Select `EncoderPort2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A — the quadrature counter starts and its value is reported in every [`AnalogData`] event. + +> [!WARNING] +> While the encoder is enabled, Port 2 repurposes its infrared and DIO lines as the quadrature inputs: poke events from Port 2 are suspended until the encoder is disabled. + +### Visualize Encoder Data + +:::workflow +![Visualize Encoder Data](../workflows/trackrotation-visualize.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`FilterMessageType`] operator and configure the `MessageType` property to `Event`. +- Insert a [`Parse`] operator and configure the `Register` property to `AnalogData`. +- Insert a [`MemberSelector`] operator and select the `Encoder` field. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the encoder count when the workflow starts. + +Run the workflow, press A to enable the encoder, and turn the encoder shaft — the visualizer plots the count going up in one direction and down in the other. + +### Reset the Encoder + +The [`EncoderReset`] register sets the counter of the selected encoders back to zero: + +:::workflow +![Reset the Encoder](../workflows/trackrotation-reset.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `EncoderResetPayload`. + - `EncoderReset` - Select `EncoderPort2`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press S — the `Encoder` value in the analog stream returns to zero. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`FilterMessageType`]: xref:Bonsai.Harp.FilterMessageType +[`Parse`]: xref:Harp.Behavior.Parse +[`MemberSelector`]: xref:Bonsai.Expressions.MemberSelectorBuilder +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`EnableEncoders`]: xref:Harp.Behavior.EnableEncoders +[`EncoderMode`]: xref:Harp.Behavior.EncoderMode +[`EncoderReset`]: xref:Harp.Behavior.EncoderReset +[`AnalogData`]: xref:Harp.Behavior.AnalogData diff --git a/docs/articles/trigger-cameras.md b/docs/articles/trigger-cameras.md new file mode 100644 index 0000000..c3aff40 --- /dev/null +++ b/docs/articles/trigger-cameras.md @@ -0,0 +1,84 @@ +## Trigger Cameras + +The Behavior generates camera trigger pulses on **DO0** and **DO1**, so video frames are captured — and timestamped — on the device clock. Trigger frequency is set per camera with the [`Camera0Frequency`] register, triggering is switched with [`StartCameras`] and [`StopCameras`], and each emitted trigger broadcasts a [`Camera0Frame`] event. The examples below use camera 0 on **DO0**. + +The complete workflow is shown below: + +:::workflow +![Trigger Cameras](../workflows/triggercameras-toplevel.bonsai) +::: + +### Configure Trigger Frequency + +:::workflow +![Configure Trigger Frequency](../workflows/triggercameras-frequency.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `A`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `Camera0FrequencyPayload`. + - `Camera0Frequency` - Set the trigger frequency in Hz (e.g. 30). Valid values are 2 to 600. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow and press A to set the trigger frequency. Configure the frequency before starting the camera — the value is read when triggering starts. + +### Start and Stop Cameras + +:::workflow +![Start and Stop Cameras](../workflows/triggercameras-startstop.bonsai) +::: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `S`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `StartCamerasPayload`. + - `StartCameras` - Select `CameraOutput0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +In a separate branch: + +- Insert a [`KeyDown`] operator and set the `Filter` property to `D`. +- Insert a [`CreateMessage`] operator and configure the following properties: + - `Payload` - Select `StopCamerasPayload`. + - `StopCameras` - Select `CameraOutput0`. +- Insert a [`MulticastSubject`] operator named `Behavior Commands`. + +Run the workflow, press S to start the trigger train on **DO0** and D to stop it. The stop command lets the current trigger pulse finish cleanly — the device broadcasts a [`StopCameras`] event when the last pulse has actually been emitted, so no truncated frame reaches the camera. Triggering also stops automatically when the device leaves active mode. + +### Visualize Frame Events + +Each trigger pulse broadcasts a [`Camera0Frame`] event, giving the device timestamp of every captured frame: + +:::workflow +![Visualize Frame Events](../workflows/triggercameras-visualizeframes.bonsai) +::: + +- Insert a [`SubscribeSubject`] operator named `Behavior Events`. +- Insert a [`FilterMessageType`] operator and configure the `MessageType` property to `Event`. +- Insert a [`Parse`] operator and configure the `Register` property to `Timestamped`. +- Insert a [`VisualizerWindow`] operator. This will automatically open a window displaying the parsed events when the workflow starts. + +Run the workflow and press S. The visualizer displays: + +```text +FrameAcquired@10.351072 +``` + +The first value confirms the frame trigger and the second is the timestamp on the device clock. Match these timestamps against the frames saved by your video capture software to align video with the rest of the data. + +> [!WARNING] +> **DO0** and **DO1** share their hardware timers with the [PWM generator](generate-pwm.md). Don't run PWM and a camera trigger on the same output at the same time. + +[!INCLUDE [](version-footer.md)] + + +[`KeyDown`]: xref:Bonsai.Windows.Input.KeyDown +[`CreateMessage`]: xref:Harp.Behavior.CreateMessage +[`MulticastSubject`]: xref:Bonsai.Expressions.MulticastSubject +[`SubscribeSubject`]: xref:Bonsai.Expressions.SubscribeSubject +[`FilterMessageType`]: xref:Bonsai.Harp.FilterMessageType +[`Parse`]: xref:Harp.Behavior.Parse +[`VisualizerWindow`]: xref:Bonsai.Design.VisualizerWindow +[`Camera0Frequency`]: xref:Harp.Behavior.Camera0Frequency +[`StartCameras`]: xref:Harp.Behavior.StartCameras +[`StopCameras`]: xref:Harp.Behavior.StopCameras +[`Camera0Frame`]: xref:Harp.Behavior.Camera0Frame diff --git a/docs/articles/troubleshooting.md b/docs/articles/troubleshooting.md new file mode 100644 index 0000000..ea28257 --- /dev/null +++ b/docs/articles/troubleshooting.md @@ -0,0 +1,28 @@ +## Errors + +This article covers how to resolve common connection errors on the Behavior board. + +### COM Port Errors + +**Q: In Bonsai, running the workflow throws an error "The port `ComX` does not exist."** + +A: Either the wrong communications port in the `PortName` property in [`Device`] was selected, or the [USB](connections.md) cable is not properly connected. Try selecting a different communications port and checking the connection. + +**Q: In Bonsai, running the workflow throws an error "Access to the port `ComX` is denied"** + +A: Only one interface connection to the Behavior board can be opened at one time. Check that multiple instances of Bonsai are not running, and that the [Behavior GUI](behavior-gui.md) is closed. Sometimes, the port can also be locked by a program that did not terminate correctly; restarting the computer fixes it. + +### Device Errors + +**Q: Poke events stopped arriving from all ports.** + +A: If a mimic register was written with `DIO0`, `DIO2`, `DO1`, or `DO3` as the target, the current firmware erroneously reconfigures the poke infrared inputs (see [Route Signals](route-signals.md)). Power-cycle the device and use only `DO0` or `DO2` as mimic targets. + +**Q: Poke events stopped arriving from Port 2 only.** + +A: Port 2 repurposes its input lines while the [quadrature encoder](track-rotation.md) is enabled. Disable the encoder to restore poke detection. + +[!INCLUDE [](version-footer.md)] + + +[`Device`]: xref:Harp.Behavior.Device diff --git a/docs/articles/version-footer.md b/docs/articles/version-footer.md new file mode 100644 index 0000000..2c3fdbd --- /dev/null +++ b/docs/articles/version-footer.md @@ -0,0 +1,8 @@ +
+ +--- + +Last updated with:
+**Hardware** v2.1
+**Firmware** v3.3
+**Bonsai Package** v0.2 diff --git a/docs/build.ps1 b/docs/build.ps1 new file mode 100644 index 0000000..01ad8f5 --- /dev/null +++ b/docs/build.ps1 @@ -0,0 +1,19 @@ +[CmdletBinding()] param ( + [string[]]$docfxArgs +) +Set-StrictMode -Version 3.0 +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +Push-Location $PSScriptRoot +try { + $libPaths = @() + $libPaths += Get-ChildItem "..\artifacts\bin\*\release_net4*" -Directory | Select-Object -Expand FullName + $libPaths += "..\artifacts\package\release" + + ./export-images.ps1 $libPaths + dotnet docfx metadata + dotnet docfx build $docfxArgs +} finally { + Pop-Location +} diff --git a/docs/docfx.json b/docs/docfx.json new file mode 100644 index 0000000..ab4cfc8 --- /dev/null +++ b/docs/docfx.json @@ -0,0 +1,79 @@ +{ + "$schema": "https://raw.githubusercontent.com/dotnet/docfx/main/schemas/docfx.schema.json", + "metadata": [ + { + "src": [ + { + "src": "../software/", + "files": "**/*.csproj", + "exclude": "**/*.App.csproj" + } + ], + "output": "../artifacts/docs/api/", + "enumSortOrder": "declaringOrder", + "memberLayout": "separatePages", + "filter": "filter.yml" + } + ], + "build": { + "content": [ + { + "files": [ + "*.md", + "toc.yml", + "{articles,tutorials,examples}/**/*.md", + "{articles,tutorials,examples}/**/toc.yml" + ], + "exclude": "README.md" + }, + { + "src": "../artifacts/docs/api/", + "dest": "api", + "files": "**/*.yml" + } + ], + "resource": [ + { + "files": [ + "images/**", + "workflows/**/*.{bonsai,svg}", + "{articles,tutorials,examples}/**/*.{bonsai,svg}" + ] + } + ], + "overwrite": [ + "apidoc/**/*.md" + ], + "output": "../artifacts/docs/site/", + "template": [ + "default", + "modern", + "harp-docfx/template", + "template" + ], + "sitemap": { + "baseUrl": "https://harp-tech.org/device.behavior" + }, + "globalMetadata": { + "_appName": "Behavior", + "_appTitle": "Harp.Behavior", + "_appFooter": "© harp-tech and Contributors. Made with docfx", + "_enableNewTab": true, + "_enableSearch": true, + "_gitContribute": { + "apiSpecFolder": "docs/apidoc" + } + }, + "markdownEngineProperties": { + "markdigExtensions": [ + "attributes", + "customcontainers" + ] + }, + "xref": [ + "https://harp-tech.org/xrefmap.yml", + "https://bonsai-rx.org/docs/xrefmap.yml", + "https://horizongir.github.io/reactive/xrefmap.yml" + ] + } +} \ No newline at end of file diff --git a/docs/export-images.ps1 b/docs/export-images.ps1 new file mode 100644 index 0000000..862a179 --- /dev/null +++ b/docs/export-images.ps1 @@ -0,0 +1,44 @@ +[CmdletBinding()] param ( + [string[]]$LibrarySources, + [bool]$UseGalleryForWorkflowsDirectory=$false, + [bool]$UseGalleryForExamplesDirectory=$true, + [string]$OutputFolder=$null +) +Set-StrictMode -Version 3.0 +$ErrorActionPreference = 'Stop' +$PSNativeCommandUseErrorActionPreference = $true + +if ($OutputFolder) { + $OutputFolder = Join-Path (Get-Location) $OutputFolder +} + +function Process-Workflow-Collection([bool]$useGallery, [string]$workflowPath, [string]$environmentPath) { + $libPath = $LibrarySources + + if ($useGallery) { + $libPath = @() + $galleryPath = Join-Path $environmentPath 'Gallery' + $null = New-Item -ItemType Directory -Path $galleryPath -Force + foreach ($librarySource in $LibrarySources) { + Get-ChildItem -Path $librarySource -Filter *.nupkg | Copy-Item -Destination $galleryPath + } + } + + $bootstrapperPath = (Join-Path $environmentPath 'Bonsai.exe') + .\harp-docfx\modules\Export-Image.ps1 -libPath $libPath -workflowPath $workflowPath -bootstrapperPath $bootstrapperPath -outputFolder $OutputFolder -documentationRoot $PSScriptRoot +} + +Push-Location $PSScriptRoot +try { + if (Test-Path -Path 'workflows/') { + Process-Workflow-Collection $UseGalleryForWorkflowsDirectory './workflows' '../.bonsai/' + } + + if (Test-Path -Path 'examples/') { + foreach ($environment in (Get-ChildItem -Path 'examples/' -Filter '.bonsai' -Recurse -FollowSymlink -Directory)) { + Process-Workflow-Collection $UseGalleryForExamplesDirectory ($environment.Parent.FullName) ($environment.FullName) + } + } +} finally { + Pop-Location +} diff --git a/docs/filter.yml b/docs/filter.yml new file mode 100644 index 0000000..472eb43 --- /dev/null +++ b/docs/filter.yml @@ -0,0 +1,4 @@ +apiRules: +- exclude: + hasAttribute: + uid: System.ObsoleteAttribute diff --git a/docs/harp-docfx b/docs/harp-docfx new file mode 160000 index 0000000..035d4e6 --- /dev/null +++ b/docs/harp-docfx @@ -0,0 +1 @@ +Subproject commit 035d4e69d875d9bc02e87372c9549e4483164654 diff --git a/docs/images/OEPS-BehaviorBoard.jpg b/docs/images/OEPS-BehaviorBoard.jpg new file mode 100644 index 0000000..4235c45 Binary files /dev/null and b/docs/images/OEPS-BehaviorBoard.jpg differ diff --git a/docs/images/OEPS-Breakout.png b/docs/images/OEPS-Breakout.png new file mode 100644 index 0000000..725a9e2 Binary files /dev/null and b/docs/images/OEPS-Breakout.png differ diff --git a/docs/images/OEPS-MicePokeWaterValve.jpg b/docs/images/OEPS-MicePokeWaterValve.jpg new file mode 100644 index 0000000..52f7864 Binary files /dev/null and b/docs/images/OEPS-MicePokeWaterValve.jpg differ diff --git a/docs/images/behavior-GUI.png b/docs/images/behavior-GUI.png new file mode 100644 index 0000000..e3ae7ad Binary files /dev/null and b/docs/images/behavior-GUI.png differ diff --git a/docs/images/behavior-devicepinout.svg b/docs/images/behavior-devicepinout.svg new file mode 100644 index 0000000..481ea9e --- /dev/null +++ b/docs/images/behavior-devicepinout.svg @@ -0,0 +1,392 @@ + + + +L0, L1OutputInputRGBP0, P1, P2 ADC12V PWRUSBCLKINState diff --git a/docs/images/behavior-peripherals.jpg b/docs/images/behavior-peripherals.jpg new file mode 100644 index 0000000..d3881e1 Binary files /dev/null and b/docs/images/behavior-peripherals.jpg differ diff --git a/docs/images/bonsai-packagemanager.png b/docs/images/bonsai-packagemanager.png new file mode 100644 index 0000000..d2ce698 Binary files /dev/null and b/docs/images/bonsai-packagemanager.png differ diff --git a/Assets/pcb.png b/docs/images/pcb.png similarity index 100% rename from Assets/pcb.png rename to docs/images/pcb.png diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..627ef41 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,24 @@ +## Overview + +The Harp [Behavior](articles/behavior-overview.md) board is a multi-purpose data acquisition and control device for behavioral neuroscience experiments. + +![Harp Behavior with Peripherals](./images/behavior-peripherals.jpg){width=450} + +A typical behavioral rig combines sensors, cue lights, reward valves, cameras and motorized actuators. These components usually need individual control interfaces and post-hoc alignment to a common timeline. The Behavior board brings them together on a single device, so that every input and output stream is controlled through one interface and timestamped on the same hardware clock. + +The Behavior provides: + +- General-purpose analog inputs, digital input and outputs for interfacing with external devices. +- Support for specialized peripherals like [nose pokes](articles/peripherals/peripherals-micepoke.md), camera triggers, servo motors, quadrature encoders and more. +- Hardware timestamping and synchronization with other [Harp](https://harp-tech.org/articles/about.html) devices. +- [Bonsai](https://bonsai-rx.org/) integration for flexible experiment acquisition and control. + +## Getting a Device + +Assembled units are available from the [Open Ephys store](https://open-ephys.org/harp), or build your own using the hardware design files in the [Behavior](https://github.com/harp-tech/device.behavior) repository. + +## Acknowledgments + +Hardware design and GUI contributed by [Champalimaud Foundation](https://www.cf-hw.org/), Bonsai interface by [NeuroGEARS](https://neurogears.org/), and documentation by [Open Ephys](https://open-ephys.org/). + +[!INCLUDE [](./articles/version-footer.md)] diff --git a/docs/template/public/main.css b/docs/template/public/main.css new file mode 100644 index 0000000..fdb72e4 --- /dev/null +++ b/docs/template/public/main.css @@ -0,0 +1 @@ +@import "bonsai.css"; diff --git a/docs/template/public/main.js b/docs/template/public/main.js new file mode 100644 index 0000000..6ebede4 --- /dev/null +++ b/docs/template/public/main.js @@ -0,0 +1,13 @@ +import WorkflowContainer from "./workflow.js" + +export default { + defaultTheme: 'light', + iconLinks: [{ + icon: 'github', + href: 'https://github.com/harp-tech/device.behavior', + title: 'GitHub' + }], + start: () => { + WorkflowContainer.init(); + } +} diff --git a/docs/toc.yml b/docs/toc.yml new file mode 100644 index 0000000..3c4ae30 --- /dev/null +++ b/docs/toc.yml @@ -0,0 +1,4 @@ +- name: Documentation + href: articles/ +- name: API + href: ../artifacts/docs/api/ \ No newline at end of file diff --git a/docs/workflows/.gitignore b/docs/workflows/.gitignore new file mode 100644 index 0000000..e2beea4 --- /dev/null +++ b/docs/workflows/.gitignore @@ -0,0 +1,2 @@ +*.layout +*.svg diff --git a/docs/workflows/acquireanalogdata-toplevel.bonsai b/docs/workflows/acquireanalogdata-toplevel.bonsai new file mode 100644 index 0000000..e25e816 --- /dev/null +++ b/docs/workflows/acquireanalogdata-toplevel.bonsai @@ -0,0 +1,91 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Analog Data + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + AnalogInput0 + + + + true + + 400 + 450 + + + 300 + 300 + + + + + + + + + + + + + + + diff --git a/docs/workflows/acquireanalogdata-visualizedata.bonsai b/docs/workflows/acquireanalogdata-visualizedata.bonsai new file mode 100644 index 0000000..427b4b3 --- /dev/null +++ b/docs/workflows/acquireanalogdata-visualizedata.bonsai @@ -0,0 +1,53 @@ + + + + + + Behavior Events + + + + + + + true + + 400 + 100 + + + 400 + 300 + + + + + AnalogInput0 + + + + true + + 400 + 450 + + + 300 + 300 + + + + + + + + + + + + diff --git a/docs/workflows/advancedconfiguration-eventenable.bonsai b/docs/workflows/advancedconfiguration-eventenable.bonsai new file mode 100644 index 0000000..d875c14 --- /dev/null +++ b/docs/workflows/advancedconfiguration-eventenable.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + PortDI PortDIO + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/advancedconfiguration-toplevel.bonsai b/docs/workflows/advancedconfiguration-toplevel.bonsai new file mode 100644 index 0000000..e80fef5 --- /dev/null +++ b/docs/workflows/advancedconfiguration-toplevel.bonsai @@ -0,0 +1,69 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Select Active Events + + + + + A + false + + + + Write + + PortDI PortDIO + + + + Behavior Commands + + + + + + + + + + + diff --git a/docs/workflows/behavior-firststeps.bonsai b/docs/workflows/behavior-firststeps.bonsai new file mode 100644 index 0000000..6fa3bf7 --- /dev/null +++ b/docs/workflows/behavior-firststeps.bonsai @@ -0,0 +1,79 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Analog Data + + + + Behavior Events + + + + Include + Event + + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + + + diff --git a/docs/workflows/configureleds-current.bonsai b/docs/workflows/configureleds-current.bonsai new file mode 100644 index 0000000..514ad58 --- /dev/null +++ b/docs/workflows/configureleds-current.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 20 + + + + Behavior Commands + + + Write + + 10 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/configureleds-ledonoff.bonsai b/docs/workflows/configureleds-ledonoff.bonsai new file mode 100644 index 0000000..c9d9b5d --- /dev/null +++ b/docs/workflows/configureleds-ledonoff.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + Led0 + + + + Behavior Commands + + + + D + false + + + + Write + + Led0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/configureleds-rgbcolors.bonsai b/docs/workflows/configureleds-rgbcolors.bonsai new file mode 100644 index 0000000..143d9d3 --- /dev/null +++ b/docs/workflows/configureleds-rgbcolors.bonsai @@ -0,0 +1,36 @@ + + + + + + + F + false + + + + Write + + 0 + 255 + 0 + 0 + 0 + 255 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/configureleds-rgbonoff.bonsai b/docs/workflows/configureleds-rgbonoff.bonsai new file mode 100644 index 0000000..4927c72 --- /dev/null +++ b/docs/workflows/configureleds-rgbonoff.bonsai @@ -0,0 +1,48 @@ + + + + + + + G + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + H + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/configureleds-toplevel.bonsai b/docs/workflows/configureleds-toplevel.bonsai new file mode 100644 index 0000000..ba62135 --- /dev/null +++ b/docs/workflows/configureleds-toplevel.bonsai @@ -0,0 +1,182 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure LED Current + + + + + A + false + + + + Write + + 20 + + + + Behavior Commands + + + Write + + 10 + + + + Behavior Commands + + + Turn LEDs On and Off + + + + + S + false + + + + Write + + Led0 + + + + Behavior Commands + + + + D + false + + + + Write + + Led0 + + + + Behavior Commands + + + Set RGB Colors + + + + + F + false + + + + Write + + 0 + 255 + 0 + 0 + 0 + 255 + + + + Behavior Commands + + + Turn RGB LEDs On and Off + + + + + G + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + H + false + + + + Write + + Rgb0 Rgb1 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-pulse.bonsai b/docs/workflows/controldigitaloutputs-pulse.bonsai new file mode 100644 index 0000000..17a532e --- /dev/null +++ b/docs/workflows/controldigitaloutputs-pulse.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-setclear.bonsai b/docs/workflows/controldigitaloutputs-setclear.bonsai new file mode 100644 index 0000000..b4a7e6e --- /dev/null +++ b/docs/workflows/controldigitaloutputs-setclear.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-timer.bonsai b/docs/workflows/controldigitaloutputs-timer.bonsai new file mode 100644 index 0000000..1756b31 --- /dev/null +++ b/docs/workflows/controldigitaloutputs-timer.bonsai @@ -0,0 +1,31 @@ + + + + + + + PT2S + PT0S + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-toggle.bonsai b/docs/workflows/controldigitaloutputs-toggle.bonsai new file mode 100644 index 0000000..329f8da --- /dev/null +++ b/docs/workflows/controldigitaloutputs-toggle.bonsai @@ -0,0 +1,31 @@ + + + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controldigitaloutputs-toplevel.bonsai b/docs/workflows/controldigitaloutputs-toplevel.bonsai new file mode 100644 index 0000000..f667d7a --- /dev/null +++ b/docs/workflows/controldigitaloutputs-toplevel.bonsai @@ -0,0 +1,160 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Set and Clear Outputs + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + DO0 + + + + Behavior Commands + + + Toggle Outputs + + + + + D + false + + + + Write + + DO0 + + + + Behavior Commands + + + Pulse Outputs + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 500 + + + + Behavior Commands + + + Alternative: Set Outputs with Timer + + + + + PT2S + PT0S + + + + Write + + DO0 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-driveled.bonsai b/docs/workflows/controlpoke-driveled.bonsai new file mode 100644 index 0000000..3bfc0e0 --- /dev/null +++ b/docs/workflows/controlpoke-driveled.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + D + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/controlpoke-inputfilter.bonsai b/docs/workflows/controlpoke-inputfilter.bonsai new file mode 100644 index 0000000..13fea8a --- /dev/null +++ b/docs/workflows/controlpoke-inputfilter.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + 5 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/controlpoke-toplevel.bonsai b/docs/workflows/controlpoke-toplevel.bonsai new file mode 100644 index 0000000..73fe19d --- /dev/null +++ b/docs/workflows/controlpoke-toplevel.bonsai @@ -0,0 +1,191 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Poke Events + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + Configure Input Filter + + + + + A + false + + + + Write + + 5 + + + + Behavior Commands + + + Drive the Poke LED + + + + + S + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + + D + false + + + + Write + + DOPort0 + + + + Behavior Commands + + + Deliver Rewards + + + + + F + false + + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort0 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-valve.bonsai b/docs/workflows/controlpoke-valve.bonsai new file mode 100644 index 0000000..93c93ab --- /dev/null +++ b/docs/workflows/controlpoke-valve.bonsai @@ -0,0 +1,70 @@ + + + + + + + F + false + + + + Write + + 15 + + + + Behavior Commands + + + Behavior Events + + + + + + + DIPort0 + + + + + + + Source1 + + + + + + + + + + Write + + SupplyPort0 + + + + Behavior Commands + + + + + + + + + + + + + diff --git a/docs/workflows/controlpoke-visualizeevents.bonsai b/docs/workflows/controlpoke-visualizeevents.bonsai new file mode 100644 index 0000000..746d0e0 --- /dev/null +++ b/docs/workflows/controlpoke-visualizeevents.bonsai @@ -0,0 +1,34 @@ + + + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + diff --git a/docs/workflows/driveservos-configure.bonsai b/docs/workflows/driveservos-configure.bonsai new file mode 100644 index 0000000..e0d1142 --- /dev/null +++ b/docs/workflows/driveservos-configure.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 20000 + + + + Behavior Commands + + + Write + + 1500 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/driveservos-enabledisable.bonsai b/docs/workflows/driveservos-enabledisable.bonsai new file mode 100644 index 0000000..c36912f --- /dev/null +++ b/docs/workflows/driveservos-enabledisable.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + D + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/driveservos-position.bonsai b/docs/workflows/driveservos-position.bonsai new file mode 100644 index 0000000..7381c0c --- /dev/null +++ b/docs/workflows/driveservos-position.bonsai @@ -0,0 +1,31 @@ + + + + + + + F + false + + + + Write + + 2000 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/driveservos-toplevel.bonsai b/docs/workflows/driveservos-toplevel.bonsai new file mode 100644 index 0000000..ab25914 --- /dev/null +++ b/docs/workflows/driveservos-toplevel.bonsai @@ -0,0 +1,139 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure the Servo + + + + + A + false + + + + Write + + 20000 + + + + Behavior Commands + + + Write + + 1500 + + + + Behavior Commands + + + Enable and Disable Servos + + + + + S + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + + D + false + + + + Write + + ServoOutput2 + + + + Behavior Commands + + + Adjust the Position + + + + + F + false + + + + Write + + 2000 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/generatepwm-configure.bonsai b/docs/workflows/generatepwm-configure.bonsai new file mode 100644 index 0000000..45efd7f --- /dev/null +++ b/docs/workflows/generatepwm-configure.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-pulseenable.bonsai b/docs/workflows/generatepwm-pulseenable.bonsai new file mode 100644 index 0000000..669f5f1 --- /dev/null +++ b/docs/workflows/generatepwm-pulseenable.bonsai @@ -0,0 +1,42 @@ + + + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 100 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-startstop.bonsai b/docs/workflows/generatepwm-startstop.bonsai new file mode 100644 index 0000000..13127ad --- /dev/null +++ b/docs/workflows/generatepwm-startstop.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + D + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/generatepwm-toplevel.bonsai b/docs/workflows/generatepwm-toplevel.bonsai new file mode 100644 index 0000000..ed57a03 --- /dev/null +++ b/docs/workflows/generatepwm-toplevel.bonsai @@ -0,0 +1,150 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure PWM + + + + + A + false + + + + Write + + 1000 + + + + Behavior Commands + + + Write + + 50 + + + + Behavior Commands + + + Start and Stop PWM + + + + + S + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + + D + false + + + + Write + + PwmDO0 + + + + Behavior Commands + + + Generate PWM Bursts + + + + + F + false + + + + Write + + DO0 + + + + Behavior Commands + + + Write + + 100 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/harp-devicepattern.bonsai b/docs/workflows/harp-devicepattern.bonsai new file mode 100644 index 0000000..05b4867 --- /dev/null +++ b/docs/workflows/harp-devicepattern.bonsai @@ -0,0 +1,43 @@ + + + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + + + + + + + diff --git a/docs/workflows/readdigitalinputs-toplevel.bonsai b/docs/workflows/readdigitalinputs-toplevel.bonsai new file mode 100644 index 0000000..14c8ea8 --- /dev/null +++ b/docs/workflows/readdigitalinputs-toplevel.bonsai @@ -0,0 +1,72 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Visualize Digital Input Events + + + + Behavior Events + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + + diff --git a/docs/workflows/routesignals-mimicir.bonsai b/docs/workflows/routesignals-mimicir.bonsai new file mode 100644 index 0000000..a83f277 --- /dev/null +++ b/docs/workflows/routesignals-mimicir.bonsai @@ -0,0 +1,48 @@ + + + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/routesignals-mimicvalve.bonsai b/docs/workflows/routesignals-mimicvalve.bonsai new file mode 100644 index 0000000..fd8ce16 --- /dev/null +++ b/docs/workflows/routesignals-mimicvalve.bonsai @@ -0,0 +1,31 @@ + + + + + + + D + false + + + + Write + + DO2 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/routesignals-serialtimestamp.bonsai b/docs/workflows/routesignals-serialtimestamp.bonsai new file mode 100644 index 0000000..2f62d5e --- /dev/null +++ b/docs/workflows/routesignals-serialtimestamp.bonsai @@ -0,0 +1,31 @@ + + + + + + + F + false + + + + Write + + TimestampPort2 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/routesignals-toplevel.bonsai b/docs/workflows/routesignals-toplevel.bonsai new file mode 100644 index 0000000..f370545 --- /dev/null +++ b/docs/workflows/routesignals-toplevel.bonsai @@ -0,0 +1,128 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Mimic Poke Inputs + + + + + A + false + + + + Write + + DO0 + + + + Behavior Commands + + + + S + false + + + + Write + + None + + + + Behavior Commands + + + Mimic Valves + + + + + D + false + + + + Write + + DO2 + + + + Behavior Commands + + + Stream Timestamps + + + + + F + false + + + + Write + + TimestampPort2 + + + + Behavior Commands + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/trackrotation-enable.bonsai b/docs/workflows/trackrotation-enable.bonsai new file mode 100644 index 0000000..943c901 --- /dev/null +++ b/docs/workflows/trackrotation-enable.bonsai @@ -0,0 +1,42 @@ + + + + + + + A + false + + + + Write + + Position + + + + Behavior Commands + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/trackrotation-reset.bonsai b/docs/workflows/trackrotation-reset.bonsai new file mode 100644 index 0000000..4430b89 --- /dev/null +++ b/docs/workflows/trackrotation-reset.bonsai @@ -0,0 +1,31 @@ + + + + + + + S + false + + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/trackrotation-toplevel.bonsai b/docs/workflows/trackrotation-toplevel.bonsai new file mode 100644 index 0000000..69b8251 --- /dev/null +++ b/docs/workflows/trackrotation-toplevel.bonsai @@ -0,0 +1,137 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Enable the Encoder + + + + + A + false + + + + Write + + Position + + + + Behavior Commands + + + Write + + EncoderPort2 + + + + Behavior Commands + + + Visualize Encoder Data + + + + Behavior Events + + + + Include + Event + + + + + + + Encoder + + + true + + 400 + 100 + + + 300 + 300 + + + + + Reset the Encoder + + + + + S + false + + + + Write + + EncoderPort2 + + + + Behavior Commands + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/trackrotation-visualize.bonsai b/docs/workflows/trackrotation-visualize.bonsai new file mode 100644 index 0000000..b2bb164 --- /dev/null +++ b/docs/workflows/trackrotation-visualize.bonsai @@ -0,0 +1,45 @@ + + + + + + Behavior Events + + + + Include + Event + + + + + + + Encoder + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + diff --git a/docs/workflows/triggercameras-frequency.bonsai b/docs/workflows/triggercameras-frequency.bonsai new file mode 100644 index 0000000..b9e3751 --- /dev/null +++ b/docs/workflows/triggercameras-frequency.bonsai @@ -0,0 +1,31 @@ + + + + + + + A + false + + + + Write + + 30 + + + + Behavior Commands + + + + + + + + diff --git a/docs/workflows/triggercameras-startstop.bonsai b/docs/workflows/triggercameras-startstop.bonsai new file mode 100644 index 0000000..904be81 --- /dev/null +++ b/docs/workflows/triggercameras-startstop.bonsai @@ -0,0 +1,48 @@ + + + + + + + S + false + + + + Write + + CameraOutput0 + + + + Behavior Commands + + + + D + false + + + + Write + + CameraOutput0 + + + + Behavior Commands + + + + + + + + + + diff --git a/docs/workflows/triggercameras-toplevel.bonsai b/docs/workflows/triggercameras-toplevel.bonsai new file mode 100644 index 0000000..eb9f000 --- /dev/null +++ b/docs/workflows/triggercameras-toplevel.bonsai @@ -0,0 +1,139 @@ + + + + + + Harp Device Pattern + + + + Behavior Commands + + + + Active + On + true + On + Disabled + false + COM8 + + + + + Behavior.harp + true + false + Include + + + + + Behavior Events + + + Configure Trigger Frequency + + + + + A + false + + + + Write + + 30 + + + + Behavior Commands + + + Start and Stop Cameras + + + + + S + false + + + + Write + + CameraOutput0 + + + + Behavior Commands + + + + D + false + + + + Write + + CameraOutput0 + + + + Behavior Commands + + + Visualize Frame Events + + + + Behavior Events + + + + Include + Event + + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + + + + + + + + + + diff --git a/docs/workflows/triggercameras-visualizeframes.bonsai b/docs/workflows/triggercameras-visualizeframes.bonsai new file mode 100644 index 0000000..438434e --- /dev/null +++ b/docs/workflows/triggercameras-visualizeframes.bonsai @@ -0,0 +1,41 @@ + + + + + + Behavior Events + + + + Include + Event + + + + + + + true + + 400 + 100 + + + 300 + 300 + + + + + + + + + + + diff --git a/Firmware/.gitignore b/firmware/.gitignore similarity index 100% rename from Firmware/.gitignore rename to firmware/.gitignore diff --git a/Firmware/Behavior.atsln b/firmware/Behavior.atsln similarity index 100% rename from Firmware/Behavior.atsln rename to firmware/Behavior.atsln diff --git a/Firmware/Behavior/Behavior.cproj b/firmware/Behavior/Behavior.cproj similarity index 100% rename from Firmware/Behavior/Behavior.cproj rename to firmware/Behavior/Behavior.cproj diff --git a/Firmware/Behavior/Makefile b/firmware/Behavior/Makefile similarity index 100% rename from Firmware/Behavior/Makefile rename to firmware/Behavior/Makefile diff --git a/Firmware/Behavior/WS2812S.c b/firmware/Behavior/WS2812S.c similarity index 100% rename from Firmware/Behavior/WS2812S.c rename to firmware/Behavior/WS2812S.c diff --git a/Firmware/Behavior/WS2812S.h b/firmware/Behavior/WS2812S.h similarity index 100% rename from Firmware/Behavior/WS2812S.h rename to firmware/Behavior/WS2812S.h diff --git a/Firmware/Behavior/app.c b/firmware/Behavior/app.c similarity index 100% rename from Firmware/Behavior/app.c rename to firmware/Behavior/app.c diff --git a/Firmware/Behavior/app.h b/firmware/Behavior/app.h similarity index 100% rename from Firmware/Behavior/app.h rename to firmware/Behavior/app.h diff --git a/Firmware/Behavior/app_funcs.c b/firmware/Behavior/app_funcs.c similarity index 100% rename from Firmware/Behavior/app_funcs.c rename to firmware/Behavior/app_funcs.c diff --git a/Firmware/Behavior/app_funcs.h b/firmware/Behavior/app_funcs.h similarity index 100% rename from Firmware/Behavior/app_funcs.h rename to firmware/Behavior/app_funcs.h diff --git a/Firmware/Behavior/app_ios_and_regs.c b/firmware/Behavior/app_ios_and_regs.c similarity index 100% rename from Firmware/Behavior/app_ios_and_regs.c rename to firmware/Behavior/app_ios_and_regs.c diff --git a/Firmware/Behavior/app_ios_and_regs.h b/firmware/Behavior/app_ios_and_regs.h similarity index 100% rename from Firmware/Behavior/app_ios_and_regs.h rename to firmware/Behavior/app_ios_and_regs.h diff --git a/Firmware/Behavior/cpu.h b/firmware/Behavior/cpu.h similarity index 100% rename from Firmware/Behavior/cpu.h rename to firmware/Behavior/cpu.h diff --git a/Firmware/Behavior/hwbp_core.h b/firmware/Behavior/hwbp_core.h similarity index 100% rename from Firmware/Behavior/hwbp_core.h rename to firmware/Behavior/hwbp_core.h diff --git a/Firmware/Behavior/hwbp_core_com.h b/firmware/Behavior/hwbp_core_com.h similarity index 100% rename from Firmware/Behavior/hwbp_core_com.h rename to firmware/Behavior/hwbp_core_com.h diff --git a/Firmware/Behavior/hwbp_core_regs.h b/firmware/Behavior/hwbp_core_regs.h similarity index 100% rename from Firmware/Behavior/hwbp_core_regs.h rename to firmware/Behavior/hwbp_core_regs.h diff --git a/Firmware/Behavior/hwbp_core_types.h b/firmware/Behavior/hwbp_core_types.h similarity index 100% rename from Firmware/Behavior/hwbp_core_types.h rename to firmware/Behavior/hwbp_core_types.h diff --git a/Firmware/Behavior/hwbp_sync.h b/firmware/Behavior/hwbp_sync.h similarity index 100% rename from Firmware/Behavior/hwbp_sync.h rename to firmware/Behavior/hwbp_sync.h diff --git a/Firmware/Behavior/interrupts.c b/firmware/Behavior/interrupts.c similarity index 100% rename from Firmware/Behavior/interrupts.c rename to firmware/Behavior/interrupts.c diff --git a/Firmware/Behavior/ios.yml b/firmware/Behavior/ios.yml similarity index 100% rename from Firmware/Behavior/ios.yml rename to firmware/Behavior/ios.yml diff --git a/Firmware/Behavior/libATxmega128A1U-1.15.a b/firmware/Behavior/libATxmega128A1U-1.15.a similarity index 100% rename from Firmware/Behavior/libATxmega128A1U-1.15.a rename to firmware/Behavior/libATxmega128A1U-1.15.a diff --git a/Firmware/Behavior/main.c b/firmware/Behavior/main.c similarity index 100% rename from Firmware/Behavior/main.c rename to firmware/Behavior/main.c diff --git a/Firmware/Behavior/registers.xls b/firmware/Behavior/registers.xls similarity index 100% rename from Firmware/Behavior/registers.xls rename to firmware/Behavior/registers.xls diff --git a/Firmware/Behavior/structs.h b/firmware/Behavior/structs.h similarity index 100% rename from Firmware/Behavior/structs.h rename to firmware/Behavior/structs.h diff --git a/Firmware/LICENSE b/firmware/LICENSE similarity index 100% rename from Firmware/LICENSE rename to firmware/LICENSE diff --git a/Hardware/.gitignore b/hardware/.gitignore similarity index 100% rename from Hardware/.gitignore rename to hardware/.gitignore diff --git a/Hardware/Mechanical/LICENSE b/hardware/Mechanical/LICENSE similarity index 100% rename from Hardware/Mechanical/LICENSE rename to hardware/Mechanical/LICENSE diff --git a/Hardware/Mechanical/README.md b/hardware/Mechanical/README.md similarity index 100% rename from Hardware/Mechanical/README.md rename to hardware/Mechanical/README.md diff --git a/Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.pdf b/hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.pdf similarity index 100% rename from Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.pdf rename to hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.pdf diff --git a/Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.svg b/hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.svg similarity index 100% rename from Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.svg rename to hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR.svg diff --git a/Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR_Color_GB.pdf b/hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR_Color_GB.pdf similarity index 100% rename from Hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR_Color_GB.pdf rename to hardware/Mechanical/case_v1.1_v1.2/Behavior_Box_LR_Color_GB.pdf diff --git a/Hardware/Mechanical/case_v2.0/Behavior_Box_V2_0_LR.pdf b/hardware/Mechanical/case_v2.0/Behavior_Box_V2_0_LR.pdf similarity index 100% rename from Hardware/Mechanical/case_v2.0/Behavior_Box_V2_0_LR.pdf rename to hardware/Mechanical/case_v2.0/Behavior_Box_V2_0_LR.pdf diff --git a/Hardware/PCB/CONTRIB b/hardware/PCB/CONTRIB similarity index 100% rename from Hardware/PCB/CONTRIB rename to hardware/PCB/CONTRIB diff --git a/Hardware/PCB/LICENSE b/hardware/PCB/LICENSE similarity index 100% rename from Hardware/PCB/LICENSE rename to hardware/PCB/LICENSE diff --git a/Hardware/PCB/README b/hardware/PCB/README similarity index 100% rename from Hardware/PCB/README rename to hardware/PCB/README diff --git a/Hardware/PCB/harp behavior.brd b/hardware/PCB/harp behavior.brd similarity index 100% rename from Hardware/PCB/harp behavior.brd rename to hardware/PCB/harp behavior.brd diff --git a/Hardware/PCB/harp behavior.pdf b/hardware/PCB/harp behavior.pdf similarity index 100% rename from Hardware/PCB/harp behavior.pdf rename to hardware/PCB/harp behavior.pdf diff --git a/Hardware/PCB/harp behavior.sch b/hardware/PCB/harp behavior.sch similarity index 100% rename from Hardware/PCB/harp behavior.sch rename to hardware/PCB/harp behavior.sch diff --git a/Hardware/PCB/harp behavior_BOM.xlsx b/hardware/PCB/harp behavior_BOM.xlsx similarity index 100% rename from Hardware/PCB/harp behavior_BOM.xlsx rename to hardware/PCB/harp behavior_BOM.xlsx diff --git a/Hardware/PCB/harp behavior_centroid.csv b/hardware/PCB/harp behavior_centroid.csv similarity index 100% rename from Hardware/PCB/harp behavior_centroid.csv rename to hardware/PCB/harp behavior_centroid.csv diff --git a/Hardware/PCB/harp behavior_gerbers.zip b/hardware/PCB/harp behavior_gerbers.zip similarity index 100% rename from Hardware/PCB/harp behavior_gerbers.zip rename to hardware/PCB/harp behavior_gerbers.zip diff --git a/Interface/.editorconfig b/software/.editorconfig similarity index 100% rename from Interface/.editorconfig rename to software/.editorconfig diff --git a/Interface/.gitignore b/software/.gitignore similarity index 100% rename from Interface/.gitignore rename to software/.gitignore diff --git a/software/Directory.Build.props b/software/Directory.Build.props new file mode 100644 index 0000000..c8f3a92 --- /dev/null +++ b/software/Directory.Build.props @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/software/Directory.Build.targets b/software/Directory.Build.targets new file mode 100644 index 0000000..b7ac253 --- /dev/null +++ b/software/Directory.Build.targets @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Interface/Harp.Behavior.App/Harp.Behavior.App.csproj b/software/Harp.Behavior.App/Harp.Behavior.App.csproj similarity index 65% rename from Interface/Harp.Behavior.App/Harp.Behavior.App.csproj rename to software/Harp.Behavior.App/Harp.Behavior.App.csproj index 846b3f1..f300e27 100644 --- a/Interface/Harp.Behavior.App/Harp.Behavior.App.csproj +++ b/software/Harp.Behavior.App/Harp.Behavior.App.csproj @@ -1,40 +1,36 @@  + Visual tool for configuring Harp Behavior devices. + $(PackageTags) App + net8.0 WinExe - - net8.0 - enable + true + harp.behavior true app.manifest - ..\bin\$(Configuration) ..\Harp.Behavior.Design\Assets\logo.ico - Harp.Behavior.App - Harp.Behavior.App - Harp.Behavior.App + $(MSBuildProjectName) + $(MSBuildProjectName) org.harp-tech - $(Version) - $(Version) + $(CiBuildVersion) + $(CiBuildVersion) AAPL . - Harp.Behavior.App + $(MSBuildProjectName) logo.icns NSApplication true - harp-tech ..\Harp.Behavior.Design\Assets\logo.ico - git - ..\bin\$(Configuration) - - - - + + + + diff --git a/Interface/Harp.Behavior.Design/Adapters/RgbRegisterAdapter.cs b/software/Harp.Behavior.Design/Adapters/RgbRegisterAdapter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Adapters/RgbRegisterAdapter.cs rename to software/Harp.Behavior.Design/Adapters/RgbRegisterAdapter.cs diff --git a/Interface/Harp.Behavior.Design/App.axaml b/software/Harp.Behavior.Design/App.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/App.axaml rename to software/Harp.Behavior.Design/App.axaml diff --git a/Interface/Harp.Behavior.Design/App.axaml.cs b/software/Harp.Behavior.Design/App.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/App.axaml.cs rename to software/Harp.Behavior.Design/App.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Assets/logo.icns b/software/Harp.Behavior.Design/Assets/logo.icns similarity index 100% rename from Interface/Harp.Behavior.Design/Assets/logo.icns rename to software/Harp.Behavior.Design/Assets/logo.icns diff --git a/Interface/Harp.Behavior.Design/Assets/logo.ico b/software/Harp.Behavior.Design/Assets/logo.ico similarity index 100% rename from Interface/Harp.Behavior.Design/Assets/logo.ico rename to software/Harp.Behavior.Design/Assets/logo.ico diff --git a/Interface/Harp.Behavior.Design/Assets/logo.png b/software/Harp.Behavior.Design/Assets/logo.png similarity index 100% rename from Interface/Harp.Behavior.Design/Assets/logo.png rename to software/Harp.Behavior.Design/Assets/logo.png diff --git a/Interface/Harp.Behavior.Design/Assets/logo.svg b/software/Harp.Behavior.Design/Assets/logo.svg similarity index 100% rename from Interface/Harp.Behavior.Design/Assets/logo.svg rename to software/Harp.Behavior.Design/Assets/logo.svg diff --git a/Interface/Harp.Behavior.Design/Assets/logo_about.png b/software/Harp.Behavior.Design/Assets/logo_about.png similarity index 100% rename from Interface/Harp.Behavior.Design/Assets/logo_about.png rename to software/Harp.Behavior.Design/Assets/logo_about.png diff --git a/Interface/Harp.Behavior.Design/Controls/ExtendedColorPicker.cs b/software/Harp.Behavior.Design/Controls/ExtendedColorPicker.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/ExtendedColorPicker.cs rename to software/Harp.Behavior.Design/Controls/ExtendedColorPicker.cs diff --git a/Interface/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml b/software/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml rename to software/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml diff --git a/Interface/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml.cs b/software/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml.cs rename to software/Harp.Behavior.Design/Controls/RgbRegisterControl.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Controls/VisualStatus.axaml b/software/Harp.Behavior.Design/Controls/VisualStatus.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/VisualStatus.axaml rename to software/Harp.Behavior.Design/Controls/VisualStatus.axaml diff --git a/Interface/Harp.Behavior.Design/Controls/VisualStatus.axaml.cs b/software/Harp.Behavior.Design/Controls/VisualStatus.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/VisualStatus.axaml.cs rename to software/Harp.Behavior.Design/Controls/VisualStatus.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml b/software/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml rename to software/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml diff --git a/Interface/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml.cs b/software/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml.cs rename to software/Harp.Behavior.Design/Controls/WriteMessagesControl.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Converters/BooleanConverter.cs b/software/Harp.Behavior.Design/Converters/BooleanConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/BooleanConverter.cs rename to software/Harp.Behavior.Design/Converters/BooleanConverter.cs diff --git a/Interface/Harp.Behavior.Design/Converters/EnableFlagConverter.cs b/software/Harp.Behavior.Design/Converters/EnableFlagConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/EnableFlagConverter.cs rename to software/Harp.Behavior.Design/Converters/EnableFlagConverter.cs diff --git a/Interface/Harp.Behavior.Design/Converters/EnumDisplayConverter.cs b/software/Harp.Behavior.Design/Converters/EnumDisplayConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/EnumDisplayConverter.cs rename to software/Harp.Behavior.Design/Converters/EnumDisplayConverter.cs diff --git a/Interface/Harp.Behavior.Design/Converters/PayloadFieldConverter.cs b/software/Harp.Behavior.Design/Converters/PayloadFieldConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/PayloadFieldConverter.cs rename to software/Harp.Behavior.Design/Converters/PayloadFieldConverter.cs diff --git a/Interface/Harp.Behavior.Design/Converters/TypeDescriptionConverter.cs b/software/Harp.Behavior.Design/Converters/TypeDescriptionConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/TypeDescriptionConverter.cs rename to software/Harp.Behavior.Design/Converters/TypeDescriptionConverter.cs diff --git a/Interface/Harp.Behavior.Design/Converters/VisualStatusColorConverter.cs b/software/Harp.Behavior.Design/Converters/VisualStatusColorConverter.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Converters/VisualStatusColorConverter.cs rename to software/Harp.Behavior.Design/Converters/VisualStatusColorConverter.cs diff --git a/Interface/Harp.Behavior.Design/FodyWeavers.xml b/software/Harp.Behavior.Design/FodyWeavers.xml similarity index 100% rename from Interface/Harp.Behavior.Design/FodyWeavers.xml rename to software/Harp.Behavior.Design/FodyWeavers.xml diff --git a/Interface/Harp.Behavior.Design/Harp.Behavior.Design.csproj b/software/Harp.Behavior.Design/Harp.Behavior.Design.csproj similarity index 88% rename from Interface/Harp.Behavior.Design/Harp.Behavior.Design.csproj rename to software/Harp.Behavior.Design/Harp.Behavior.Design.csproj index a7155e9..042aa35 100644 --- a/Interface/Harp.Behavior.Design/Harp.Behavior.Design.csproj +++ b/software/Harp.Behavior.Design/Harp.Behavior.Design.csproj @@ -1,9 +1,8 @@  - enable - latest + Design Library containing UI components for configuring Harp Behavior devices. true - ..\bin\$(Configuration) + $(PackageTags) Design Bonsai Rx net8.0 diff --git a/Interface/Harp.Behavior.Design/Styles/DefaultStyles.axaml b/software/Harp.Behavior.Design/Styles/DefaultStyles.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Styles/DefaultStyles.axaml rename to software/Harp.Behavior.Design/Styles/DefaultStyles.axaml diff --git a/Interface/Harp.Behavior.Design/ViewModels/AboutViewModel.cs b/software/Harp.Behavior.Design/ViewModels/AboutViewModel.cs similarity index 100% rename from Interface/Harp.Behavior.Design/ViewModels/AboutViewModel.cs rename to software/Harp.Behavior.Design/ViewModels/AboutViewModel.cs diff --git a/Interface/Harp.Behavior.Design/ViewModels/BehaviorViewModel.cs b/software/Harp.Behavior.Design/ViewModels/BehaviorViewModel.cs similarity index 100% rename from Interface/Harp.Behavior.Design/ViewModels/BehaviorViewModel.cs rename to software/Harp.Behavior.Design/ViewModels/BehaviorViewModel.cs diff --git a/Interface/Harp.Behavior.Design/ViewModels/ViewModelBase.cs b/software/Harp.Behavior.Design/ViewModels/ViewModelBase.cs similarity index 100% rename from Interface/Harp.Behavior.Design/ViewModels/ViewModelBase.cs rename to software/Harp.Behavior.Design/ViewModels/ViewModelBase.cs diff --git a/Interface/Harp.Behavior.Design/Views/About.axaml b/software/Harp.Behavior.Design/Views/About.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Views/About.axaml rename to software/Harp.Behavior.Design/Views/About.axaml diff --git a/Interface/Harp.Behavior.Design/Views/About.axaml.cs b/software/Harp.Behavior.Design/Views/About.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Views/About.axaml.cs rename to software/Harp.Behavior.Design/Views/About.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Views/BehaviorView.axaml b/software/Harp.Behavior.Design/Views/BehaviorView.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Views/BehaviorView.axaml rename to software/Harp.Behavior.Design/Views/BehaviorView.axaml diff --git a/Interface/Harp.Behavior.Design/Views/BehaviorView.axaml.cs b/software/Harp.Behavior.Design/Views/BehaviorView.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Views/BehaviorView.axaml.cs rename to software/Harp.Behavior.Design/Views/BehaviorView.axaml.cs diff --git a/Interface/Harp.Behavior.Design/Views/MainWindow.axaml b/software/Harp.Behavior.Design/Views/MainWindow.axaml similarity index 100% rename from Interface/Harp.Behavior.Design/Views/MainWindow.axaml rename to software/Harp.Behavior.Design/Views/MainWindow.axaml diff --git a/Interface/Harp.Behavior.Design/Views/MainWindow.axaml.cs b/software/Harp.Behavior.Design/Views/MainWindow.axaml.cs similarity index 100% rename from Interface/Harp.Behavior.Design/Views/MainWindow.axaml.cs rename to software/Harp.Behavior.Design/Views/MainWindow.axaml.cs diff --git a/Interface/Harp.Behavior.sln b/software/Harp.Behavior.sln similarity index 87% rename from Interface/Harp.Behavior.sln rename to software/Harp.Behavior.sln index 4ac5e07..5e12e6a 100644 --- a/Interface/Harp.Behavior.sln +++ b/software/Harp.Behavior.sln @@ -9,12 +9,6 @@ Project("{D6F1C6E5-7507-425D-A697-29DAB58ED458}") = "Harp.Behavior.App", "Harp.B EndProject Project("{D6F1C6E5-7507-425D-A697-29DAB58ED458}") = "Harp.Behavior.Design", "Harp.Behavior.Design\Harp.Behavior.Design.csproj", "{FCB73743-9ECF-4D3E-A235-F0493BC10629}" EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{10D72C30-D95E-452C-910F-F39FC6BAF129}" - ProjectSection(SolutionItems) = preProject - .editorconfig = .editorconfig - Harp.Behavior.nsi = Harp.Behavior.nsi - EndProjectSection -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU diff --git a/Interface/Harp.Behavior/AsyncDevice.Generated.cs b/software/Harp.Behavior/AsyncDevice.Generated.cs similarity index 100% rename from Interface/Harp.Behavior/AsyncDevice.Generated.cs rename to software/Harp.Behavior/AsyncDevice.Generated.cs diff --git a/Interface/Harp.Behavior/Device.Generated.cs b/software/Harp.Behavior/Device.Generated.cs similarity index 100% rename from Interface/Harp.Behavior/Device.Generated.cs rename to software/Harp.Behavior/Device.Generated.cs diff --git a/software/Harp.Behavior/Harp.Behavior.csproj b/software/Harp.Behavior/Harp.Behavior.csproj new file mode 100644 index 0000000..7be6d10 --- /dev/null +++ b/software/Harp.Behavior/Harp.Behavior.csproj @@ -0,0 +1,17 @@ + + + + Bonsai Library containing interfaces for data acquisition and control of Harp Behavior devices. + $(PackageTags) Bonsai Rx + net472;net8.0 + + + + + + + + + + + diff --git a/Interface/Harp.Behavior/Properties/AssemblyInfo.cs b/software/Harp.Behavior/Properties/AssemblyInfo.cs similarity index 100% rename from Interface/Harp.Behavior/Properties/AssemblyInfo.cs rename to software/Harp.Behavior/Properties/AssemblyInfo.cs diff --git a/Interface/Harp.Behavior/Properties/launchSettings.json b/software/Harp.Behavior/Properties/launchSettings.json similarity index 100% rename from Interface/Harp.Behavior/Properties/launchSettings.json rename to software/Harp.Behavior/Properties/launchSettings.json diff --git a/Interface/Harp.Behavior/README.md b/software/Harp.Behavior/README.md similarity index 100% rename from Interface/Harp.Behavior/README.md rename to software/Harp.Behavior/README.md diff --git a/Interface/LICENSE b/software/LICENSE similarity index 100% rename from Interface/LICENSE rename to software/LICENSE diff --git a/software/build/Common.Tests.csproj.props b/software/build/Common.Tests.csproj.props new file mode 100644 index 0000000..c42b25f --- /dev/null +++ b/software/build/Common.Tests.csproj.props @@ -0,0 +1,6 @@ + + + false + false + + \ No newline at end of file diff --git a/software/build/Common.csproj.props b/software/build/Common.csproj.props new file mode 100644 index 0000000..f96fce7 --- /dev/null +++ b/software/build/Common.csproj.props @@ -0,0 +1,69 @@ + + + + + Debug + AnyCPU + + + + + 12.0 + true + strict + enable + true + true + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)../../artifacts')) + + + + + true + Dependency;BonsaiLibrary + + icon.png + $(MSBuildThisFileDirectory)icon.png + + LICENSE + $(MSBuildThisFileDirectory)../LICENSE + + README.md + $(MSBuildThisFileDirectory)../../docs/README.md + $(MSBuildThisFileDirectory)README.nuget.md + $(MSBuildProjectDirectory)\README.md + $(MSBuildProjectDirectory)\README.nuget.md + + + false + true + snupkg + + + false + true + + + + + $(WarningsAsErrors);NU1701;CS7035 + + + true + + + true + + + + + + \ No newline at end of file diff --git a/software/build/Common.csproj.targets b/software/build/Common.csproj.targets new file mode 100644 index 0000000..07f4916 --- /dev/null +++ b/software/build/Common.csproj.targets @@ -0,0 +1,46 @@ + + + + + + + + + + + $(TargetName.ToLowerInvariant()) + DotnetTool + + + 1591,1573 + + + + + + + + 0 + 42.42.42-dev$(DevVersion) + + $(CiBuildVersion) + + + + + + + + + + + + \ No newline at end of file diff --git a/software/build/Package.props b/software/build/Package.props new file mode 100644 index 0000000..cecc3ab --- /dev/null +++ b/software/build/Package.props @@ -0,0 +1,9 @@ + + + Harp Behavior + https://harp-tech.org/device.behavior + + harp-tech + Copyright © harp-tech and Contributors + + \ No newline at end of file diff --git a/software/build/Project.csproj.props b/software/build/Project.csproj.props new file mode 100644 index 0000000..276e93b --- /dev/null +++ b/software/build/Project.csproj.props @@ -0,0 +1,5 @@ + + + 11.2.6 + + \ No newline at end of file diff --git a/Interface/icon.png b/software/build/icon.png similarity index 100% rename from Interface/icon.png rename to software/build/icon.png