- Wed Apr 17, 2019 11:16 am
#81855
davydnorris wrote:I'm using a slightly modified driverlib file - but all I use it for is diagnostic logging so it's good enough for now.
Ok fair enough. I'm using the UART for "production" (data bridging to network and driving led pixels) so it must work efficiently.
I'm in the process of rewriting all the drivers so that they more closely follow the linux kernel driver model, which means I can drop in IIO driver code for sensor chips more easily. It also means I can also use I2C mux chips as if they were just another I2C bus.
I already have support for I2C mux chips
And indeed it's following a framework that allows easy expansion with new devices and even autoprobing (which is often a pita on I2C).
I2S has been completely rewritten so that the various values in the control registers are a lot more transparent, and it can run both single value and buffered input and output.
You mean in your code? If I'm ever going to use I2S, I'll definitely have a look. The demo code from Espressif is hideous.
The I2C function they use in the existing I2S code is simply to start the 160Mhz PLL clock for the bus.
I know... The crux is that it's called "i2c" but it has nothing to do with "i2c", it's "i2s" and therefore it's misnomer. There is no hardware I2C support in the ESP8266...
That often makes me wonder why they ended up with a SoC with such a weird combination of function modules. It almost looks like they did a mis-spelling twice: ordered I2C (which would be logical for a general purpose SoC) but got I2S, and ordered PWM (which also would be useful for a general purpose SoC) but got PDM instead (the "sigma-delta" module, which is actually just PDM). Those two would make a lot more sense to me.
I am truly a bit sad our ESP8266 doesn't have hardware support for both PWM and I2C, but on the other hand, the CPU is quick enough and it allows for far more flexibility. I now have PWM up to 18 bits width (which you'll never see in a hardware implementation) and a very robust I2C implementation (if you're using I2C sensors, you know what I mean...) that runs configurable up to 800 kHz. So I guess I shouldn't complain. It was very interesting and learning to make those implementations.
I guess I don't have to say again that the code for both (I2C and PWM) from Espressif suck big time again, here. It's clear they're hardware developers and they're good at it too. But software is difficult for them.