MAX32665 Peripheral Driver API
Peripheral Driver API for the MAX32665
htmr.h
1 
6 /* ****************************************************************************
7  * Copyright (C) 2017 Maxim Integrated Products, Inc., All Rights Reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person obtaining a
10  * copy of this software and associated documentation files (the "Software"),
11  * to deal in the Software without restriction, including without limitation
12  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13  * and/or sell copies of the Software, and to permit persons to whom the
14  * Software is furnished to do so, subject to the following conditions:
15  *
16  * The above copyright notice and this permission notice shall be included
17  * in all copies or substantial portions of the Software.
18  *
19  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22  * IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES
23  * OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
25  * OTHER DEALINGS IN THE SOFTWARE.
26  *
27  * Except as contained in this notice, the name of Maxim Integrated
28  * Products, Inc. shall not be used except as stated in the Maxim Integrated
29  * Products, Inc. Branding Policy.
30  *
31  * The mere transfer of this software does not imply any licenses
32  * of trade secrets, proprietary technology, copyrights, patents,
33  * trademarks, maskwork rights, or any other form of intellectual
34  * property whatsoever. Maxim Integrated Products, Inc. retains all
35  * ownership rights.
36  *
37  *************************************************************************** */
38 
39 /* Define to prevent redundant inclusion */
40 #ifndef _HTMR_H_
41 #define _HTMR_H_
42 
43 /* **** Includes **** */
44 #include <stdint.h>
45 #include "mxc_device.h"
46 #include "htmr_regs.h"
47 #include "mxc_sys.h"
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
59 /* **** Definitions **** */
60 #define IBRO_FREQ HIRC8_FREQ
61 
65 typedef enum {
70 
74 typedef enum {
79 
87 int MXC_HTMR_EnableInt (mxc_htmr_regs_t* htmr, uint32_t mask);
88 
96 int MXC_HTMR_DisableInt (mxc_htmr_regs_t* htmr, uint32_t mask);
97 
104 int MXC_HTMR_SetLongAlarm (mxc_htmr_regs_t* htmr, uint32_t interval);
105 
112 int MXC_HTMR_SetShortAlarm (mxc_htmr_regs_t* htmr, uint32_t interval);
113 
120 
127 
135 int MXC_HTMR_Init (mxc_htmr_regs_t* htmr, uint32_t longInterval, uint8_t shortInterval);
136 
143 
152 
160 int MXC_HTMR_ClearFlags (mxc_htmr_regs_t* htmr, int flags);
161 
168 
175 
176 #ifdef __cplusplus
177 }
178 #endif
179 
181 #endif /* _HTMR_H_ */
MXC_HTMR_DisableInt
int MXC_HTMR_DisableInt(mxc_htmr_regs_t *htmr, uint32_t mask)
Disable Interurpts.
MXC_HTMR_Stop
int MXC_HTMR_Stop(mxc_htmr_regs_t *htmr)
Disable/Stop the High Speed Timer.
MXC_HTMR_SetLongAlarm
int MXC_HTMR_SetLongAlarm(mxc_htmr_regs_t *htmr, uint32_t interval)
Set Long Interval alarm value and enable Interrupt.
MXC_HTMR_INT_FL_READY
@ MXC_HTMR_INT_FL_READY
Timer ready interrupt flag.
Definition: htmr.h:77
mxc_htmr_regs_t
Definition: htmr_regs.h:88
mxc_htmr_int_fl_t
mxc_htmr_int_fl_t
Bitmasks for each of the HTimer's interrupt flags.
Definition: htmr.h:74
MXC_F_HTMR_CTRL_ALARM_TOD_FL
#define MXC_F_HTMR_CTRL_ALARM_TOD_FL
Definition: htmr_regs.h:182
MXC_F_HTMR_CTRL_ALARM_SS_FL
#define MXC_F_HTMR_CTRL_ALARM_SS_FL
Definition: htmr_regs.h:185
MXC_HTMR_Init
int MXC_HTMR_Init(mxc_htmr_regs_t *htmr, uint32_t longInterval, uint8_t shortInterval)
Initialize the longInterval and shortInterval registers and enable MXC_HTMR.
MXC_HTMR_GetLongCount
int MXC_HTMR_GetLongCount(mxc_htmr_regs_t *htmr)
Get value in long interval register.
MXC_HTMR_GetFlags
int MXC_HTMR_GetFlags(mxc_htmr_regs_t *htmr)
Get interrupt flags.
MXC_F_HTMR_CTRL_READY_INT_EN
#define MXC_F_HTMR_CTRL_READY_INT_EN
Definition: htmr_regs.h:179
mxc_htmr_int_en_t
mxc_htmr_int_en_t
Bitmasks for each of the HTimer's interrupt enables.
Definition: htmr.h:65
MXC_F_HTMR_CTRL_ALARM_TOD_EN
#define MXC_F_HTMR_CTRL_ALARM_TOD_EN
Definition: htmr_regs.h:167
MXC_HTMR_INT_FL_SHORT
@ MXC_HTMR_INT_FL_SHORT
Short-interval alarm interrupt flag.
Definition: htmr.h:76
MXC_HTMR_Start
int MXC_HTMR_Start(mxc_htmr_regs_t *htmr)
Enable/Start the High Speed Timer.
MXC_HTMR_CheckBusy
int MXC_HTMR_CheckBusy(mxc_htmr_regs_t *htmr)
Check if BUSY bit is 0.
MXC_HTMR_INT_EN_SHORT
@ MXC_HTMR_INT_EN_SHORT
Short-interval alarm interrupt enable.
Definition: htmr.h:67
MXC_HTMR_EnableInt
int MXC_HTMR_EnableInt(mxc_htmr_regs_t *htmr, uint32_t mask)
Enable Interurpts.
MXC_F_HTMR_CTRL_READY
#define MXC_F_HTMR_CTRL_READY
Definition: htmr_regs.h:176
MXC_HTMR_ClearFlags
int MXC_HTMR_ClearFlags(mxc_htmr_regs_t *htmr, int flags)
Clear interrupt flags.
MXC_HTMR_SetShortAlarm
int MXC_HTMR_SetShortAlarm(mxc_htmr_regs_t *htmr, uint32_t interval)
Set Short Interval alarm value and enable interrupt,.
MXC_HTMR_INT_EN_READY
@ MXC_HTMR_INT_EN_READY
Timer ready interrupt enable.
Definition: htmr.h:68
MXC_HTMR_INT_EN_LONG
@ MXC_HTMR_INT_EN_LONG
Long-interval alarm interrupt enable.
Definition: htmr.h:66
MXC_HTMR_INT_FL_LONG
@ MXC_HTMR_INT_FL_LONG
Long-interval alarm interrupt flag.
Definition: htmr.h:75
MXC_HTMR_GetShortCount
int MXC_HTMR_GetShortCount(mxc_htmr_regs_t *htmr)
Get value in short interval register.
MXC_F_HTMR_CTRL_ALARM_SS_EN
#define MXC_F_HTMR_CTRL_ALARM_SS_EN
Definition: htmr_regs.h:170