?? headset_buttonmanager.h
字號:
/****************************************************************************
Copyright (C) Cambridge Silicon Radio Ltd. 2004
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 + -