Jump to content

Component: I2S Master/Slave ESP32 (Comms: Interface)

From Flowcode Help
Revision as of 16:13, 16 November 2021 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix TSL |- | width="20%" style="color:gray;" | Version | 2.0 |- | width="20%" style="color:gray...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Detailed description

No detailed description exists yet for this component

Examples

No additional examples


Downloadable macro reference

Stop
Stops the I2S audio stream 
- VOID Return


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. 
[[File:]] - 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


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. 
[[File:]] - Return


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. 
[[File:]] - 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


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


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


InitRXFilter
Initialization setting for RX Filter 
- BYTE Filter
 
- ULONG Value
 
- VOID Return


GetRxDataCount
Returns the number of valid data bytes in the buffer 
- BYTE buffer
The index of the required buffer 
- BYTE Return


Init
Must be called at least once and after every Uninit call to enable the CAN instance  
- VOID Return


InitTXBuffer
Initialization settings for TX Buffers 
- BYTE Buffer
TX Buffer ID = 0,1 or 2 
- ULONG ID
CAN Address 
- BYTE Length
Number of bytes to send 
- STRING Data
Data Array (of Length bytes) 
- VOID Return


SetRxMaskStd
Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter  
- BYTE Mask
Mask number 
- BYTE Hi
The high byte (bits 8-15) of the ID 
- BYTE Lo
The low byte (bits 0-7) of the ID 
- VOID Return


SetRxMaskExd
Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
- BYTE Mask
Mask 0 or 1 
- BYTE ID3
The high byte (bits 24-31) of the ID 
- BYTE ID2
The mid-high byte (bits 16-23) of the ID 
- BYTE ID1
The mid-low byte (bits 8-15) of the ID 
- BYTE ID0
The low byte (bits 0-7) of the ID 
- VOID Return


SetValue
Set the Value of the Named property 
- STRING Name
 
- STRING Value
 
- VOID Return


SetRxFilter
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
- BYTE filter
 
- ULONG id
 
- VOID Return


SetTxIdent
Generic function to set Identifier. CAN registers will be configured depending upon Std/Ext mode setting.  
- BYTE buffer
 
- ULONG id
 
- VOID Return


CheckRx
Checks to see if any messages are available for 'Buffer' specified  
- BYTE Buffer
Send buffer: 0 to 1 
- BYTE Return


InitRXConfig
Initialization setting for RX Buffer Config 
- BYTE Buffer
Buffer Number (0 or 1) 
- BYTE Value
Config data byte 
- VOID Return


Uninit
Uninitialises the CAN, freeing its connections for general use  
- VOID Return


GetList
Get the Filter List of the Named Property 
- STRING Name
 
- STRING Return


GetRxIdent
Generic function to get the received message Identifier.  
- BYTE buffer
 
- ULONG Return


SetRxFilterStd
Sets the 16-bit filter as a bit-mask of the standard ID for received messages The messages are accepted if (StdID & Mask) == Filter  
- BYTE Filter
Filter number 
- BYTE Hi
The high byte (bits 8-15) of the ID 
- BYTE Lo
The low byte (bits 0-7) of the ID 
- VOID Return


SetRxFilterExd
Sets the 32-bit filter as a bit-mask of the extended ID for received messages The messages are accepted if (ExtID & Mask) == Filter  
- BYTE Filter
Send filter: 0 to 3 
- BYTE ID3
The high byte (bits 24-31) of the ID 
- BYTE ID2
The mid-high byte (bits 16-23) of the ID 
- BYTE ID1
The mid-low byte (bits 8-15) of the ID 
- BYTE ID0
The low byte (bits 0-7) of the ID 
- VOID 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 
Connections
Simulations