Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Enum

This section introduces the enumerations that I2S should configure before performing transfer. More...

Overview

This section introduces the enumerations that I2S should configure before performing transfer.

Enumerations

enum  hal_i2s_link_channel_per_sample {
  MHAL_I2S_LINK_CHANNLE_PER_SAMPLE_2 = 0,
  MHAL_I2S_LINK_CHANNLE_PER_SAMPLE_4 = 1
}
 I2S link channel per sample. More...
 
enum  hal_i2s_link_bits_sample {
  MHAL_I2S_BITS_PER_SAMPLE_32 = 0,
  MHAL_I2S_BITS_PER_SAMPLE_64 = 1,
  MHAL_I2S_BITS_PER_SAMPLE_128 = 2
}
 I2S bits per sample. More...
 
enum  hal_i2s_tx_mode {
  MHAL_I2S_TX_MONO_DUPLICATE_DISABLE = 0,
  MHAL_I2S_TX_MONO_DUPLICATE_ENABLE = 1
}
 Enable or disable the right channel of I2S Tx sending the same data as the left channel of I2S Tx. More...
 
enum  hal_i2s_rx_down_rate {
  MHAL_I2S_RX_DOWN_RATE_DISABLE = 0,
  MHAL_I2S_RX_DOWN_RATE_ENABLE = 1
}
 Enable or disable 2x down sample rate mode in the I2S Rx link. More...
 
enum  hal_i2s_channel_number {
  MHAL_I2S_MONO = 0,
  MHAL_I2S_STEREO = 1
}
 I2S channel number define. More...
 
enum  i2s_no {
  MHAL_I2S0 = 0,
  MHAL_I2S1 = 1
}
 I2S port number. More...
 
enum  i2s_fnen {
  MHAL_FN_DIS = 0,
  MHAL_FN_EN = 1
}
 Function enable/disable. More...
 
enum  hal_i2s_initial_type {
  MHAL_I2S_TYPE_EXTERNAL_MODE = 0,
  MHAL_I2S_TYPE_EXTERNAL_TDM_MODE = 1,
  MHAL_I2S_TYPE_INTERNAL_LOOPBACK_MODE = 2
}
 This enum defines the initial type of I2S. More...
 
enum  hal_i2s_sample_rate {
  MHAL_I2S_SAMPLE_RATE_8K = 0,
  MHAL_I2S_SAMPLE_RATE_12K = 1,
  MHAL_I2S_SAMPLE_RATE_16K = 2,
  MHAL_I2S_SAMPLE_RATE_24K = 3,
  MHAL_I2S_SAMPLE_RATE_32K = 4,
  MHAL_I2S_SAMPLE_RATE_48K = 5
}
 I2S sample rate define. More...
 

Enumeration Type Documentation

I2S link channel per sample.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config() and just used in TDM mode.

Enumerator
MHAL_I2S_LINK_CHANNLE_PER_SAMPLE_2 

Two channels in each frame sync cycle.

MHAL_I2S_LINK_CHANNLE_PER_SAMPLE_4 

Four channels in each frame sync cycle.

I2S bits per sample.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_I2S_BITS_PER_SAMPLE_32 

32 bits in each frame sync cycle.

MHAL_I2S_BITS_PER_SAMPLE_64 

64 bits in each frame sync cycle.

MHAL_I2S_BITS_PER_SAMPLE_128 

128 bits in each frame sync cycle.

Enable or disable the right channel of I2S Tx sending the same data as the left channel of I2S Tx.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_I2S_TX_MONO_DUPLICATE_DISABLE 

The right channel of Tx sends all 0.

MHAL_I2S_TX_MONO_DUPLICATE_ENABLE 

The right channel of Tx sends the same data as the left channelof I2S Tx.

Enable or disable 2x down sample rate mode in the I2S Rx link.

There is a mode that the sample rate of I2S Tx is 48kHz and the sample rate of I2S Rx is 24kHz. And in this mode, I2S Rx will drop one sample in each two input samples automatically. Before I2S transfer, users should make sure the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_I2S_RX_DOWN_RATE_DISABLE 

Real sample rate of I2S Rx = sample rate.

MHAL_I2S_RX_DOWN_RATE_ENABLE 

Real sample rate of I2S Rx is 1/2 of the sample rate.

I2S channel number define.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_I2S_MONO 

This value means one channel.

MHAL_I2S_STEREO 

This value means two channels.

enum i2s_no

I2S port number.

This parameter is defined in the mtk_i2s_ctlr structure, which is used by the user to specify the I2S port.

Enumerator
MHAL_I2S0 

I2S port is i2s0.

MHAL_I2S1 

I2S port is i2s1.

enum i2s_fnen

Function enable/disable.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure, which is used in lr_swap and word_select_inverse. They are configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_FN_DIS 

Function disable.

MHAL_FN_EN 

Function enable.

This enum defines the initial type of I2S.

Before I2S transfer, users should use the parameter in mtk_mhal_i2s_cfg_type() function to set I2S HW initial parameter

Enumerator
MHAL_I2S_TYPE_EXTERNAL_MODE 

I2S external mode.

MHAL_I2S_TYPE_EXTERNAL_TDM_MODE 

I2S external TDM mode.

MHAL_I2S_TYPE_INTERNAL_LOOPBACK_MODE 

I2S internal loopback mode.

I2S sample rate define.

Before I2S transfer, users should make sure that the parameter is defined in hal_i2s_link_config structure and configured through mtk_mhal_i2s_set_config().

Enumerator
MHAL_I2S_SAMPLE_RATE_8K 

8000Hz

MHAL_I2S_SAMPLE_RATE_12K 

12000Hz

MHAL_I2S_SAMPLE_RATE_16K 

16000Hz

MHAL_I2S_SAMPLE_RATE_24K 

24000Hz

MHAL_I2S_SAMPLE_RATE_32K 

32000Hz

MHAL_I2S_SAMPLE_RATE_48K 

48000Hz