• 大小: 6.4MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-02
  • 语言: 其他
  • 标签: LD3320  

资源简介

LD3320语音识别芯片的PCB封装图文件,已经芯片的说明文档,实测可用。

资源截图

代码片段和文件信息

#include “ld3320.h“


uint8_t g_Mic;
int RSTB=9;//RSTB引脚定义
int CS=4;//RSTB引脚定义
uint8_t MIC_VOL=0x55;//ADC增益初始值
uint8_t speech_endpoint=0x10;//语音端点检测初始值
uint8_t speech_start_time=0x08;//语音端点检测开始时间初始值
uint8_t speech_end_time=0x10;//语音端点检测结束时间初始值
uint8_t voice_max_length=0xC3;//最长语音段时间,默认20秒
uint8_t noise_time=0x02;//忽略上电噪声时间
//uint8_t ASR_time最长时间
int readflag=0;
int readnum=0;

VoiceRecognition::VoiceRecognition(){}

int VoiceRecognition::read()//识别结果读取
{
if(readflag==1)
{
readflag=0;
return readnum;
}
return -1;
}
void update()//中断服务函数

uint8_t Asr_Count=0;
if((readReg(0x2b) & 0x10) && readReg(0xb2)==0x21 && readReg(0xbf)==0x35)//如果有语音识别中断、DSP闲、ASR正常结束
{
writeReg(0x290) ;///////////关中断
writeReg(0x020) ;/////////////关FIFO中断
Asr_Count = readReg(0xba);//读中断辅助信息
if(Asr_Count>0 && Asr_Count<4) //////如果有识别结果
{
readnum=readReg(0xc5);
readflag=1;
}
writeReg(0x2b0);//////清楚中断编号
writeReg(0x1C0);////////貌似关麦克风啊~~为毛
}
readReg(0x06);  
delay(10);
readReg(0x06);  
writeReg(0x89 0x03);  
delay(5);
writeReg(0xcf 0x43);  
delay(5);
writeReg(0xcb 0x02);
writeReg(0x11 PLL_11);  
writeReg(0x1e0x00);
writeReg(0x19 PLL_ASR_19); 
writeReg(0x1b PLL_ASR_1B);
writeReg(0x1d PLL_ASR_1D);
delay(10);
writeReg(0xcd 0x04);
writeReg(0x17 0x4c); 
delay(5);
writeReg(0xcf 0x4f);  
writeReg(0xbd 0x00);
writeReg(0x17 0x48);
delay(10);
writeReg(0x3c 0x80);  
writeReg(0x3e 0x07);
writeReg(0x38 0xff);  
writeReg(0x3a 0x07);
writeReg(0x40 0);   
writeReg(0x42 8);
writeReg(0x44 0); 
writeReg(0x46 8); 
delay(1);
writeReg(0x1c 0x09);////////麦克风设置保留
writeReg(0xbd 0x20);/////////保留设置
writeReg(0x08 0x01);///////////→清除FIFO_DATA
delay( 1);
writeReg(0x08 0x00);////////////清除指定FIFO后再写入一次00H
delay( 1);
writeReg(0xb2 0xff);////////给0xB2写FF
writeReg(0x37 0x06);////////开始识别
delay( 5 );
writeReg(0x1c g_Mic);////////选择麦克风
writeReg(0x29 0x10);////////开同步中断
writeReg(0xbd 0x00);/////////启动为语音识别
}
void cSHigh() {//CS拉高
  digitalWrite(CS HIGH);
}
void cSLow() {//CS脚拉低
  digitalWrite(CS LOW);
}
void writeReg(unsigned char addressunsigned char value)////////写寄存器,参数(寄存器地址,数据)
{
cSLow();////拉低CS
delay(10);
transfer(0x04);////////////写指令
transfer(address);
transfer(value);
cSHigh();////拉高CS
 }

unsigned char readReg(unsigned char address)///读寄存器,参数(寄存器地址)

unsigned char result;
cSLow();////拉低CS
delay(10);
transfer(0x05);///////////读指令
transfer(address);
result=transfer(0x00);
cSHigh();///拉高CS
return(result);
 }
byte transfer(byte _data) /////////////////SPI数据交换
{
SPDR = _data;
while (!(SPSR & _BV(SPIF)));
return SPDR;
}

void VoiceRecognition::init(uint8_t mic)////////模块启用,参数为麦克风选择(MIC/MONO)与丝印对照在SETUP中调用
{
if(mic==MIC)
{
g_Mic=MIC;
}
else if(mic==MONO)
{
g_Mic=MONO;
}
pinMode(RSTBOUTPUT);
pinMode(CS OUTPUT);
cSHigh();

pinMode(SPI_MISO_PIN INPUT);
pinMode(SPI_MOSI_PIN OUTPUT);
pinMode(SPI_SCK_PIN OUTPUT);

#ifndef SOFTWARE_SPI
  // SS must be in outp

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       8192  2010-12-21 10:22  Ld3320语音识别芯片LD3320\Cadence\LD3320.OBK

     文件       8192  2010-12-21 11:18  Ld3320语音识别芯片LD3320\Cadence\LD3320.OLB

     文件       1010  2010-12-21 11:18  Ld3320语音识别芯片LD3320\Cadence\ld3320.opj

     文件     116832  2010-04-03 19:24  Ld3320语音识别芯片LD3320\Cadence\QFN48.dra

     文件         58  2010-04-03 19:24  Ld3320语音识别芯片LD3320\Cadence\qfn48.log

     文件        100  2010-04-03 19:21  Ld3320语音识别芯片LD3320\Cadence\qfn48.log1

     文件        100  2010-04-03 19:22  Ld3320语音识别芯片LD3320\Cadence\qfn48.log2

     文件         58  2010-04-03 19:23  Ld3320语音识别芯片LD3320\Cadence\qfn48.log3

     文件      34092  2010-04-03 19:24  Ld3320语音识别芯片LD3320\Cadence\qfn48.psm

     文件     247660  2017-05-14 16:46  Ld3320语音识别芯片LD3320\LD3320\LD3320-advanced.pdf

     文件     122476  2017-04-11 15:48  Ld3320语音识别芯片LD3320\LD3320\LD3320-APP.pdf

     文件       7752  2015-04-28 09:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\Arduino\ld3320\ld3320.cpp

     文件       2156  2015-04-28 09:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\Arduino\ld3320\ld3320.h

     文件      12249  2014-08-18 17:16  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\Arduino\ld3320\PinMap.h

     文件       1569  2016-07-22 17:18  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\Arduino\VoiceLED.ino

     文件        399  2011-05-09 18:17  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\keilkill.bat

     文件      17273  2010-06-07 10:25  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\core_cm3.c

     文件      85714  2011-02-09 14:59  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\core_cm3.h

     文件      15766  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_cl.s

     文件      15503  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_hd.s

     文件      15692  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_hd_vl.s

     文件      12376  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_ld.s

     文件      13656  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_ld_vl.s

     文件      12765  2011-03-10 10:52  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_md.s

     文件      14073  2011-03-10 10:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_md_vl.s

     文件      15955  2011-03-10 10:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\startup\startup_stm32f10x_xl.s

     文件     633941  2011-03-10 10:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\stm32f10x.h

     文件      36557  2011-03-10 10:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\system_stm32f10x.c

     文件       2085  2011-03-10 10:51  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\CMSIS\system_stm32f10x.h

     文件       8982  2011-03-10 10:47  Ld3320语音识别芯片LD3320\LD3320\LD3320-Board-Code\LD3320-Board-Code\STM32\Open103Z\Libraries\FWlib\inc\misc.h

............此处省略206个文件信息

评论

共有 条评论