Blame view

redpitaya/server/liboscimp_fpga.py 1.06 KB
9d344927e   bmarechal   first commit
1
2
3
4
5
  import ctypes
  lib = ctypes.CDLL('/usr/lib/liboscimp_fpga.so')
  
  def add_const_set_offset(device, offset):
      lib.add_const_set_offset(device, offset)
8b90e736c   bmarechal   add pinc/poff args
6
7
  def nco_counter_send_conf(device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw):
      lib.nco_counter_send_conf(device, freq_ref, freq_dds, acc_size, offset, pinc_sw, poff_sw)
145da201a   bmarechal   -
8

8b90e736c   bmarechal   add pinc/poff args
9
10
11
12
  def fir16bits_send_conf(device, fileCoeff, coeffSize):
      lib.fir16bits_send_conf(device, fileCoeff, coeffSize)
  
  '''~
145da201a   bmarechal   -
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  def fpga_send(fpga_dev, registre, value):
      lib.fpga_send(fpga_dev, registre, value)
  
  def fpga_read(fpga_dev, registre):
      lib.fpga_read(fpga_dev, registre)
  
  def fpga_read32(fpga_dev, registre):
      lib.fpga_read32(fpga_dev, registre)
  
  def fpga_close(fpga_device):
      lib.fpga_close(fpga_dev)
  
  def fpga_open(fpga_dev, fpga_address, fpga_offset):
      lib.fpga_open(fpga_dev, fpga_address, fpga_offset)
  
  class fpga_dev(ctypes.Structure):
      _fields_ = [('fd', ctypes.c_int),
                  ('ptr_fpga', ctypes.c_void_p),
                  ('fpga_address', ctypes.c_uint),
                  ('fpga_offset', ctypes.c_uint)]
8b90e736c   bmarechal   add pinc/poff args
33
  '''