35 #ifndef __HAL_KEYPAD_H__ 36 #define __HAL_KEYPAD_H__ 38 #include "hal_platform.h" 41 #ifdef HAL_KEYPAD_MODULE_ENABLED 42 #include "hal_keypad_table.h" 74 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 146 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 213 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 227 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 281 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 359 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 383 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 405 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 483 #ifdef HAL_KEYPAD_FEATURE_POWERKEY 510 #ifdef HAL_KEYPAD_FEATURE_POWERKEY hal_keypad_key_state_t state
Specifies the key status, such as released, pressed, longpressed, etc.
Definition: hal_keypad.h:354
hal_keypad_mode_t
This enum defines keypad mode selection.
Definition: hal_keypad.h:299
hal_keypad_mode_t mode
Specifies the keypad single or double key mode.
Definition: hal_keypad.h:336
This structure defines key event data.
Definition: hal_keypad.h:353
hal_keypad_status_t hal_keypad_register_callback(hal_keypad_callback_t callback, void *user_data)
This function registers a callback function when in a normal key mode.
uint32_t longpress_time
Specifies the keypad longpress event time, the unit is millisecond.
Definition: hal_keypad.h:340
PMU hardware powerkey is long pressed.
Definition: hal_keypad.h:317
uint8_t row_high_pulse
Specifies the high level of row pulses will stay clocks.
Definition: hal_keypad.h:347
A key is pressed.
Definition: hal_keypad.h:314
A key is released.
Definition: hal_keypad.h:313
uint8_t column_bitmap
Specifies the keypad column bitmap [2:0].
Definition: hal_keypad.h:329
A key is repeat pressed.
Definition: hal_keypad.h:316
This structure defines keypad scan timing.
Definition: hal_keypad.h:345
uint32_t key_data
Specifies the powerkey data.
Definition: hal_keypad.h:363
hal_keypad_status_t hal_keypad_get_key(hal_keypad_event_t *keypad_event)
This function gets the key event.
A key is long pressed.
Definition: hal_keypad.h:315
hal_keypad_status_t
This enum defines keypad status.
Definition: hal_keypad.h:305
hal_keypad_status_t hal_keypad_powerkey_deinit(void)
This function de-initializes the powerkey base environment.
hal_keypad_status_t hal_keypad_powerkey_register_callback(hal_powerkey_callback_t callback, void *user_data)
This function registers a callback function when in a powerkey mode.
uint32_t repeat_time
Specifies the keypad repeat event time, the unit is millisecond.
Definition: hal_keypad.h:339
uint8_t column_scan_div
Specifies the period of column pulses will stay clocks.
Definition: hal_keypad.h:348
hal_keypad_status_t hal_keypad_init(const hal_keypad_config_t *keypad_config)
This function initialize the keypad module.
hal_keypad_status_t hal_keypad_disable(void)
This function disables the keypad module.
An invalid parameter.
Definition: hal_keypad.h:307
hal_keypad_status_t hal_keypad_get_debounce(uint32_t *keypad_debounce)
This function gets the keypad debounce time, the unit is in milliseconds.
hal_keypad_status_t hal_keypad_get_scan_timing(hal_keypad_scan_timing_t *keypad_scan_timing)
Get the keypad scan timing.
void(* hal_powerkey_callback_t)(void *user_data)
This function registers a callback function when in a powerkey mode.
Definition: hal_keypad.h:287
hal_keypad_status_t hal_keypad_set_debounce(const uint32_t *keypad_debounce)
This function sets the keypad debounce time, the unit is in milliseconds.
hal_keypad_status_t hal_keypad_deinit(void)
This function deinitializes the keypad module.
hal_keypad_column_row_t key_map
Specifies the keypad column and row bitmaps.
Definition: hal_keypad.h:337
uint32_t time_stamp
Specifies the time stamp of event on the keypad.
Definition: hal_keypad.h:356
uint8_t column_high_pulse
Specifies the high level of column pulses will stay clocks.
Definition: hal_keypad.h:346
This structure defines keypad configuration.
Definition: hal_keypad.h:335
hal_keypad_status_t hal_keypad_enable(void)
This function enables the keypad module.
No error occurred during the function call.
Definition: hal_keypad.h:308
uint32_t time_stamp
Specifies the time stamp of event on the keypad.
Definition: hal_keypad.h:364
hal_keypad_status_t hal_keypad_set_scan_timing(const hal_keypad_scan_timing_t *keypad_scan_timing)
Set the keypad scan timing.
hal_keypad_status_t hal_keypad_powerkey_init(uint32_t powerkey_data)
This function initializes the powerkey base environment.
This structure defines powerkey key data.
Definition: hal_keypad.h:361
void(* hal_keypad_callback_t)(void *user_data)
This function registers a callback function when in a normal key mode.
Definition: hal_keypad.h:279
A keypad function error.
Definition: hal_keypad.h:306
hal_keypad_key_state_t
This enum defines key status.
Definition: hal_keypad.h:312
This structure defines keypad column and row parameter.
Definition: hal_keypad.h:328
Sets the keypad single key mode.
Definition: hal_keypad.h:300
uint32_t debounce
Specifies the keypad debounce time, the unit is millisecond.
Definition: hal_keypad.h:338
uint8_t row_bitmap
Specifies the keypad row bitmap [2:0].
Definition: hal_keypad.h:330
hal_keypad_status_t hal_keypad_powerkey_get_key(hal_keypad_powerkey_event_t *powerkey_event)
This function gets the powerkey event.
uint32_t key_data
Specifies the key position number on the keypad.
Definition: hal_keypad.h:355
uint8_t row_scan_div
Specifies the period of row pulses will stay clocks.
Definition: hal_keypad.h:349
hal_keypad_key_state_t state
Specifies the powerkey state is pressed or released.
Definition: hal_keypad.h:362
Sets the keypad double key mode.
Definition: hal_keypad.h:301