📄 at91_audio.h
字号:
/*----------------------------------------------------------
** linux/drivers/at91/at91_audio.h
**
**
** Copyright (C) 2006 Hyesco Technology Co.,Ltd
**
** Author: casiawu <wujh@hyesco.com>
**
** History:
**
** 2006.4 casiawu <wujh@hyesco.com>
** Original version
**---------------------------------------------------------*/
#ifndef __AT91_AUDIO_H_
#define __AT91_AUDIO_H_
#include "at91_pdc.h"
#define OUT_CHAN 0 /* write channel */
#define IN_CHAN 1 /* read channel */
#define FILE_SAMPLING_FREQ 44100 // in Hz
/*
* Buffer Management
*/
typedef struct {
int size; /* buffer size */
char *start; /* points to actual buffer */
dma_addr_t dma_addr; /* physical buffer address */
struct semaphore sem; /* down before touching the buffer */
int master; /* owner for buffer allocation, contain size when true */
struct audio_stream_s *stream; /* owning stream */
} audio_buf_t;
typedef struct audio_stream_s {
audio_buf_t *buffers; /* pointer to audio buffer structures */
audio_buf_t *buf; /* current buffer used by read/write */
u_int buf_idx; /* index for the pointer above... */
u_int fragsize; /* fragment i.e. buffer size */
u_int nbfrags; /* nbr of fragments i.e. buffers */
int active; /* actually in progress */
at91rm9200_dma_t * dma; /* DMA struct pointer */
wait_queue_head_t wq; /* for poll */
} audio_stream_t;
/* DMA channel 0: write ; 1: read */
at91rm9200_dma_t dma_chan[2];
audio_stream_t output_stream, input_stream;
at91rm9200_dma_state_t audio_state ;
#endif // __AT91_AUDIO_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -