Skip to content

Commit e4ea2bd

Browse files
Merge pull request #2730 from Gnanasaikiran/Gnanasaikiran-patch-1
docs: Add missing read() method documentation to I2S library
2 parents 198a644 + 7c91f3c commit e4ea2bd

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)