代码拉取完成,页面将自动刷新
/*
* Copyright (c) 2020 Huawei Device Co., 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.
*/
/**
* @addtogroup wifiiot
* @{
*
* @brief Provides dedicated device operation interfaces on the Wi-Fi module,
* including ADC, AT, flash, GPIO, I2C, I2S, partition, PWM, SDIO, UART, and watchdog.
*
*
*
* @since 1.0
* @version 1.0
*/
/**
* @file wifiiot_i2s.h
*
* @brief Declares the I2S interface functions.
*
* These functions are used for I2S initialization and data transmission. \n
*
* @since 1.0
* @version 1.0
*/
#ifndef WIFIIOT_I2S_H
#define WIFIIOT_I2S_H
/**
* @brief Enumerates I2S sampling rates.
*/
typedef enum {
/** 8K sampling rate */
WIFI_IOT_I2S_SAMPLE_RATE_8K = 8,
/** 16K sampling rate */
WIFI_IOT_I2S_SAMPLE_RATE_16K = 16,
/** 32K sampling rate */
WIFI_IOT_I2S_SAMPLE_RATE_32K = 32,
/** 48K sampling rate */
WIFI_IOT_I2S_SAMPLE_RATE_48K = 48,
} WifiIotI2sSampleRate;
/**
* @brief Enumerates I2S resolution.
*/
typedef enum {
/** 16-bit resolution */
WIFI_IOT_I2S_RESOLUTION_16BIT = 16,
/** 24-bit resolution */
WIFI_IOT_I2S_RESOLUTION_24BIT = 24,
} WifiIotI2sResolution;
/**
* @brief Defines I2S attributes.
*/
typedef struct {
/** Sampling rate */
WifiIotI2sSampleRate sampleRate;
/** Resolution */
WifiIotI2sResolution resolution;
} WifiIotI2sAttribute;
/**
* @brief Initializes the I2S device.
*
*
*
* @param i2sAttribute Indicates the pointer to the I2S configuration parameter.
* @return Returns {@link WIFI_IOT_SUCCESS} if the operation is successful;
* returns an error code defined in {@link wifiiot_errno.h} otherwise.
* @since 1.0
* @version 1.0
*/
unsigned int I2sInit(const WifiIotI2sAttribute *i2sAttribute);
/**
* @brief Deinitializes the I2S device.
*
* @return Returns {@link WIFI_IOT_SUCCESS} if the operation is successful;
* returns an error code defined in {@link wifiiot_errno.h} otherwise.
* @since 1.0
* @version 1.0
*/
unsigned int I2sDeinit(void);
/**
* @brief Writes data to the I2S device.
*
* This function writes data with the length specified by <b>wrLen</b> to
* an I2S device within the duration specified by <b>timeOutMs</b>.
*
* @param wrData Indicates the pointer to the data to write.
* @param wrLen Indicates the length of the data to write.
* @param timeOutMs Indicates the timeout interval.
* @return Returns {@link WIFI_IOT_SUCCESS} if the operation is successful;
* returns an error code defined in {@link wifiiot_errno.h} otherwise.
* @since 1.0
* @version 1.0
*/
unsigned int I2sWrite(unsigned char *wrData, unsigned int wrLen, unsigned int timeOutMs);
/**
* @brief Reads data from the I2S device.
*
* This function reads data with the length specified by <b>rdLen</b>
* from an I2S device within the duration specified by <b>timeOutMs</b>.
*
* @param rdData Indicates the pointer to the data to read.
* @param rdLen Indicates the length of the data to read.
* @param timeOutMs Indicates the timeout interval.
* @return Returns {@link WIFI_IOT_SUCCESS} if the operation is successful;
* returns an error code defined in {@link wifiiot_errno.h} otherwise.
* @since 1.0
* @version 1.0
*/
unsigned int I2sRead(unsigned char *rdData, unsigned int rdLen, unsigned int timeOutMs);
#endif
/** @} */
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。