This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import ftd2xx as ftd | |
print(ftd.listDevices()) | |
d = ftd.open(1) | |
print(d.getDeviceInfo()) | |
d.resetDevice() | |
d.setBitMode(0xff, 0x40) | |
d.setUSBParameters(64*1024, 64*1024) | |
d.setFlowControl(ftd.defines.FLOW_RTS_CTS) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* IceZProg -- Programmer and Debug Tool for the IcoZero Board | |
* | |
* Copyright (C) 2017 Clifford Wolf <clifford@clifford.at> | |
* | |
* Permission to use, copy, modify, and/or distribute this software for any | |
* purpose with or without fee is hereby granted, provided that the above | |
* copyright notice and this permission notice appear in all copies. | |
* | |
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wave | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import array | |
wav_obj = wave.open('spike11K.wav', 'rb') | |
sample_freq = wav_obj.getframerate() | |
print(sample_freq) | |
n_samples = wav_obj.getnframes() | |
print(n_samples) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SB_PLL40_PAD #( | |
.FEEDBACK_PATH("SIMPLE"), | |
.PLLOUT_SELECT("GENCLK"), | |
.DIVR(4'b0000), | |
.DIVF(7'b1010100), | |
.DIVQ(3'b101), | |
.FILTER_RANGE(3'b001), | |
) SB_PLL40_CORE_inst ( | |
.RESETB(1'b1), | |
.BYPASS(1'b0), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Rom ( | |
input clk, | |
input [6:0] addr, | |
output reg [7:0] data); | |
reg [7:0] Rom [127:0]; | |
initial $readmemh("Rom.data", Rom); | |
always @(posedge clk) | |
data <= Rom[addr]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, I2C | |
import binascii | |
def i2c_read(i2c,reg): | |
rx_buf = bytearray(1) | |
reg_add = bytearray(1) | |
reg_add[0] = reg | |
i2c.writeto(0x55, reg_add) | |
rx_buf = i2c.readfrom(0x55, 1) | |
return binascii.hexlify(rx_buf) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SB_IO #( | |
.PIN_TYPE(6'b1010_01), | |
.PULLUP(1'b0) | |
) triState ( | |
.PACKAGE_PIN(pin), | |
.OUTPUT_ENABLE(oe), | |
.D_OUT_0(dout), | |
.D_IN_0(din) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/////////////////////////////////////////////////////////////////////////////////////////////////// | |
// | |
// File: random_pulse_generator.v | |
// File history: | |
// Version 1: 2015-03-24: Created | |
// | |
// Description: | |
// | |
// Poisson process generator. | |
// Generate Poisson process with desired inversed rate (number of clocks per hit). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Analog Device DAC Driver | |
module ad_dac( | |
clk, | |
rst, | |
send, | |
valid, | |
tx_value, | |
channel, | |
command, | |
rx_value, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module st_rom( | |
clk, | |
rst, | |
run, | |
st_out | |
); | |
input wire clk; | |
input wire rst; | |
input wire run; |