Hi,
I'm trying to write a test application for the Analog Discovery 3 which utilises the DIO channels. From my understanding, the static.py file contains the library functions for this, and also the test_static-supplies.py file exists for testing purposes. When I run the test_static-supplies.py test file, it returns the following once reaching here:
# set the state of every DIO channel
static.set_state(device_data, index, not(mask & pow(2, index)))
and the error:
Exception has occurred: TypeError
unsupported operand type(s) for &=: 'c_ushort' and 'int'
File "C:\Program Files (x86)\Digilent\WaveFormsSDK\inc\WF_SDK\samples\test_static-supplies.py", line 36, in <module>
static.set_state(device_data, index, not(mask & pow(2, index)))
TypeError: unsupported operand type(s) for &=: 'c_ushort' and 'int'
From the library side, it seems to be complaining due to this in the set_state function:
# set bit in mask
if value == True:
mask |= __rotate_left__(1, channel, data.count)
else:
bits = pow(2, data.count) - 2
mask &= __rotate_left__(bits, channel, data.count)
I've tried casting mask to a uint16_t, an int, and an short but still receive the same result (or variations of it complaining about unsupported operand types).
Am I doing something wrong here?