Is I2S supported in any way?

Posted on
  • Hi Gordon,
    What are your thoughts about supporting I2S for audio digital on Espruino? I notice that the ST processor has such interfaces & features and I trust that nice application scenarios may arise from these (like enabling sound output, bluetooth audio, a.s.o.).
    No particular project in my mind, just wondering if there are any hardware/software limitations for use.

  • There's no I2S support at the moment, but you could easily enable it by extending the Espruino interpreter with C code.

    The issue really is supplying the data to it fast enough. For that, you really need DMA (which you can enable pretty easily), but then where do you get data from? There's not much memory on-chip for high bitrate audio, JS isn't fast enough to generate it, and even the SD card library would struggle at the moment.

    So to be honest you're probably going to end up writing all your audio stuff in C, and then just controlling it from JS. That's great, but it means that there's very little point exposing I2S to JavaScript :(

  • That's fair enough! As a matter of fact I was afraid that one would need to write the code in Assambler language to keep code delay to minimum. And it's fine that there is no hardware lock due to use in whatever board functionality of conflicting resources.
    As for the speed in accessing data: there are plenty of applications like digital to analog audio conversion, bluetooth audio and possibly others where you won't need to store the data ( at least this is my assumption today ) but just to process it on the fly.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Is I2S supported in any way?

Posted by Avatar for verdeimpacat @verdeimpacat

Actions