?? headset_private.h
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004
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:15;
unsigned reserved2:6;
unsigned supportedSyncPacketTypes:10 ;
} 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 + -