biemster / pico-serialmic

Raspberry Pico INMP411 MEMS mic with serial output for C-SDK
4 stars 3 forks source link

DMA Example #4

Open fredsco opened 1 week ago

fredsco commented 1 week ago

in machine_i2s.c I can see that DMA is used which is great!

I am trying to figure out wether DMA is enabled by default (Which seems like it)

Are there any other functions I would need to call to ensure DMA is being used?

For now I have

machine_i2s_obj_t* i2s0 = machine_i2s_make_new(0, SCK, WS, SD, RX, BPS, MONO, /*ringbuf_len*/ SIZEOF_DMA_BUFFER_IN_BYTES, RATE);

And I am unsure if I should call

machine_i2s_stream_read(i2s0, (void*)&buffer[0], I2S_RX_FRAME_SIZE_IN_BYTES)

Since this is blocking CPU intensive right?

biemster commented 1 week ago

That's a good question. That code is not mine, so you will have better luck asking in the repo where it is from. I'll keep this open for a while in case someone else wants to shed some light on this.