1 /***************************************************************************//**
2  * @file
3  * @brief SYSRTC 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_SYSRTC_COMPAT_H
32 #define SL_HAL_SYSRTC_COMPAT_H
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*******************************************************************************
39  *********************************   DEFINES   *********************************
40  ******************************************************************************/
41 
42 // Enum.
43 #define SL_SYSRTC_CAPTURE_EDGE_RISING                 SL_HAL_SYSRTC_CAPTURE_EDGE_RISING
44 #define SL_SYSRTC_CAPTURE_EDGE_FALLING                SL_HAL_SYSRTC_CAPTURE_EDGE_FALLING
45 #define SL_SYSRTC_CAPTURE_EDGE_BOTH                   SL_HAL_SYSRTC_CAPTURE_EDGE_BOTH
46 #define SL_SYSRTC_COMPARE_MATCH_OUT_ACTION_CLEAR      SL_HAL_SYSRTC_COMPARE_MATCH_OUT_ACTION_CLEAR
47 #define SL_SYSRTC_COMPARE_MATCH_OUT_ACTION_SET        SL_HAL_SYSRTC_COMPARE_MATCH_OUT_ACTION_SET
48 #define SL_SYSRTC_COMPARE_MATCH_OUT_ACTION_PULSE      SL_HAL_SYSRTC_COMPARE_MATCH_OUT_ACTION_PULSE
49 #define SL_SYSRTC_COMPARE_MATCH_OUT_ACTION_TOGGLE     SL_HAL_SYSRTC_COMPARE_MATCH_OUT_ACTION_TOGGLE
50 #define SL_SYSRTC_COMPARE_MATCH_OUT_ACTION_CMPIF      SL_HAL_SYSRTC_COMPARE_MATCH_OUT_ACTION_CMPIF
51 #define sl_sysrtc_capture_edge_t                      sl_hal_sysrtc_capture_edge_t
52 #define sl_sysrtc_compare_match_out_action_t          sl_hal_sysrtc_compare_match_out_action_t
53 
54 // Structure.
55 #define sl_sysrtc_config_t                            sl_hal_sysrtc_config_t
56 #define sl_sysrtc_group_channel_compare_config_t      sl_hal_sysrtc_group_channel_compare_config_t
57 #define sl_sysrtc_group_channel_capture_config_t      sl_hal_sysrtc_group_channel_capture_config_t
58 #define sl_sysrtc_group_config_t                      sl_hal_sysrtc_group_config_t
59 
60 // Function.
61 #define sl_sysrtc_init                                sl_hal_sysrtc_init
62 #define sl_sysrtc_enable                              sl_hal_sysrtc_enable
63 #define sl_sysrtc_disable                             sl_hal_sysrtc_disable
64 #define sl_sysrtc_wait_sync                           sl_hal_sysrtc_wait_sync
65 #define sl_sysrtc_wait_ready                          sl_hal_sysrtc_wait_ready
66 #define sl_sysrtc_start                               sl_hal_sysrtc_start
67 #define sl_sysrtc_stop                                sl_hal_sysrtc_stop
68 #define sl_sysrtc_reset                               sl_hal_sysrtc_reset
69 #define sl_sysrtc_get_status                          sl_hal_sysrtc_get_status
70 #define sl_sysrtc_lock                                sl_hal_sysrtc_lock
71 #define sl_sysrtc_unlock                              sl_hal_sysrtc_unlock
72 #define sl_sysrtc_get_counter                         sl_hal_sysrtc_get_counter
73 #define sl_sysrtc_set_counter                         sl_hal_sysrtc_set_counter
74 #define sl_sysrtc_init_group                          sl_hal_sysrtc_init_group
75 #define sl_sysrtc_enable_group_interrupts             sl_hal_sysrtc_enable_group_interrupts
76 #define sl_sysrtc_disable_group_interrupts            sl_hal_sysrtc_disable_group_interrupts
77 #define sl_sysrtc_clear_group_interrupts              sl_hal_sysrtc_clear_group_interrupts
78 #define sl_sysrtc_get_group_interrupts                sl_hal_sysrtc_get_group_interrupts
79 #define sl_sysrtc_get_group_enabled_interrupts        sl_hal_sysrtc_get_group_enabled_interrupts
80 #define sl_sysrtc_set_group_interrupts                sl_hal_sysrtc_set_group_interrupts
81 #define sl_sysrtc_get_group_compare_channel_value     sl_hal_sysrtc_get_group_compare_channel_value
82 #define sl_sysrtc_set_group_compare_channel_value     sl_hal_sysrtc_set_group_compare_channel_value
83 #define sl_sysrtc_get_group_capture_channel_value     sl_hal_sysrtc_get_group_capture_channel_value
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
89 #endif // SL_HAL_SYSRTC_COMPAT_H
90