BUTN driver APIs. More...
Functions | |
| static uint32_t | butn_get_status (BUTN_Type *ptr) |
| Get status. More... | |
| static void | butn_enable_irq (BUTN_Type *ptr, uint32_t mask) |
| Enable interrupt with mask. More... | |
| static void | butn_disable_irq (BUTN_Type *ptr, uint32_t mask) |
| Disable interrupt with mask. More... | |
| static void | butn_set_intense (BUTN_Type *ptr, uint8_t intense) |
| Set intense of PLED and RLED/WLED. More... | |
BUTN driver APIs.
| #define BUTN_EVENT_POWER_CLICKED (BUTN_BTN_STATUS_PCLICK_SET(1)) |
| #define BUTN_EVENT_POWER_CLICKED_WAKE_HELD (BUTN_BTN_STATUS_XPCLICK_SET(1)) |
| #define BUTN_EVENT_POWER_CLICKED_X2 (BUTN_BTN_STATUS_PCLICK_SET(2)) |
| #define BUTN_EVENT_POWER_CLICKED_X2_WAKE_HELD (BUTN_BTN_STATUS_XPCLICK_SET(2)) |
| #define BUTN_EVENT_POWER_CLICKED_X3 (BUTN_BTN_STATUS_PCLICK_SET(4)) |
| #define BUTN_EVENT_POWER_CLICKED_X3_WAKE_HELD (BUTN_BTN_STATUS_XPCLICK_SET(4)) |
| #define BUTN_EVENT_POWER_PRESSED (BUTN_BTN_STATUS_PBTN_SET(1)) |
| #define BUTN_EVENT_POWER_PRESSED_HOLD_0_5_S (BUTN_BTN_STATUS_PBTN_SET(2)) |
| #define BUTN_EVENT_POWER_PRESSED_HOLD_16_S (BUTN_BTN_STATUS_PBTN_SET(8)) |
| #define BUTN_EVENT_POWER_PRESSED_HOLD_8_S (BUTN_BTN_STATUS_PBTN_SET(4)) |
| #define BUTN_EVENT_WAKE_CLICKED (BUTN_BTN_STATUS_WCLICK_SET(1)) |
| #define BUTN_EVENT_WAKE_CLICKED_POWER_HELD (BUTN_BTN_STATUS_XWCLICK_SET(1)) |
| #define BUTN_EVENT_WAKE_CLICKED_X2 (BUTN_BTN_STATUS_WCLICK_SET(2)) |
| #define BUTN_EVENT_WAKE_CLICKED_X2_POWER_HELD (BUTN_BTN_STATUS_XWCLICK_SET(2)) |
| #define BUTN_EVENT_WAKE_CLICKED_X3 (BUTN_BTN_STATUS_WCLICK_SET(4)) |
| #define BUTN_EVENT_WAKE_CLICKED_X3_POWER_HELD (BUTN_BTN_STATUS_XWCLICK_SET(4)) |
| #define BUTN_EVENT_WAKE_POWER_PRESSED (BUTN_BTN_STATUS_DBTN_SET(1)) |
| #define BUTN_EVENT_WAKE_POWER_PRESSED_HOLD_0_5_S (BUTN_BTN_STATUS_DBTN_SET(2)) |
| #define BUTN_EVENT_WAKE_POWER_PRESSED_HOLD_16_S (BUTN_BTN_STATUS_DBTN_SET(8)) |
| #define BUTN_EVENT_WAKE_POWER_PRESSED_HOLD_8_S (BUTN_BTN_STATUS_DBTN_SET(4)) |
| #define BUTN_EVENT_WAKE_PRESSED (BUTN_BTN_STATUS_WBTN_SET(1)) |
| #define BUTN_EVENT_WAKE_PRESSED_HOLD_0_5_S (BUTN_BTN_STATUS_WBTN_SET(2)) |
| #define BUTN_EVENT_WAKE_PRESSED_HOLD_16_S (BUTN_BTN_STATUS_WBTN_SET(8)) |
| #define BUTN_EVENT_WAKE_PRESSED_HOLD_8_S (BUTN_BTN_STATUS_WBTN_SET(4)) |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_butn_drv.h>
Disable interrupt with mask.
| [in] | ptr | BUTN base address |
| [in] | mask | Mask of interrupts to be disabled, please refer to BUTN_EVENT_* macros |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_butn_drv.h>
Enable interrupt with mask.
| [in] | ptr | BUTN base address |
| [in] | mask | Mask of interrupts to be enabled, please refer to BUTN_EVENT_* macros |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_butn_drv.h>
Get status.
| [in] | ptr | BUTN base address |
| status | mask in 32 bits, please refer to BUTN_EVENT_* macros |
|
inlinestatic |
#include </home/docs/checkouts/readthedocs.org/user_builds/hpm-sdk/checkouts/latest/drivers/inc/hpm_butn_drv.h>
Set intense of PLED and RLED/WLED.
| [in] | ptr | BUTN base address |
| [in] | intense | Intense value (0~15) |