i2s interface confusion / i2s_write_bytes
i2s interface confusion / i2s_write_bytes
I'm looking at the i2s example (i2s_example_main.c from 2.0 rc1) and am really confused by something. The setup_triangle_sine_waves function creates what looks like 1 wave form of 100 Hz data (10 msec) and sends it to the i2s via i2s_write_bytes. The main loop then delays for 5000 msec. I don't understand what the i2s is sending out. It should underrun almost the whole time. Does it continue to send out the last buffer received and just loop it until it gets new data?
Re: i2s interface confusion / i2s_write_bytes
As a follow-on to this, how is the driver user supposed to know when the transmit buffer needs more data. I see the interrupt handler in i2s.c which has an underrun case, but I don't know how that is supposed to get relayed on to the driver's user so that the application can send more data buffers to the driver.
-
- Posts: 9761
- Joined: Thu Nov 26, 2015 4:08 am
Re: i2s interface confusion / i2s_write_bytes
Normally, the i2c_write_bytes function blocks. You can just start up a thread that writes bytes as fast as it can using that function, and the blocking behaviour will make sure the timing is OK.
Also, yes, I think the current behaviour of the I2S-driver is to repeat the last sample buffer if it does not get new information.
Also, yes, I think the current behaviour of the I2S-driver is to repeat the last sample buffer if it does not get new information.
Who is online
Users browsing this forum: Baidu [Spider] and 128 guests