libwebsockets
Lightweight C library for HTML5 websockets
|
Go to the source code of this file.
Data Structures | |
struct | lws_button_regime |
struct | lws_button_map |
struct | lws_button_controller |
Macros | |
#define | LWS_BUTTON_MON_TIMER_MS 5 |
Typedefs | |
typedef uint16_t | lws_button_idx_t |
typedef void(* | lws_button_cb_t) (void *opaque, lws_button_idx_t idx, int state) |
typedef struct lws_button_regime | lws_button_regime_t |
typedef struct lws_button_map | lws_button_map_t |
typedef struct lws_button_controller | lws_button_controller_t |
Enumerations | |
enum | { LWSBTNRGMFLAG_CLASSIFY_DOUBLECLICK = (1 << 0) } |
Functions | |
LWS_VISIBLE LWS_EXTERN struct lws_button_state * | lws_button_controller_create (struct lws_context *ctx, const lws_button_controller_t *controller) |
LWS_VISIBLE LWS_EXTERN void | lws_button_controller_destroy (struct lws_button_state *bcs) |
LWS_VISIBLE LWS_EXTERN lws_button_idx_t | lws_button_get_bit (struct lws_button_state *bcs, const char *name) |
LWS_VISIBLE LWS_EXTERN void | lws_button_enable (struct lws_button_state *bcs, lws_button_idx_t _reset, lws_button_idx_t _set) |
struct lws_button_regime |
Definition at line 44 of file lws-button.h.
Data Fields | ||
---|---|---|
uint16_t | ms_min_down | |
uint16_t | ms_min_down_longpress | |
uint16_t | ms_up_settle | |
uint16_t | ms_doubleclick_grace | |
uint16_t | ms_repeat_down | |
uint8_t | flags |
when double-click classification is enabled, clicks are delayed by ms_min_down + ms_doubleclick_grace to wait and see if it will become a double-click. Set LWSBTNRGMFLAG_CLASSIFY_DOUBLECLICK to enable it or leave that bit at 0 to get faster single-click classification. |
struct lws_button_map |
Definition at line 64 of file lws-button.h.
Data Fields | ||
---|---|---|
_lws_plat_gpio_t | gpio | |
const char * | smd_interaction_name | |
const lws_button_regime_t * | regime |
a default regime is applied if this is left NULL |
struct lws_button_controller |
Definition at line 71 of file lws-button.h.
Data Fields | ||
---|---|---|
const char * | smd_bc_name | |
const lws_gpio_ops_t * | gpio_ops | |
const lws_button_map_t * | button_map | |
lws_button_idx_t | active_state_bitmap | |
uint8_t | count_buttons |
#define LWS_BUTTON_MON_TIMER_MS 5 |
Definition at line 33 of file lws-button.h.
typedef uint16_t lws_button_idx_t |
Definition at line 30 of file lws-button.h.
typedef void(* lws_button_cb_t) (void *opaque, lws_button_idx_t idx, int state) |
Definition at line 35 of file lws-button.h.
typedef struct lws_button_regime lws_button_regime_t |
typedef struct lws_button_map lws_button_map_t |
typedef struct lws_button_controller lws_button_controller_t |
anonymous enum |
LWS_VISIBLE LWS_EXTERN struct lws_button_state* lws_button_controller_create | ( | struct lws_context * | ctx, |
const lws_button_controller_t * | controller | ||
) |
lws_button_controller_create() - instantiate a button controller
ctx | the lws_context |
controller | the static controller definition |
Instantiates a button controller from a static definition of the buttons and their smd names, and active levels, and binds it to a gpio implementation
LWS_VISIBLE LWS_EXTERN void lws_button_controller_destroy | ( | struct lws_button_state * | bcs | ) |
lws_button_controller_destroy() - destroys a button controller
bcs | button controller state previously created |
Disables all buttons and then destroys and frees a previously created button controller.
LWS_VISIBLE LWS_EXTERN lws_button_idx_t lws_button_get_bit | ( | struct lws_button_state * | bcs, |
const char * | name | ||
) |
LWS_VISIBLE LWS_EXTERN void lws_button_enable | ( | struct lws_button_state * | bcs, |
lws_button_idx_t | _reset, | ||
lws_button_idx_t | _set | ||
) |