Commit 8f664e40 authored by Jan Pospisil's avatar Jan Pospisil

fixed AD9512 SPI communication

parent 35954103
......@@ -4,12 +4,12 @@ class AD9512(Spi):
Ad9512Config = {
"Channel": 0,
"CPol": 1,
"CPha": 1,
"CPol": 0,
"CPha": 0,
"LSB1st": 0,
"Length": 24,
"HalfPeriod": 5, # 10 MHz
"WaitTime": 5
"HalfPeriod": 10, # HalfPeriod=5 ~ 10 MHz
"WaitTime": 10
}
def __init__(self, wbOverlay, SpiBaseAddress, SpiOffset = 0):
......@@ -17,7 +17,7 @@ class AD9512(Spi):
def Write(self, Address, Data, SelfCommit = False):
RnW = 0
Length = 1 # only 1 byte transaction supported
Length = 0 # only 1 byte transaction supported
Address &= 2**13-1
Data &= 2**8-1
DataLow = (RnW<<23) + (Length<<21) + (Address<<8) + Data
......@@ -28,7 +28,7 @@ class AD9512(Spi):
def Read(self, Address):
RnW = 1
Length = 1 # only 1 byte transaction supported
Length = 0 # only 1 byte transaction supported
Address &= 2**13-1
DataLow = (RnW<<23) + (Length<<21) + (Address<<8)
self._debug("AD9512 SPI Read: 0x%06x" % DataLow)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment