1 /***************************************************************************//**
2  * @file
3  * @brief KEYSCAN Compatibility Layer.
4  *******************************************************************************
5  * # License
6  * <b>Copyright 2024 Silicon Laboratories Inc. www.silabs.com</b>
7  *******************************************************************************
8  *
9  * SPDX-License-Identifier: Zlib
10  *
11  * The licensor of this software is Silicon Laboratories Inc.
12  *
13  * This software is provided 'as-is', without any express or implied
14  * warranty. In no event will the authors be held liable for any damages
15  * arising from the use of this software.
16  *
17  * Permission is granted to anyone to use this software for any purpose,
18  * including commercial applications, and to alter it and redistribute it
19  * freely, subject to the following restrictions:
20  *
21  * 1. The origin of this software must not be misrepresented; you must not
22  *    claim that you wrote the original software. If you use this software
23  *    in a product, an acknowledgment in the product documentation would be
24  *    appreciated but is not required.
25  * 2. Altered source versions must be plainly marked as such, and must not be
26  *    misrepresented as being the original software.
27  * 3. This notice may not be removed or altered from any source distribution.
28  *
29  ******************************************************************************/
30 
31 #ifndef SL_HAL_KEYSCAN_COMPAT_H
32 #define SL_HAL_KEYSCAN_COMPAT_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*******************************************************************************
39  *********************************   DEFINES   *********************************
40  ******************************************************************************/
41 
42 // Enum.
43 #define SL_KEYSCAN_DELAY_2MS                          SL_HAL_KEYSCAN_DELAY_2MS
44 #define SL_KEYSCAN_DELAY_4MS                          SL_HAL_KEYSCAN_DELAY_4MS
45 #define SL_KEYSCAN_DELAY_6MS                          SL_HAL_KEYSCAN_DELAY_6MS
46 #define SL_KEYSCAN_DELAY_8MS                          SL_HAL_KEYSCAN_DELAY_8MS
47 #define SL_KEYSCAN_DELAY_10MS                         SL_HAL_KEYSCAN_DELAY_10MS
48 #define SL_KEYSCAN_DELAY_12MS                         SL_HAL_KEYSCAN_DELAY_12MS
49 #define SL_KEYSCAN_DELAY_14MS                         SL_HAL_KEYSCAN_DELAY_14MS
50 #define SL_KEYSCAN_DELAY_16MS                         SL_HAL_KEYSCAN_DELAY_16MS
51 #define SL_KEYSCAN_DELAY_18MS                         SL_HAL_KEYSCAN_DELAY_18MS
52 #define SL_KEYSCAN_DELAY_20MS                         SL_HAL_KEYSCAN_DELAY_20MS
53 #define SL_KEYSCAN_DELAY_22MS                         SL_HAL_KEYSCAN_DELAY_22MS
54 #define SL_KEYSCAN_DELAY_24MS                         SL_HAL_KEYSCAN_DELAY_24MS
55 #define SL_KEYSCAN_DELAY_26MS                         SL_HAL_KEYSCAN_DELAY_26MS
56 #define SL_KEYSCAN_DELAY_28MS                         SL_HAL_KEYSCAN_DELAY_28MS
57 #define SL_KEYSCAN_DELAY_30MS                         SL_HAL_KEYSCAN_DELAY_30MS
58 #define SL_KEYSCAN_DELAY_32MS                         SL_HAL_KEYSCAN_DELAY_32MS
59 #define sl_keyscan_delay_t                            sl_hal_keyscan_delay_t
60 
61 // Structure.
62 #define sl_keyscan_config_t                           sl_hal_keyscan_config_t
63 
64 // Function.
65 #define sl_keyscan_init                               sl_hal_keyscan_init
66 #define sl_keyscan_enable                             sl_hal_keyscan_enable
67 #define sl_keyscan_disable                            sl_hal_keyscan_disable
68 #define sl_keyscan_wait_ready                         sl_hal_keyscan_wait_ready
69 #define sl_keyscan_wait_sync                          sl_hal_keyscan_wait_sync
70 #define sl_keyscan_start_scan                         sl_hal_keyscan_start_scan
71 #define sl_keyscan_stop_scan                          sl_hal_keyscan_stop_scan
72 #define sl_keyscan_reset                              sl_hal_keyscan_reset
73 #define sl_keyscan_get_status                         sl_hal_keyscan_get_status
74 #define sl_keyscan_enable_interrupts                  sl_hal_keyscan_enable_interrupts
75 #define sl_keyscan_disable_interrupts                 sl_hal_keyscan_disable_interrupts
76 #define sl_keyscan_clear_interrupts                   sl_hal_keyscan_clear_interrupts
77 #define sl_keyscan_get_interrupts                     sl_hal_keyscan_get_interrupts
78 #define sl_keyscan_get_enabled_interrupts             sl_hal_keyscan_get_enabled_interrupts
79 #define sl_keyscan_set_interrupts                     sl_hal_keyscan_set_interrupts
80 
81 #ifdef __cplusplus
82 }
83 #endif
84 
85 #endif // SL_HAL_KEYSCAN_COMPAT_H
86