1 /******************************************************************************
2  *
3  * Copyright (C) 2022-2023 Maxim Integrated Products, Inc. (now owned by
4  * Analog Devices, Inc.),
5  * Copyright (C) 2023-2024 Analog Devices, Inc.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *     http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  ******************************************************************************/
20 
21 #ifndef LIBRARIES_PERIPHDRIVERS_SOURCE_TMR_TMR_REVA_H_
22 #define LIBRARIES_PERIPHDRIVERS_SOURCE_TMR_TMR_REVA_H_
23 
24 /* **** Includes **** */
25 #include <stddef.h>
26 #include "mxc_assert.h"
27 #include "tmr.h"
28 #include "gpio.h"
29 #include "mxc_pins.h"
30 #include "mxc_lock.h"
31 #include "tmr_reva_regs.h"
32 
33 /* **** Functions **** */
34 void MXC_TMR_RevA_Init(mxc_tmr_reva_regs_t *tmr, mxc_tmr_cfg_t *cfg);
35 void MXC_TMR_RevA_Shutdown(mxc_tmr_reva_regs_t *tmr);
36 void MXC_TMR_RevA_Start(mxc_tmr_reva_regs_t *tmr);
37 void MXC_TMR_RevA_Stop(mxc_tmr_reva_regs_t *tmr);
38 int MXC_TMR_RevA_SetPWM(mxc_tmr_reva_regs_t *tmr, uint32_t pwm);
39 uint32_t MXC_TMR_RevA_GetCompare(mxc_tmr_reva_regs_t *tmr);
40 uint32_t MXC_TMR_RevA_GetCapture(mxc_tmr_reva_regs_t *tmr);
41 uint32_t MXC_TMR_RevA_GetCount(mxc_tmr_reva_regs_t *tmr);
42 void MXC_TMR_RevA_ClearFlags(mxc_tmr_reva_regs_t *tmr);
43 uint32_t MXC_TMR_RevA_GetFlags(mxc_tmr_reva_regs_t *tmr);
44 void MXC_TMR_RevA_SetCompare(mxc_tmr_reva_regs_t *tmr, uint32_t cmp_cnt);
45 void MXC_TMR_RevA_SetCount(mxc_tmr_reva_regs_t *tmr, uint32_t cnt);
46 void MXC_TMR_RevA_TO_Start(mxc_tmr_reva_regs_t *tmr, uint32_t us);
47 int MXC_TMR_RevA_GetTime(mxc_tmr_reva_regs_t *tmr, uint32_t ticks, uint32_t *time,
48                          mxc_tmr_unit_t *units);
49 
50 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_TMR_TMR_REVA_H_
51