Skip to content

Instantly share code, notes, and snippets.

@mfe5003
mfe5003 / urukul.py
Created August 25, 2018 15:42
additions to CPLD code for ad9910 profile support
# CFG configuration register bit masks
CFG_PROF_MASK = 7 << CFG_PROFILE
@kernel
def change_profile(self, profile):
"""Change the DDS profile for all channels in the configuration register.
:param profile: profile number between 0 and 7
@mfe5003
mfe5003 / ad9910.py
Last active August 25, 2018 15:37
Changes to ad9910.py API for RAM mode
from numpy import int32, int64
from artiq.language.core import kernel, delay, portable
from artiq.language.units import us, ns, ms
from artiq.coredevice import spi2 as spi
from artiq.coredevice import urukul
urukul_sta_pll_lock = urukul.urukul_sta_pll_lock
@mfe5003
mfe5003 / prod_test_avro_no-schema.py
Created September 16, 2017 16:36
example producer with no schema
from confluent_kafka import avro
from confluent_kafka.avro import AvroProducer
# load schema to the registry from one producer
value_schema = avro.load('test_schema.avsc')
# This producer creates the schema and registers it
p1 = AvroProducer({
'bootstrap.servers': 'localhost:9092',
'schema.registry.url': 'http://localhost:8081'