From 9de3678e0c04cb3d29664ff45f1fa8f986123969 Mon Sep 17 00:00:00 2001 From: Jonathan Hogg Date: Thu, 20 Oct 2016 16:17:43 +0100 Subject: [PATCH] Add license; other changes --- LICENSE | 10 ++++++++++ README.md | 3 +++ scope.py | 8 ++++---- 3 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 LICENSE create mode 100644 README.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..43bbea3 --- /dev/null +++ b/LICENSE @@ -0,0 +1,10 @@ +Copyright (c) 2016, Jonathan Hogg +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..0aede92 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ + +More here soon! + diff --git a/scope.py b/scope.py index 5c56991..4e18767 100644 --- a/scope.py +++ b/scope.py @@ -66,7 +66,7 @@ class Scope(vm.VirtualMachine): else: nsamples_multiplier = 1 ticks = int(period / nsamples / nsamples_multiplier / self.capture_clock_period) - if ticks >= 40 and ticks < 65536: + if ticks >= 20 and ticks < 65536: sample_width = 2 buffer_width = 6*1024 dump_mode = vm.DumpMode.Native @@ -123,7 +123,7 @@ class Scope(vm.VirtualMachine): trigger_channel = channels[0] else: assert trigger_channel in channels - spock_option = vm.SpockOption.TriggerTypeHardwareComparator + spock_option = vm.SpockOption.TriggerTypeSampledAnalog #HardwareComparator if trigger_channel == 'A': kitchen_sink_a = vm.KitchenSinkA.ChannelAComparatorEnable spock_option |= vm.SpockOption.TriggerSourceA @@ -148,7 +148,7 @@ class Scope(vm.VirtualMachine): await self.set_registers(TraceMode=trace_mode, BufferMode=buffer_mode, SampleAddress=0, ClockTicks=ticks, ClockScale=1, TraceIntro=total_samples//2, TraceOutro=total_samples//2, TraceDelay=0, Timeout=int(round((period*5 if timeout is None else timeout) / self.trigger_timeout_tick)), - TriggerMask=0x7f, TriggerLogic=0x80, TriggerLevel=trigger_level, SpockOption=spock_option, + TriggerMask=0x7f, TriggerLogic=0x80, TriggerValue=trigger_level, SpockOption=spock_option, TriggerIntro=trigger_intro, TriggerOutro=2 if hair_trigger else 4, Prelude=0, ConverterLo=low if raw else self._analog_map_func(self.analog_low_ks, low, high), ConverterHi=high if raw else self._analog_map_func(self.analog_high_ks, low, high), @@ -291,7 +291,7 @@ async def main(): s = await Scope.connect() x = np.linspace(0, 2*np.pi, s.awg_wavetable_size, endpoint=False) y = np.round((np.sin(x)**5)*127 + 128, 0).astype('uint8') - await s.start_generator(1000, wavetable=y) + await s.start_generator(1000, waveform='sawtooth') #wavetable=y) #if await s.calibrate(): # await s.save_params()