Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
rt-thread
提交
94746d8e
R
rt-thread
项目概览
BaiXuePrincess
/
rt-thread
与 Fork 源项目一致
Fork自
RT-Thread / rt-thread
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
rt-thread
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
94746d8e
编写于
8月 16, 2017
作者:
Y
yygg_you
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
audio驱动使用系统内的dataqueue,修复一些缩进,乱码
上级
05496a5c
变更
2
展开全部
显示空白变更内容
内联
并排
Showing
2 changed file
with
484 addition
and
785 deletion
+484
-785
components/drivers/audio/audio.c
components/drivers/audio/audio.c
+349
-655
components/drivers/include/drivers/audio.h
components/drivers/include/drivers/audio.h
+135
-130
未找到文件。
components/drivers/audio/audio.c
浏览文件 @
94746d8e
此差异已折叠。
点击以展开。
components/drivers/include/drivers/audio.h
浏览文件 @
94746d8e
/*
* File : audio.h
* This file is part of RT-Thread RTOS
* COPYRIGHT (C) 2006 - 2017, RT-Thread Development Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Change Logs:
* Date Author Notes
* 2017-05-09 Urey first version
*/
#ifndef __AUDIO_H__
#define __AUDIO_H__
//#define AUDIO_DEVICE_USE_PRIVATE_BUFFER
/* AUDIO command */
#define _AUDIO_CTL(a) (0x10 + a)
...
...
@@ -93,6 +114,10 @@
#define CFG_AUDIO_REPLAY_QUEUE_COUNT 4
#define CFG_AUDIO_RECORD_PIPE_SIZE (8 * 1024)
#define AUDIO_DEVICE_MP_CNT (4)
#define AUDIO_DEVICE_DECODE_MP_BLOCK_SZ (4352 * 4)
#define AUDIO_DEVICE_DECODE_MP_SZ ((AUDIO_DEVICE_DECODE_MP_BLOCK_SZ*2 + 4)*AUDIO_DEVICE_MP_CNT)
enum
{
...
...
@@ -117,23 +142,6 @@ struct rt_audio_frame
{
const
void
*
data_ptr
;
rt_size_t
data_size
;
rt_size_t
data_ofs
;
};
struct
rt_audio_queue
{
rt_uint16_t
count
;
rt_uint16_t
size
;
rt_uint16_t
lwm
;
rt_bool_t
waiting_lwm
;
rt_uint16_t
get_index
;
rt_uint16_t
put_index
;
struct
rt_audio_frame
*
queue
;
rt_list_t
suspended_push_list
;
rt_list_t
suspended_pop_list
;
};
struct
rt_audio_device
;
...
...
@@ -156,10 +164,6 @@ struct rt_audio_ops
//get page size of codec or private buffer's info
void
(
*
buffer_info
)
(
struct
rt_audio_device
*
audio
,
struct
rt_audio_buf_info
*
info
);
#ifdef AUDIO_DEVICE_USE_PRIVATE_BUFFER
rt_err_t
(
*
buffer_alloc
)
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
**
data_ptr
,
rt_size_t
*
size
);
void
(
*
buffer_free
)
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
data_ptr
);
#endif
};
...
...
@@ -188,7 +192,7 @@ struct rt_audio_caps
struct
rt_audio_replay
{
rt_bool_t
activated
;
struct
rt_
audio_queue
queue
;
struct
rt_
data_queue
queue
;
};
struct
rt_audio_record
...
...
@@ -202,14 +206,16 @@ struct rt_audio_device
struct
rt_device
parent
;
struct
rt_audio_ops
*
ops
;
struct
rt_mempool
mp
;
struct
rt_audio_replay
*
replay
;
struct
rt_audio_record
*
record
;
};
rt_err_t
rt_audio_register
(
struct
rt_audio_device
*
audio
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
);
void
rt_audio_tx_complete
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
pbuf
);
void
rt_audio_rx_done
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
pbuf
,
rt_size_t
len
);
rt_uint32_t
rt_audio_format_to_bits
(
rt_uint32_t
format
);
rt_err_t
rt_audio_register
(
struct
rt_audio_device
*
audio
,
const
char
*
name
,
rt_uint32_t
flag
,
void
*
data
);
void
rt_audio_tx_complete
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
pbuf
);
void
rt_audio_rx_done
(
struct
rt_audio_device
*
audio
,
rt_uint8_t
*
pbuf
,
rt_size_t
len
);
rt_uint32_t
rt_audio_format_to_bits
(
rt_uint32_t
format
);
/* Device Control Commands */
...
...
@@ -219,7 +225,6 @@ rt_uint32_t rt_audio_format_to_bits(rt_uint32_t format);
#define CODEC_CMD_SAMPLERATE 3
#define CODEC_CMD_EQ 4
#define CODEC_CMD_3D 5
#define CODEC_CMD_SWITCH 6
#define CODEC_VOLUME_MAX (63)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录