Replies: 1 comment 3 replies
-
In theory, this is a good addition; however, as usual, the devil is in the detail. You can use the The first option is definitely a no-go, since it would effectively allow to edit any register, as you correctly identified. The second one is much better, but like you said, making it a PhysicalLayer abstraction would be the best. However, there are two questions that need to be examined before implementation:
|
Beta Was this translation helpful? Give feedback.
-
Hello,
Many chips include DIO pins that can output various internal states for use by the host MCU. For instance, the CC1101 can output a logic 1 when it sees the carrier (CarrierSense), the RFM69 does the same when it has seen a strong enough signal (RSSI) and so on.
I could not find a user-friendly way in RadioLib to set those pins functions and I'm using the low level
SPIsetRegValue
methods after having activated god mode.But because it's not "safe" to use this mode, I'd like to create a pull request to add this functionality.
However, I would like to discuss the possible options with you.
At first, I thought of adding a method like this:
But this would have allowed users to "abuse" this method to set pretty much any register value.
And this does not translate well to RFM69 where multiple pins are in the same register, forcing users of RadioLib to learn about the mapping details.
So I think it would be better to have methods like this one:
This could then be replicated for other boards, but I'm wondering if
setDIOMapping
should be declared as a virtual abstract method in thePhysicalLayer
base class.What do you think of this? Do you have other suggestions?
Beta Was this translation helpful? Give feedback.
All reactions