Owners manual
Interfaces
H3 Datasheet(Revision1.2) Copyright© 2015 Allwinner Technology Co.,Ltd.All Rights Reserved. Page 527
8.6.5. Operation Modes
The software operation of the I2S/PCM is divided into five steps: system setup, PCM/I2S initialization, the channel setup,
DMA setup and Enable/Disable module. These five steps are described in detail in the following sections.
8.6.5.1. System setup and I2S/PCM initialization
The first step in the system setup is properly programming the GPIO. Because the I2S/PCM port is a multiplex pin. You
can find the function in the pin multiplex specification. The clock source for the I2S/PCM should be followed. At first you
must reset the audio PLL though the PLL_ENABLE bit of PLL_AUDIO_CTRL_REG in the CCU. The second step, you must
setup the frequence of the audio pll in the PLL_AUDIO_CTRL_REG. The configuration of audio pll can be found in the
chapter 4.3.5. After that, you must open the I2S/PCM gating though the I2S/PCM0_CLK_REG/I2S/PCM1_CLK_REG when
you checkout that the LOCK bit of PLL_AUDIO_CTRL_REG become 1. At last, you must reset the I2S/PCM in
BUS_SOFT_RST_REG3's bit[13:12] and open the I2S/PCM bus gating in the BUS_CLK_GATING_REG2's bit[13:12].
After the system setup, the register of I2S/PCM can be setup. At first, you should initialization the I2S/PCM. You should
closed the globe enable bit(I2S/PCM_CTL[0]) , TX enable bit(I2S/PCM_CTL[2]) and RX enable bit(I2S/PCM_CTL[1]) by
write 0 to it. After that, you must clear the TX/RX FIFO by write 0 to register I2S/PCM_FCTL[25:24]. At last, you can clear
the TX FIFO and RX FIFO counter by write 0 to I2S/PCM_TXCNT and I2S/CPM_RXCNT.
8.6.5.2. The channel setup and DMA setup
Before the usage and control of I2S/PCM, you must configure the I2C. The configuration of I2C will not describe in this
chapter. But you can only configure I2S/PCM of master and slave though the I2C. In the following, you can setup the
I2S/PCM of mater and slave. The configuration can be referred to the the protocol of I2S/PCM. Then, you can set the
translation mode, the sample precision, the wide of slot, the frame mode and the trigger level. The register set can be
found in the spec.
The I2S/PCM supports three methods to transfer the data. The most common way is DMA, the set of DMA can be found
in the DMA spec. In this module, you just to enable the DRQ.
8.6.5.3. Enable and disable the I2S/PCM
To enable the function, you can enable TX/RX by write the I2S/PCM_CTL[2:1]. After that, you must enable I2S/PCM by
write the Globe Enable bit to 1 in the I2S/PCM_CTL. The disable process is writed the Globe Enable to 0.
confidential