Texas Instruments CC2650DK ユーザーズマニュアル

ページ / 1570
Usage
22.9 Usage
This section describes the recommended start-up and termination sequences.
22.9.1 Start-up Sequence
The configuration of the I2S module should be carried out in the following order:
1. Set up and configure required ADx and clock pins (set externally in the IOC module).
2. Enable I2S peripheral and configure WCLK and MCLK audio clocks (set externally in the PRCM
module).
3. Configure the serial audio interface format and the memory interface controller:
Set the following registers: [I2S:AIFWCLKSRC], [I2S:AIFDIRCFG], [I2S:AIFFMTCFG],
[I2S:AIFWMSK0], [I2S:AIFWMSK1] and [I2S:AIFWMSK2]. BCLK should not be running when
changing the [I2S:AIFWCLKSRC] register.
4. Enable BCLK (set externally in the PRCM module).
5. Configure and prepare the samplestamp generator:
Set the [I2S:STMPWPER] register. This number corresponds to the total size of the sample ring
buffer used by the system.
Set the two registers [I2S:STMPINTRIG] and [I2S:STMPOUTTRIG] > [I2S:STMPWPER] to avoid
false triggers before the samplestamp generator is started.
6. Enable the samplestamp generator:
Set [I2S:STMPCTRL:STMP_EN] = 1
Optional steps:
Poll the [I2S:STMPWCNT] register and wait until the counter value is 2 or higher:
When the value is 2 or higher, there are no more false increments (as described in
Counters and Registers).
When the value is 4 or higher, the WCLK period is read out from the [I2S:STMPXPER]
register. This is used to determine the sample rate when using an external clock source.
Reset the WCLK counter by writing [I2S:STMPWSET] = 0
7. Enable the serial audio interface:
Set the [I2S:AIFINPTRNEXT] and [I2S:AIFOUTPTRNEXT] registers for first memory interface
buffers.
Set the [I2S:AIFDMACFG] register; This number corresponds to the length of each block in the
sample ring buffer used by the system.
Set the [I2S:AIFINPTRNEXT] and [I2S:AIFOUTPTRNEXT] registers for second memory interface
buffers.
8. Start input and output audio streaming:
Set the [I2S:STMPINTRIG] and [I2S:STMPOUTTRIG] registers so they correctly match the
[I2S:AIFINPTR] and [I2S:AIFOUTPTR] registers.
1421
SWCU117A – February 2015 – Revised March 2015
Integrated Interchip Sound (I2S) Module
Copyright © 2015, Texas Instruments Incorporated