Open sapperlott opened 4 years ago
Those registers are read-only, not read-write.
The documentation for the RGB block is at https://rm.fomu.im/rgb.html which has a link to the Lattice documentation for the hardware block you're controlling. Appendix D (starting on page 38) documents the actual register set, which has this summary:
Note the "Access" column that indicates write-only access -- there's no way to read values back.
Since almost all the examples rely on the LED driver, I think it would be interesting to add @xobs' clarification to the docs.
Ah thanks - that clarifies things. But since all the RGB LED registers seem to be write only, wouldn't it make sense to then remove rgb.read_raw() from the Fomu MicroPython library? That would help prevent future users getting confused about this.
It's only the hard IP that's write-only. Other registers, namely those that wrap the IP and provide control, are read-write. For example, https://rm.fomu.im/rgb.html#rgb-ctrl is readable.
When I try to read the LEDDPWR registers from MicroPython, I don't get the expected values:
On closer inspection this doesn't necessarily seem to be a MicroPython issue since I also can't get this to work when using wishbone-tool (trying to read back the values written via MicroPython before):