资源简介
支持4路矩阵mic,有可并联两个ac108实现8路矩阵mic
代码片段和文件信息
/*
* ac108.c -- ac108 ALSA Soc Audio driver
*
* Version: 3.0
*
* Author: panjunwen
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “ac108.h“
#define AC108_DEBUG_EN 1
#if AC108_DEBUG_EN
#define AC108_DEBUG(...) printk(__VA_ARGS__)
#else
#define AC108_DEBUG(...)
#endif
#define USE_CONFIG 1
#if USE_CONFIG
static int power_gpio1 = 0;
static int power_gpio2 = 0;
static int ac108_rst_gpio = 0;
#else
#define AC108_POWER_GPIO1 GPIOE(0)
#define AC108_POWER_GPIO2 GPIOL(11)
#define AC108_RST_GPIO GPIOE(1)
#endif
//test config
#define AC108_DAPM_TEST_EN 1
#define AC108_CODEC_RW_TEST_EN 0
#define AC108_ADC_PATTERN_SEL ADC_PTN_NORMAL //0:ADC normal 1:0x5A5A5A 2:0x123456 3:0x000000 4~7:I2S_RX_DATA other:reserved
//AC108 config
#define AC108_CHANNELS_MAX 4 //range[1 16]
#define AC108_SLOT_WIDTH 32 //16bit or 32bit slot width other value will be reserved
#define AC108_ENCODING_EN 1 //TX Encoding mode enable
#define AC108_ENCODING_CH_NUMS 4 //TX Encoding channel numbers must be dual range[1 16]
#define AC108_PGA_GAIN ADC_PGA_GAIN_5dB //0dB~30dB and -6dB except 1~2dB
#define AC108_LRCK_PERIOD ((AC108_SLOT_WIDTH*(AC108_ENCODING_EN ? 2 : AC108_CHANNELS_MAX))/2) //range[1 1024] default PCM mode I2S/LJ/RJ mode shall divide by 2
#define AC108_SDO2_EN 0 //AC108 SDO2/TX2 Enable (SDO1 has be enabled default)
#define AC108_DMIC_EN 0 //0:ADC 1:DMIC
#define AC108_IDLE_RESET_EN 0 //reset AC108 when in idle time
#define AC108_POWERON_RESET_EN 1 //AC108 poweron soft reset enable
#define AC108_MATCH_DTS_EN 0 //AC108 match method select: 0: i2c_detect 1:devices tree
#define AC108_REGULATOR_NAME “voltage_enable“
#define AC108_RATES (SNDRV_PCM_RATE_8000_96000 | SNDRV_PCM_RATE_KNOT)
#define AC108_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE | SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE)
struct i2c_client *i2c_clt[(AC108_CHANNELS_MAX+3)/4];
int regulator_en;
struct voltage_supply {
struct regulator *vcc3v3;
};
struct ac108_priv {
struct i2c_client *i2c;
struct snd_soc_codec *codec;
struct voltage_supply vol_supply;
};
static const struct regmap_config ac108_regmap_config
- 上一篇:共享内存 读写
- 下一篇:ROS操作系统入门讲义
相关资源
- 共享内存 读写
- 简易web服务器的设计与实现
- 《LINUX C编程从初学到精通》光盘源码
- STM32 LIN通信数据发送实现 测试通过
- Linux那些事儿之我是USB core
- Linux c语言 学生成绩管理系统
- Linux开发工具手册
- Linux操作系统下C语言编程从零开始
- 基于Linux下C语言开发的员工管理系统
- 超级玛丽c++源码win32Linux平台
- UNIX/LINUX下C语言中文短信UCS2编码和解
- online judge在线判题系统源代码
- 嵌入式工程师必知必会 (完整高清中
- linux-2.6.24.rar
- Linux下C语言操作静态ARP表,包括增加
- c语言 linux 贪吃蛇.doc
- Linux多线程服务端编程:使用muduo C+
- Spline曲线(穿过控制点CC++版本)
- libstdc++.so.6.0.23_linux7
- libstdc++-devel-4.1.2-48.el5.x86_64
-
minibl
ink c++ qt 浏览器 - C++版仿Linux文件管理系统
- 基于SDL的贪吃蛇游戏
- php-cpp项目移值到windows的vs2017解决方案
- 链表栈的基本操作(C语言
- 基于linux C/C++和Qt的聊天程序
-
simuli
nk仿真模型到C语言的转化 - Linux+gladeGTK++C语言+mysql的模仿QQ聊天工
- 嵌入式linuxC语言程序设计基础教程
- C Programming in Linux Linux下C语言
评论
共有 条评论