From 7c91f3cc669d0fef75f60cf7d8b222c74223e12c Mon Sep 17 00:00:00 2001 From: "Palla. Gnana Sai Kiran" <2400031822@kluniversity.in> Date: Thu, 20 Nov 2025 22:32:45 +0530 Subject: [PATCH] docs: Add missing read() method documentation to I2S library Fixes #2583 Added comprehensive documentation for the read() method in the I2S library. The read() method was being used in examples but was not documented in the API reference. This commit adds: - Method description - Two syntax variants (single sample and buffer read) - Parameter documentation - Return value documentation This resolves the issue where users could not find documentation for the read() method despite it being used in code examples. --- .../learn/07.built-in-libraries/02.i2s/i2s.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/content/learn/07.built-in-libraries/02.i2s/i2s.md b/content/learn/07.built-in-libraries/02.i2s/i2s.md index 3f9e299fd5..92f5d7eb77 100644 --- a/content/learn/07.built-in-libraries/02.i2s/i2s.md +++ b/content/learn/07.built-in-libraries/02.i2s/i2s.md @@ -110,6 +110,36 @@ None #### Returns The next sample of incoming I2S data available (or 0 if no data is available) + +### `read()` + +#### Description + +Reads incoming I2S data from the I2S interface. This method reads and removes the next sample of incoming I2S data available from the internal I2S buffer. read() inherits from the Stream utility class. + +#### Syntax + +``` +I2S.read() +``` + +``` +I2S.read(buffer, length) +``` + +#### Parameters + +None (for single sample read) + +buffer: an array to read data into + +length: the number of samples to read + +#### Returns + +The first sample of incoming I2S data available (or -1 if no data is available) - int + +For buffer read: the number of samples read into the buffer ### `write()` #### Description