Skip to content

Fix Frequency and power output control

Compare
Choose a tag to compare
@jerryneedell jerryneedell released this 09 May 14:17
10f68ef

Most of the changes were to make this driver compatible with the Arduino driver.
The main changes are to the way the frequency was set - the actual "setter" was never being called and the default frequency (434mHz) remained the actual setting. In addition there was an error in calculation of the frequency setting due to the use of "//" vs "/".

The default baudrate of 10Mhz was causing some "hangs" during reads from the FIFO, even with a featherwing. Lowering it to 5MHz seems to have made this much more reliable

Several minor changes were made bring the code to closer agreement with the Arduino dirver.

Added an arbitrary 2 second timeout to the send function. It may be changed via a keyword argument. but It now avoids a possible infinite loop.

Before these changes, two devices running CP could communicate, but they could not communicate to a device using Arduino. This was due to the frequency mis-configuration. The two CP devices were consistent with eachother, but not with the Arduino Driver.

Note: the timeout keywords for the send and receive functions have been changed from "timeout_s" to just "timeout". If you are setting these, they will have to be updated.