This commit is contained in:
2025-05-20 20:33:12 -05:00
parent 8a1a6ea770
commit fcb291590b
104 changed files with 63299 additions and 45045 deletions

View File

@@ -1,5 +1,5 @@
import ctypes
from ctypes import Structure, c_uint64, c_uint32, c_uint16, c_uint8, c_float
from ctypes import Structure, c_uint64, c_int64, c_uint32, c_uint16, c_uint8, c_float
AXI_WRITE_REG = 1
AXI_READ_REG = 2
@@ -10,6 +10,9 @@ AXI_WRITE_REG_BURST = 6
RF_SPI_WRITE = 7
SET_AD9081_DAC_NCO = 128
SET_AD9081_ADC_NCO = 129
SET_LANE_MAP = 130
AD9081_REG_WRITE = 131
AD9081_REG_READ = 132
ACK_FLAG_VALID_PACKET = 0x01
ACK_FLAG_VALID_EXECUTION = 0x02
@@ -74,8 +77,8 @@ class WriteRegType(Structure):
("data", c_uint32)
]
def __init__(self):
init_header(self, AXI_WRITE_REG)
def __init__(self, msg_id=AXI_WRITE_REG):
init_header(self, msg_id)
self.address = 0
self.data = 0
@@ -114,8 +117,8 @@ class ReadRequestType(Structure):
("address", c_uint32)
]
def __init__(self):
init_header(self, AXI_READ_REG)
def __init__(self, msg_id=AXI_READ_REG):
init_header(self, msg_id)
self.address = 0
@@ -136,7 +139,7 @@ class DacNcoConfigType(Structure):
_fields_ = [
("header", Header),
("channel", c_uint32),
("frequency", c_float)
("frequency", c_int64)
]
def __init__(self):
@@ -149,7 +152,7 @@ class AdcNcoConfigType(Structure):
_fields_ = [
("header", Header),
("channel", c_uint32),
("frequency", c_float)
("frequency", c_int64)
]
def __init__(self):
@@ -170,4 +173,14 @@ class RfSpiWriteType(Structure):
init_header(self, RF_SPI_WRITE)
self.dev_sel = 0
self.num_bits = 0
self.data = 0
self.data = 0
class LaneMapType(Structure):
_pack_ = 1
_fields_ = [
("header", Header),
("lane_map", c_uint8 * 8)
]
def __init__(self):
init_header(self, SET_LANE_MAP)