LibDriver MULTI_BUTTON
Loading...
Searching...
No Matches
multi_button basic driver function

multi_button basic driver modules More...

Collaboration diagram for multi_button basic driver function:

Data Structures

struct  multi_button_s
 multi_button structure definition More...
struct  multi_button_time_s
 multi_button time structure definition More...
struct  multi_button_decode_s
 multi_button decode structure definition More...
struct  multi_button_single_s
 multi_button single structure definition More...
struct  multi_button_handle_s
 multi_button handle structure definition More...
struct  multi_button_info_s
 multi_button information structure definition More...

Macros

#define MULTI_BUTTON_NUMBER   128
 multi_button max number definition
#define MULTI_BUTTON_EACH_LENGTH   16
 multi_button each length definition

Typedefs

typedef struct multi_button_s multi_button_t
 multi_button structure definition
typedef struct multi_button_time_s multi_button_time_t
 multi_button time structure definition
typedef struct multi_button_decode_s multi_button_decode_t
 multi_button decode structure definition
typedef struct multi_button_single_s multi_button_single_t
 multi_button single structure definition
typedef struct multi_button_handle_s multi_button_handle_t
 multi_button handle structure definition
typedef struct multi_button_info_s multi_button_info_t
 multi_button information structure definition

Enumerations

enum  multi_button_status_t {
  MULTI_BUTTON_STATUS_PRESS = (1 << 0) , MULTI_BUTTON_STATUS_RELEASE = (1 << 1) , MULTI_BUTTON_STATUS_SINGLE_CLICK = (1 << 2) , MULTI_BUTTON_STATUS_DOUBLE_CLICK = (1 << 3) ,
  MULTI_BUTTON_STATUS_TRIPLE_CLICK = (1 << 4) , MULTI_BUTTON_STATUS_REPEAT_CLICK = (1 << 5) , MULTI_BUTTON_STATUS_SHORT_PRESS_START = (1 << 6) , MULTI_BUTTON_STATUS_SHORT_PRESS_END = (1 << 7) ,
  MULTI_BUTTON_STATUS_LONG_PRESS_START = (1 << 8) , MULTI_BUTTON_STATUS_LONG_PRESS_HOLD = (1 << 9) , MULTI_BUTTON_STATUS_LONG_PRESS_END = (1 << 10)
}
 check range More...

Functions

uint8_t multi_button_info (multi_button_info_t *info)
 get chip's information
uint8_t multi_button_init (multi_button_handle_t *handle, uint8_t row, uint8_t col)
 initialize the chip
uint8_t multi_button_deinit (multi_button_handle_t *handle)
 close the chip
uint8_t multi_button_process (multi_button_handle_t *handle)
 process
uint8_t multi_button_set_timeout (multi_button_handle_t *handle, uint32_t us)
 set timeout
uint8_t multi_button_get_timeout (multi_button_handle_t *handle, uint32_t *us)
 get timeout
uint8_t multi_button_set_interval (multi_button_handle_t *handle, uint32_t us)
 set interval
uint8_t multi_button_get_interval (multi_button_handle_t *handle, uint32_t *us)
 get interval
uint8_t multi_button_set_short_time (multi_button_handle_t *handle, uint32_t us)
 set short time
uint8_t multi_button_get_short_time (multi_button_handle_t *handle, uint32_t *us)
 get short time
uint8_t multi_button_set_long_time (multi_button_handle_t *handle, uint32_t us)
 set long time
uint8_t multi_button_get_long_time (multi_button_handle_t *handle, uint32_t *us)
 get long time
uint8_t multi_button_set_repeat_time (multi_button_handle_t *handle, uint32_t us)
 set repeat time
uint8_t multi_button_get_repeat_time (multi_button_handle_t *handle, uint32_t *us)
 get repeat time
uint8_t multi_button_set_repeat_cnt (multi_button_handle_t *handle, uint32_t cnt)
 set repeat cnt
uint8_t multi_button_get_repeat_cnt (multi_button_handle_t *handle, uint32_t *cnt)
 get repeat cnt
uint8_t multi_button_set_period (multi_button_handle_t *handle, uint32_t period)
 set period
uint8_t multi_button_get_period (multi_button_handle_t *handle, uint32_t *period)
 get period

Detailed Description

multi_button basic driver modules

Macro Definition Documentation

◆ MULTI_BUTTON_EACH_LENGTH

#define MULTI_BUTTON_EACH_LENGTH   16

multi_button each length definition

16

Definition at line 70 of file driver_multi_button.h.

◆ MULTI_BUTTON_NUMBER

#define MULTI_BUTTON_NUMBER   128

multi_button max number definition

max 128 number

Definition at line 63 of file driver_multi_button.h.

Typedef Documentation

◆ multi_button_decode_t

multi_button decode structure definition

◆ multi_button_handle_t

multi_button handle structure definition

◆ multi_button_info_t

multi_button information structure definition

◆ multi_button_single_t

multi_button single structure definition

◆ multi_button_t

multi_button structure definition

◆ multi_button_time_t

multi_button time structure definition

Enumeration Type Documentation

◆ multi_button_status_t

check range

multi_button status enumeration definition

Enumerator
MULTI_BUTTON_STATUS_PRESS 

press

MULTI_BUTTON_STATUS_RELEASE 

release

MULTI_BUTTON_STATUS_SINGLE_CLICK 

single click

MULTI_BUTTON_STATUS_DOUBLE_CLICK 

double click

MULTI_BUTTON_STATUS_TRIPLE_CLICK 

triple click

MULTI_BUTTON_STATUS_REPEAT_CLICK 

repeat click

MULTI_BUTTON_STATUS_SHORT_PRESS_START 

short press start

MULTI_BUTTON_STATUS_SHORT_PRESS_END 

short press end

MULTI_BUTTON_STATUS_LONG_PRESS_START 

long press start

MULTI_BUTTON_STATUS_LONG_PRESS_HOLD 

long press hold

MULTI_BUTTON_STATUS_LONG_PRESS_END 

long press end

Definition at line 83 of file driver_multi_button.h.

Function Documentation

◆ multi_button_deinit()

uint8_t multi_button_deinit ( multi_button_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to a multi_button handle structure
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 756 of file driver_multi_button.c.

◆ multi_button_get_interval()

uint8_t multi_button_get_interval ( multi_button_handle_t * handle,
uint32_t * us )

get interval

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*uspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 869 of file driver_multi_button.c.

◆ multi_button_get_long_time()

uint8_t multi_button_get_long_time ( multi_button_handle_t * handle,
uint32_t * us )

get long time

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*uspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 973 of file driver_multi_button.c.

◆ multi_button_get_period()

uint8_t multi_button_get_period ( multi_button_handle_t * handle,
uint32_t * period )

get period

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*periodpointer to a period buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1129 of file driver_multi_button.c.

◆ multi_button_get_repeat_cnt()

uint8_t multi_button_get_repeat_cnt ( multi_button_handle_t * handle,
uint32_t * cnt )

get repeat cnt

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*cntpointer to a counter buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1077 of file driver_multi_button.c.

◆ multi_button_get_repeat_time()

uint8_t multi_button_get_repeat_time ( multi_button_handle_t * handle,
uint32_t * us )

get repeat time

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*uspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1025 of file driver_multi_button.c.

◆ multi_button_get_short_time()

uint8_t multi_button_get_short_time ( multi_button_handle_t * handle,
uint32_t * us )

get short time

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*uspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 921 of file driver_multi_button.c.

◆ multi_button_get_timeout()

uint8_t multi_button_get_timeout ( multi_button_handle_t * handle,
uint32_t * us )

get timeout

Parameters
[in]*handlepointer to a multi_button handle structure
[out]*uspointer to a time buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 817 of file driver_multi_button.c.

◆ multi_button_info()

uint8_t multi_button_info ( multi_button_info_t * info)

get chip's information

Parameters
[out]*infopointer to a multi_button info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 1153 of file driver_multi_button.c.

◆ multi_button_init()

uint8_t multi_button_init ( multi_button_handle_t * handle,
uint8_t row,
uint8_t col )

initialize the chip

Parameters
[in]*handlepointer to a multi_button handle structure
[in]rowmax row of buttons
[in]colmax col of buttons
Returns
status code
  • 0 success
  • 1 gpio initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 row or col is invalid
  • 5 matrix init failed
Note
none

Definition at line 618 of file driver_multi_button.c.

◆ multi_button_process()

uint8_t multi_button_process ( multi_button_handle_t * handle)

process

Parameters
[in]*handlepointer to a multi_button handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 546 of file driver_multi_button.c.

◆ multi_button_set_interval()

uint8_t multi_button_set_interval ( multi_button_handle_t * handle,
uint32_t us )

set interval

Parameters
[in]*handlepointer to a multi_button handle structure
[in]usset time
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 843 of file driver_multi_button.c.

◆ multi_button_set_long_time()

uint8_t multi_button_set_long_time ( multi_button_handle_t * handle,
uint32_t us )

set long time

Parameters
[in]*handlepointer to a multi_button handle structure
[in]usset time
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 947 of file driver_multi_button.c.

◆ multi_button_set_period()

uint8_t multi_button_set_period ( multi_button_handle_t * handle,
uint32_t period )

set period

Parameters
[in]*handlepointer to a multi_button handle structure
[in]periodset period
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1103 of file driver_multi_button.c.

◆ multi_button_set_repeat_cnt()

uint8_t multi_button_set_repeat_cnt ( multi_button_handle_t * handle,
uint32_t cnt )

set repeat cnt

Parameters
[in]*handlepointer to a multi_button handle structure
[in]cntset repeat counter
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 1051 of file driver_multi_button.c.

◆ multi_button_set_repeat_time()

uint8_t multi_button_set_repeat_time ( multi_button_handle_t * handle,
uint32_t us )

set repeat time

Parameters
[in]*handlepointer to a multi_button handle structure
[in]usset time
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 999 of file driver_multi_button.c.

◆ multi_button_set_short_time()

uint8_t multi_button_set_short_time ( multi_button_handle_t * handle,
uint32_t us )

set short time

Parameters
[in]*handlepointer to a multi_button handle structure
[in]usset time
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 895 of file driver_multi_button.c.

◆ multi_button_set_timeout()

uint8_t multi_button_set_timeout ( multi_button_handle_t * handle,
uint32_t us )

set timeout

Parameters
[in]*handlepointer to a multi_button handle structure
[in]usset time
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 791 of file driver_multi_button.c.