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

From Flowcode Help
Jump to navigationJump to search
 
(4 intermediate revisions by the same user not shown)
Line 73: Line 73:
  
 
''<span style="color:red;">No additional examples</span>''
 
''<span style="color:red;">No additional examples</span>''
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
  
Line 81: Line 91:
 
==Macro reference==
 
==Macro reference==
  
===Stop===
+
===CheckQueue===
 +
{| 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''
 +
|}
 +
 
 +
 
 +
===Initialise===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise'''
 
|-
 
|-
| colspan="2" | Stops the I2S audio stream&nbsp;
+
| colspan="2" | Configures the I2C peripheral ready for data.&nbsp;
 
|-
 
|-
 
|-
 
|-
Line 124: Line 148:
  
  
===CheckQueue===
+
===Start===
 +
{| 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''
 +
|}
 +
 
 +
 
 +
===Stop===
 
{| class="wikitable" style="width:60%; background-color:#FFFFFF;"
 
{| 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" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]]
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckQueue'''
+
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Stop'''
 
|-
 
|-
| 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" | Stops the I2S audio stream&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''
 
|}
 
|}
Line 165: Line 203:
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
| width="90%" style="border-top: 2px solid #000;" | ''Return''
 
|}
 
|}
 
 
===Start===
 
{| 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''
 
|}
 
 
 
===Initialise===
 
{| 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''
 
|}
 
 
 
  
  

Latest revision as of 10:24, 24 February 2023

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

Fc9-comp-macro.png 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. 
Fc9-bool-icon.png - BOOL Return


Initialise

Fc9-comp-macro.png Initialise
Configures the I2C peripheral ready for data. 
Fc9-void-icon.png - VOID Return


Read

Fc9-comp-macro.png 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. 
Fc9-s16-icon.png - INT Data
Data array to populate with incoming data 
Fc9-u16-icon.png - UINT Length
Max number of samples to try and receive 
Fc9-u16-icon.png - UINT Timeout
Max number of ticks to wait for incoming samples 
Fc9-u16-icon.png - UINT Return


Start

Fc9-comp-macro.png Start
Starts the I2S audio stream, auto started by the initialise function. 
Fc9-void-icon.png - VOID Return


Stop

Fc9-comp-macro.png Stop
Stops the I2S audio stream 
Fc9-void-icon.png - VOID Return


Write

Fc9-comp-macro.png 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. 
Fc9-s16-icon.png - INT Data
Data array containing outgoing data 
Fc9-u16-icon.png - UINT Length
Max number of samples to try and send 
Fc9-u16-icon.png - UINT Timeout
Max number of ticks to wait for space in the outgoing buffer 
Fc9-u16-icon.png - UINT Return


Property reference

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