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

📄 headset_buttonmanager.h

📁 蓝牙耳机的源代码,结合csr的开发套件使用
💻 H
字号:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004-2006
Part of BlueLab 3.5.2-release

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;
}button_config_type;


/****************************************************************************
NAME 
 buttonManagerInit

DESCRIPTION
 Initialises the button event 

RETURNS
 void
    
*/
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
    pStateMask
        the 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 ( uint16        pButtonMask , 
                               headsetEvents_t     pSystemEvent , 
                               uint16        pStateMask ,
                               ButtonsTime_t pDuration) ;



/****************************************************************************
NAME 
 buttonManagerCleanDestroy

DESCRIPTION
 function to delete all allocated memory malloced by the button task 
    - used on power down.

RETURNS

*/
void buttonManagerClean ( void ) ;



/****************************************************************************
NAME 
 ButtonManagerConfigDurations
    
DESCRIPTION
 Wrapper method for the button Duration Setup
    
RETURNS

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

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

DESCRIPTION
 function call for when a button has been detected 
          
RETURNS
 void
*/    
void BMButtonDetected ( uint16 pButtonMask  , ButtonsTime_t pTime ) ;



/****************************************************************************
NAME 
 ButtonManagerUnregisterButtons
    
DESCRIPTION
 Wrapper method for the button unregister function
    
RETURNS

    void
*/   
void buttonManagerUnregisterButtons ( uint16 pButtonMask ) ;


  
/****************************************************************************
NAME 
 buttonManagerRemoveMapping
    
DESCRIPTION
 External Method to remove all button events previously defined whith a given event index
    This is used by the Config Manager if changes to the default config are required

RETURNS
    uint16 -  Number of Events Deleted
*/
uint16 buttonManagerRemoveMapping ( headsetEvents_t pEvent );


bool BMAddPatternMapping ( uint16 pSystemEvent , uint16 * pButtonsToMatch ) ;

#endif

⌨️ 快捷键说明

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