13#ifndef __DEV_AUDIO_H__
14#define __DEV_AUDIO_H__
16#include "dev_audio_pipe.h"
19#define _AUDIO_CTL(a) (RT_DEVICE_CTRL_BASE(Sound) + a)
21#define AUDIO_CTL_GETCAPS _AUDIO_CTL(1)
22#define AUDIO_CTL_CONFIGURE _AUDIO_CTL(2)
23#define AUDIO_CTL_START _AUDIO_CTL(3)
24#define AUDIO_CTL_STOP _AUDIO_CTL(4)
25#define AUDIO_CTL_GETBUFFERINFO _AUDIO_CTL(5)
28#define AUDIO_TYPE_QUERY 0x00
29#define AUDIO_TYPE_INPUT 0x01
30#define AUDIO_TYPE_OUTPUT 0x02
31#define AUDIO_TYPE_MIXER 0x04
34#define AUDIO_SAMP_RATE_8K 0x0001
35#define AUDIO_SAMP_RATE_11K 0x0002
36#define AUDIO_SAMP_RATE_16K 0x0004
37#define AUDIO_SAMP_RATE_22K 0x0008
38#define AUDIO_SAMP_RATE_32K 0x0010
39#define AUDIO_SAMP_RATE_44K 0x0020
40#define AUDIO_SAMP_RATE_48K 0x0040
41#define AUDIO_SAMP_RATE_96K 0x0080
42#define AUDIO_SAMP_RATE_128K 0x0100
43#define AUDIO_SAMP_RATE_160K 0x0200
44#define AUDIO_SAMP_RATE_172K 0x0400
45#define AUDIO_SAMP_RATE_192K 0x0800
48#define AUDIO_BIT_RATE_22K 0x01
49#define AUDIO_BIT_RATE_44K 0x02
50#define AUDIO_BIT_RATE_48K 0x04
51#define AUDIO_BIT_RATE_96K 0x08
52#define AUDIO_BIT_RATE_128K 0x10
53#define AUDIO_BIT_RATE_160K 0x20
54#define AUDIO_BIT_RATE_172K 0x40
55#define AUDIO_BIT_RATE_192K 0x80
58#define AUDIO_DSP_PARAM 0
59#define AUDIO_DSP_SAMPLERATE 1
60#define AUDIO_DSP_CHANNELS 2
61#define AUDIO_DSP_SAMPLEBITS 3
64#define AUDIO_MIXER_QUERY 0x0000
65#define AUDIO_MIXER_MUTE 0x0001
66#define AUDIO_MIXER_VOLUME 0x0002
67#define AUDIO_MIXER_BASS 0x0004
68#define AUDIO_MIXER_MID 0x0008
69#define AUDIO_MIXER_TREBLE 0x0010
70#define AUDIO_MIXER_EQUALIZER 0x0020
71#define AUDIO_MIXER_LINE 0x0040
72#define AUDIO_MIXER_DIGITAL 0x0080
73#define AUDIO_MIXER_MIC 0x0100
74#define AUDIO_MIXER_VITURAL 0x0200
75#define AUDIO_MIXER_EXTEND 0x8000
77#define AUDIO_VOLUME_MAX (100)
78#define AUDIO_VOLUME_MIN (0)
80#define CFG_AUDIO_REPLAY_QUEUE_COUNT 4
167#define CODEC_CMD_RESET 0
168#define CODEC_CMD_SET_VOLUME 1
169#define CODEC_CMD_GET_VOLUME 2
170#define CODEC_CMD_SAMPLERATE 3
171#define CODEC_CMD_EQ 4
172#define CODEC_CMD_3D 5
174#define CODEC_VOLUME_MAX (63)
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)
void rt_audio_rx_done(struct rt_audio_device *audio, rt_uint8_t *pbuf, rt_size_t len)
unsigned short rt_uint16_t
struct rt_audio_configure config
union rt_audio_caps::@100157007125373205103010077341215021254332336214 udata
struct rt_audio_ops * ops
struct rt_audio_replay * replay
struct rt_audio_record * record
rt_ssize_t(* transmit)(struct rt_audio_device *audio, const void *writeBuf, void *readBuf, rt_size_t size)
rt_err_t(* configure)(struct rt_audio_device *audio, struct rt_audio_caps *caps)
rt_err_t(* stop)(struct rt_audio_device *audio, int stream)
rt_err_t(* init)(struct rt_audio_device *audio)
rt_err_t(* getcaps)(struct rt_audio_device *audio, struct rt_audio_caps *caps)
void(* buffer_info)(struct rt_audio_device *audio, struct rt_audio_buf_info *info)
rt_err_t(* start)(struct rt_audio_device *audio, int stream)
struct rt_audio_pipe pipe
struct rt_audio_buf_info buf_info
struct rt_data_queue queue