1
0
mirror of https://github.com/jonathanhogg/scopething synced 2025-07-13 10:52:08 +01:00

Add license; other changes

This commit is contained in:
Jonathan Hogg
2016-10-20 16:17:43 +01:00
parent fee5e5c455
commit 9de3678e0c
3 changed files with 17 additions and 4 deletions

10
LICENSE Normal file
View File

@ -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.

3
README.md Normal file
View File

@ -0,0 +1,3 @@
More here soon!

View File

@ -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()