Use I2S in real-time capable applications
Important
This is the Azure Sphere (Legacy) documentation. Azure Sphere (Legacy) is retiring on 27 September 2027, and users must migrate to Azure Sphere (Integrated) by this time. Use the Version selector located above the TOC to view the Azure Sphere (Integrated) documentation.
Azure Sphere supports the Inter-IC Sound (I2S) interface.
I2S is a serial bus interface standard used for connecting digital audio devices together. An I2S bus has separate clock and serial data signals.
This topic describes how to use I2S in real-time capable applications (RTApps).
Note
- I2S is currently not supported for use in high-level applications.
- The Azure Sphere OS does not reset peripherals on start-up. Your applications should ensure that peripherals are in a known-good state on start-up or after restart.
MT3620 support for I2S on the real-time cores
This section describes the I2S options that only apply when running Azure Sphere on the MT3620.
MT3620 features two I2S interfaces: I2S0 and I2S1. They can be allocated to the assigned real-time core during resource allocation after system boot. Each I2S interface is protected by a core mapping module which denies access from unassigned MCUs.
The I2S module supports only subordinate mode with external codecs. Master mode and internal codecs are not supported. However, a master clock (I2S_MCLK) is provided for external codecs to generate I2S Frame Sync (I2S_FS) and an I2S Bit Clock (I2S_BCLK).
Internal audio codecs and master mode are not supported. The I2S interface is used to communicate with external audio codecs through the I2S bus as an I2S subordinate.
Two data formats are supported: standard I2S protocol and Time Division Multiplexing (TDM) protocol.
Two blocks of five pins are multiplexed between GPIO and I2S (I2S0:GPIO56-GPIO60, I2S1:GPIO61-GPIO65).
For register base addresses, interrupt numbers, clock rate, sampling frequency, and other details about the MT3620, see the MT3620 Datasheet and the MT3620 M4 User Manual; if questions remain, you can request details from Avnet by emailing Azure.Sphere@avnet.com.
Application manifest settings
To use the I2S subordinate interface, an RTApp must list it in the Capabilities section of the application manifest. For example, the following adds an I2S interface to the list of resources that can be accessed by an application:
"Capabilities": {
"I2sSubordinate": [ "I2S0" ] }
The Inter-IC Sound (I2S) subordinate interface is only used by an RTApp. This capability isn't available to high-level applications.
Azure Sphere application manifest has more details about the application manifest.
The I2S sample applications
The CodethinkLabs repository on GitHub contains a number of sample applications that demonstrate how to use MT3620 supported peripherals in Azure Sphere real-time capable applications. Specifically, the I2S_RTApp_MT3620_BareMetal sample demonstrates how to incorporate an I2S peripheral in a real-time capable application.