fsl_dmamux.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Freescale Semiconductor, Inc.
3  * Copyright 2016-2017 NXP
4  * All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef _FSL_DMAMUX_H_
10 #define _FSL_DMAMUX_H_
11 
12 #include "fsl_common.h"
13 
19 /*******************************************************************************
20  * Definitions
21  ******************************************************************************/
22 
26 #define FSL_DMAMUX_DRIVER_VERSION (MAKE_VERSION(2, 0, 4))
27 
29 /*******************************************************************************
30  * API
31  ******************************************************************************/
32 
33 #if defined(__cplusplus)
34 extern "C" {
35 #endif /* __cplusplus */
36 
50 void DMAMUX_Init(DMAMUX_Type *base);
51 
59 void DMAMUX_Deinit(DMAMUX_Type *base);
60 
61 /* @} */
75 static inline void DMAMUX_EnableChannel(DMAMUX_Type *base, uint32_t channel)
76 {
77  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
78 
79  base->CHCFG[channel] |= DMAMUX_CHCFG_ENBL_MASK;
80 }
81 
91 static inline void DMAMUX_DisableChannel(DMAMUX_Type *base, uint32_t channel)
92 {
93  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
94 
95  base->CHCFG[channel] &= ~(uint8_t)DMAMUX_CHCFG_ENBL_MASK;
96 }
97 
105 static inline void DMAMUX_SetSource(DMAMUX_Type *base, uint32_t channel, uint32_t source)
106 {
107  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
108 
109  base->CHCFG[channel] = (uint8_t)((base->CHCFG[channel] & ~DMAMUX_CHCFG_SOURCE_MASK) | DMAMUX_CHCFG_SOURCE(source));
110 }
111 
112 #if defined(FSL_FEATURE_DMAMUX_HAS_TRIG) && FSL_FEATURE_DMAMUX_HAS_TRIG > 0U
113 
121 static inline void DMAMUX_EnablePeriodTrigger(DMAMUX_Type *base, uint32_t channel)
122 {
123  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
124 
125  base->CHCFG[channel] |= DMAMUX_CHCFG_TRIG_MASK;
126 }
127 
136 static inline void DMAMUX_DisablePeriodTrigger(DMAMUX_Type *base, uint32_t channel)
137 {
138  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
139 
140  base->CHCFG[channel] &= ~(uint8_t)DMAMUX_CHCFG_TRIG_MASK;
141 }
142 #endif /* FSL_FEATURE_DMAMUX_HAS_TRIG */
143 
144 #if (defined(FSL_FEATURE_DMAMUX_HAS_A_ON) && FSL_FEATURE_DMAMUX_HAS_A_ON)
145 
154 static inline void DMAMUX_EnableAlwaysOn(DMAMUX_Type *base, uint32_t channel, bool enable)
155 {
156  assert(channel < (uint32_t)FSL_FEATURE_DMAMUX_MODULE_CHANNEL);
157 
158  if (enable)
159  {
160  base->CHCFG[channel] |= DMAMUX_CHCFG_A_ON_MASK;
161  }
162  else
163  {
164  base->CHCFG[channel] &= ~DMAMUX_CHCFG_A_ON_MASK;
165  }
166 }
167 #endif /* FSL_FEATURE_DMAMUX_HAS_A_ON */
168 
169 /* @} */
170 
171 #if defined(__cplusplus)
172 }
173 #endif /* __cplusplus */
174 
175 /* @} */
176 
177 #endif /* _FSL_DMAMUX_H_ */
fsl_common.h
DMAMUX_CHCFG_SOURCE_MASK
#define DMAMUX_CHCFG_SOURCE_MASK
Definition: MIMXRT1052.h:15075
DMAMUX_Deinit
void DMAMUX_Deinit(DMAMUX_Type *base)
Deinitializes the DMAMUX peripheral.
Definition: fsl_dmamux.c:86
DMAMUX_EnableChannel
static void DMAMUX_EnableChannel(DMAMUX_Type *base, uint32_t channel)
Enables the DMAMUX channel.
Definition: fsl_dmamux.h:75
DMAMUX_DisableChannel
static void DMAMUX_DisableChannel(DMAMUX_Type *base, uint32_t channel)
Disables the DMAMUX channel.
Definition: fsl_dmamux.h:91
FSL_FEATURE_DMAMUX_MODULE_CHANNEL
#define FSL_FEATURE_DMAMUX_MODULE_CHANNEL
Definition: MIMXRT1052_features.h:264
DMAMUX_CHCFG_A_ON_MASK
#define DMAMUX_CHCFG_A_ON_MASK
Definition: MIMXRT1052.h:15080
DMAMUX_CHCFG_ENBL_MASK
#define DMAMUX_CHCFG_ENBL_MASK
Definition: MIMXRT1052.h:15095
DMAMUX_CHCFG_TRIG_MASK
#define DMAMUX_CHCFG_TRIG_MASK
Definition: MIMXRT1052.h:15087
DMAMUX_Type::CHCFG
__IO uint32_t CHCFG[32]
Definition: MIMXRT1052.h:15061
DMAMUX_Init
void DMAMUX_Init(DMAMUX_Type *base)
Initializes the DMAMUX peripheral.
Definition: fsl_dmamux.c:72
DMAMUX_SetSource
static void DMAMUX_SetSource(DMAMUX_Type *base, uint32_t channel, uint32_t source)
Configures the DMAMUX channel source.
Definition: fsl_dmamux.h:105
DMAMUX_Type
Definition: MIMXRT1052.h:15060
DMAMUX_CHCFG_SOURCE
#define DMAMUX_CHCFG_SOURCE(x)
Definition: MIMXRT1052.h:15079


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:56