I have checked the source code of AD9912, there is no method to set amp, only a set_att method to set attenuator. But it seems all four channel of a 4412 DDS card will have same atte, is that possible to set the output voltage of those channels individually?
Can 4412DDS / AD9912 set atte individually for every channel?
AD9912.set_att()
should eventually call CPLD.set_att_mu()
.
a = self.att_reg & ~(0xff << (channel * 8)) # erase the corresponding channel attenuation record on the kernel
a |= att << (channel * 8) # update the corresponding channel only
self.set_all_att_mu(a) # set attenuation of all channels according to the updated record
This should already allow different attenuation on different channels.