Until now I used Arduinos with shields and ICs and mostly I used libraries to communicate with i.e. ADC, DAC, Real Time Clock, etc.
Now I want to do the same kind of programming with the same ICs with the ESP32 and ESP-IDF framework. But often there are no libraries so I have to do this from scratch. This is obviously different from Arduino programming and I have to learn how to use APIs for i.e. SPI, I2C and other protocols.
The problem which I see is how to do this right. Let's say I want to communicate with an ADC IC with SPI. This needs a couple of lines of code to configure the ADC and then to request data and read this data. And if one line is not 100% correct then it "wont work". I will likely only see that it does not work but I won't know why it does not work and what I did wrong.
Now my idea is to use a logic analyzer and record the electrical signals between and Arduino and an ADC IC. I know this works so then I have a sample how the signals should look like.
And then, when I start to program something similar with the ESP32 and ESP-IDF, I can also record the electrical signals and compare them with the signals from the Arduino. I guess with this method I should be able to see which programming lines do what I expect and which are wrong.
Is this a good way to do this? Or are there better and maybe easier ways to write and analyze low level code like this?
Is a logic analyzer a good tool to write and debug low level code?