![]() |
LibDriver BUTTON
|
driver button header file More...
#include <stdio.h>#include <stdint.h>#include <string.h>Go to the source code of this file.
Data Structures | |
| struct | button_s |
| button structure definition More... | |
| struct | button_time_s |
| button time structure definition More... | |
| struct | button_decode_s |
| button decode structure definition More... | |
| struct | button_handle_s |
| button handle structure definition More... | |
| struct | button_info_s |
| button information structure definition More... | |
Macros | |
| #define | BUTTON_LENGTH 16 |
| button length definition | |
| #define | DRIVER_BUTTON_LINK_INIT(HANDLE, STRUCTURE) |
| initialize button_handle_t structure | |
| #define | DRIVER_BUTTON_LINK_TIMESTAMP_READ(HANDLE, FUC) |
| link timestamp_read function | |
| #define | DRIVER_BUTTON_LINK_DELAY_MS(HANDLE, FUC) |
| link delay_ms function | |
| #define | DRIVER_BUTTON_LINK_DEBUG_PRINT(HANDLE, FUC) |
| link debug_print function | |
| #define | DRIVER_BUTTON_LINK_RECEIVE_CALLBACK(HANDLE, FUC) |
| link receive_callback function | |
Typedefs | |
| typedef struct button_s | button_t |
| button structure definition | |
| typedef struct button_time_s | button_time_t |
| button time structure definition | |
| typedef struct button_decode_s | button_decode_t |
| button decode structure definition | |
| typedef struct button_handle_s | button_handle_t |
| button handle structure definition | |
| typedef struct button_info_s | button_info_t |
| button information structure definition | |
Enumerations | |
| enum | button_status_t { BUTTON_STATUS_PRESS = (1 << 0) , BUTTON_STATUS_RELEASE = (1 << 1) , BUTTON_STATUS_SINGLE_CLICK = (1 << 2) , BUTTON_STATUS_DOUBLE_CLICK = (1 << 3) , BUTTON_STATUS_TRIPLE_CLICK = (1 << 4) , BUTTON_STATUS_REPEAT_CLICK = (1 << 5) , BUTTON_STATUS_SHORT_PRESS_START = (1 << 6) , BUTTON_STATUS_SHORT_PRESS_END = (1 << 7) , BUTTON_STATUS_LONG_PRESS_START = (1 << 8) , BUTTON_STATUS_LONG_PRESS_HOLD = (1 << 9) , BUTTON_STATUS_LONG_PRESS_END = (1 << 10) } |
| check range More... | |
Functions | |
| uint8_t | button_info (button_info_t *info) |
| get chip's information | |
| uint8_t | button_irq_handler (button_handle_t *handle, uint8_t press_release) |
| irq handler | |
| uint8_t | button_period_handler (button_handle_t *handle) |
| period handler | |
| uint8_t | button_init (button_handle_t *handle) |
| initialize the chip | |
| uint8_t | button_deinit (button_handle_t *handle) |
| close the chip | |
| uint8_t | button_set_timeout (button_handle_t *handle, uint32_t us) |
| set timeout | |
| uint8_t | button_get_timeout (button_handle_t *handle, uint32_t *us) |
| get timeout | |
| uint8_t | button_set_interval (button_handle_t *handle, uint32_t us) |
| set interval | |
| uint8_t | button_get_interval (button_handle_t *handle, uint32_t *us) |
| get interval | |
| uint8_t | button_set_short_time (button_handle_t *handle, uint32_t us) |
| set short time | |
| uint8_t | button_get_short_time (button_handle_t *handle, uint32_t *us) |
| get short time | |
| uint8_t | button_set_long_time (button_handle_t *handle, uint32_t us) |
| set long time | |
| uint8_t | button_get_long_time (button_handle_t *handle, uint32_t *us) |
| get long time | |
| uint8_t | button_set_repeat_time (button_handle_t *handle, uint32_t us) |
| set repeat time | |
| uint8_t | button_get_repeat_time (button_handle_t *handle, uint32_t *us) |
| get repeat time | |
driver button header file
Copyright (c) 2015 - present LibDriver All rights reserved
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
| Date | Version | Author | Description |
|---|---|---|---|
| 2023/11/30 | 1.0 | Shifeng Li | first upload |
Definition in file driver_button.h.