I use this code to set IIS clock in arduino,got ret=0 (ESP_OK)but no clock signal,and i can get clock signal in linux
int32_t ret;
ret = i2s_set_clk(I2S_NUM_0, 44100 , (i2s_bits_per_sample_t)16 , (i2s_channel_t)2);
printf("set clock=%d \n",ret);
Arduino SDK can not set IIs clock
-
- Posts: 9708
- Joined: Thu Nov 26, 2015 4:08 am
Re: Arduino SDK can not set IIs clock
Have you actually enabled I2S and set the clock output to a GPIO?
Re: Arduino SDK can not set IIs clock
I set it as the example
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER ,
.sample_rate = SAMPLE_RATE,
.bits_per_sample = BITS_PER_SAMPLE,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1
};
i2s_config.dma_buf_count = 5;
i2s_config.dma_buf_len = 100;
i2s_pin_config_t pin_config = {
.bck_io_num =5,
.ws_io_num =17,
.data_out_num =0,
.data_in_num =36
};
printf("pin_config.bck_io_num=%d \n",pin_config.bck_io_num);
i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
i2s_set_pin(I2S_NUM_0, &pin_config);
int32_t ret;
ret = i2s_set_clk(I2S_NUM_0, 44100 , (i2s_bits_per_sample_t)16 , (i2s_channel_t)2);
printf("set clock=%d \n",ret);
ret=0(ESP_OK) but i dont get clock signal at GPIO 5 and 17
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER ,
.sample_rate = SAMPLE_RATE,
.bits_per_sample = BITS_PER_SAMPLE,
.channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1
};
i2s_config.dma_buf_count = 5;
i2s_config.dma_buf_len = 100;
i2s_pin_config_t pin_config = {
.bck_io_num =5,
.ws_io_num =17,
.data_out_num =0,
.data_in_num =36
};
printf("pin_config.bck_io_num=%d \n",pin_config.bck_io_num);
i2s_driver_install(I2S_NUM_0, &i2s_config, 0, NULL);
i2s_set_pin(I2S_NUM_0, &pin_config);
int32_t ret;
ret = i2s_set_clk(I2S_NUM_0, 44100 , (i2s_bits_per_sample_t)16 , (i2s_channel_t)2);
printf("set clock=%d \n",ret);
ret=0(ESP_OK) but i dont get clock signal at GPIO 5 and 17
Re: Arduino SDK can not set IIs clock
ESP_Sprite wrote:Have you actually enabled I2S and set the clock output to a GPIO?
my code can work in LINUX but no clock in Arduio
Who is online
Users browsing this forum: Bing [Bot], Google Adsense [Bot] and 71 guests