ScriptBasic wrote: ↑
Wed May 29, 2019 8:51 pm
This GPIO interface has more variations than BASIC if that is possible.
That's pretty much unavoidable. There may be a few protocols defined as standard for transferring data but, beyond that, it's like the wild west, everyone implementing their own register layouts with different schemes for configuring the chip and retrieving data.
Many chip designers design purely for microcontroller interfacing with no regard that systems running OS's and userland programs doing bit-banging might not have the determinism required to use their chips, or is a massive undertaking to achieve.
Many don't seem to consider whether what they implement will be easy to use or not, or whether there's a better, more useful, way to do things. Take the Pi's Bluetooth/WiFi chip; that's two chips mashed into one and, because of that, it requires a UART and an SDIO interface. It would have been so much more convenient if they'd found a way to tunnel the UART data over the SDIO bus meaning only one interface would be required.
And take the Pi SoC itself; why did Broadcom choose one full UART and one mini-UART rather than two full UART's, have its clock tied to a variable system frequency ?
I guess in most cases there will have been a rational reason. Even if just the usual 'do the minimum of what's needed' rather than 'cater for everything anyone might need', which takes longer, carries more cost, requires more effort, which is considered 'wasted' or 'pointless' when there's no necessity foreseen.