Infineon Logo AIROC BTSDK v4.6 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
ButtonDriver

Data Structures

struct  ButtonData
 Button run time data. More...
 

Typedefs

typedef struct ButtonData ButtonData
 Button run time data.
 

Functions

void btn_wakeupDisable (void)
 This file defines the button interface provided by the 20732 core. More...
 
void btn_wakeupEnable (void)
 Enable wakeup from all buttons. Also clear any pending events.
 
UINT16 btn_getCurrentState (void)
 Return the current button state as a bit mapped value. More...
 
UINT16 btn_flush (void)
 Flush any queued button activity in FW or HW and returns the current state of the buttons. More...
 
BOOL32 btn_eventsPending (void)
 Returns whether there are any pending unprocessed button events. More...
 
void btn_registerForInterrupt (void(*userfn)(void *), void *userdata)
 Register for notification of changes. More...
 
void btn_init (void)
 Initialize the button driver.
 
void btn_processEvent (KeyEvent *event)
 Process the provided button (keyscan) event.
 

Detailed Description

Function Documentation

BOOL32 btn_eventsPending ( void  )

Returns whether there are any pending unprocessed button events.

Returns
TRUE if there are any pending unprocessed button events, FALSE otherwise.
UINT16 btn_flush ( void  )

Flush any queued button activity in FW or HW and returns the current state of the buttons.

Interpretation of the return value is the same as getCurrentState().

Returns
a 32 bit map representing the current state of the buttons.
UINT16 btn_getCurrentState ( void  )

Return the current button state as a bit mapped value.

0 for a button indicates that the button is not pressed, 1 indicates the button is pressed.

Returns
a 32 bit map representing the current state of the buttons.
void btn_registerForInterrupt ( void(*)(void *)  userfn,
void *  userdata 
)

Register for notification of changes.

Once registered, you CAN NOT UNREGISTER; registration is meant to be a startup activity

Parameters
userfnpoints to the function to call when the interrupt comes and matches one of the masks (if you pass a method, it must be static). The function does not need to clear the interrupt status; this will be done by KeyscanDriver::lhlInterrupt(). The function will be called ONCE per interrupt.
userdatawill be passed back to userfn as-is; it can be used to carry the "this", for example
void btn_wakeupDisable ( void  )

This file defines the button interface provided by the 20732 core.

Buttons are implamented as keys on the 20732. A scan matrix of 1 row, n cols is created and scanned by the key scan hardware. The hardware reports the state of the buttons as keys. This information is translated by the button interface into a byte representing various buttons.Disable wakeup from all buttons. Clear all pending events.