Use of IIS

Introduction

The iis interface is mainly used to transmit audio signals. For detailed definitions, please refer to Baidu Encyclopedia. It is necessary to understand the left and right channel control, clock, etc., described below one by one

interface

  • I2S_SD: Serial data
  • I2S_ext_SD: To support full duplex, use extended SD to receive data
  • I2S_CK: serial clock line
  • I2S_WS: Channel switching
  • I2S_MCK: main clock output

IIS mode

Divided into four types, choose the appropriate mode according to your needs:

Full-duplex master mode, full-duplex slave mode, half-duplex master mode, half-duplex slave mode

As the name implies, it can be understood, the host mode can also choose whether to output the clock

Protocol

Philips mode, left-justified, right-justified, long data mode, short data mode, the selection of the mode needs to be selected according to the other end, if the Philips mode is supported, it is recommended to use the Philips mode directly, which is simple and convenient

Data length

There are several types, generally the lowest is 16 bits. It should be noted that 16-bit data refers to the sampling depth of 16 bits. What is sent is one channel. WS will switch the polarity every 16 bits. If 8 bits are transmitted, the host needs to support it.

frequency

The value sampling frequency is also the sending frequency. This parameter must be consistent with another segment and the sound source can be played normally.

The human hearing range is generally 1k-20k Hz, so to fully meet the hearing needs, a sampling rate greater than 40KHz is required. The sampling rate of 40KHz is 20K for each of the left and right channels. If it is a mono channel, only 20K is required.

to sum up

  • iis will have a certain error depending on the clock
  • In the process of sending, it must be sent all the time to ensure the correctness of the sound;
  • If you save resources, you can reduce the sampling depth and the sampling frequency, so the sound quality will also decrease
  • The sound quality is most affected by frequency, and the depth effect is not particularly large. 40K 16bit and 40K 32bit sound almost the same
  • 8-bit audio will definitely have noise during export and cannot be eliminated. It is recommended to use 16-bit at least

 

The following are generally used:

Guess you like

Origin blog.csdn.net/shaynerain/article/details/108052027