You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when I tried to use spi I got a traceback error when reading back values, see below.
I use WaveForms beta 3.23.40 (latest beta) on Windows 11.
WaveForms has such a lot of functionality that I believe a testbench which tests all functions is mandatory.
I assume you convert from c to python with a translation script I did not try to debug further.
For sure many more read functions are affected.
Root cause of the conversion error is that the parameter list are not modified in a way that out channels are return values.
Please set up a regression test and clearly point out what is functioning correctly and what not.
Thanks for your effort!
==============================
Traceback (most recent call last):
File "C:\Users\grw2rt\Desktop_local_Coole_Eva_Kits\cj135_digilent_discovery\protocol_spi.py", line 51, in
rx = spi.read(words_to_receive=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\grw2rt\AppData\Local\Programs\Python\Python311\Lib\site-packages\dwfpy\protocols.py", line 417, in read
api.dwf_digital_spi_read(self._device.handle, dq_mode, bits_per_word, rx_buffer8, len(rx_buffer8))
TypeError: call takes exactly 4 arguments (5 given)
Hi Marius,
principally I like the feel of dwfpy.
But when I tried to use spi I got a traceback error when reading back values, see below.
I use WaveForms beta 3.23.40 (latest beta) on Windows 11.
WaveForms has such a lot of functionality that I believe a testbench which tests all functions is mandatory.
I assume you convert from c to python with a translation script I did not try to debug further.
For sure many more read functions are affected.
Root cause of the conversion error is that the parameter list are not modified in a way that out channels are return values.
Please set up a regression test and clearly point out what is functioning correctly and what not.
Thanks for your effort!
==============================
Traceback (most recent call last):
File "C:\Users\grw2rt\Desktop_local_Coole_Eva_Kits\cj135_digilent_discovery\protocol_spi.py", line 51, in
rx = spi.read(words_to_receive=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\grw2rt\AppData\Local\Programs\Python\Python311\Lib\site-packages\dwfpy\protocols.py", line 417, in read
api.dwf_digital_spi_read(self._device.handle, dq_mode, bits_per_word, rx_buffer8, len(rx_buffer8))
TypeError: call takes exactly 4 arguments (5 given)
declaration in bindings.py
dwf_digital_spi_write_read = _dwf_function('FDwfDigitalSpiWriteRead', (_IN, HDWF, 'hdwf'),
(_IN, c_int, 'cDQ'),
(_IN, c_int, 'cBitPerWord'),
(_IN, POINTER(c_ubyte), 'rgTX'),
(_IN, c_int, 'cTX'),
(_OUT, POINTER(c_ubyte), 'rgRX'),
(_IN, c_int, 'cRX'))
incorrect use in protocols.py
"""
api.dwf_digital_spi_read(self._device.handle, dq_mode, bits_per_word, rx_buffer8, len(rx_buffer8))
"""
Possibly correct use, need to be corrected
rx_buffer8=api.dwf_digital_spi_read(self._device.handle, dq_mode, bits_per_word, len(rx_buffer8))
=========================
Traceback (most recent call last):
File "C:\Users\grw2rt\Desktop_local_Coole_Eva_Kits\cj135_digilent_discovery\protocol_spi.py", line 33, in
rx = spi.write_read(buffer=tx, words_to_receive=10)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\grw2rt\AppData\Local\Programs\Python\Python311\Lib\site-packages\dwfpy\protocols.py", line 463, in write_read
api.dwf_digital_spi_write_read(
TypeError: call takes exactly 6 arguments (7 given)
declaration in bindings.py
dwf_digital_spi_write_read = _dwf_function('FDwfDigitalSpiWriteRead', (_IN, HDWF, 'hdwf'),
(_IN, c_int, 'cDQ'),
(_IN, c_int, 'cBitPerWord'),
(_IN, POINTER(c_ubyte), 'rgTX'),
(_IN, c_int, 'cTX'),
(_OUT, POINTER(c_ubyte), 'rgRX'),
(_IN, c_int, 'cRX'))
incorrect use in protocols.py
"""
api.dwf_digital_spi_write_read(
self._device.handle,
dq_mode,
bits_per_word,
tx_buffer8,
len(tx_buffer8),
rx_buffer8,
len(rx_buffer8),
)
"""
Possibly correct use, need to be corrected
rx_buffer8=api.dwf_digital_spi_write_read(
self._device.handle,
dq_mode,
bits_per_word,
tx_buffer8,
len(tx_buffer8),
len(rx_buffer8),
)
The text was updated successfully, but these errors were encountered: