I am interested in writing a few scripts in python which need to be able to access the AIC inputs for control, particularly the AICin 5 It channel. I understand the general code structure for writing to or reading from memory, and this is not the problem. I am confused as to which address the information is at. I have gathered for the output channels, the addresses are magic + 8 through magic + 8 + 7 corresponding in kind to AIC out 0- AIC out 7 where the magic array is read from index 0x4000. I have verified that i can write to the Ub channel with an external scope, but I can't seem to read from the input channels. I have tried to look at FB_spm_dataexchange.h. as Weyers suggested, but my script just returns a string of constants at those addresses with varying input. Does anyone know what the problem might be or could anyone offer some general help in the matter?
Some more information: the following script functions properly verified on an external scope.
version = "2.1.0"
import gobject, gtk
import os # use os because python IO is bugy
sr = open ("/dev/sranger0","r")
os.lseek (sr.fileno(), 0x4000, 0)
magic_fmt = ">HHHHHHHHHHHHHHHHHHHHHH"
magic = struct.unpack (magic_fmt, sr.read (struct.calcsize (magic_fmt)))
i = 0.0
output = 0
sr = open ("/dev/sranger0", "wb")
while (i < 100000) :
output = int (math.sin(i/100)*10000)
os.lseek (sr.fileno(), magic+8+6, 1)
os.write (sr.fileno(), struct.pack (">h", output))
i = i + 1
print (int (i), output)
However, I am only able to write to the address magic+8+6, the Ub channel. I am unable to write to the other outputs, and similarly the addresses from magic 0-8 are constant with varying inputs. Does anyone know why this would be the case?