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

📄 headset_private.h

📁 此软件为BlueLab 3.6.2 平台所自带的蓝牙耳机源码
💻 H
字号:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2006
Part of BlueLab 3.6.2-release

FILE NAME
    headset_private.h
    
DESCRIPTION
    
*/

#ifndef _HEADSET_PRIVATE_H_
#define _HEADSET_PRIVATE_H_

#include <connection.h>
#include <hfp.h>
#include <message.h>
#include <app/message/system_message.h>
#include <stdio.h>

#include "headset_buttonmanager.h"
    /*needed for the LED manager task definition*/
#include "headset_leddata.h"
/*#include "headset_soundmanager.h"*/

#include "headset_powermanager.h"

#include "headset_debug.h"


/* COD definitions */
#define AUDIO_MAJOR_SERV_CLASS  0x200000
#define AV_MAJOR_DEVICE_CLASS   0x000400
#define AV_MINOR_HEADSET        0x000004
#define AV_MINOR_MICROPHONE     0x000010
#define AV_MINOR_SPEAKER        0x000014
#define AV_MINOR_HEADPHONES     0x000018
#define AV_MINOR_PORTABLE       0x00001c
#define AV_MINOR_HIFI           0x000028
#define AV_COD_RENDER           0x040000
#define AV_COD_CAPTURE          0x080000

/* Locally generted message base */
#define HEADSET_MSG_BASE    (0x0)

enum
{
    HEADSET_INIT_CFM = HEADSET_MSG_BASE

};

/*The last message - keep this correct*/
#define HEADSET_MESSAGE_TOP HEADSET_INIT_CFM

#define INPUT_PIO_UNASSIGNED	(0xf)

/* Feature Block */
typedef struct
{
    unsigned MicBiasUsesLDO:1;
    
    unsigned    ScaleSpeakerCodec:1 ;

    unsigned    MuteSpeakerAndMic:1 ;

    unsigned    PlayTonesAtFixedVolume:1 ;
    
    unsigned    RebootAfterReset:1 ;
    
    unsigned    RemainDiscoverableAtAllTimes:1;
    
    unsigned    DisablePowerOffAfterPowerOn:1;
    
    unsigned    AutoAnswerOnConnect:1;

    unsigned    UseUserDefinedCodecGains:1 ;
    
    unsigned    PowerOnLDO:1;
    unsigned    PowerOnSMPS:1;

    unsigned    MuteLocalVolAction:1; /*whether or not to update the global vol whilst muted*/   
    unsigned    OverideMute:1 ;/*whether or not to unmute if a vol msg is received*/
    
    unsigned nimh_charger_en:1;
    unsigned lion_charger_en:1;
    unsigned pair_mode_en:1;
     /*---------------------------*/           
    unsigned DefaultIsDifferentToLastAG:1 ;
    
    unsigned Unsused:1;   
    unsigned AutoReconnectPowerOn:1 ;
    unsigned AutoReconnectLinkLoss:1 ;
    
    unsigned ActionOnDisconnect:4;
    unsigned ActionOnCallTransfer:4;    
    unsigned ActionOnPowerOn:4;
     /*---------------------------*/   
    unsigned reserved:13;
    
    unsigned QueueToneEvents:1;
    unsigned QueueLEDEvents:1;
    
    unsigned StoreLastUserOnPairing:1;

}feature_config_type;


typedef uint16 HeadsetTone_t ;
#define TONE_NOT_DEFINED 0

    /*the volume mapping structure - one for each volume level*/
typedef struct  VolMappingTag
{
    unsigned       IncVol:4 ;
    unsigned       DecVol:4 ;
    unsigned       Mic:8 ;
    HeadsetTone_t  Tone ;
    
    unsigned        VolGain:8;
    unsigned        MicGain:8;
    
}VolMapping_t ;

typedef struct ToneQueueTag
{   
    unsigned Tone1:8 ;
    unsigned Tone2:8 ;
    unsigned Tone3:8 ;
    unsigned Tone4:8 ;
}ToneQueue_t ;




    /*the sound manager data - part of the main data structure*/
typedef struct soundManagerTaskDataTag
{
    TaskData        task ;
    VolMapping_t  * gVolMaps ;
    HeadsetTone_t * gEventTones   ;
    
    unsigned        gVolButtonsInverted:1;
    unsigned        gSMVolumeLevel:7 ;   
    unsigned        gSMMuteRemindTimeSec:7 ;
    unsigned        gMuted:1 ; /*the local state of mute*/
    ToneQueue_t     gToneQueue ;

}soundManagerTaskData_t ;

    /*Block containing the PIOs assigned to fixed events the bit fields define if a PIO has been set*/
typedef struct PIO_block_t
{
    unsigned    CallActivePIOEnabled:1    ;
    unsigned    IncomingRingPIOEnabled:1  ;
    unsigned    OutgoingRingPIOEnabled:1  ; 
    unsigned    HeadsetActivePIOEnabled:1 ;
    unsigned    PowerOnPIOEnabled:1       ;
	unsigned 	ChargerEnablePIOEnabled:1 ;
    
    unsigned    Pad:2                     ;
    

    unsigned    CallActivePIO:4   ;
    unsigned    IncomingRingPIO:4 ; 
    
    unsigned    OutgoingRingPIO:4 ;
    unsigned    HeadsetActivePIO:4;
    
    unsigned    PowerOnPIO:4      ;
    unsigned    ChargerEnablePIO:4 ;
    
} PIO_block ;

typedef struct
{
	unsigned reserved:8;
    unsigned charger_input:4;
	unsigned dut_pio:4;
}input_pio_config_type;

    /*The out of band ring Information - uint16*/
typedef struct RingInfoTag
{
    unsigned    InBandRingEnabled:1 ;
    unsigned    RingTone:7 ;
    unsigned    Pad:8 ;
}RingInfo_t ;

/* Radio configuration data */
typedef struct
{
	uint16	page_scan_interval;
	uint16  page_scan_window;
	uint16	inquiry_scan_interval;
	uint16	inquiry_scan_window;
}radio_config_type;

typedef struct 
{
    unsigned    HFP_1_5_Is_Enabled:1;
    unsigned    reserved:14;
    unsigned    Additional_Parameters_Enabled:1;
    
    unsigned    reserved2:6;
    unsigned    supportedSyncPacketTypes:10 ;
    
        /*additional optional parameters for HFP 1.5*/
    uint32      bandwidth;
    uint16      max_latency;
    uint16      voice_settings;
    uint16      retx_effort;  
    
} HFP_1_5_features_type ;

/* Headset data */
typedef struct
{
    TaskData                 task;
	uint16          	     page_scan_enabled;
    uint16          	     inquiry_scan_enabled;
	radio_config_type		 radio;
    uint16					 supp_features_local;
	uint16          	     supp_features_remote;
    HFP_1_5_features_type    HFP_1_5_supp_features;
	feature_config_type		 features;
    RingInfo_t               RingInfo ;
    PIO_block                PIO;
	Sink            	     sco_sink;
	hfp_profile              profile_connected;
	HFP                      *hfp;
    HFP                      *hsp;
    BTaskData                theButtonTask;
    LedTaskData              theLEDTask ;   
    power_type				 *power;
    soundManagerTaskData_t   theSoundTask ;
	input_pio_config_type	 input_PIO;
    
    uint16                   LinkLossNumRetries;

    uint16                   AutoSwitchOffTimeSecs ;
    uint16                   AutoPowerOnTimeoutSecs ;
    uint16                   NetworkServiceIndicatorRepeatTimeSecs ;
    uint16                   DisablePowerOffAfterPowerOnTimeSecs ;


    unsigned                 PowerOffIsEnabled:1; /*Disables the power off event after power on if required*/
    unsigned                 VoiceRecognitionIsActive:1;
    unsigned                 VolumeOrientationIsInverted:1; /*whether or not the vol buttons are inverted*/
    
    unsigned                 NetworkIsPresent:1;
    unsigned                 reserved:12;
    
} hsTaskData;


/****************************************************************************
NAME    
    avGetAppTask
    
DESCRIPTION
  Returns the AV headset application main task.

RETURNS
    Task
*/
Task getAppTask(void);


/*malloc wrapper with added panic if malloc returns NULL*/
void * mallocPanic ( size_t pSize ) ;


#endif /* HEADSET_PRIVATE_H_ */

⌨️ 快捷键说明

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