⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 microphone.c

📁 蓝牙耳机软件源代码
💻 C
字号:
#include "demohs.h"
#include "hal.h"

#include <message.h>
#include <framework.h>


/*
    sendMicGainReq

    Send a message requesting the lib to send a microphone gain
    AT request.
*/

static void sendMicGainReq(int8 increment, uint8 gain)
{
    MAKE_MSG(HS_MIC_REQ);
    msg->increment = increment;
    msg->gain = gain;
    putMsg(msg);
}


/*
   sendInitialMicGain

   Sends the initial mic gain of the headset on connection
   establishment.  See demohs.h for default values.
*/
void sendInitialMicGain(void)
{
    sendMicGainReq(VG_ZERO_INCREMENT, VG_ZERO_GAIN);
}


/*
    onMicGainUp

    Request to increment the current gain value.
*/
void onMicGainUp(void)
{
    sendMicGainReq(VG_VOLUME_UP, VG_ZERO_GAIN);
}


/*
    onMicGainDown
  
    Request to decrement the current mic gain value.
*/
void onMicGainDown(void)
{
    sendMicGainReq(VG_VOLUME_DOWN, VG_ZERO_GAIN);
}


/*
    microphoneGainInd

    Called by the headsetframework whenever a VGM is received.  This
    may be as a result of us sending a HS_MIC_REQ from the app.    
*/
void microphoneGainInd(const HS_MIC_IND_T * ind)
{
    HALsetMicrophone(ind->gain);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -