请求esp8266 iis dma寄存器描述
Re: 请求esp8266 iis dma寄存器描述
Postby ESP_Faye » Mon Sep 21, 2015 6:37 pm
您好,
I2S demo 和文档如附件。
感谢贵司对 ESP8266 的关注!
I2S demo 和文档如附件。
感谢贵司对 ESP8266 的关注!
- Attachments
-
- app.zip
- (425.54 KiB) Downloaded 1070 times
-
- 8P-ESP8266 I2S Module description__CN_v1.0.pdf
- (590.04 KiB) Downloaded 1239 times
Re: 请求esp8266 iis dma寄存器描述
Postby ESP_Faye » Thu Sep 24, 2015 7:18 pm
您好,
请参考如下定义:
请参考如下定义:
Code: Select all
#define ETS_SLC_INUM 1
#define ETS_SLC_INTR_ATTACH(func, arg)\
ets_isr_attach(ETS_SLC_INUM, (func), (void *)(arg))
#define ETS_SLC_INTR_ENABLE() \
ETS_INTR_ENABLE(ETS_SLC_INUM)
Re: 请求esp8266 iis dma寄存器描述
Postby danshi126 » Thu Sep 24, 2015 9:40 pm
Hi Faye,
1、采样率以及位时钟,是用什么公式计算?
注:用esp8266_mp3_decoder SDK里的i2sSetRate计算出来的数据和您设置的数值不一样
2、I2SCONF第12~15Bit 分别表示的含义?
以下是esp8266_mp3_decoder SDK里的i2sSetRate:
1、采样率以及位时钟,是用什么公式计算?
注:用esp8266_mp3_decoder SDK里的i2sSetRate计算出来的数据和您设置的数值不一样
2、I2SCONF第12~15Bit 分别表示的含义?
以下是esp8266_mp3_decoder SDK里的i2sSetRate:
Code: Select all
#define BASEFREQ (12000000L)
#define ABS(x) (((x)>0)?(x):(-(x)))
//Set the I2S sample rate, in HZ
void i2sSetRate(int rate) {
//Find closest divider
int bestbck=0, bestfreq=0;
int tstfreq;
int i;
//Calculate the base divider for 16 bits of data
int div=(BASEFREQ/(rate*24)); //24Bit 位宽
//The base divider can be off by as much as <1 Compensate by trying to make the amount of bytes in the
//i2s cycle more than 16. Do this by trying the amounts from 16 to 32 and keeping the one that fits best.
for (i=16; i<32; i++) {
tstfreq=BASEFREQ/(div*i*2);
// printf("Best (%d,%d) cur (%d,%d) div %d\n", bestbck, bestfreq, i, tstfreq, ABS(rate-tstfreq));
if (ABS(rate-tstfreq)<ABS(rate-bestfreq)) {
bestbck=i;
bestfreq=tstfreq;
}
}
// printf("ReqRate %d Div %d Bck %d Frq %d\n", rate, div, bestbck, BASEFREQ/(div*bestbck*2));
os_printf("bestbck = %d, div = %d\n\r",bestbck,div);
#if 1
//Master mode
CLEAR_PERI_REG_MASK(I2SCONF, I2S_TRANS_SLAVE_MOD|
(I2S_BITS_MOD<<I2S_BITS_MOD_S)|
(I2S_BCK_DIV_NUM <<I2S_BCK_DIV_NUM_S)|
(I2S_CLKM_DIV_NUM<<I2S_CLKM_DIV_NUM_S));
SET_PERI_REG_MASK(I2SCONF, I2S_RIGHT_FIRST|I2S_MSB_RIGHT|I2S_RECE_SLAVE_MOD|
I2S_RECE_MSB_SHIFT|I2S_TRANS_MSB_SHIFT|
(((bestbck-1)&I2S_BCK_DIV_NUM )<<I2S_BCK_DIV_NUM_S)|
(((div-1)&I2S_CLKM_DIV_NUM)<<I2S_CLKM_DIV_NUM_S)|
(8<<I2S_BITS_MOD_S));
#else
//Slave mode
CLEAR_PERI_REG_MASK(I2SCONF, I2S_RECE_SLAVE_MOD|
(I2S_BITS_MOD<<I2S_BITS_MOD_S)|
(I2S_BCK_DIV_NUM <<I2S_BCK_DIV_NUM_S)|
(I2S_CLKM_DIV_NUM<<I2S_CLKM_DIV_NUM_S));
SET_PERI_REG_MASK(I2SCONF, I2S_RIGHT_FIRST|I2S_MSB_RIGHT|I2S_TRANS_SLAVE_MOD|
I2S_RECE_MSB_SHIFT|I2S_TRANS_MSB_SHIFT|
(((bestbck-1)&I2S_BCK_DIV_NUM )<<I2S_BCK_DIV_NUM_S)|
(((div-1)&I2S_CLKM_DIV_NUM)<<I2S_CLKM_DIV_NUM_S));
#endif
}
Re: 请求esp8266 iis dma寄存器描述
Postby ESP_Faye » Fri Sep 25, 2015 6:44 pm
您好,
1、采样率以及位时钟,是用什么公式计算?
-> SCK 的频率 = 2 × 采样频率 × 采样位数
对于 2 声道 24-bit 数据 32K 采样率,时钟的频率是 32k*2*24 = 1.53MHz
不分频的时钟是 160M,分频一个是 26 一个是 8,1.53 = 160*2/26/8。
2、I2SCONF第12~15Bit 分别表示的含义?
12 ~ 15bit 的值 a (a的值为 0 到 8),设置以后,代表我们的 I2S 传输 (16+a)-bit 的数据。
1、采样率以及位时钟,是用什么公式计算?
-> SCK 的频率 = 2 × 采样频率 × 采样位数
对于 2 声道 24-bit 数据 32K 采样率,时钟的频率是 32k*2*24 = 1.53MHz
不分频的时钟是 160M,分频一个是 26 一个是 8,1.53 = 160*2/26/8。
2、I2SCONF第12~15Bit 分别表示的含义?
12 ~ 15bit 的值 a (a的值为 0 到 8),设置以后,代表我们的 I2S 传输 (16+a)-bit 的数据。
Who is online
Users browsing this forum: No registered users and 27 guests
Login
Newbies Start Here
Are you new to ESP8266?
Unsure what to do?
Dunno where to start?
Start right here!
Latest SDK
Documentation
Complete listing of the official ESP8266 related documentation release by ESPRESSIF!
Must read here!
- All times are UTC+08:00
- Top
- Delete all board cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. We are the manufacturer of ESP8266EX.