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_REVC_H_
22 #define LIBRARIES_PERIPHDRIVERS_SOURCE_TMR_TMR_REVC_H_
23 
24 /* **** Includes **** */
25 #include <stddef.h>
26 #include "mxc_assert.h"
27 #include "mxc_errors.h"
28 #include "tmr.h"
29 #include "gpio.h"
30 #include "mxc_pins.h"
31 #include "mxc_lock.h"
32 
33 /* **** Functions **** */
34 int MXC_TMR_RevC_Init(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg);
35 void MXC_TMR_RevC_ConfigGeneric(mxc_tmr_regs_t *tmr, mxc_tmr_cfg_t *cfg);
36 void MXC_TMR_RevC_Shutdown(mxc_tmr_regs_t *tmr);
37 void MXC_TMR_RevC_Start(mxc_tmr_regs_t *tmr);
38 void MXC_TMR_RevC_Stop(mxc_tmr_regs_t *tmr);
39 int MXC_TMR_RevC_SetPWM(mxc_tmr_regs_t *tmr, uint32_t pwm);
40 uint32_t MXC_TMR_RevC_GetCompare(mxc_tmr_regs_t *tmr);
41 uint32_t MXC_TMR_RevC_GetCapture(mxc_tmr_regs_t *tmr);
42 uint32_t MXC_TMR_RevC_GetCount(mxc_tmr_regs_t *tmr);
43 uint32_t MXC_TMR_RevC_GetPeriod(mxc_tmr_regs_t *tmr, mxc_tmr_clock_t clock, uint32_t prescalar,
44                                 uint32_t frequency);
45 void MXC_TMR_RevC_ClearFlags(mxc_tmr_regs_t *tmr);
46 uint32_t MXC_TMR_RevC_GetFlags(mxc_tmr_regs_t *tmr);
47 void MXC_TMR_RevC_SetCompare(mxc_tmr_regs_t *tmr, uint32_t cmp_cnt);
48 void MXC_TMR_RevC_SetCount(mxc_tmr_regs_t *tmr, uint32_t cnt);
49 void MXC_TMR_RevC_TO_Start(mxc_tmr_regs_t *tmr, uint32_t us);
50 int MXC_TMR_RevC_GetTime(mxc_tmr_regs_t *tmr, uint32_t ticks, uint32_t *time,
51                          mxc_tmr_unit_t *units);
52 
53 #endif // LIBRARIES_PERIPHDRIVERS_SOURCE_TMR_TMR_REVC_H_
54