Skip to content

Commit 7c91f3c

Browse files
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.
1 parent f42b67d commit 7c91f3c

File tree

1 file changed

+30
-0
lines changed
  • content/learn/07.built-in-libraries/02.i2s

1 file changed

+30
-0
lines changed

content/learn/07.built-in-libraries/02.i2s/i2s.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,36 @@ None
110110
#### Returns
111111
The next sample of incoming I2S data available (or 0 if no data is available)
112112

113+
114+
### `read()`
115+
116+
#### Description
117+
118+
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.
119+
120+
#### Syntax
121+
122+
```
123+
I2S.read()
124+
```
125+
126+
```
127+
I2S.read(buffer, length)
128+
```
129+
130+
#### Parameters
131+
132+
None (for single sample read)
133+
134+
buffer: an array to read data into
135+
136+
length: the number of samples to read
137+
138+
#### Returns
139+
140+
The first sample of incoming I2S data available (or -1 if no data is available) - int
141+
142+
For buffer read: the number of samples read into the buffer
113143
### `write()`
114144

115145
#### Description

0 commit comments

Comments
 (0)