├── .gitattributes ├── .github └── ISSUE_TEMPLATE │ └── bug_report.md ├── .gitignore ├── BootloaderExample_Python ├── fw_upload_serial_port.py ├── lib │ └── fw_upload_lib.py └── readme.txt ├── Example_MethodSCRIPTs ├── MSExample001-EmStat4M_with_MUX8_multiplexer.txt ├── MSExample002-SensitBT_running_and_storing_SWV.txt ├── MSExample003-SensitBT_temp_measurement_I2C.txt ├── MSExample004-SensitBT_wake_on_trigger_button.txt ├── MSExample005-SensitBT_run_CV_on_trigger_button_and_store.txt ├── MSExample006-Peak_search_using_min_max.txt └── MSExample007-EmStatPicoMux16.txt ├── LICENSE.txt ├── MethodSCRIPTExample_Android ├── .gitignore ├── .idea │ ├── codeStyles │ │ └── Project.xml │ ├── gradle.xml │ ├── misc.xml │ ├── runConfigurations.xml │ └── vcs.xml ├── GettingStarted_MethodSCRIPT_Example_Android.docx ├── GettingStarted_MethodSCRIPT_Example_Android.pdf ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── methodSCRIPTExample │ ├── .gitignore │ ├── build.gradle │ ├── libs │ │ └── d2xx.jar │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── LSV_on_10kOhm.txt │ │ └── SWV_on_10kOhm.txt │ │ ├── java │ │ └── com │ │ │ └── palmsens │ │ │ └── methodSCRIPTExample │ │ │ └── MethodSCRIPTExample.java │ │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_method_script_example.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ └── device_filter.xml ├── msBluetooth │ ├── .gitignore │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── LSV_on_10kOhm.txt │ │ └── SWV_on_10kOhm.txt │ │ ├── java │ │ └── com │ │ │ └── palmsens │ │ │ └── msBluetooth │ │ │ ├── BluetoothConnectionService.java │ │ │ └── MSBluetoothActivity.java │ │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout-land │ │ └── activity_msbluetooth.xml │ │ ├── layout │ │ └── activity_msbluetooth.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml └── settings.gradle ├── MethodSCRIPTExample_Arduino ├── GettingStarted_MethodSCRIPT_Example_Arduino.docx ├── GettingStarted_MethodSCRIPT_Example_Arduino.pdf ├── MathHelperLibrary │ ├── LICENSE.md │ └── MathHelpers.h ├── MethodSCRIPTComm │ ├── MSComm.c │ ├── MSComm.h │ └── MSCommon.h └── MethodSCRIPTExample │ └── MethodSCRIPTExample.ino ├── MethodSCRIPTExample_C# ├── GettingStarted_MethodSCRIPT_Example_C#.docx ├── GettingStarted_MethodSCRIPT_Example_C#.pdf ├── MSCodeExamples.sln ├── MSConsoleExample │ ├── App.config │ ├── MSConsoleExample.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── scripts │ │ ├── LSV_on_10kOhm.txt │ │ └── SWV_on_10kOhm.txt ├── MSEISConsoleExample │ ├── App.config │ ├── MSEISConsoleExample.csproj │ ├── Program.cs │ ├── Properties │ │ └── AssemblyInfo.cs │ └── scripts │ │ └── EIS_on_Randles_560Ohm_10kOhm_33nF.txt ├── MSEISPlotExample │ ├── App.config │ ├── FormEISPlotExample.Designer.cs │ ├── FormEISPlotExample.cs │ ├── FormEISPlotExample.resx │ ├── MSEISPlotExample.csproj │ ├── Program.cs │ ├── Properties │ │ ├── AssemblyInfo.cs │ │ ├── Resources.Designer.cs │ │ ├── Resources.resx │ │ ├── Settings.Designer.cs │ │ └── Settings.settings │ ├── packages.config │ └── scripts │ │ └── EIS_on_Randles_560Ohm_10kOhm_33nF.txt └── MSPlotExample │ ├── App.config │ ├── FormPlotExample.Designer.cs │ ├── FormPlotExample.cs │ ├── FormPlotExample.resx │ ├── MSPlotExample.csproj │ ├── Program.cs │ ├── Properties │ ├── AssemblyInfo.cs │ ├── Resources.Designer.cs │ ├── Resources.resx │ ├── Settings.Designer.cs │ └── Settings.settings │ ├── packages.config │ └── scripts │ ├── LSV_on_10kOhm.txt │ └── SWV_on_10kOhm.txt ├── MethodSCRIPTExample_C ├── GettingStarted_MethodSCRIPT_Example_C.docx ├── GettingStarted_MethodSCRIPT_Example_C.pdf └── MethodSCRIPTExample_C │ ├── .gitignore │ ├── Doxyfile │ ├── Makefile │ ├── Makefile_windows │ ├── MethodSCRIPT-example.sln │ ├── MethodSCRIPT-example.vcxproj │ ├── make.bat │ ├── results │ └── .gitignore │ ├── scripts │ ├── example_EIS.mscr │ ├── example_LSV_10k.mscr │ └── example_SWV_10k.mscr │ └── src │ ├── example.c │ └── palmsens │ ├── mscript.c │ ├── mscript.h │ ├── mscript_debug_printf.h │ ├── mscript_serial_port.h │ ├── mscript_serial_port_linux.c │ └── mscript_serial_port_windows.c ├── MethodSCRIPTExample_Python ├── GettingStarted_MethodSCRIPT_Example_Python.docx ├── GettingStarted_MethodSCRIPT_Example_Python.pdf ├── MethodSCRIPTExample_Python │ ├── console_example.py │ ├── palmsens │ │ ├── instrument.py │ │ ├── mscript.py │ │ └── serial.py │ ├── plot_advanced_swv.py │ ├── plot_cv.py │ ├── plot_eis.py │ ├── requirements.txt │ ├── revision_history.txt │ ├── scripts │ │ ├── example_advanced_swv_es4.mscr │ │ ├── example_advanced_swv_espico.mscr │ │ ├── example_cv.mscr │ │ └── example_eis.mscr │ └── tox.ini └── MethodSCRIPT_Example_Python.code-workspace ├── MethodSCRIPTExample_iOS ├── .com.greenworldsoft.syncfolderspro ├── .idea │ ├── .gitignore │ ├── MethodSCRIPTExample_Swift.iml │ ├── dictionaries │ │ └── evertwiesenekker.xml │ ├── misc.xml │ ├── modules.xml │ ├── vcs.xml │ └── xcode.xml ├── GettingStarted_MethodSCRIPT_Example_iOS.docx ├── GettingStarted_MethodSCRIPT_Example_iOS.pdf ├── MethodSCRIPTExample_iOS.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ ├── evertwiesenekker.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ ├── xcdebugger │ │ │ │ └── Expressions.xcexplist │ │ │ └── xcschemes │ │ │ │ └── xcschememanagement.plist │ │ │ └── mallepietje.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── xcuserdata │ │ ├── evertwiesenekker.xcuserdatad │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ │ ├── MethodSCRIPTExample_Swift.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── mallepietje.xcuserdatad │ │ ├── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ │ └── xcschemes │ │ ├── MethodSCRIPTExample_Swift.xcscheme │ │ └── xcschememanagement.plist └── MethodSCRIPTExample_iOS │ ├── AppDelegate.swift │ ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ ├── Contents.json │ │ ├── PalmSensLogo120x120.png │ │ ├── PalmSensLogo180x180.png │ │ ├── PalmSensLogo40x40.png │ │ └── PalmSensLogo60x60.png │ └── Contents.json │ ├── BLEConnection.swift │ ├── Base.lproj │ └── LaunchScreen.storyboard │ ├── ContentView.swift │ ├── Extensions.swift │ ├── Info.plist │ ├── Logger.swift │ ├── Preview Content │ └── Preview Assets.xcassets │ │ └── Contents.json │ └── SceneDelegate.swift └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Used example** 23 | The name of the example that was used. 24 | 25 | **Used device(s)** 26 | The PalmSens potentiostat device and host system used. 27 | 28 | **Additional context** 29 | Add any other context about the problem here. It can be helpful to attach the following: 30 | - Custom MethodSCRIPT's 31 | - Communication logs 32 | - Example output logs 33 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | 4 | # User-specific files 5 | *.suo 6 | *.user 7 | *.userosscache 8 | *.sln.docstates 9 | 10 | # User-specific files (MonoDevelop/Xamarin Studio) 11 | *.userprefs 12 | 13 | # Build results 14 | [Dd]ebug/ 15 | [Dd]ebugPublic/ 16 | [Rr]elease/ 17 | [Rr]eleases/ 18 | [Xx]64/ 19 | [Xx]86/ 20 | [Bb]uild/ 21 | bld/ 22 | [Bb]in/ 23 | [Oo]bj/ 24 | 25 | # Visual Studio 2015 cache/options directory 26 | .vs/ 27 | # Uncomment if you have tasks that create the project's static files in wwwroot 28 | #wwwroot/ 29 | 30 | # MSTest test Results 31 | [Tt]est[Rr]esult*/ 32 | [Bb]uild[Ll]og.* 33 | 34 | # NUNIT 35 | *.VisualState.xml 36 | TestResult.xml 37 | 38 | # Build Results of an ATL Project 39 | [Dd]ebugPS/ 40 | [Rr]eleasePS/ 41 | dlldata.c 42 | 43 | # DNX 44 | project.lock.json 45 | artifacts/ 46 | 47 | *_i.c 48 | *_p.c 49 | *_i.h 50 | *.ilk 51 | *.meta 52 | *.obj 53 | *.pch 54 | *.pdb 55 | *.pgc 56 | *.pgd 57 | *.rsp 58 | *.sbr 59 | *.tlb 60 | *.tli 61 | *.tlh 62 | *.tmp 63 | *.tmp_proj 64 | *.log 65 | *.vspscc 66 | *.vssscc 67 | .builds 68 | *.pidb 69 | *.svclog 70 | *.scc 71 | 72 | # Chutzpah Test files 73 | _Chutzpah* 74 | 75 | # Visual C++ cache files 76 | ipch/ 77 | *.aps 78 | *.ncb 79 | *.opendb 80 | *.opensdf 81 | *.sdf 82 | *.cachefile 83 | *.VC.db 84 | 85 | # Visual Studio profiler 86 | *.psess 87 | *.vsp 88 | *.vspx 89 | *.sap 90 | 91 | # TFS 2012 Local Workspace 92 | $tf/ 93 | 94 | # Guidance Automation Toolkit 95 | *.gpState 96 | 97 | # ReSharper is a .NET coding add-in 98 | _ReSharper*/ 99 | *.[Rr]e[Ss]harper 100 | *.DotSettings.user 101 | 102 | # JustCode is a .NET coding add-in 103 | .JustCode 104 | 105 | # TeamCity is a build add-in 106 | _TeamCity* 107 | 108 | # DotCover is a Code Coverage Tool 109 | *.dotCover 110 | 111 | # NCrunch 112 | _NCrunch_* 113 | .*crunch*.local.xml 114 | nCrunchTemp_* 115 | 116 | # MightyMoose 117 | *.mm.* 118 | AutoTest.Net/ 119 | 120 | # Web workbench (sass) 121 | .sass-cache/ 122 | 123 | # Installshield output folder 124 | [Ee]xpress/ 125 | 126 | # DocProject is a documentation generator add-in 127 | DocProject/buildhelp/ 128 | DocProject/Help/*.HxT 129 | DocProject/Help/*.HxC 130 | DocProject/Help/*.hhc 131 | DocProject/Help/*.hhk 132 | DocProject/Help/*.hhp 133 | DocProject/Help/Html2 134 | DocProject/Help/html 135 | 136 | # Click-Once directory 137 | publish/ 138 | 139 | # Publish Web Output 140 | *.[Pp]ublish.xml 141 | *.azurePubxml 142 | 143 | # TODO: Un-comment the next line if you do not want to checkin 144 | # your web deploy settings because they may include unencrypted 145 | # passwords 146 | #*.pubxml 147 | *.publishproj 148 | 149 | # NuGet Packages 150 | *.nupkg 151 | # The packages folder can be ignored because of Package Restore 152 | **/packages/* 153 | # except build/, which is used as an MSBuild target. 154 | !**/packages/build/ 155 | # Uncomment if necessary however generally it will be regenerated when needed 156 | #!**/packages/repositories.config 157 | # NuGet v3's project.json files produces more ignoreable files 158 | *.nuget.props 159 | *.nuget.targets 160 | 161 | # Microsoft Azure Build Output 162 | csx/ 163 | *.build.csdef 164 | 165 | # Microsoft Azure Emulator 166 | ecf/ 167 | rcf/ 168 | 169 | # Windows Store app package directory 170 | AppPackages/ 171 | BundleArtifacts/ 172 | 173 | # Visual Studio cache files 174 | # files ending in .cache can be ignored 175 | *.[Cc]ache 176 | # but keep track of directories ending in .cache 177 | !*.[Cc]ache/ 178 | 179 | # Others 180 | ClientBin/ 181 | [Ss]tyle[Cc]op.* 182 | ~$* 183 | *~ 184 | *.dbmdl 185 | *.dbproj.schemaview 186 | *.pfx 187 | *.publishsettings 188 | node_modules/ 189 | orleans.codegen.cs 190 | 191 | # RIA/Silverlight projects 192 | Generated_Code/ 193 | 194 | # Backup & report files from converting an old project file 195 | # to a newer Visual Studio version. Backup files are not needed, 196 | # because we have git ;-) 197 | _UpgradeReport_Files/ 198 | Backup*/ 199 | UpgradeLog*.XML 200 | UpgradeLog*.htm 201 | 202 | # SQL Server files 203 | *.mdf 204 | *.ldf 205 | 206 | # Business Intelligence projects 207 | *.rdl.data 208 | *.bim.layout 209 | *.bim_*.settings 210 | 211 | # Microsoft Fakes 212 | FakesAssemblies/ 213 | 214 | # GhostDoc plugin setting file 215 | *.GhostDoc.xml 216 | 217 | # Node.js Tools for Visual Studio 218 | .ntvs_analysis.dat 219 | 220 | # Visual Studio 6 build log 221 | *.plg 222 | 223 | # Visual Studio 6 workspace options file 224 | *.opt 225 | 226 | # Visual Studio LightSwitch build output 227 | **/*.HTMLClient/GeneratedArtifacts 228 | **/*.DesktopClient/GeneratedArtifacts 229 | **/*.DesktopClient/ModelManifest.xml 230 | **/*.Server/GeneratedArtifacts 231 | **/*.Server/ModelManifest.xml 232 | _Pvt_Extensions 233 | 234 | # LightSwitch generated files 235 | GeneratedArtifacts/ 236 | ModelManifest.xml 237 | 238 | # Paket dependency manager 239 | .paket/paket.exe 240 | 241 | # FAKE - F# Make 242 | .fake/ 243 | 244 | # Python cache files 245 | *.pyc 246 | __pycache__/ 247 | 248 | # Apple/Windows desktop files 249 | .DS_Store 250 | desktop.ini 251 | 252 | /.metadata 253 | /MethodSCRIPTExample_Android/.metadata/.plugins 254 | /MethodSCRIPTExample_Android/.metadata/.mylyn 255 | /MethodSCRIPTExample_Android/.metadata 256 | /MethodSCRIPTExample_Android/methodSCRIPTExample/.settings/org.eclipse.cdt.managedbuilder.core.prefs 257 | /MethodSCRIPTExample_Arduino/.metadata 258 | /MethodSCRIPTExample_C/.metadata 259 | /MethodSCRIPTExample_C/MethodSCRIPTExample_C/**/.settings/language.settings.xml 260 | /MethodSCRIPTExample_C/MethodSCRIPTExample_C/**/.settings/org.eclipse.cdt.managedbuilder.core.prefs 261 | /MethodSCRIPTExample_iOS/.DS_Store 262 | /MethodSCRIPTExample_Python/MethodSCRIPTExample_Python/output 263 | /MethodSCRIPTExample_Python/MethodSCRIPTExample_Python/venv 264 | MethodSCRIPTExamples.zip 265 | /**/workspace/ 266 | -------------------------------------------------------------------------------- /BootloaderExample_Python/fw_upload_serial_port.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Upload a firmware binary to a PalmSens device, using a serial port connection. 4 | """ 5 | 6 | # usage: fw_upload_serial_port.py [-h] [-f {off,soft,hard}] [-b BAUDRATE] binary port 7 | # positional arguments: 8 | # binary The binary to upload 9 | # port The COM port connected the bootloader 10 | # 11 | # options: 12 | # -h, --help show this help message and exit 13 | # -f {off,soft,hard}, --flow_control {off,soft,hard} 14 | # -b BAUDRATE, --baudrate BAUDRATE 15 | 16 | from pathlib import Path 17 | import argparse 18 | import serial 19 | from lib.fw_upload_lib import program 20 | 21 | SERIAL_TIMEOUT = 15 22 | 23 | if __name__ == "__main__": 24 | 25 | parser = argparse.ArgumentParser(description=__doc__) 26 | parser.add_argument( 27 | "binary", 28 | type=Path, 29 | help="The binary to upload", 30 | ) 31 | parser.add_argument( 32 | "port", 33 | type=str, 34 | help="The COM port connected the bootloader", 35 | ) 36 | parser.add_argument( 37 | "-f", 38 | "--flow_control", 39 | choices=["off", "soft", "hard"], 40 | default="hard", 41 | ) 42 | parser.add_argument( 43 | "-b", 44 | "--baudrate", 45 | default=230400, 46 | ) 47 | 48 | args = parser.parse_args() 49 | program( 50 | args.binary, 51 | serial.Serial( 52 | args.port, 53 | args.baudrate, 54 | timeout=SERIAL_TIMEOUT, 55 | rtscts=(args.flow_control == "hard"), 56 | xonxoff=(args.flow_control == "soft"), 57 | ), 58 | ) 59 | -------------------------------------------------------------------------------- /BootloaderExample_Python/lib/fw_upload_lib.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """ 3 | Library for programming a binary file using the PalmSens bootloader for MethodSCRIPT devices. 4 | """ 5 | 6 | from pathlib import Path 7 | from io import RawIOBase 8 | 9 | 10 | def program(binary: Path, channel: RawIOBase): 11 | """Download a firmware binary to a PalmSens bootloader 12 | 13 | binary: The binary to upload 14 | 15 | channel: The binary communications channel to use 16 | """ 17 | 18 | 19 | def tx_and_rx(channel: RawIOBase, data: bytes): 20 | """Transmit data and check reply does not error 21 | 22 | `extra_lines` can be used if the device returns multiple lines in 23 | response to a single command (like `t`) 24 | """ 25 | channel.write(data) 26 | 27 | ret_data = channel.readline() 28 | if b"!" in ret_data: 29 | msg = f"Got device error {ret_data}, after sending {data.decode('utf8')}" 30 | raise RuntimeError(msg) 31 | 32 | 33 | def fletcher(inp: bytes) -> int: 34 | """Compute the fletcher CRC for a byte stream""" 35 | sum1 = 0 36 | sum2 = 0 37 | for byte in inp: 38 | sum1 = (sum1 + byte) % 255 39 | sum2 = (sum1 + sum2) % 255 40 | return (sum2 << 8) | sum1 41 | 42 | 43 | # End a previous download if there is one. Just in case. 44 | try: 45 | tx_and_rx(channel, b"endfw\n") 46 | except RuntimeError: 47 | pass 48 | 49 | print("Erasing") 50 | tx_and_rx(channel, b"startfw\n") 51 | 52 | with open(binary, "rb") as fw_file: 53 | index = 0 54 | while(chunk := fw_file.read(50)): 55 | index = index + 1 56 | payload = ( 57 | f"{len(chunk):02x}".encode("ascii") 58 | + chunk.hex().encode("ascii") 59 | + f"{fletcher(chunk):04x}".encode("ascii") 60 | ) 61 | tx_and_rx(channel, b"data" + payload + b"\n") 62 | print(f"Uploading {index}\r", end='', flush=True) 63 | 64 | print("\nFinishing upload") 65 | tx_and_rx(channel, b"endfw\n") 66 | 67 | print("Rebooting") 68 | tx_and_rx(channel, b"boot\n") 69 | -------------------------------------------------------------------------------- /BootloaderExample_Python/readme.txt: -------------------------------------------------------------------------------- 1 | This example can be used to upload firmware on any of the following PalmSens devices: 2 | - EmStat4 3 | - EmStat Pico 4 | - Nexus 5 | 6 | Only serial port connections (generally Serial USB Converters) are supported. 7 | To add another type of port, copy and modify the file "fw_upload_serial_port.py". 8 | 9 | The device must be already in bootloader mode before running the bootloader example. 10 | On most PalmSens devices, this can be done either by pulling the DWNLD pin low, or sending the "dlfw\n" command. 11 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample001-EmStat4M_with_MUX8_multiplexer.txt: -------------------------------------------------------------------------------- 1 | e 2 | ############# 3 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 4 | # 5 | # 6 | # Description: Runs a chronoamperometry measurement on each channel sequentially of a MUX8 multiplexer 7 | # The MUX8 inputs d0,d1 and d2 should be connected to d0,d1 and d2 digital outputs of the EmStat4M 8 | # 9 | # 10 | # MethodSCRIPT version: 1.3 11 | # Last modified: 17/05/2023 12 | # Applies to: EmStat4M with a MUX8 multiplexer 13 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 14 | # 15 | var c 16 | var p 17 | var i 18 | var t 19 | set_gpio_cfg 0b111 1 20 | store_var i 0i aa 21 | ############# Measurement initialisation ############# 22 | set_pgstat_chan 0 23 | set_pgstat_mode 3 24 | set_max_bandwidth 40 25 | set_range ba 2100n 26 | set_autoranging ba 2100n 2100u 27 | set_e 500m 28 | cell_on 29 | loop i < 8i 30 | set_gpio i 31 | timer_start 32 | meas_loop_ca p c 500m 100m 60100m 33 | timer_get t 34 | pck_start 35 | pck_add t 36 | pck_add c 37 | pck_end 38 | endloop 39 | add_var i 1i 40 | endloop 41 | on_finished: 42 | cell_off 43 | 44 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample002-SensitBT_running_and_storing_SWV.txt: -------------------------------------------------------------------------------- 1 | e 2 | ############# 3 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 4 | # 5 | # 6 | # Description: This example shows how to run an SWV on the Sensit BT 7 | # and save the results on internal storage 8 | # 9 | # MethodSCRIPT version: 1.3 10 | # Last modified: 22/05/2023 11 | # Applies to: Sensit BT (with EmStat Pico) 12 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 13 | # 14 | ############# 15 | # Sets GPIO pin configuration. Bitmask followed by 2 for enabling SPI flash memory 16 | set_gpio_cfg 0x1E 2 17 | # 1=Create new file. If a file with the same name exists, new data is appended to it 18 | file_open "/Measurements/14-04-2022/SWV-10-49-16-0.dmeas" 1 19 | # 3=Output to both normal channel and file storage 20 | set_script_output 3 21 | # for potential 22 | var p 23 | # for measured current 24 | var c 25 | # for measured forward current 26 | var f 27 | # for measured reverse current 28 | var g 29 | ############# Measurement initialisation ############# 30 | set_pgstat_chan 1 31 | set_pgstat_mode 0 32 | set_pgstat_chan 0 33 | set_pgstat_mode 2 34 | set_max_bandwidth 200 35 | set_range_minmax da -400m 400m 36 | set_range ba 59n 37 | set_autoranging ba 59n 59n 38 | set_e -300m 39 | cell_on 40 | # SWV Ebegin=-0.3V, Eend=0.3V, Estep=0.01V, Eamp=0.1V, 5 Hz 41 | meas_loop_swv p c f g -300m 300m 10m 100m 5 42 | pck_start 43 | pck_add p 44 | pck_add c 45 | pck_add f 46 | pck_add g 47 | pck_end 48 | endloop 49 | on_finished: 50 | file_close 51 | cell_off 52 | 53 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample003-SensitBT_temp_measurement_I2C.txt: -------------------------------------------------------------------------------- 1 | e 2 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 3 | # 4 | # Description: Run SWV + internal temperature measurement (using ADT7420 inside the EmStat Pico module) with I2C 5 | # 6 | # MethodSCRIPT version: 1.3 7 | # Last modified: 22/05/2023 8 | # Applies to: Sensit BT (with EmStat Pico) 9 | # 10 | ############# I2C Temperature measurement initialisation ############# 11 | # Declare variables for Temperature measurement 12 | # Most significant bits 13 | var m 14 | # Least significant bits 15 | var l 16 | # Acknowledge 17 | var a 18 | # Array with Write data 19 | array w 2 20 | # Array with Read data 21 | array r 2 22 | # Status register 23 | var s 24 | # Configure I2C GPIOs and set it to 100 kHz clock, 7-bit address 25 | set_gpio_cfg 0x0300i 2 26 | i2c_config 100k 7 27 | # Configure the sensor for 16-bit mode with continuous conversion 28 | store_var a 0i ja 29 | array_set w 0i 0x03i 30 | array_set w 1i 0x80i 31 | i2c_write 0x48i w 2 a 32 | ############# Declare measurement variables variables ############# 33 | var p 34 | var c 35 | var f 36 | var g 37 | ############# Measurement initialisation ############# 38 | set_pgstat_chan 0 39 | set_pgstat_mode 2 40 | set_max_bandwidth 200 41 | set_range_minmax da -400m 400m 42 | set_range ba 59n 43 | set_autoranging ba 59n 59n 44 | set_e -300m 45 | cell_on 46 | ############# Run measurement ############# 47 | # Perform SWV measurement from -300 mV to 300 mV at 5 Hz 48 | meas_loop_swv p c f g -300m 300m 10m 100m 5 49 | ############# Get I2C temperature ############# 50 | # Check if temperature sensor is ready 51 | store_var s 0x80i ja 52 | i2c_write_byte 0x48i 0x02i a 53 | i2c_read_byte 0x48i s a 54 | bit_and_var s 0x80i 55 | # Ignore if temperature sensor not ready. 56 | if s != 0x80i 57 | # Read temperature values 58 | i2c_write_byte 0x48i 0x00i a 59 | i2c_read 0x48i r 2 a 60 | array_get r 0i m 61 | array_get r 1i l 62 | # Convert to degrees Celcius 63 | bit_lsl_var m 8i 64 | add_var m l 65 | if m > 0x8000i 66 | sub_var m 0x10000i 67 | endif 68 | int_to_float m 69 | div_var m 128 70 | endif 71 | ############# Send measurement package ############# 72 | pck_start 73 | # Sweep potential 74 | pck_add p 75 | # Current 76 | pck_add c 77 | # Temperature 78 | pck_add m 79 | pck_end 80 | endloop 81 | on_finished: 82 | cell_off 83 | 84 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample004-SensitBT_wake_on_trigger_button.txt: -------------------------------------------------------------------------------- 1 | e 2 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 3 | # 4 | # Description: Hibernate in low power mode, wake up on WAKE pin event (button push) 5 | # 6 | # MethodSCRIPT version: 1.3 7 | # Last modified: 22/05/2023 8 | # Applies to: Sensit BT (with EmStat Pico) 9 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 10 | # 11 | ############# Hibernate and wait for button push ############# 12 | #Hibernate in low power mode, wake up on WAKE pin event (button push) 13 | #Could also have used get_gpio on with GPIO pin if saving power wasn't a concern 14 | #Bitmask for wake-up sources: 15 | #0x01 = Communication 16 | #0x02 = WAKE pin 17 | #0x04 = Timer 18 | #At least one wake-up source must be specified. 19 | #60=60 seconds used by the Timer if Timer flag was set, ignored now since we use only wake pin. 20 | hibernate 0x02i 60 21 | ############# Declare measurement variables variables ############# 22 | var p 23 | var c 24 | var f 25 | var g 26 | ############# Measurement initialisation ############# 27 | set_pgstat_chan 0 28 | set_pgstat_mode 2 29 | set_max_bandwidth 200 30 | set_range_minmax da -400m 400m 31 | set_range ba 59n 32 | set_autoranging ba 59n 59n 33 | set_e -300m 34 | cell_on 35 | ############# Run measurement ############# 36 | # Perform SWV measurement from -300 mV to 300 mV at 5 Hz 37 | meas_loop_swv p c f g -300m 300m 10m 100m 5 38 | pck_start 39 | # Sweep potential 40 | pck_add p 41 | # Current 42 | pck_add c 43 | pck_end 44 | endloop 45 | on_finished: 46 | cell_off 47 | 48 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample005-SensitBT_run_CV_on_trigger_button_and_store.txt: -------------------------------------------------------------------------------- 1 | e 2 | ############# 3 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 4 | # 5 | # 6 | # Description: This example shows how to run three CVs on the Sensit BT 7 | # every CV starts at the push of the trigger button 8 | # results are stored on the internal storage 9 | # 10 | # MethodSCRIPT version: 1.3 11 | # Last modified: 17/05/2023 12 | # Applies to: Sensit BT (with EmStat Pico) 13 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 14 | # 15 | ############# 16 | #The following line is only needed for EmStat Pico based devices. Bitmask followed by 2 for enabling SPI flash memory 17 | set_gpio_cfg 0x1E 2 18 | file_open "/Measurements/three_cvs.dmeas" 0 19 | #set_script_output options: 20 | #0 = Disable the output of the script completely. 21 | #1 = Output to the normal output channel (default). 22 | #2 = Output to file storage. 23 | #3 = Output to both normal channel and file storage. 24 | set_script_output 2 25 | var i 26 | var c 27 | var p 28 | var d 29 | ############# Measurement initialisation ############# 30 | set_pgstat_chan 0 31 | set_pgstat_mode 2 32 | set_max_bandwidth 400 33 | set_range_minmax da -1 1 34 | set_range ba 100u 35 | set_autoranging ba 1u 1m 36 | set_e -500m 37 | #make sure to start the loop at i=0 38 | store_var i 0i aa 39 | #start a loop with 3 iteratons 40 | loop i < 3i 41 | ############# wait for trigger button here ############# 42 | get_gpio d 43 | loop d & 0x80 44 | get_gpio d 45 | endloop 46 | # 47 | cell_on 48 | meas_loop_cv p c -500m -1 1 10m 1 49 | pck_start 50 | pck_add p 51 | pck_add c 52 | pck_end 53 | endloop 54 | cell_off 55 | add_var i 1i 56 | endloop 57 | on_finished: 58 | file_close 59 | cell_off 60 | 61 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample006-Peak_search_using_min_max.txt: -------------------------------------------------------------------------------- 1 | e 2 | ############# 3 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 4 | # 5 | # 6 | # Description: Simple peak detection after runnning an SWV on an EmStat4M 7 | # 8 | # MethodSCRIPT version: 1.3 9 | # Last modified: 17/05/2023 10 | # Applies to: all MethodSCRIPT-compatible instruments, example tailored for EmStat4M 11 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 12 | # 13 | ############# Declare measurement variables variables ############# 14 | var c 15 | var p 16 | var f 17 | var g 18 | ############# Init peak detect ############# 19 | # Declare variables 20 | var n 21 | var i 22 | var m 23 | var l 24 | array a 100i 25 | array b 100i 26 | store_var n 0i ja 27 | store_var m 0 ba 28 | store_var l 1M ba 29 | ############# Configure LED pins (EmStat4M) ############# 30 | set_gpio_cfg 0x7 1 31 | set_gpio 0x0 32 | ############# Measurement initialisation ############# 33 | set_pgstat_chan 0 34 | set_pgstat_mode 2 35 | set_max_bandwidth 200 36 | set_range_minmax da -400m 400m 37 | set_range ba 59n 38 | set_autoranging ba 59n 59n 39 | set_e -300m 40 | cell_on 41 | ############# Run measurement ############# 42 | # Perform SWV measurement from -300 mV to 300 mV at 5 Hz 43 | meas_loop_swv p c f g -300m 300m 10m 100m 5 44 | # Store measurement data in array 45 | array_set a n p 46 | array_set b n c 47 | add_var n 1i 48 | endloop 49 | ############# Simple peak search algorithm ############# 50 | # As an example, we just determine max and min value 51 | # Many applications will need a more sophisticated algorithm 52 | store_var i 0i ja 53 | loop i < n 54 | array_get b i c 55 | if c > m 56 | copy_var c m 57 | endif 58 | if c < l 59 | copy_var c l 60 | endif 61 | add_var i 1i 62 | endloop 63 | ############# Send measurement data ############# 64 | store_var i 0i ja 65 | loop i < n 66 | array_get a i p 67 | array_get b i c 68 | pck_start 69 | pck_add p 70 | pck_add c 71 | pck_add m 72 | pck_add l 73 | pck_end 74 | add_var i 1i 75 | endloop 76 | ############# Decision time ############# 77 | #subtract "min" value from "max" to get the relative peak height 78 | sub_var m l 79 | # Enable red LED if peak > nA, otherwise enable green LED (EmStat4M) 80 | if m > 2n 81 | set_gpio 0x1 82 | else 83 | set_gpio 0x2 84 | endif 85 | ############# Turn cell off, even if aborted ############# 86 | on_finished: 87 | cell_off 88 | 89 | -------------------------------------------------------------------------------- /Example_MethodSCRIPTs/MSExample007-EmStatPicoMux16.txt: -------------------------------------------------------------------------------- 1 | e 2 | ############# 3 | # MethodSCRIPT example for potentiostats by PalmSens BV - www.palmsens.com 4 | # 5 | # 6 | # Description: This example shows how to run an a repeated CA measurement 7 | # on 5 channels using an EmStat Pico MUX16. 8 | # 9 | # MethodSCRIPT version: 1.3 10 | # Last modified: 01/11/2023 11 | # Applies to: EmStat Pico MUX16 (with EmStat Pico) 12 | # Go to www.palmsens.com/msmanual for the MethodSCRIPT Manual 13 | # 14 | ############# 15 | # 16 | # initialize the GPIO pins for use with the MUX16 17 | set_gpio_cfg 0x3FFi 1 18 | set_gpio 0x00i 19 | # Declare some variables to work with 20 | # c: current 21 | # p: potential 22 | # i: inner loop-counter 23 | # j: outer loop-counter 24 | # m: GPIO pins bitMask 25 | var c 26 | var p 27 | var i 28 | var j 29 | var m 30 | # ======================= 31 | # Set up the potentiostat 32 | # ======================= 33 | set_pgstat_chan 1 34 | set_pgstat_mode 0 35 | set_pgstat_chan 0 36 | set_pgstat_mode 2 37 | set_max_bandwidth 1400 38 | set_cr 1m 39 | set_range_minmax da -1m 1 40 | set_range_minmax ba 100u 100u 41 | set_autoranging ba 10n 1m 42 | set_e -200m 43 | cell_on 44 | # Initialize loop-counter 45 | store_var j 0i ja 46 | # Outer loop, repeat the process 10 times 47 | loop j < 10i 48 | # Inner loop 49 | # (replace 0i with the first channel to use minus one) 50 | store_var i 0i ja 51 | # Loop channels over 1 to 5 (replace `5i` with the last channel to use) 52 | loop i < 5i 53 | # Set appropriate pins to select multiplexer channels. 54 | # First copy `i` since we want to keep it's value for counting. 55 | copy_var i m 56 | # Multiply with a "mask" to switch certain signals. 57 | # Possible values are: 58 | # 0x01 to switch only WE 59 | # 0x10 to switch only RE/CE 60 | # 0x11 to switch both WE and RE/CE 61 | mul_var m 0x11 62 | # Write the pins to the GPIO to switch the Pico MUX16's channel 63 | set_gpio m 64 | # ==================================== 65 | # Perform measurement on selected cell 66 | # ==================================== 67 | set_e -200m 68 | wait 500m 69 | meas_loop_ca p c 200m 20m 1 70 | pck_start 71 | pck_add p 72 | pck_add c 73 | pck_end 74 | endloop 75 | # ====================================== 76 | # End of measurement on selected channel 77 | # ====================================== 78 | # Increment inner loop-counter 79 | add_var i 1i 80 | endloop 81 | # Wait approximately 30 seconds (+/-3.2%) 82 | # before starting the next round. 83 | wait 30 84 | # Increment outer loop-counter 85 | add_var j 1i 86 | endloop 87 | on_finished: 88 | cell_off 89 | 90 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 PalmSens BV 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | - Redistributions of source code must retain the above copyright notice, 8 | this list of conditions and the following disclaimer. 9 | - Neither the name of PalmSens BV nor the names of its contributors 10 | may be used to endorse or promote products derived from this software 11 | without specific prior written permission. 12 | - This license does not release you from any requirement to obtain separate 13 | licenses from 3rd party patent holders to use this software. 14 | - Use of the software either in source or binary form must be connected to, 15 | run on or loaded to an PalmSens BV component. 16 | 17 | DISCLAIMER: THIS SOFTWARE IS PROVIDED BY PALMSENS "AS IS" AND ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 20 | EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, 23 | OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 26 | EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 15 | 16 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 14 | 15 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 9 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/GettingStarted_MethodSCRIPT_Example_Android.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PalmSens/MethodSCRIPT_Examples/57622e5b293c047e8102f9cb9db688ea81d4bf99/MethodSCRIPTExample_Android/GettingStarted_MethodSCRIPT_Example_Android.docx -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/GettingStarted_MethodSCRIPT_Example_Android.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PalmSens/MethodSCRIPT_Examples/57622e5b293c047e8102f9cb9db688ea81d4bf99/MethodSCRIPTExample_Android/GettingStarted_MethodSCRIPT_Example_Android.pdf -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | google() 6 | jcenter() 7 | 8 | } 9 | dependencies { 10 | classpath 'com.android.tools.build:gradle:3.3.1' 11 | 12 | // NOTE: Do not place your application dependencies here; they belong 13 | // in the individual module build.gradle files 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | jcenter() 21 | 22 | } 23 | } 24 | 25 | task clean(type: Delete) { 26 | delete rootProject.buildDir 27 | } 28 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | 15 | 16 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PalmSens/MethodSCRIPT_Examples/57622e5b293c047e8102f9cb9db688ea81d4bf99/MethodSCRIPTExample_Android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Mar 28 10:54:36 CET 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip 7 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 28 5 | defaultConfig { 6 | applicationId "com.palmsens.methodscriptexample" 7 | minSdkVersion 16 8 | targetSdkVersion 28 9 | versionCode 1 10 | versionName "1.0" 11 | 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | productFlavors { 22 | } 23 | } 24 | 25 | dependencies { 26 | implementation fileTree(include: ['*.jar'], dir: 'libs') 27 | implementation 'com.android.support:appcompat-v7:28.0.0' 28 | implementation 'com.android.support.constraint:constraint-layout:1.1.3' 29 | testImplementation 'junit:junit:4.12' 30 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 31 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 32 | implementation files('libs/d2xx.jar') 33 | } 34 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/libs/d2xx.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PalmSens/MethodSCRIPT_Examples/57622e5b293c047e8102f9cb9db688ea81d4bf99/MethodSCRIPTExample_Android/methodSCRIPTExample/libs/d2xx.jar -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/src/main/assets/LSV_on_10kOhm.txt: -------------------------------------------------------------------------------- 1 | e 2 | var c 3 | var p 4 | set_pgstat_mode 3 5 | set_max_bandwidth 200 6 | set_cr 500u 7 | set_e -500m 8 | cell_on 9 | wait 1 10 | meas_loop_lsv p c -500m 500m 50m 100m 11 | pck_start 12 | pck_add p 13 | pck_add c 14 | pck_end 15 | endloop 16 | on_finished: 17 | cell_off 18 | 19 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/src/main/assets/SWV_on_10kOhm.txt: -------------------------------------------------------------------------------- 1 | e 2 | var p 3 | var c 4 | var f 5 | var r 6 | set_pgstat_mode 3 7 | set_max_bandwidth 100000 8 | set_cr 500n 9 | set_e -500m 10 | cell_on 11 | wait 1 12 | meas_loop_swv p c f r -500m 500m 5m 25m 10 13 | pck_start 14 | pck_add p 15 | pck_add c 16 | pck_end 17 | endloop 18 | on_finished: 19 | cell_off 20 | 21 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 12 | 13 | 19 | 22 | 25 | 26 | 27 | 28 | 34 | 35 | -------------------------------------------------------------------------------- /MethodSCRIPTExample_Android/methodSCRIPTExample/src/main/res/layout/activity_method_script_example.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 |