RTEMS
6.3
Toggle main menu visibility
Loading...
Searching...
No Matches
bsps
arm
imxrt
mcux-sdk
drivers
ewm
fsl_ewm.h
1
/*
2
* Copyright (c) 2015, Freescale Semiconductor, Inc.
3
* Copyright 2016-2017, 2020 NXP
4
* All rights reserved.
5
*
6
* SPDX-License-Identifier: BSD-3-Clause
7
*/
8
#ifndef _FSL_EWM_H_
9
#define _FSL_EWM_H_
10
11
#include "fsl_common.h"
12
17
18
/*******************************************************************************
19
* Definitions
20
*******************************************************************************/
21
25
#define FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 3))
27
29
#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT
30
typedef
enum
_ewm_lpo_clock_source
31
{
32
kEWM_LpoClockSource0 = 0U,
33
kEWM_LpoClockSource1 = 1U,
34
kEWM_LpoClockSource2 = 2U,
35
kEWM_LpoClockSource3 = 3U,
36
} ewm_lpo_clock_source_t;
37
#endif
/* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */
38
44
typedef
struct
_ewm_config
45
{
46
bool
enableEwm
;
47
bool
enableEwmInput
;
48
bool
setInputAssertLogic
;
49
bool
enableInterrupt
;
50
#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT
51
ewm_lpo_clock_source_t clockSource;
52
#endif
/* FSL_FEATURE_EWM_HAS_CLOCK_SELECT */
53
#if defined(FSL_FEATURE_EWM_HAS_PRESCALER) && FSL_FEATURE_EWM_HAS_PRESCALER
54
uint8_t prescaler;
55
#endif
/* FSL_FEATURE_EWM_HAS_PRESCALER */
56
uint8_t
compareLowValue
;
57
uint8_t
compareHighValue
;
58
}
ewm_config_t
;
59
65
enum
_ewm_interrupt_enable_t
66
{
67
kEWM_InterruptEnable
= EWM_CTRL_INTEN_MASK,
68
};
69
75
enum
_ewm_status_flags_t
76
{
77
kEWM_RunningFlag
= EWM_CTRL_EWMEN_MASK,
78
};
79
80
/*******************************************************************************
81
* API
82
*******************************************************************************/
83
84
#if defined(__cplusplus)
85
extern
"C"
{
86
#endif
/* __cplusplus */
87
92
112
void
EWM_Init
(
EWM_Type
*base,
const
ewm_config_t
*config);
113
121
void
EWM_Deinit
(
EWM_Type
*base);
122
142
void
EWM_GetDefaultConfig
(
ewm_config_t
*config);
143
144
/* @} */
145
150
161
static
inline
void
EWM_EnableInterrupts(
EWM_Type
*base, uint32_t mask)
162
{
163
base->CTRL |= (uint8_t)mask;
164
}
165
176
static
inline
void
EWM_DisableInterrupts(
EWM_Type
*base, uint32_t mask)
177
{
178
base->CTRL &= (uint8_t)(~mask);
179
}
180
196
static
inline
uint32_t EWM_GetStatusFlags(
EWM_Type
*base)
197
{
198
return
((uint32_t)base->CTRL & EWM_CTRL_EWMEN_MASK);
199
}
200
208
void
EWM_Refresh
(
EWM_Type
*base);
209
211
212
#if defined(__cplusplus)
213
}
214
#endif
/* __cplusplus */
215
217
218
#endif
/* _FSL_EWM_H_ */
EWM_Deinit
void EWM_Deinit(EWM_Type *base)
Deinitializes the EWM peripheral.
Definition
fsl_ewm.c:73
_ewm_config::enableEwm
bool enableEwm
Definition
fsl_ewm.h:46
_ewm_config::compareLowValue
uint8_t compareLowValue
Definition
fsl_ewm.h:56
_ewm_status_flags_t
_ewm_status_flags_t
EWM status flags.
Definition
fsl_ewm.h:76
_ewm_config::enableInterrupt
bool enableInterrupt
Definition
fsl_ewm.h:49
EWM_GetDefaultConfig
void EWM_GetDefaultConfig(ewm_config_t *config)
Initializes the EWM configuration structure.
Definition
fsl_ewm.c:103
_ewm_config::setInputAssertLogic
bool setInputAssertLogic
Definition
fsl_ewm.h:48
_ewm_config::enableEwmInput
bool enableEwmInput
Definition
fsl_ewm.h:47
_ewm_config::compareHighValue
uint8_t compareHighValue
Definition
fsl_ewm.h:57
EWM_Refresh
void EWM_Refresh(EWM_Type *base)
Services the EWM.
Definition
fsl_ewm.c:131
_ewm_interrupt_enable_t
_ewm_interrupt_enable_t
EWM interrupt configuration structure with default settings all disabled.
Definition
fsl_ewm.h:66
ewm_config_t
struct _ewm_config ewm_config_t
Describes EWM clock source.
EWM_Init
void EWM_Init(EWM_Type *base, const ewm_config_t *config)
Initializes the EWM peripheral.
Definition
fsl_ewm.c:39
kEWM_RunningFlag
@ kEWM_RunningFlag
Definition
fsl_ewm.h:77
kEWM_InterruptEnable
@ kEWM_InterruptEnable
Definition
fsl_ewm.h:67
EWM_Type
Definition
MIMXRT1052.h:20382
_ewm_config
Describes EWM clock source.
Definition
fsl_ewm.h:45
Generated by
1.18.0