Pinedio support#73
Conversation
[Pinedio](https://pine64.org/documentation/Pinedio/_full/) uses the CH341F pin 7 for DIO1 (receive interrupt) and can, with modification, make use of pin 6 and 5 (DIO2 + DIO3). Those pins fall in the second GPIO control bit which was not supported in the CH341 GPIO manager. This commit also introduces the pinedio radio type which is basically just a variation of ch341 with a different pinout. For this change I took the time to refactor the available radio types from the examples into a common, imported list to minimize the chance of forgetting radio types that are added in the future.
rightup
left a comment
There was a problem hiding this comment.
Looks like a really nice job, I like the consolidation of the radio types.
I will test on the handful of ch341 I have and merge!
Top work!
Thanks
|
Thanks for working on this. I like the direction, but I’m not fully convinced this is safe to merge yet. The new PinEDIO support relies on CH341 GPIO pins 10 and 11, but from the implementation it still looks like GPIO direction/output handling is only writing the lower 8 bits. If that’s the case, the new upper-pin support may not be fully working end-to-end yet. The existing tests pass, which is good, but there doesn’t seem to be any focused coverage for this new CH341 upper-pin behavior. Has this been tested on the actual device? I’d be more comfortable merging once that assumption is confirmed, either with real hardware validation or a targeted test. |
As far as I understand, in synchronous serial mode only the first 5 GPIO lanes can be configured as either input or output while the rest are input-only which is why we only need to write one direction byte. I might be wrong, of course, documentation about this is rather sparse, sadly. Also note that GPIO 10 and 11 are used as inputs which is the default setting as far as I understand.
I couldn't find any existing tests for CH341 and without a mock device I'm not sure whether there is a lot that we can do for useful tests but if you have some ideas I can certainly implement some. I have verified on my pinedio that |
Pinedio uses the CH341F pin 7 for DIO1 (receive interrupt) and can, with modification, make use of pin 6 and 5 (DIO2 + DIO3). Those pins fall in the second GPIO control bit which was not supported in the CH341 GPIO manager.
This commit also introduces the pinedio radio type which is basically just a variation of ch341 with a different pinout. For this change I took the time to refactor the available radio types from the examples into a common, imported list to minimize the chance of forgetting radio types that are added in the future.