This SoC has a 4k register that I have been previously succesfully wrapping with the following code. Now I am porting to latest Zig, and struggling to find a replacement since @memset() lost it’s size parameter. Any tips please?
you could also store a pointer to an array, instead of a multi item pointer, then you wouldn’t need to slice it (which actually makes a pointer to an array when the slicing is comptime know)
Spent a while trying to muck about with pointer casting to a sized array instead of doing the slice, until I realized you could just store a pointer to the array instead.
Thanks, I went wrong trying to add size info to the [*]volatile. That’s what happens after 2 years away from Zig, and soo much changed in that short time!
Just out of curiosity, what are you working on? Embedded SoC + display sounds like something that could be vaguely similar to what I’m doing professionally.
Currently hacking the PinePhone. I was previously following some nuttx tutorials but I decided to replicate the reverse engineering journey in Zig rather than C. I have most of the SoC represented in Zig since 2 years ago, just need to remove all the \t from my comments and complete the port from 0.8.1 to 0.14.
Although last time I got a bit stuck with the framebuffer declaration working from C but not Zig. But today some DSI stuff.
Thanks. Code seems to be working, at least the screen lights up! So next is the framebuffer stuff. It’ll be nice to get away from using the device LED for debugging
Your work sounds fun. My first electronics training was on a steel machine control system.