亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? autosira_msm7731.c

?? 藍牙HANDFREE軟件源代碼
?? C
字號:
/****************************************************************************
FILE
    autosira_msm7731.c
 
DESCRIPTION
    This module contains a device abstraction for an OKI Semiconductor MSM7731
    dual echo canceler and noise canceller with dual codec for hands free
    applications.  The library is built on top of the SPI library.

    The MSM 7731 is an IC device developed for portable, handfree
    communication with built-in echo canceler, acoustic echo canceler,
    and transmission signal noise canceler.  Built-in to the voice
    signal interface is a linear CODEC for the analog interface on the
    acoustic-side and a linear CODEC for the analog interface on the
    line-side.  On the line-side, in addition to the analog interface,
    there is also a U-law PCM/16-bit linear digital interface.
    Equipped with gain and mute controls for data transmission and
    reception, a u-law PCM/16-bit linear digital interface for memo
    recording and message output, and transfer clock and sync clock
    generators for digital communication, the device is ideally suited
    for handsfree systems.
 
MODIFICATION HISTORY
    1.1     11:Nov:02   jm01    Created.
    1.2     26:Nov:02   am01    Modified.
*/

#include "spi.h"
#include "autosira_msm7731.h"

#include <ccltypes.h>
#include <pio.h>
#include <ps.h>
#include <stdlib.h>

/****************************************************************************
NAME
    Msm7731Init
 
FUNCTION
    This function is called by the client at Reset to configure the
    device for operation.  The underlying SPI transport is initialised
    and any device specific initialisation

RETURNS
    void
*/

void Msm7731Init(void)
{
    /* Initialise the SPI transport Library */  
    SpiInit();

    /* Update the PS keys on BlueCore */
    PsUpdate();

    /* Toggtle the PDN/RST low and then high again */
    MsmPdnRst();

    /* Update all registers of the MSM */
    MsmUpdate();
//      MSMGainInit();

    /* Once updated set CR0 B0 & B1 to 1 */
    MsmAudio();
}


/****************************************************************************
NAME
    Msm7731Write
 
FUNCTION
    This function is called by the client to write to one of the
    devices internal registers.  See pages 26 to 39 of the datasheet
    for a full description

        CR0 -   Basic operating mode setting
        CR1 -   
        CR2 -   Receive side level control
        CR3 -   Transmit gain adjustment
        CR4 -   Line echo canceler strings
        CR5     -       Acoustic echo canceler setting
        CR6 -   Internal data memory write register
        CR7 -   Internal data memory write register
        CR8 -   Internal data memory write register
        CR9 -   Internal data memory write register
        CR10-   Echo canceler I/O level setting
        CR11-   SYNC power-down control register
        CR12-   Reserved register

    The control regsiter to write to is defined by reg and the data to
    be written supplied by data.  This function performs a write
    followed by read to verify the write cycle.  In the event that a
    write operation fails then FALSE is returned to indicate to the
    Client that the operation was unsuccessful
        
RETURNS
    TRUE or FALSE
*/

uint16 Msm7731Write(MSM7731_REG reg, uint8 data)
{
    uint8       cr[2];

    /* Assume successful write operation */
    uint16      success = TRUE;

    /* Ensure that control register address is valid (Within range) */
    cr[0] = reg & MSM7731_REG_MASK;
        
    /* Write data to control register */
    cr[1] = data;
    SpiWrite(cr,2);

    return success;
}


/****************************************************************************
NAME
    Msm7731Read
 
FUNCTION
    This function is called by the client to read one of the devices
    internal registers.  See pages 26 to 39 of the datasheet for a
    full description

        CR0 -   Basic operating mode setting
        CR1 -   
        CR2 -   Receive side level control
        CR3 -   Transmit gain adjustment
        CR4 -   Line echo canceler strings
        CR5     -       Acoustic echo canceler setting
        CR6 -   Internal data memory write register
        CR7 -   Internal data memory write register
        CR8 -   Internal data memory write register
        CR9 -   Internal data memory write register
        CR10-   Echo canceler I/O level setting
        CR11-   SYNC power-down control register
        CR12-   Reserved register

    The control regsiter to read is defined by reg 
        
RETURNS
    The contents of the control register
*/

uint8 Msm7731Read(MSM7731_REG reg)
{
    uint8       cr;
    uint8       data;

    /* Ensure that control register address is valid (Within range) */
    cr = reg & MSM7731_REG_MASK;
        
    /* Set the MS bit of the control register address to indicate a write operation */
    cr |= MSM7731_READ;

    /* Read data from control register */
    SpiCommandRead(cr,&data,1);

    return data;
}

/****************************************************************************
NAME
    PsUpdate
 
FUNCTION
    This function is called to update the PS values on BlueCore with default values is empty.

RETURNS
    void
*/

void PsUpdate(void)
{
    uint16 i;
    uint16 zeroBuf;

    /* Check if PS is blank, if so load default value */
    for (i=0; i<13; i++)
    {   
        if (PsRetrieve(PS_CR0+i,&zeroBuf,1)==0)
        {
            zeroBuf = msmDefaultValues[i];
            PsStore(PS_CR0+i,&zeroBuf,1);
        }
                
        PioSetDir(PWNRST, ~0);
        PioSet(PWNRST, 0);
    }
}


/****************************************************************************
NAME
    Msm7731ReadReady
 
FUNCTION
    This function is called to read the ready bit from the MSM.

RETURNS
    void
*/

uint8 Msm7731ReadReady(void)
{
    /* Check if MSM is ready or not */
    uint16 state;

    if ((Msm7731Read(CR11) & (MSM7731_READY))==MSM7731_READY)
        state = 1;
    else
        state = 0;

    return state;
}


/****************************************************************************
NAME
    MsmUpdate
 
FUNCTION
    This function is called to write PS values on BlueCore to the MSM device.

RETURNS
    void
*/

void MsmUpdate(void)
{
        
    uint16 i;
    uint16      zeroBuf;

    /* Load default values into MSM */
    for (i=0; i<13; i++) 
    {
        PsRetrieve(PS_CR0+i,&zeroBuf,1);
        while(Msm7731ReadReady()== 0);
        Msm7731Write(CR0+i, zeroBuf);
    }
}


void MsmAudio(void)
{
    uint16      zeroBuf;
    PsRetrieve(PS_CR0,&zeroBuf,1);

    /* set CR0 B0 & B1 to 1 */
    Msm7731Write(CR0, zeroBuf|0x03);
}


/* Initialise the Power Down Reset pin to high, then toggle low and then high again*/
void MsmPdnRst (void)
{
    PioSet(PWNRST, 0);
    PioSet(PWNRST, ~0);
}


/*Write a delay time of 32ms into MSM memory register*/
void MsmWriteDelay (void)
{
    uint16 data;
        
    while (Msm7731ReadReady()==0);
    Msm7731Write(CR6, 0x00);
    Msm7731Write(CR7, 0x9b);
    PsRetrieve(PS_CR8,&data,1);
    Msm7731Write(CR8, data);
    PsRetrieve(PS_CR9,&data,1);
    Msm7731Write(CR9, data);
    data=Msm7731Read(CR1);
    Msm7731Write(CR1, (MSM7731_INTWRITE | data));
    data=Msm7731Read(CR1);
    while (Msm7731Read((CR1)&(0x80))==1);
}


void setMSMGain(uint16 gain)
{
    Msm7731Write(CR2,msmGain[gain]);
}

void MSMGainInit(void)
{
    uint16 gainBuf;
    PsRetrieve(PS_CR13,&gainBuf,1);
    Msm7731Write(CR2,msmGain[gainBuf]);
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久久99精品免费观看不卡| 精品久久久网站| 国产乱码精品一区二区三区av | 国产白丝网站精品污在线入口| 热久久久久久久| 日本不卡视频一二三区| 麻豆精品新av中文字幕| 精品一区二区三区在线播放视频| 人人超碰91尤物精品国产| 久久精品国产亚洲高清剧情介绍| 久久疯狂做爰流白浆xx| 国产福利一区二区三区视频在线| 处破女av一区二区| 99视频精品全部免费在线| 色婷婷综合久久| 欧美日韩在线播放三区| 这里只有精品电影| 精品伦理精品一区| 国产精品女主播在线观看| 国产精品伦一区二区三级视频| 日韩久久一区二区| 首页国产欧美久久| 国产乱国产乱300精品| 91亚洲午夜精品久久久久久| 欧美日韩在线一区二区| 亚洲精品一线二线三线| 亚洲日本电影在线| 久草中文综合在线| 国产精品自拍三区| 色综合网站在线| 欧美一区二区三区思思人| 欧美韩国一区二区| 香蕉成人啪国产精品视频综合网| 精品一区二区久久久| 91麻豆文化传媒在线观看| 91精品国产综合久久久蜜臀粉嫩 | 日本一二三四高清不卡| 亚洲综合免费观看高清完整版在线| 日本成人在线视频网站| 国产成人综合亚洲91猫咪| 欧美日韩久久久一区| 久久久美女艺术照精彩视频福利播放| 国产精品高潮呻吟久久| 免播放器亚洲一区| 在线亚洲免费视频| 国产精品免费视频网站| 免费人成在线不卡| 在线影院国内精品| 国产精品成人在线观看| 国产麻豆精品95视频| 欧美高清dvd| 亚洲日穴在线视频| 不卡欧美aaaaa| 久久人人97超碰com| 日本成人在线看| 欧美在线观看一二区| 国产精品狼人久久影院观看方式| 久久精品噜噜噜成人av农村| 欧美精选午夜久久久乱码6080| 中文字幕一区视频| 懂色av中文一区二区三区| 精品国免费一区二区三区| 午夜一区二区三区视频| 91精品福利在线| 亚洲女厕所小便bbb| jiyouzz国产精品久久| 国产视频不卡一区| 国产黑丝在线一区二区三区| 日韩午夜激情电影| 免费在线观看一区二区三区| 日韩一区二区精品在线观看| 日本aⅴ免费视频一区二区三区| 欧美三电影在线| 五月天视频一区| 欧美一区二区三区视频在线观看| 天堂蜜桃一区二区三区 | 国产精品一区二区果冻传媒| 精品日韩在线一区| 国精产品一区一区三区mba桃花| 亚洲精品在线观| 粉嫩aⅴ一区二区三区四区五区| 国产清纯在线一区二区www| 国产黑丝在线一区二区三区| 国产精品免费丝袜| 欧美自拍偷拍午夜视频| 亚洲国产视频一区二区| 91精品国产免费| 国产精选一区二区三区| 中文字幕亚洲欧美在线不卡| 色婷婷av一区二区三区软件| 亚洲成av人影院| 日韩亚洲欧美在线观看| 国产馆精品极品| 亚洲欧美日韩精品久久久久| 在线亚洲一区观看| 免费精品视频最新在线| 久久久久久99久久久精品网站| 成人黄色电影在线| 丝袜美腿亚洲一区二区图片| 久久综合久久99| 日本高清不卡一区| 精品一区二区三区免费播放| 中文字幕第一页久久| 欧美日韩中文字幕一区| 久久99九九99精品| 亚洲欧美日韩国产综合| 欧美一区永久视频免费观看| 国产成人精品亚洲日本在线桃色 | 亚洲成人精品一区| 亚洲精品一区二区三区在线观看| 99re视频这里只有精品| 日韩高清不卡一区| 亚洲人妖av一区二区| 欧美成人伊人久久综合网| 99精品桃花视频在线观看| 日本vs亚洲vs韩国一区三区二区 | 丝袜a∨在线一区二区三区不卡| 久久久久久久久久久久久夜| 91国在线观看| 成人免费va视频| 韩国精品在线观看| 天天射综合影视| 亚洲日本va午夜在线影院| 久久久久久一级片| 3d动漫精品啪啪1区2区免费 | 日韩一区二区三区av| 一本在线高清不卡dvd| 久久爱www久久做| 亚洲与欧洲av电影| 亚洲精选视频在线| 欧美激情一区二区三区蜜桃视频| 欧美一级免费观看| 欧美亚洲综合在线| 99re8在线精品视频免费播放| 国产精品资源站在线| 老鸭窝一区二区久久精品| 亚洲午夜精品在线| 一色桃子久久精品亚洲| 亚洲精品一区二区三区在线观看| 欧美日韩大陆在线| 欧美日韩中文另类| 欧美性做爰猛烈叫床潮| 日本高清不卡一区| 欧美性色黄大片| 91福利精品视频| 在线观看视频一区| 91成人免费在线| 在线国产电影不卡| 欧美日韩一级片在线观看| 在线观看三级视频欧美| 在线视频中文字幕一区二区| 日本乱码高清不卡字幕| 色综合视频一区二区三区高清| 本田岬高潮一区二区三区| 不卡一区二区三区四区| 99久久国产综合精品麻豆| 色网站国产精品| 欧美色国产精品| 欧美一区二区视频免费观看| 日韩一级二级三级| 久久夜色精品一区| 国产欧美在线观看一区| 国产欧美日韩久久| 亚洲免费毛片网站| 亚洲国产婷婷综合在线精品| 日本欧美一区二区| 韩国视频一区二区| jizz一区二区| 欧美亚洲日本一区| 欧美不卡一二三| 亚洲欧美综合色| 午夜激情久久久| 国产成人免费视频一区| 一本色道久久综合精品竹菊| 欧美日韩国产系列| 国产日韩亚洲欧美综合| 亚洲一区在线观看免费 | 日韩av高清在线观看| 国产精品12区| 精品视频在线看| 久久一区二区视频| 亚洲精品国产成人久久av盗摄| 五月激情六月综合| 国产精品77777| 欧美日韩在线三级| 日本一区二区在线不卡| 亚洲成人免费在线观看| 国产成人精品免费| 欧美日本在线一区| 国产人久久人人人人爽| 亚州成人在线电影| www.亚洲精品| 欧美成人精精品一区二区频| 亚洲欧洲无码一区二区三区| 午夜不卡在线视频| 91免费小视频| 国产日产欧美一区| 久久国产人妖系列| 欧美美女直播网站| 亚洲另类春色国产|