RTEMS 6.1-rc2
Loading...
Searching...
No Matches
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
18/*******************************************************************************
19 * Definitions
20 *******************************************************************************/
21
25#define FSL_EWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 3))
29#if defined(FSL_FEATURE_EWM_HAS_CLOCK_SELECT) && FSL_FEATURE_EWM_HAS_CLOCK_SELECT
30typedef 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
44typedef struct _ewm_config
45{
46 bool enableEwm;
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 */
59
66{
67 kEWM_InterruptEnable = EWM_CTRL_INTEN_MASK,
68};
69
76{
77 kEWM_RunningFlag = EWM_CTRL_EWMEN_MASK,
78};
79
80/*******************************************************************************
81 * API
82 *******************************************************************************/
83
84#if defined(__cplusplus)
85extern "C" {
86#endif /* __cplusplus */
87
112void EWM_Init(EWM_Type *base, const ewm_config_t *config);
113
121void EWM_Deinit(EWM_Type *base);
122
143
144/* @} */
145
161static inline void EWM_EnableInterrupts(EWM_Type *base, uint32_t mask)
162{
163 base->CTRL |= (uint8_t)mask;
164}
165
176static inline void EWM_DisableInterrupts(EWM_Type *base, uint32_t mask)
177{
178 base->CTRL &= (uint8_t)(~mask);
179}
180
196static inline uint32_t EWM_GetStatusFlags(EWM_Type *base)
197{
198 return ((uint32_t)base->CTRL & EWM_CTRL_EWMEN_MASK);
199}
200
208void EWM_Refresh(EWM_Type *base);
209
212#if defined(__cplusplus)
213}
214#endif /* __cplusplus */
215
218#endif /* _FSL_EWM_H_ */
void EWM_Deinit(EWM_Type *base)
Deinitializes the EWM peripheral.
Definition: fsl_ewm.c:73
bool enableEwm
Definition: fsl_ewm.h:46
uint8_t compareLowValue
Definition: fsl_ewm.h:56
_ewm_status_flags_t
EWM status flags.
Definition: fsl_ewm.h:76
bool enableInterrupt
Definition: fsl_ewm.h:49
void EWM_GetDefaultConfig(ewm_config_t *config)
Initializes the EWM configuration structure.
Definition: fsl_ewm.c:103
bool setInputAssertLogic
Definition: fsl_ewm.h:48
bool enableEwmInput
Definition: fsl_ewm.h:47
uint8_t compareHighValue
Definition: fsl_ewm.h:57
void EWM_Refresh(EWM_Type *base)
Services the EWM.
Definition: fsl_ewm.c:131
_ewm_interrupt_enable_t
EWM interrupt configuration structure with default settings all disabled.
Definition: fsl_ewm.h:66
struct _ewm_config ewm_config_t
Describes EWM clock source.
void EWM_Init(EWM_Type *base, const ewm_config_t *config)
Initializes the EWM peripheral.
Definition: fsl_ewm.c:39
@ kEWM_RunningFlag
Definition: fsl_ewm.h:77
@ kEWM_InterruptEnable
Definition: fsl_ewm.h:67
Definition: MIMXRT1052.h:20382
Describes EWM clock source.
Definition: fsl_ewm.h:45
Definition: deflate.c:114