components/driver/i2s.c
/**
 * @brief   Initialize I2S DMA object
 *
 * @param   i2s_num     I2S device number
 * @return
 *      - ESP_OK            DMA object initialize success
 *      - ESP_ERR_NO_MEM    No memory for DMA object
 */
@brief   Initialize I2S DMA object
@param   i2s_num     I2S device number
@return
- ESP_OK            DMA object initialize success
- ESP_ERR_NO_MEM    No memory for DMA object
@brief Initialize I2S DMA object @param i2s_num I2S device number @return - ESP_OK DMA object initialize success - ESP_ERR_NO_MEM No memory for DMA object
static esp_err_t i2s_dma_object_init(i2s_port_t i2s_num)
{
    uint32_t buf_size = i2s_get_buf_size(i2s_num);
    if (p_i2s[i2s_num]->hal_cfg.mode & I2S_MODE_TX) {
        ESP_RETURN_ON_ERROR(i2s_create_dma_object(i2s_num, &p_i2s[i2s_num]->tx), TAG, "I2S TX DMA object create failed");
        p_i2s[i2s_num]->tx->buf_size = buf_size;
    }
    if (p_i2s[i2s_num]->hal_cfg.mode & I2S_MODE_RX) {
        ESP_RETURN_ON_ERROR(i2s_create_dma_object(i2s_num, &p_i2s[i2s_num]->rx), TAG, "I2S RX DMA object create failed");
        p_i2s[i2s_num]->rx->buf_size = buf_size;
    }
    return ESP_OK;
}
static esp_err_t i2s_dma_object_init ( i2s_port_t i2s_num ) { uint32_t buf_size = i2s_get_buf_size ( i2s_num ) ; if ( p_i2s [ i2s_num ] -> hal_cfg . mode & I2S_MODE_TX ) { ESP_RETURN_ON_ERROR ( i2s_create_dma_object ( i2s_num , & p_i2s [ i2s_num ] -> tx ) , TAG , " " ) ; p_i2s [ i2s_num ] -> tx -> buf_size = buf_size ; } if ( p_i2s [ i2s_num ] -> hal_cfg . mode & I2S_MODE_RX ) { ESP_RETURN_ON_ERROR ( i2s_create_dma_object ( i2s_num , & p_i2s [ i2s_num ] -> rx ) , TAG , " " ) ; p_i2s [ i2s_num ] -> rx -> buf_size = buf_size ; } return ESP_OK ; }
@brief   Initialize I2S DMA object
 @param   i2s_num     I2S device number
 @return
      - ESP_OK            DMA object initialize success
      - ESP_ERR_NO_MEM    No memory for DMA object
@brief Initialize I2S DMA object @param i2s_num I2S device number @return - ESP_OK DMA object initialize success - ESP_ERR_NO_MEM No memory for DMA object
/* Create DMA object */