e010470f0de85c7b0d926758afaa29b25f661e36
[bertos.git] / bertos / drv / i2s.h
1 #ifndef I2S_H
2 #define I2S_H
3
4 #include <cfg/compiler.h>
5
6 #define CONFIG_PLAY_BUF_LEN 16
7 #define I2S_FIRST_BUF  1
8 #define I2S_SECOND_BUF 2
9
10 void i2s_init(void);
11
12 /* Low level call that returns one of the two buffers or NULL if none is available */
13 uint8_t *i2s_getBuffer(unsigned buf_num);
14
15 /* Returns a buffer that will be played after the current one. Blocking call */
16 uint8_t *i2s_getFreeBuffer(void);
17
18 /* Starts playing from I2S_FIRST_BUFFER. You must have filled both buffers before calling this
19  * function. Does nothing if already playing. */
20 bool i2s_start(void);
21
22 #endif /* I2S_H */