Merge branch 'refactor/i2s_deprecate_confusing_names' into 'master'
i2s: deprecate confusing names Closes IDF-4368 See merge request espressif/esp-idf!16088
This commit is contained in:
@@ -1,16 +1,8 @@
|
||||
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -62,8 +54,8 @@ void app_main(void)
|
||||
.bits_per_sample = 16,
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, //2-channels
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_MSB,
|
||||
.dma_buf_count = 6,
|
||||
.dma_buf_len = 60,
|
||||
.dma_desc_num = 6,
|
||||
.dma_frame_num = 60,
|
||||
.intr_alloc_flags = 0, //Default interrupt priority
|
||||
.tx_desc_auto_clear = true //Auto clear tx descriptor on underflow
|
||||
};
|
||||
|
||||
@@ -693,8 +693,8 @@ void app_main(void)
|
||||
.sample_rate = 44100,
|
||||
.bits_per_sample = 16,
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT, //2-channels
|
||||
.dma_buf_count = 6,
|
||||
.dma_buf_len = 60,
|
||||
.dma_desc_num = 6,
|
||||
.dma_frame_num = 60,
|
||||
.intr_alloc_flags = 0, //Default interrupt priority
|
||||
.tx_desc_auto_clear = true //Auto clear tx descriptor on underflow
|
||||
};
|
||||
|
||||
@@ -69,8 +69,8 @@ void example_i2s_init(void)
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_MSB,
|
||||
.channel_format = EXAMPLE_I2S_FORMAT,
|
||||
.intr_alloc_flags = 0,
|
||||
.dma_buf_count = 2,
|
||||
.dma_buf_len = 1024,
|
||||
.dma_desc_num = 2,
|
||||
.dma_frame_num = 1024,
|
||||
.use_apll = 1,
|
||||
};
|
||||
//install and start i2s driver
|
||||
|
||||
@@ -75,7 +75,7 @@ Running this example, you will see the Bits per Sample changes every 5 seconds a
|
||||
|
||||
```
|
||||
I (361) pdm_rec_example: PDM microphone recording Example start
|
||||
I (371) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=64
|
||||
I (371) I2S: DMA Malloc info, datalen=blocksize=2048, dma_desc_num=64
|
||||
I (401) I2S: APLL: Req RATE: 44100, real rate: 88199.977, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 22579194.000, SCLK: 2822399.250000, diva: 1, divb: 0
|
||||
I (431) I2S: APLL: Req RATE: 44100, real rate: 88199.977, BITS: 16, CLKM: 1, BCK_M: 8, MCLK: 22579194.000, SCLK: 2822399.250000, diva: 1, divb: 0
|
||||
I (431) pdm_rec_example: Initializing SD card
|
||||
|
||||
@@ -173,8 +173,8 @@ void init_microphone(void)
|
||||
.channel_format = I2S_CHANNEL_FMT_ONLY_LEFT,
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_I2S,
|
||||
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL2,
|
||||
.dma_buf_count = 8,
|
||||
.dma_buf_len = 200,
|
||||
.dma_desc_num = 8,
|
||||
.dma_frame_num = 200,
|
||||
.use_apll = 0,
|
||||
};
|
||||
|
||||
|
||||
@@ -38,15 +38,15 @@ Running this example, you will see the Bits per Sample changes every 5 seconds a
|
||||
|
||||
```
|
||||
Test bits=24 free mem=293780, written data=2880
|
||||
I2S: DMA Malloc info, datalen=blocksize=480, dma_buf_count=6
|
||||
I2S: DMA Malloc info, datalen=blocksize=480, dma_desc_num=6
|
||||
I2S: PLL_D2: Req RATE: 36000, real rate: 37878.000, BITS: 24, CLKM: 11, BCK: 8, MCLK: 13837837.838, SCLK: 1818144.000000, diva: 64, divb: 36
|
||||
|
||||
Test bits=32 free mem=292336, written data=2880
|
||||
I2S: DMA Malloc info, datalen=blocksize=480, dma_buf_count=6
|
||||
I2S: DMA Malloc info, datalen=blocksize=480, dma_desc_num=6
|
||||
I2S: PLL_D2: Req RATE: 36000, real rate: 36764.000, BITS: 32, CLKM: 17, BCK: 4, MCLK: 9216921.692, SCLK: 2352896.000000, diva: 64, divb: 23
|
||||
|
||||
Test bits=16 free mem=293772, written data=1440
|
||||
I2S: DMA Malloc info, datalen=blocksize=240, dma_buf_count=6
|
||||
I2S: DMA Malloc info, datalen=blocksize=240, dma_desc_num=6
|
||||
I2S: PLL_D2: Req RATE: 36000, real rate: 36764.000, BITS: 16, CLKM: 17, BCK: 8, MCLK: 9216921.692, SCLK: 1176448.000000, diva: 64, divb: 23
|
||||
```
|
||||
|
||||
|
||||
@@ -96,8 +96,8 @@ void app_main(void)
|
||||
.bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT,
|
||||
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
|
||||
.communication_format = I2S_COMM_FORMAT_STAND_MSB,
|
||||
.dma_buf_count = 6,
|
||||
.dma_buf_len = 60,
|
||||
.dma_desc_num = 6,
|
||||
.dma_frame_num = 60,
|
||||
.use_apll = false,
|
||||
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1 //Interrupt level 1
|
||||
};
|
||||
|
||||
@@ -94,8 +94,8 @@ See the Getting Started Guide for full steps to configure and use ESP-IDF to bui
|
||||
Running this example in music mode, you can hear a piece of music (canon), the log is shown as follow:
|
||||
|
||||
```
|
||||
I (348) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=6
|
||||
I (348) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=6
|
||||
I (348) I2S: DMA Malloc info, datalen=blocksize=1200, dma_desc_num=6
|
||||
I (348) I2S: DMA Malloc info, datalen=blocksize=1200, dma_desc_num=6
|
||||
I (358) I2S: I2S0, MCLK output by GPIO0
|
||||
I (368) DRV8311: ES8311 in Slave mode
|
||||
I (378) gpio: GPIO[10]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
@@ -106,8 +106,8 @@ I (7948) i2s_es8311: I2S music played, 213996 bytes are written.
|
||||
|
||||
Running this example in echo mode, you can hear the sound in earphone that collected by mic.
|
||||
```
|
||||
I (312) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=6
|
||||
I (312) I2S: DMA Malloc info, datalen=blocksize=1200, dma_buf_count=6
|
||||
I (312) I2S: DMA Malloc info, datalen=blocksize=1200, dma_desc_num=6
|
||||
I (312) I2S: DMA Malloc info, datalen=blocksize=1200, dma_desc_num=6
|
||||
I (322) I2S: I2S0, MCLK output by GPIO0
|
||||
I (332) DRV8311: ES8311 in Slave mode
|
||||
I (342) gpio: GPIO[10]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
|
||||
|
||||
@@ -100,8 +100,8 @@ static esp_err_t i2s_driver_init(void)
|
||||
.bit_order_msb = false,
|
||||
.skip_msk = false,
|
||||
#endif
|
||||
.dma_buf_count = 8,
|
||||
.dma_buf_len = 64,
|
||||
.dma_desc_num = 8,
|
||||
.dma_frame_num = 64,
|
||||
.use_apll = false,
|
||||
.mclk_multiple = EXAMPLE_MCLK_MULTIPLE,
|
||||
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
|
||||
|
||||
Reference in New Issue
Block a user