1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #include <components/log.h> 18 #include <driver/i2s_types.h> 19 20 #define I2S_TAG "i2s" 21 #define I2S_LOGI(...) BK_LOGI(I2S_TAG, ##__VA_ARGS__) 22 #define I2S_LOGW(...) BK_LOGW(I2S_TAG, ##__VA_ARGS__) 23 #define I2S_LOGE(...) BK_LOGE(I2S_TAG, ##__VA_ARGS__) 24 #define I2S_LOGD(...) BK_LOGD(I2S_TAG, ##__VA_ARGS__) 25 26 /** 27 * @brief clear i2s tx_udf interrupt flag 28 * 29 * This API clear i2s tx_udf interrupt flag 30 * 31 * @param channel_id i2s channel id 32 * 33 * @return 34 * - BK_OK: succeed 35 * - BK_ERR_AUD_NOT_INIT: i2s driver is not init 36 * - others: other errors. 37 */ 38 bk_err_t bk_i2s_clear_txudf_int(i2s_channel_id_t channel_id); 39 40 /** 41 * @brief clear i2s rx_ovf interrupt flag 42 * 43 * This API clear i2s rx_ovf interrupt flag 44 * 45 * @param channel_id i2s channel id 46 * 47 * @return 48 * - BK_OK: succeed 49 * - BK_ERR_AUD_NOT_INIT: i2s driver is not init 50 * - others: other errors. 51 */ 52 bk_err_t bk_i2s_clear_rxovf_int(i2s_channel_id_t channel_id); 53 54 55