Добавил:
ИВТ (советую зайти в "Несортированное") Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
interfeysy_1 / ИДЗ_машинка / даташиты / esp32_technical_reference_manual_en.pdf
Скачиваний:
16
Добавлен:
26.01.2024
Размер:
9.62 Mб
Скачать

12 I2S Controller (I2S)

Table 12-7 shows the configuration of the I2S_RX_PDM_SINC_DSR_16_EN bit whose PCM signal frequency remains 48 KHz at different PDM signal frequencies.

Table 12­7. Down­sampling Configuration

PDM freq (KHz)

I2S_RX_PDM_SINC_DSR_16_EN

PCM freq (KHz)

fpcm×128

1

fpcm

fpcm×64

0

 

12.5Camera­LCD Controller

There are three operational modes in the LCD mode of ESP32 I2S:

LCD master transmitting mode

Camera slave receiving mode

ADC/DAC mode

The clock configuration of the LCD master transmitting mode is identical to I2S’ clock configuration. In the LCD mode, the frequency of WS is half of fBCK.

In the ADC/DAC mode, use PLL_F160M_CLK as the clock source.

12.5.1 LCD Master Transmitting Mode

As is shown in Figure 12-13, the WR signal of LCD connects to the WS signal of I2S. The LCD data bus width is 24 bits.

Figure 12­13. LCD Master Transmitting Mode

The I2S_LCD_EN bit of register I2S_CONF2_REG needs to be set and the I2S_TX_SLAVE_MOD bit of register I2S_CONF_REG needs to be cleared, in order to configure I2S to the LCD master transmitting mode. Meanwhile, data should be sent under the correct mode, according to the I2S_TX_CHAN_MOD[2:0] bit of register I2S_CONF_CHAN_REG and the I2S_TX_FIFO_MOD[2:0] bit of register I2S_FIFO_CONF_REG. The WS signal needs to be inverted when it is routed through the GPIO Matrix. For details, please refer to the chapter about IO_MUX and the GPIO Matrix. The I2S_LCD_TX_SDX2_EN bit and the I2S_LCD_TX_WRX2_EN bit of register I2S_CONF2_REG should be set to the LCD master transmitting mode, so that both the data bus and WR signal work in the appropriate mode.

Espressif Systems

318

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

12 I2S Controller (I2S)

Figure 12­14. LCD Master Transmitting Data Frame, Form 1

Figure 12­15. LCD Master Transmitting Data Frame, Form 2

As is shown in Figure 12-14 and Figure 12-15, the I2S_LCD_TX_WRX2_EN bit should be set to 1 and the I2S_LCD_TX_SDX2_EN bit should be set to 0 in the data frame, form 1. Both I2S_LCD_TX_SDX2_EN bit and I2S_LCD_TX_WRX2_EN bit are set to 1 in the data frame, form 2.

12.5.2 Camera Slave Receiving Mode

ESP32 I2S supports a camera slave mode for high-speed data transfer from external camera modules. As shown in Figure 12-16, in this mode, I2S is set to slave receiving mode. Besides the 16-channel data signal bus I2SnI_Data_in, there are other signals, such as I2Sn_H_SYNC, I2Sn_V_SYNC and I2Sn_H_ENABLE.

The PCLK in the Camera module connects to I2SnI_WS_in in the I2S module, as Figure 12-16 shows.

Figure 12­16. Camera Slave Receiving Mode

When I2S is in the camera slave receiving mode, and when I2Sn_H_SYNC, I2S_V_SYNC and I2S_H_REF are held high, the master starts transmitting data, that is,

transmission_start = (I2Sn_H_SY NC == 1)&&(I2Sn_V _SY NC == 1)&&(I2Sn_H_ENABLE == 1)

Thus, during data transmission, these three signals should be kept at a high level. For example, if the I2Sn_V_SYNC signal of a camera is at low level during data transmission, it will be inverted when routed to the I2S module. ESP32 supports signal inversion through the GPIO matrix. For details, please refer to the chapter about IO_MUX and the GPIO Matrix.

In order to make I2S work in camera mode, the I2S_LCD_EN bit and the I2S_CAMERA_EN bit of register I2S_CONF2 _REG are set to 1, the I2S_RX_SLAVE_MOD bit of register I2S_CONF_REG is set to 1, the I2S_RX_MSB_RIGHT

Espressif Systems

319

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

12 I2S Controller (I2S)

bit and the I2S_RX_RIGHT_FIRST bit of I2S_CONF_REG are set to 0. Thus, I2S works in the LCD slave receiving mode. At the same time, in order to use the correct mode to receive data, both the I2S_RX_CHAN_MOD[2:0] bit of register I2S_CONF_CHAN_REG and the I2S_RX_FIFO_MOD[2:0] bit of register I2S_FIFO_CONF_REG are set to 1.

12.5.3 ADC/DAC mode

In LCD mode, ESP32’s ADC and DAC can receive data. When the I2S0 module connects to the on-chip ADC, the I2S0 module should be set to master receiving mode. Figure 12-17 shows the signal connection between the I2S0 module and the ADC.

Figure 12­17. ADC Interface of I2S0

Firstly, the I2S_LCD_EN bit of register I2S_CONF2_REG is set to 1, and the I2S_RX_SLAVE_MOD bit of register I2S_CONF_REG is set to 0, so that the I2S0 module works in LCD master receiving mode, and the I2S0 module clock is configured such that the WS signal of I2S0 outputs an appropriate frequency. Then, the SYSCON_SAR ADC_DATA_TO_I2S bit of register SYSCON_APB_SARADC_CTRL_REG is set to 1. Enable I2S to receive data after configuring the relevant registers of SARADC. For details, please refer to Chapter On-Chip Sensors and Analog Signal Processing.

Figure 12­18. DAC Interface of I2S

Figure 12­19. Data Input by I2S DAC Interface

The I2S0 module should be configured to master transmitting mode when it connects to the on-chip DAC. Figure

Espressif Systems

320

ESP32 TRM (Version 5.0)

Submit Documentation Feedback

Соседние файлы в папке даташиты