Lines Matching refs:id
20 uint32_t dma_stm32_id_to_stream(uint32_t id) in dma_stm32_id_to_stream() argument
33 __ASSERT_NO_MSG(id < ARRAY_SIZE(stream_nr)); in dma_stm32_id_to_stream()
35 return stream_nr[id]; in dma_stm32_id_to_stream()
58 void dma_stm32_clear_ht(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_ht() argument
71 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_ht()
73 func[id](DMAx); in dma_stm32_clear_ht()
76 void dma_stm32_clear_tc(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_tc() argument
89 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_tc()
91 func[id](DMAx); in dma_stm32_clear_tc()
94 bool dma_stm32_is_ht_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_ht_active() argument
107 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_ht_active()
109 return func[id](DMAx); in dma_stm32_is_ht_active()
112 bool dma_stm32_is_tc_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_tc_active() argument
125 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_tc_active()
127 return func[id](DMAx); in dma_stm32_is_tc_active()
130 void dma_stm32_clear_te(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_te() argument
143 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_te()
145 func[id](DMAx); in dma_stm32_clear_te()
148 void dma_stm32_clear_dme(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_dme() argument
161 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_dme()
163 func[id](DMAx); in dma_stm32_clear_dme()
166 void dma_stm32_clear_fe(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_fe() argument
179 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_fe()
181 func[id](DMAx); in dma_stm32_clear_fe()
184 bool dma_stm32_is_te_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_te_active() argument
197 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_te_active()
199 return func[id](DMAx); in dma_stm32_is_te_active()
202 bool dma_stm32_is_dme_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_dme_active() argument
215 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_dme_active()
217 return func[id](DMAx); in dma_stm32_is_dme_active()
220 bool dma_stm32_is_fe_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_fe_active() argument
233 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_fe_active()
235 return func[id](DMAx); in dma_stm32_is_fe_active()
238 void stm32_dma_dump_stream_irq(DMA_TypeDef *dma, uint32_t id) in stm32_dma_dump_stream_irq() argument
241 dma_stm32_is_tc_active(dma, id), in stm32_dma_dump_stream_irq()
242 dma_stm32_is_ht_active(dma, id), in stm32_dma_dump_stream_irq()
243 dma_stm32_is_te_active(dma, id), in stm32_dma_dump_stream_irq()
244 dma_stm32_is_dme_active(dma, id), in stm32_dma_dump_stream_irq()
245 dma_stm32_is_fe_active(dma, id)); in stm32_dma_dump_stream_irq()
248 inline bool stm32_dma_is_tc_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_tc_irq_active() argument
250 return LL_DMA_IsEnabledIT_TC(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_tc_irq_active()
251 dma_stm32_is_tc_active(dma, id); in stm32_dma_is_tc_irq_active()
254 inline bool stm32_dma_is_ht_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_ht_irq_active() argument
256 return LL_DMA_IsEnabledIT_HT(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_ht_irq_active()
257 dma_stm32_is_ht_active(dma, id); in stm32_dma_is_ht_irq_active()
260 static inline bool stm32_dma_is_te_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_te_irq_active() argument
262 return LL_DMA_IsEnabledIT_TE(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_te_irq_active()
263 dma_stm32_is_te_active(dma, id); in stm32_dma_is_te_irq_active()
266 static inline bool stm32_dma_is_dme_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_dme_irq_active() argument
268 return LL_DMA_IsEnabledIT_DME(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_dme_irq_active()
269 dma_stm32_is_dme_active(dma, id); in stm32_dma_is_dme_irq_active()
272 static inline bool stm32_dma_is_fe_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_fe_irq_active() argument
274 return LL_DMA_IsEnabledIT_FE(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_fe_irq_active()
275 dma_stm32_is_fe_active(dma, id); in stm32_dma_is_fe_irq_active()
278 bool stm32_dma_is_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_irq_active() argument
280 return stm32_dma_is_tc_irq_active(dma, id) || in stm32_dma_is_irq_active()
281 stm32_dma_is_ht_irq_active(dma, id) || in stm32_dma_is_irq_active()
282 stm32_dma_is_te_irq_active(dma, id) || in stm32_dma_is_irq_active()
283 stm32_dma_is_dme_irq_active(dma, id) || in stm32_dma_is_irq_active()
284 stm32_dma_is_fe_irq_active(dma, id); in stm32_dma_is_irq_active()
287 void stm32_dma_clear_stream_irq(DMA_TypeDef *dma, uint32_t id) in stm32_dma_clear_stream_irq() argument
289 dma_stm32_clear_te(dma, id); in stm32_dma_clear_stream_irq()
290 dma_stm32_clear_dme(dma, id); in stm32_dma_clear_stream_irq()
291 dma_stm32_clear_fe(dma, id); in stm32_dma_clear_stream_irq()
294 bool stm32_dma_is_irq_happened(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_irq_happened() argument
296 if (LL_DMA_IsEnabledIT_FE(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_irq_happened()
297 dma_stm32_is_fe_active(dma, id)) { in stm32_dma_is_irq_happened()
304 bool stm32_dma_is_unexpected_irq_happened(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_unexpected_irq_happened() argument
306 if (LL_DMA_IsEnabledIT_FE(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_unexpected_irq_happened()
307 dma_stm32_is_fe_active(dma, id)) { in stm32_dma_is_unexpected_irq_happened()
309 stm32_dma_dump_stream_irq(dma, id); in stm32_dma_is_unexpected_irq_happened()
310 stm32_dma_clear_stream_irq(dma, id); in stm32_dma_is_unexpected_irq_happened()
318 void stm32_dma_enable_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_enable_stream() argument
320 LL_DMA_EnableStream(dma, dma_stm32_id_to_stream(id)); in stm32_dma_enable_stream()
323 bool stm32_dma_is_enabled_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_enabled_stream() argument
325 if (LL_DMA_IsEnabledStream(dma, dma_stm32_id_to_stream(id)) == 1) { in stm32_dma_is_enabled_stream()
331 int stm32_dma_disable_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_disable_stream() argument
333 LL_DMA_DisableStream(dma, dma_stm32_id_to_stream(id)); in stm32_dma_disable_stream()
335 while (stm32_dma_is_enabled_stream(dma, id)) { in stm32_dma_disable_stream()
338 dma_stm32_clear_tc(dma, id); in stm32_dma_disable_stream()
343 void stm32_dma_disable_fifo_irq(DMA_TypeDef *dma, uint32_t id) in stm32_dma_disable_fifo_irq() argument
345 LL_DMA_DisableIT_FE(dma, dma_stm32_id_to_stream(id)); in stm32_dma_disable_fifo_irq()
349 void stm32_dma_config_channel_function(DMA_TypeDef *dma, uint32_t id, in stm32_dma_config_channel_function() argument
352 LL_DMA_SetChannelSelection(dma, dma_stm32_id_to_stream(id), in stm32_dma_config_channel_function()