On lower level function paths with multiple writes, manage the writing of the -csPin yourself because you know what is going on. For higher levels, you handle it in the top level function.
If you need to write multiple things, you set -csPin as first thing, then you do the multiple writes without passing the csPin as last argument, and for the last write you pass the csPin. Yes, the idea is that the -csPin stays low until you are done. For a single (occasional) write you pass csPin with every write as last argument.
For most situations - especially with Graphics buffer - @Gordon has already taken care of by providing options in the setup. If you though think about partial update out of a graphics buffer, the pulling out and prepping the array for the display, it is for sure helpful (I used it here: Efficiently moving things around in zig-zag Graphics buffer visualized w/ 24/32 bpp displays / neopixel strings).
© Espruino, powered by microcosm.
Report a problem