Lines Matching refs:id
18 uint32_t dma_stm32_id_to_stream(uint32_t id) in dma_stm32_id_to_stream() argument
39 __ASSERT_NO_MSG(id < ARRAY_SIZE(stream_nr)); in dma_stm32_id_to_stream()
41 return stream_nr[id]; in dma_stm32_id_to_stream()
44 void dma_stm32_clear_ht(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_ht() argument
65 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_ht()
67 func[id](DMAx); in dma_stm32_clear_ht()
70 void dma_stm32_clear_tc(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_tc() argument
91 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_tc()
93 func[id](DMAx); in dma_stm32_clear_tc()
96 bool dma_stm32_is_ht_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_ht_active() argument
117 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_ht_active()
119 return func[id](DMAx); in dma_stm32_is_ht_active()
122 bool dma_stm32_is_tc_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_tc_active() argument
143 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_tc_active()
145 return func[id](DMAx); in dma_stm32_is_tc_active()
149 void dma_stm32_clear_te(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_te() argument
170 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_te()
172 func[id](DMAx); in dma_stm32_clear_te()
175 void dma_stm32_clear_gi(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_clear_gi() argument
196 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_clear_gi()
198 func[id](DMAx); in dma_stm32_clear_gi()
201 bool dma_stm32_is_te_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_te_active() argument
222 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_te_active()
224 return func[id](DMAx); in dma_stm32_is_te_active()
227 bool dma_stm32_is_gi_active(DMA_TypeDef *DMAx, uint32_t id) in dma_stm32_is_gi_active() argument
248 __ASSERT_NO_MSG(id < ARRAY_SIZE(func)); in dma_stm32_is_gi_active()
250 return func[id](DMAx); in dma_stm32_is_gi_active()
253 void stm32_dma_dump_stream_irq(DMA_TypeDef *dma, uint32_t id) in stm32_dma_dump_stream_irq() argument
256 dma_stm32_is_tc_active(dma, id), in stm32_dma_dump_stream_irq()
257 dma_stm32_is_ht_active(dma, id), in stm32_dma_dump_stream_irq()
258 dma_stm32_is_te_active(dma, id), in stm32_dma_dump_stream_irq()
259 dma_stm32_is_gi_active(dma, id)); in stm32_dma_dump_stream_irq()
262 bool stm32_dma_is_tc_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_tc_irq_active() argument
264 return LL_DMA_IsEnabledIT_TC(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_tc_irq_active()
265 dma_stm32_is_tc_active(dma, id); in stm32_dma_is_tc_irq_active()
268 bool stm32_dma_is_ht_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_ht_irq_active() argument
270 return LL_DMA_IsEnabledIT_HT(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_ht_irq_active()
271 dma_stm32_is_ht_active(dma, id); in stm32_dma_is_ht_irq_active()
274 static inline bool stm32_dma_is_te_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_te_irq_active() argument
276 return LL_DMA_IsEnabledIT_TE(dma, dma_stm32_id_to_stream(id)) && in stm32_dma_is_te_irq_active()
277 dma_stm32_is_te_active(dma, id); in stm32_dma_is_te_irq_active()
280 bool stm32_dma_is_irq_active(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_irq_active() argument
282 return stm32_dma_is_tc_irq_active(dma, id) || in stm32_dma_is_irq_active()
283 stm32_dma_is_ht_irq_active(dma, id) || in stm32_dma_is_irq_active()
284 stm32_dma_is_te_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()
292 bool stm32_dma_is_irq_happened(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_irq_happened() argument
294 if (dma_stm32_is_te_active(dma, id)) { in stm32_dma_is_irq_happened()
301 bool stm32_dma_is_unexpected_irq_happened(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_unexpected_irq_happened() argument
307 void stm32_dma_enable_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_enable_stream() argument
309 LL_DMA_EnableChannel(dma, dma_stm32_id_to_stream(id)); in stm32_dma_enable_stream()
312 bool stm32_dma_is_enabled_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_is_enabled_stream() argument
314 if (LL_DMA_IsEnabledChannel(dma, dma_stm32_id_to_stream(id)) == 1) { in stm32_dma_is_enabled_stream()
320 int stm32_dma_disable_stream(DMA_TypeDef *dma, uint32_t id) in stm32_dma_disable_stream() argument
322 LL_DMA_DisableChannel(dma, dma_stm32_id_to_stream(id)); in stm32_dma_disable_stream()
324 if (!LL_DMA_IsEnabledChannel(dma, dma_stm32_id_to_stream(id))) { in stm32_dma_disable_stream()