From 9d36fb69c15687141698cb59f615ad83c8ed1437 Mon Sep 17 00:00:00 2001 From: Daniel Fekete Date: Mon, 12 Jun 2017 05:15:33 +0200 Subject: [PATCH] documentation: i2s: document bufferred transfer, remove 32 bit write --- tools/documentation/mkdocs/i2s.md | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/tools/documentation/mkdocs/i2s.md b/tools/documentation/mkdocs/i2s.md index e1cb238..e51241a 100644 --- a/tools/documentation/mkdocs/i2s.md +++ b/tools/documentation/mkdocs/i2s.md @@ -1,6 +1,7 @@ ## I2S Not to be confused with [I2C](i2c.md), is a protocol for connecting to audio devices. +The samples are sent continuously in the background using DMA transfer. ## **This library is in beta, and the API / implementation is subject to change!** @@ -37,27 +38,23 @@ Configure the pins, and the parameters for the connection. * mode: one of I2S_PHILIPS_MODE,I2S_RIGHT_JUSTIFIED_MODE, I2S_LEFT_JUSTIFIED_MODE * sampleRate: between 8000 and 96000 -* bitsPerSample: 16, 24 or 32 +* bitsPerSample: 16. ** (Note: 24 or 32 bit per sample currently not working!) ** -#### **`write(uint16_t data);`** +#### **`write(int16_t data);`** -Send 16 bit data. **Currently in blocking mode** +Send 16 bit data. Blocks if there is no space left in the internal buffer. +#### **`write(int16_t *data, uint16_t size);`** -#### **`write32(uint32_t data);`** +Send 16 bit data. Blocks if there is no space left in the internal buffer. -Send 32 bit data. **Currently in blocking mode** +#### **`setBuffer(uint16_t *buffer, int bufferSize);`** +Set the DMA transfer buffer size. The default buffer is 2048 * 16 bits. -#### **`write(uint16_t *data, uint16_t size);`** - -Send 16 bit data. **Currently in blocking mode** - - -#### **`write(uint32_t *data, uint16_t size);`** - -Send 32 bit data. **Currently in blocking mode** +#### **`int getBufferSize();`** +Returns size of the transfer buffer. #### **`stm32SetSD(uint8_t pin);`**