Jump to content

Component: I2S Master/Slave ESP32 (Comms: Interface): Difference between revisions

From Flowcode Help
No edit summary
m Text replacement - "style="background-color:#EAE1EA;"" to "class="mtx-class-propfolder""
 
(13 intermediate revisions by 2 users not shown)
Line 17: Line 17:
==Component Source Code==
==Component Source Code==


Please click here to download the component source project: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_I2S.fcfx FC_Comp_Source_I2S.fcfx]
Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_I2S.fcfx FC_Comp_Source_I2S.fcfx]


Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_I2S.fcfx FC_Comp_Source_I2S.fcfx]
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_I2S.fcfx FC_Comp_Source_I2S.fcfx]


==Detailed description==
==Detailed description==




Line 64: Line 68:




''<span style="color:red;">No additional examples</span>''




==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
|-
| colspan="2" | Stops the I2S audio stream&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


''<span style="color:red;">No additional examples</span>''


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
|-
| colspan="2" | Wait timeout ticks to receive length number of samples, returns samples received. 24 and 32-bit data must be split into two integer values per sample.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Data
|-
| colspan="2" | Data array to populate with incoming data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Length
|-
| colspan="2" | Max number of samples to try and receive&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Max number of ticks to wait for incoming samples&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckQueue'''
|-
| colspan="2" | Checks the I2S Event queue for a DMA Buffer full or empty event. For an output returns true when there is an empty DMA buffer available. For an input return true when there is a full DMA buffer available.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write'''
|-
| colspan="2" | Wait timeout ticks to send length number of samples, returns samples sent 24 and 32-bit data must be split into two integer values per sample.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Data
|-
| colspan="2" | Data array containing outgoing data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Length
|-
| colspan="2" | Max number of samples to try and send&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Max number of ticks to wait for space in the outgoing buffer&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Start'''
|-
| colspan="2" | Starts the I2S audio stream, auto started by the initialise function.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Configures the I2C peripheral ready for data.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}








==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | DAC Channel number&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Clock Pin
|-
| colspan="2" | I2S Clock Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Serial Data Pin
|-
| colspan="2" | I2S Serial Data (SD) Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Word Select Pin
|-
| colspan="2" | I2S Word Select (WS) Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Mode
|-
| colspan="2" | Configures if the I2S peripheral is a master or slave on the bus.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Direction
|-
| colspan="2" | Controls if the I2S data is coming in or out of the microcontroller&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Audio Channels
|-
| colspan="2" | Number of distinct audio channels in the data stream&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Sample Rate
|-
| colspan="2" | Audio sample rate in Hz&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Bits
|-
| colspan="2" | Nmber of bits in each audio sample&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | DMA Buffer Count
|-
| colspan="2" | I2S DMA Buffer Count &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | DMA Buffer Size
|-
| colspan="2" | I2S DMA Buffer Size&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|}==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
|-
| colspan="2" | Stops the I2S audio stream&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}


==Macro reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===CheckQueue===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
| width="90%" class="mtx-class-macrohead" | '''CheckQueue'''
|-
|-
| colspan="2" | Wait timeout ticks to receive length number of samples, returns samples received. 24 and 32-bit data must be split into two integer values per sample.&nbsp;
| colspan="2" | Checks the I2S Event queue for a DMA Buffer full or empty event. For an output returns true when there is an empty DMA buffer available. For an input return true when there is a full DMA buffer available.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" | Data
|-
| colspan="2" | Data array to populate with incoming data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Length
|-
| colspan="2" | Max number of samples to try and receive&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
|-
| colspan="2" | Max number of ticks to wait for incoming samples&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Initialise===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckQueue'''
| width="90%" class="mtx-class-macrohead" | '''Initialise'''
|-
|-
| colspan="2" | Checks the I2S Event queue for a DMA Buffer full or empty event. For an output returns true when there is an empty DMA buffer available. For an input return true when there is a full DMA buffer available.&nbsp;
| colspan="2" | Configures the I2C peripheral ready for data.&nbsp;
|-
|-
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Read===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write'''
| width="90%" class="mtx-class-macrohead" | '''Read'''
|-
|-
| colspan="2" | Wait timeout ticks to send length number of samples, returns samples sent 24 and 32-bit data must be split into two integer values per sample.&nbsp;
| colspan="2" | Wait timeout ticks to receive length number of samples, returns samples received. 24 and 32-bit data must be split into two integer values per sample.&nbsp;
|-
|-
|-
|-
Line 312: Line 131:
| width="90%" | Data
| width="90%" | Data
|-
|-
| colspan="2" | Data array containing outgoing data&nbsp;
| colspan="2" | Data array to populate with incoming data&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Length
| width="90%" | Length
|-
|-
| colspan="2" | Max number of samples to try and send&nbsp;
| colspan="2" | Max number of samples to try and receive&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Timeout
| width="90%" | Timeout
|-
|-
| colspan="2" | Max number of ticks to wait for space in the outgoing buffer&nbsp;
| colspan="2" | Max number of ticks to wait for incoming samples&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
Line 329: Line 148:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Start===
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Start'''
| width="90%" class="mtx-class-macrohead" | '''Start'''
|-
|-
| colspan="2" | Starts the I2S audio stream, auto started by the initialise function.&nbsp;
| colspan="2" | Starts the I2S audio stream, auto started by the initialise function.&nbsp;
Line 342: Line 162:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Stop===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Configures the I2C peripheral ready for data.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
 
 
==Property reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''
|-
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Channel
|-
| colspan="2" | DAC Channel number&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Clock Pin
|-
| colspan="2" | I2S Clock Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Serial Data Pin
|-
| colspan="2" | I2S Serial Data (SD) Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-5-icon.png]]
| width="90%" | Word Select Pin
|-
| colspan="2" | I2S Word Select (WS) Pin&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Mode
|-
| colspan="2" | Configures if the I2S peripheral is a master or slave on the bus.&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Direction
|-
| colspan="2" | Controls if the I2S data is coming in or out of the microcontroller&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Audio Channels
|-
| colspan="2" | Number of distinct audio channels in the data stream&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | Sample Rate
|-
| colspan="2" | Audio sample rate in Hz&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-16-icon.png]]
| width="90%" | Data Bits
|-
| colspan="2" | Nmber of bits in each audio sample&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | DMA Buffer Count
|-
| colspan="2" | I2S DMA Buffer Count &nbsp;
|-
| width="10%" align="center" | [[File:Fc9-type-21-icon.png]]
| width="90%" | DMA Buffer Size
|-
| colspan="2" | I2S DMA Buffer Size&nbsp;
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
|-
|}==Macro reference==
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
| width="90%" class="mtx-class-macrohead" | '''Stop'''
|-
|-
| colspan="2" | Stops the I2S audio stream&nbsp;
| colspan="2" | Stops the I2S audio stream&nbsp;
Line 438: Line 176:




{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
===Write===
|-
{| class="mtx-class-macrotable wikitable"
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read'''
|-
| colspan="2" | Wait timeout ticks to receive length number of samples, returns samples received. 24 and 32-bit data must be split into two integer values per sample.&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT
| width="90%" | Data
|-
| colspan="2" | Data array to populate with incoming data&nbsp;
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" | Length
|-
| colspan="2" | Max number of samples to try and receive&nbsp;
|-
|-
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]]
| width="90%" | Timeout
| width="90%" class="mtx-class-macrohead" | '''Write'''
|-
| colspan="2" | Max number of ticks to wait for incoming samples&nbsp;
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckQueue'''
|-
| colspan="2" | Checks the I2S Event queue for a DMA Buffer full or empty event. For an output returns true when there is an empty DMA buffer available. For an input return true when there is a full DMA buffer available.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
 
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write'''
|-
|-
| colspan="2" | Wait timeout ticks to send length number of samples, returns samples sent 24 and 32-bit data must be split into two integer values per sample.&nbsp;
| colspan="2" | Wait timeout ticks to send length number of samples, returns samples sent 24 and 32-bit data must be split into two integer values per sample.&nbsp;
Line 505: Line 203:
| width="90%" style="border-top: 2px solid #000;" | ''Return''
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Start'''
|-
| colspan="2" | Starts the I2S audio stream, auto started by the initialise function.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
|-
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
|-
| colspan="2" | Configures the I2C peripheral ready for data.&nbsp;
|-
|-
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID
| width="90%" style="border-top: 2px solid #000;" | ''Return''
|}




==Property reference==
==Property reference==


{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
{| class="mtx-class-macrotable wikitable"
|-
|-
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]]
| width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-prop-icon.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties'''  
| width="90%" class="mtx-class-macrohead" | '''Properties'''  
|-
|-
|-
|-
Line 598: Line 268:
| colspan="2" | I2S DMA Buffer Size&nbsp;
| colspan="2" | I2S DMA Buffer Size&nbsp;
|-
|-
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]]
| width="10%" align="center" class="mtx-class-propfolder" | [[File:Fc9-conn-icon.png]]
| width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Simulation
| width="90%" class="mtx-class-propfolder" | Simulation
|-
|-
|}
|}

Latest revision as of 14:36, 13 July 2026

Author Matrix TSL
Version 2.0
Category Comms: Interface


I2S Master/Slave ESP32 component

Provides access to the onboard inter-IC sound (I2S) peripheras allowing for simple digital audio input and output.

Component Source Code

Please click here to download the component source project: FC_Comp_Source_I2S.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_I2S.fcfx

Detailed description

No detailed description exists yet for this component

Examples

No additional examples









Macro reference

CheckQueue

CheckQueue
Checks the I2S Event queue for a DMA Buffer full or empty event. For an output returns true when there is an empty DMA buffer available. For an input return true when there is a full DMA buffer available. 
- BOOL Return


Initialise

Initialise
Configures the I2C peripheral ready for data. 
- VOID Return


Read

Read
Wait timeout ticks to receive length number of samples, returns samples received. 24 and 32-bit data must be split into two integer values per sample. 
- INT Data
Data array to populate with incoming data 
- UINT Length
Max number of samples to try and receive 
- UINT Timeout
Max number of ticks to wait for incoming samples 
- UINT Return


Start

Start
Starts the I2S audio stream, auto started by the initialise function. 
- VOID Return


Stop

Stop
Stops the I2S audio stream 
- VOID Return


Write

Write
Wait timeout ticks to send length number of samples, returns samples sent 24 and 32-bit data must be split into two integer values per sample. 
- INT Data
Data array containing outgoing data 
- UINT Length
Max number of samples to try and send 
- UINT Timeout
Max number of ticks to wait for space in the outgoing buffer 
- UINT Return


Property reference

Properties
Channel
DAC Channel number 
Clock Pin
I2S Clock Pin 
Serial Data Pin
I2S Serial Data (SD) Pin 
Word Select Pin
I2S Word Select (WS) Pin 
Mode
Configures if the I2S peripheral is a master or slave on the bus. 
Data Direction
Controls if the I2S data is coming in or out of the microcontroller 
Audio Channels
Number of distinct audio channels in the data stream 
Sample Rate
Audio sample rate in Hz 
Data Bits
Nmber of bits in each audio sample 
DMA Buffer Count
I2S DMA Buffer Count  
DMA Buffer Size
I2S DMA Buffer Size 
Simulation