fossasia / pslab-python

Python Library for PSLab Desktop: https://pslab.io
GNU General Public License v3.0
1.63k stars 225 forks source link

Implement missing SQR1 and SQR2 functions #197

Open CloudyPadmal opened 3 years ago

CloudyPadmal commented 3 years ago

In the previous psl package, there were functions to control SQR1 and SQR2 pins individually. However, they are missing in the latest version and one has to use SQR4 function driving all 4 SQR pins.

With the latest firmware upgrades, it is made possible to generate sine and square waves simultaneously and we need to implement whatever the missing functions referring to the old python package.

Refer to following as a guide:

bessman commented 3 years ago

We will need to add a way to check the firmware version as well, because I think WAVEGEN->SET_SQR2 is broken in the current version.

CloudyPadmal commented 3 years ago

That's true.. in the old SQR2 function in firmware, the right timer is never turned on making it broken. I wonder if there's a way to trigger it indirectly. 🤔

Now that I'm thinking, it would be nice if we had a getter setter function to access any arbitrary register in firmware.