headset_buttonmanager.h

来自「bc5_stereo:bluetooth stereo Headset CODE」· C头文件 代码 · 共 110 行

H
110
字号
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2007

FILE NAME
    headset_buttonmanager.h
    
DESCRIPTION
    
*/
#ifndef HEADSET_BUTTON_MANAGER_H
#define HEADSET_BUTTON_MANAGER_H

#include "headset_buttons.h"
#include "headset_events.h"


/* Definition of the button configuration */
typedef struct
{
  uint16 double_press_time;
  uint16 long_press_time;
  uint16 very_long_press_time; 
  uint16 repeat_time;
  uint16 very_very_long_press_time ;
  uint16 debounce;
}button_config_type;


/****************************************************************************
  FUNCTIONS
*/

/****************************************************************************
NAME 
 	buttonManagerInit
    
DESCRIPTION
 	Initialises the Button Module parameters.
*/
void buttonManagerInit (  BTaskData *pBTask, Task pClient ) ;


/****************************************************************************
NAME	
	buttonManagerAddMapping

DESCRIPTION
	Maps a button event to a system event.
        
    pButtonMask - 
    mask of the buttons that when pressed will generate an event
    e.g.  0x0001 = button PIO 0
    
          0x0003 = combination of PIO 0  and PIO 1
    pSystemEvent
        The Event to be signalled as define in headset_events.h
    pHfpStateMask
        the HFP states as defined in headset_states that the event will be generated in
    pA2dpStateMask
        the A2DP states as defined in headset_states that the event will be generated in
    pDuration
        the Duration of the button press as defined in headset_buttons.h
        B_SHORT , B_LONG , B_VLONG, B_DOUBLE
          
RETURNS
    bool to indicate success of button being added to map
    
*/     
bool buttonManagerAddMapping ( uint32        pButtonMask , 
                               headsetEvents_t     pSystemEvent , 
                               uint16        pHfpStateMask ,
                               uint16        pA2dpStateMask ,
                               ButtonsTime_t pDuration,
							   const uint16	 pio_debounce) ;


/****************************************************************************
NAME 
 	buttonManagerConfigDurations
    
DESCRIPTION
	Wrapper method for the button Duration Setup
	configures the button durations to the user values.

*/   
void buttonManagerConfigDurations ( uint16 pLong , uint16 pVeryLong , uint16 pDouble , uint16 pRepeat ,uint16 pVeryVeryLong) ; 


/****************************************************************************
NAME	
	BMButtonDetected

DESCRIPTION
	Function call for when a button has been detected. 
*/ 
void BMButtonDetected ( uint32 pButtonMask  , ButtonsTime_t pTime ) ;


/****************************************************************************
NAME	
    BMAddPatternMapping
    
DESCRIPTION
 	Add a new button pattern mapping.
*/
bool BMAddPatternMapping ( uint16 pSystemEvent , uint32 * pButtonsToMatch ) ;


#endif

⌨️ 快捷键说明

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