stm32g0xx_ll_dmamux.h 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828
  1. /**
  2. ******************************************************************************
  3. * @file stm32g0xx_ll_dmamux.h
  4. * @author MCD Application Team
  5. * @brief Header file of DMAMUX LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2018 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32G0xx_LL_DMAMUX_H
  21. #define STM32G0xx_LL_DMAMUX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32g0xx.h"
  27. /** @addtogroup STM32G0xx_LL_Driver
  28. * @{
  29. */
  30. #if defined (DMAMUX1)
  31. /** @defgroup DMAMUX_LL DMAMUX
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /* Private constants ---------------------------------------------------------*/
  37. /** @defgroup DMAMUX_LL_Private_Constants DMAMUX Private Constants
  38. * @{
  39. */
  40. /* Define used to get DMAMUX CCR register size */
  41. #define DMAMUX_CCR_SIZE 0x00000004UL
  42. /* Define used to get DMAMUX RGCR register size */
  43. #define DMAMUX_RGCR_SIZE 0x00000004UL
  44. /**
  45. * @}
  46. */
  47. /* Private macros ------------------------------------------------------------*/
  48. /* Exported types ------------------------------------------------------------*/
  49. /* Exported constants --------------------------------------------------------*/
  50. /** @defgroup DMAMUX_LL_Exported_Constants DMAMUX Exported Constants
  51. * @{
  52. */
  53. /** @defgroup DMAMUX_LL_EC_CLEAR_FLAG Clear Flags Defines
  54. * @brief Flags defines which can be used with LL_DMAMUX_WriteReg function
  55. * @{
  56. */
  57. #define LL_DMAMUX_CFR_CSOF0 DMAMUX_CFR_CSOF0 /*!< Synchronization Event Overrun Flag Channel 0 */
  58. #define LL_DMAMUX_CFR_CSOF1 DMAMUX_CFR_CSOF1 /*!< Synchronization Event Overrun Flag Channel 1 */
  59. #define LL_DMAMUX_CFR_CSOF2 DMAMUX_CFR_CSOF2 /*!< Synchronization Event Overrun Flag Channel 2 */
  60. #define LL_DMAMUX_CFR_CSOF3 DMAMUX_CFR_CSOF3 /*!< Synchronization Event Overrun Flag Channel 3 */
  61. #define LL_DMAMUX_CFR_CSOF4 DMAMUX_CFR_CSOF4 /*!< Synchronization Event Overrun Flag Channel 4 */
  62. #if defined(DMAMUX1_Channel5)
  63. #define LL_DMAMUX_CFR_CSOF5 DMAMUX_CFR_CSOF5 /*!< Synchronization Event Overrun Flag Channel 5 */
  64. #endif
  65. #if defined(DMAMUX1_Channel6)
  66. #define LL_DMAMUX_CFR_CSOF6 DMAMUX_CFR_CSOF6 /*!< Synchronization Event Overrun Flag Channel 6 */
  67. #endif
  68. #if defined(DMA2)
  69. #define LL_DMAMUX_CFR_CSOF7 DMAMUX_CFR_CSOF7 /*!< Synchronization Event Overrun Flag Channel 7 */
  70. #define LL_DMAMUX_CFR_CSOF8 DMAMUX_CFR_CSOF8 /*!< Synchronization Event Overrun Flag Channel 8 */
  71. #define LL_DMAMUX_CFR_CSOF9 DMAMUX_CFR_CSOF9 /*!< Synchronization Event Overrun Flag Channel 9 */
  72. #define LL_DMAMUX_CFR_CSOF10 DMAMUX_CFR_CSOF10 /*!< Synchronization Event Overrun Flag Channel 10 */
  73. #define LL_DMAMUX_CFR_CSOF11 DMAMUX_CFR_CSOF11 /*!< Synchronization Event Overrun Flag Channel 11 */
  74. #endif /* DMA2 */
  75. #define LL_DMAMUX_RGCFR_RGCOF0 DMAMUX_RGCFR_COF0 /*!< Request Generator 0 Trigger Event Overrun Flag */
  76. #define LL_DMAMUX_RGCFR_RGCOF1 DMAMUX_RGCFR_COF1 /*!< Request Generator 1 Trigger Event Overrun Flag */
  77. #define LL_DMAMUX_RGCFR_RGCOF2 DMAMUX_RGCFR_COF2 /*!< Request Generator 2 Trigger Event Overrun Flag */
  78. #define LL_DMAMUX_RGCFR_RGCOF3 DMAMUX_RGCFR_COF3 /*!< Request Generator 3 Trigger Event Overrun Flag */
  79. /**
  80. * @}
  81. */
  82. /** @defgroup DMAMUX_LL_EC_GET_FLAG Get Flags Defines
  83. * @brief Flags defines which can be used with LL_DMAMUX_ReadReg function
  84. * @{
  85. */
  86. #define LL_DMAMUX_CSR_SOF0 DMAMUX_CSR_SOF0 /*!< Synchronization Event Overrun Flag Channel 0 */
  87. #define LL_DMAMUX_CSR_SOF1 DMAMUX_CSR_SOF1 /*!< Synchronization Event Overrun Flag Channel 1 */
  88. #define LL_DMAMUX_CSR_SOF2 DMAMUX_CSR_SOF2 /*!< Synchronization Event Overrun Flag Channel 2 */
  89. #define LL_DMAMUX_CSR_SOF3 DMAMUX_CSR_SOF3 /*!< Synchronization Event Overrun Flag Channel 3 */
  90. #define LL_DMAMUX_CSR_SOF4 DMAMUX_CSR_SOF4 /*!< Synchronization Event Overrun Flag Channel 4 */
  91. #if defined(DMAMUX1_Channel5)
  92. #define LL_DMAMUX_CSR_SOF5 DMAMUX_CSR_SOF5 /*!< Synchronization Event Overrun Flag Channel 5 */
  93. #endif
  94. #if defined(DMAMUX1_Channel6)
  95. #define LL_DMAMUX_CSR_SOF6 DMAMUX_CSR_SOF6 /*!< Synchronization Event Overrun Flag Channel 6 */
  96. #endif
  97. #if defined(DMA2)
  98. #define LL_DMAMUX_CSR_SOF7 DMAMUX_CSR_SOF7 /*!< Synchronization Event Overrun Flag Channel 7 */
  99. #define LL_DMAMUX_CSR_SOF8 DMAMUX_CSR_SOF8 /*!< Synchronization Event Overrun Flag Channel 8 */
  100. #define LL_DMAMUX_CSR_SOF9 DMAMUX_CSR_SOF9 /*!< Synchronization Event Overrun Flag Channel 9 */
  101. #define LL_DMAMUX_CSR_SOF10 DMAMUX_CSR_SOF10 /*!< Synchronization Event Overrun Flag Channel 10 */
  102. #define LL_DMAMUX_CSR_SOF11 DMAMUX_CSR_SOF11 /*!< Synchronization Event Overrun Flag Channel 11 */
  103. #endif /* DMA2 */
  104. #define LL_DMAMUX_RGSR_RGOF0 DMAMUX_RGSR_OF0 /*!< Request Generator 0 Trigger Event Overrun Flag */
  105. #define LL_DMAMUX_RGSR_RGOF1 DMAMUX_RGSR_OF1 /*!< Request Generator 1 Trigger Event Overrun Flag */
  106. #define LL_DMAMUX_RGSR_RGOF2 DMAMUX_RGSR_OF2 /*!< Request Generator 2 Trigger Event Overrun Flag */
  107. #define LL_DMAMUX_RGSR_RGOF3 DMAMUX_RGSR_OF3 /*!< Request Generator 3 Trigger Event Overrun Flag */
  108. /**
  109. * @}
  110. */
  111. /** @defgroup DMAMUX_LL_EC_IT IT Defines
  112. * @brief IT defines which can be used with LL_DMA_ReadReg and LL_DMAMUX_WriteReg functions
  113. * @{
  114. */
  115. #define LL_DMAMUX_CCR_SOIE DMAMUX_CxCR_SOIE /*!< Synchronization Event Overrun Interrupt */
  116. #define LL_DMAMUX_RGCR_RGOIE DMAMUX_RGxCR_OIE /*!< Request Generation Trigger Event Overrun Interrupt */
  117. /**
  118. * @}
  119. */
  120. /** @defgroup DMAMUX_LL_EC_REQUEST Transfer request
  121. * @{
  122. */
  123. #define LL_DMAMUX_REQ_MEM2MEM 0x00000000U /*!< memory to memory transfer */
  124. #define LL_DMAMUX_REQ_GENERATOR0 0x00000001U /*!< DMAMUX request generator 0 */
  125. #define LL_DMAMUX_REQ_GENERATOR1 0x00000002U /*!< DMAMUX request generator 1 */
  126. #define LL_DMAMUX_REQ_GENERATOR2 0x00000003U /*!< DMAMUX request generator 2 */
  127. #define LL_DMAMUX_REQ_GENERATOR3 0x00000004U /*!< DMAMUX request generator 3 */
  128. #define LL_DMAMUX_REQ_ADC1 0x00000005U /*!< DMAMUX ADC1 request */
  129. #if defined(AES)
  130. #define LL_DMAMUX_REQ_AES_IN 0x00000006U /*!< DMAMUX AES_IN request */
  131. #define LL_DMAMUX_REQ_AES_OUT 0x00000007U /*!< DMAMUX AES_OUT request */
  132. #endif
  133. #if defined(DAC1)
  134. #define LL_DMAMUX_REQ_DAC1_CH1 0x00000008U /*!< DMAMUX DAC_CH1 request */
  135. #define LL_DMAMUX_REQ_DAC1_CH2 0x00000009U /*!< DMAMUX DAC_CH2 request */
  136. #endif
  137. #define LL_DMAMUX_REQ_I2C1_RX 0x0000000AU /*!< DMAMUX I2C1 RX request */
  138. #define LL_DMAMUX_REQ_I2C1_TX 0x0000000BU /*!< DMAMUX I2C1 TX request */
  139. #define LL_DMAMUX_REQ_I2C2_RX 0x0000000CU /*!< DMAMUX I2C2 RX request */
  140. #define LL_DMAMUX_REQ_I2C2_TX 0x0000000DU /*!< DMAMUX I2C2 TX request */
  141. #if defined(LPUART1)
  142. #define LL_DMAMUX_REQ_LPUART1_RX 0x0000000EU /*!< DMAMUX LPUART1 RX request */
  143. #define LL_DMAMUX_REQ_LPUART1_TX 0x0000000FU /*!< DMAMUX LPUART1 TX request */
  144. #endif
  145. #define LL_DMAMUX_REQ_SPI1_RX 0x00000010U /*!< DMAMUX SPI1 RX request */
  146. #define LL_DMAMUX_REQ_SPI1_TX 0x00000011U /*!< DMAMUX SPI1 TX request */
  147. #define LL_DMAMUX_REQ_SPI2_RX 0x00000012U /*!< DMAMUX SPI2 RX request */
  148. #define LL_DMAMUX_REQ_SPI2_TX 0x00000013U /*!< DMAMUX SPI2 TX request */
  149. #define LL_DMAMUX_REQ_TIM1_CH1 0x00000014U /*!< DMAMUX TIM1 CH1 request */
  150. #define LL_DMAMUX_REQ_TIM1_CH2 0x00000015U /*!< DMAMUX TIM1 CH2 request */
  151. #define LL_DMAMUX_REQ_TIM1_CH3 0x00000016U /*!< DMAMUX TIM1 CH3 request */
  152. #define LL_DMAMUX_REQ_TIM1_CH4 0x00000017U /*!< DMAMUX TIM1 CH4 request */
  153. #define LL_DMAMUX_REQ_TIM1_TRIG_COM 0x00000018U /*!< DMAMUX TIM1 TRIG COM request */
  154. #define LL_DMAMUX_REQ_TIM1_UP 0x00000019U /*!< DMAMUX TIM1 UP request */
  155. #if defined(TIM2)
  156. #define LL_DMAMUX_REQ_TIM2_CH1 0x0000001AU /*!< DMAMUX TIM2 CH1 request */
  157. #define LL_DMAMUX_REQ_TIM2_CH2 0x0000001BU /*!< DMAMUX TIM2 CH2 request */
  158. #define LL_DMAMUX_REQ_TIM2_CH3 0x0000001CU /*!< DMAMUX TIM2 CH3 request */
  159. #define LL_DMAMUX_REQ_TIM2_CH4 0x0000001DU /*!< DMAMUX TIM2 CH4 request */
  160. #define LL_DMAMUX_REQ_TIM2_TRIG 0x0000001EU /*!< DMAMUX TIM2 TRIG request */
  161. #define LL_DMAMUX_REQ_TIM2_UP 0x0000001FU /*!< DMAMUX TIM2 UP request */
  162. #endif
  163. #define LL_DMAMUX_REQ_TIM3_CH1 0x00000020U /*!< DMAMUX TIM3 CH1 request */
  164. #define LL_DMAMUX_REQ_TIM3_CH2 0x00000021U /*!< DMAMUX TIM3 CH2 request */
  165. #define LL_DMAMUX_REQ_TIM3_CH3 0x00000022U /*!< DMAMUX TIM3 CH3 request */
  166. #define LL_DMAMUX_REQ_TIM3_CH4 0x00000023U /*!< DMAMUX TIM3 CH4 request */
  167. #define LL_DMAMUX_REQ_TIM3_TRIG 0x00000024U /*!< DMAMUX TIM3 TRIG request */
  168. #define LL_DMAMUX_REQ_TIM3_UP 0x00000025U /*!< DMAMUX TIM3 UP request */
  169. #if defined(TIM6)
  170. #define LL_DMAMUX_REQ_TIM6_UP 0x00000026U /*!< DMAMUX TIM6 UP request */
  171. #endif
  172. #if defined(TIM7)
  173. #define LL_DMAMUX_REQ_TIM7_UP 0x00000027U /*!< DMAMUX TIM7 UP request */
  174. #endif
  175. #if defined(TIM15)
  176. #define LL_DMAMUX_REQ_TIM15_CH1 0x00000028U /*!< DMAMUX TIM15 CH1 request */
  177. #define LL_DMAMUX_REQ_TIM15_CH2 0x00000029U /*!< DMAMUX TIM15 CH2 request */
  178. #define LL_DMAMUX_REQ_TIM15_TRIG_COM 0x0000002AU /*!< DMAMUX TIM15 TRIG COM request */
  179. #define LL_DMAMUX_REQ_TIM15_UP 0x0000002BU /*!< DMAMUX TIM15 UP request */
  180. #endif
  181. #define LL_DMAMUX_REQ_TIM16_CH1 0x0000002CU /*!< DMAMUX TIM16 CH1 request */
  182. #define LL_DMAMUX_REQ_TIM16_COM 0x0000002DU /*!< DMAMUX TIM16 COM request */
  183. #define LL_DMAMUX_REQ_TIM16_UP 0x0000002EU /*!< DMAMUX TIM16 UP request */
  184. #define LL_DMAMUX_REQ_TIM17_CH1 0x0000002FU /*!< DMAMUX TIM17 CH1 request */
  185. #define LL_DMAMUX_REQ_TIM17_COM 0x00000030U /*!< DMAMUX TIM17 COM request */
  186. #define LL_DMAMUX_REQ_TIM17_UP 0x00000031U /*!< DMAMUX TIM17 UP request */
  187. #define LL_DMAMUX_REQ_USART1_RX 0x00000032U /*!< DMAMUX USART1 RX request */
  188. #define LL_DMAMUX_REQ_USART1_TX 0x00000033U /*!< DMAMUX USART1 TX request */
  189. #define LL_DMAMUX_REQ_USART2_RX 0x00000034U /*!< DMAMUX USART2 RX request */
  190. #define LL_DMAMUX_REQ_USART2_TX 0x00000035U /*!< DMAMUX USART2 TX request */
  191. #if defined(USART3)
  192. #define LL_DMAMUX_REQ_USART3_RX 0x00000036U /*!< DMAMUX USART3 RX request */
  193. #define LL_DMAMUX_REQ_USART3_TX 0x00000037U /*!< DMAMUX USART3 TX request */
  194. #endif
  195. #if defined(USART4)
  196. #define LL_DMAMUX_REQ_USART4_RX 0x00000038U /*!< DMAMUX USART4 RX request */
  197. #define LL_DMAMUX_REQ_USART4_TX 0x00000039U /*!< DMAMUX USART4 TX request */
  198. #endif
  199. #if defined(UCPD1)
  200. #define LL_DMAMUX_REQ_UCPD1_RX 0x0000003AU /*!< DMAMUX UCPD1 RX request */
  201. #define LL_DMAMUX_REQ_UCPD1_TX 0x0000003BU /*!< DMAMUX UCPD1 TX request */
  202. #endif
  203. #if defined(UCPD2)
  204. #define LL_DMAMUX_REQ_UCPD2_RX 0x0000003CU /*!< DMAMUX UCPD2 RX request */
  205. #define LL_DMAMUX_REQ_UCPD2_TX 0x0000003DU /*!< DMAMUX UCPD2 TX request */
  206. #endif
  207. #if defined(I2C3)
  208. #define LL_DMAMUX_REQ_I2C3_RX 0x0000003EU /*!< DMAMUX I2C3 RX request */
  209. #define LL_DMAMUX_REQ_I2C3_TX 0x0000003FU /*!< DMAMUX I2C3 TX request */
  210. #endif
  211. #if defined(LPUART2)
  212. #define LL_DMAMUX_REQ_LPUART2_RX 0x00000040U /*!< DMAMUX LPUART2 RX request */
  213. #define LL_DMAMUX_REQ_LPUART2_TX 0x00000041U /*!< DMAMUX LPUART2 TX request */
  214. #endif
  215. #if defined(SPI3)
  216. #define LL_DMAMUX_REQ_SPI3_RX 0x00000042U /*!< DMAMUX SPI3 RX request */
  217. #define LL_DMAMUX_REQ_SPI3_TX 0x00000043U /*!< DMAMUX SPI3 TX request */
  218. #endif
  219. #if defined(TIM4)
  220. #define LL_DMAMUX_REQ_TIM4_CH1 0x00000044U /*!< DMAMUX TIM4 CH1 request */
  221. #define LL_DMAMUX_REQ_TIM4_CH2 0x00000045U /*!< DMAMUX TIM4 CH2 request */
  222. #define LL_DMAMUX_REQ_TIM4_CH3 0x00000046U /*!< DMAMUX TIM4 CH3 request */
  223. #define LL_DMAMUX_REQ_TIM4_CH4 0x00000047U /*!< DMAMUX TIM4 CH4 request */
  224. #define LL_DMAMUX_REQ_TIM4_TRIG 0x00000048U /*!< DMAMUX TIM4 TRIG request */
  225. #define LL_DMAMUX_REQ_TIM4_UP 0x00000049U /*!< DMAMUX TIM4 UP request */
  226. #endif
  227. #if defined(USART5)
  228. #define LL_DMAMUX_REQ_USART5_RX 0x0000004AU /*!< DMAMUX USART5 RX request */
  229. #define LL_DMAMUX_REQ_USART5_TX 0x0000004BU /*!< DMAMUX USART5 TX request */
  230. #endif
  231. #if defined(USART6)
  232. #define LL_DMAMUX_REQ_USART6_RX 0x0000004CU /*!< DMAMUX USART6 RX request */
  233. #define LL_DMAMUX_REQ_USART6_TX 0x0000004DU /*!< DMAMUX USART6 TX request */
  234. #endif
  235. #if defined(STM32G0C1xx)||defined(STM32G0B1xx)
  236. #define LL_DMAMUX_MAX_REQ LL_DMAMUX_REQ_USART6_TX
  237. #elif defined(STM32G0B0xx)
  238. #define LL_DMAMUX_MAX_REQ LL_DMAMUX_REQ_USART4_TX
  239. #elif defined(STM32G081xx)||defined(STM32G071xx)
  240. #define LL_DMAMUX_MAX_REQ LL_DMAMUX_REQ_UCPD2_TX
  241. #elif defined(STM32G070xx)
  242. #define LL_DMAMUX_MAX_REQ LL_DMAMUX_REQ_USART4_TX
  243. #else
  244. #define LL_DMAMUX_MAX_REQ LL_DMAMUX_REQ_USART2_TX
  245. #endif
  246. /**
  247. * @}
  248. */
  249. /** @defgroup DMAMUX_LL_EC_CHANNEL DMAMUX Channel
  250. * @{
  251. */
  252. #define LL_DMAMUX_CHANNEL_0 0x00000000U /*!< DMAMUX Channel 0 connected to DMA1 Channel 1 */
  253. #define LL_DMAMUX_CHANNEL_1 0x00000001U /*!< DMAMUX Channel 1 connected to DMA1 Channel 2 */
  254. #define LL_DMAMUX_CHANNEL_2 0x00000002U /*!< DMAMUX Channel 2 connected to DMA1 Channel 3 */
  255. #define LL_DMAMUX_CHANNEL_3 0x00000003U /*!< DMAMUX Channel 3 connected to DMA1 Channel 4 */
  256. #define LL_DMAMUX_CHANNEL_4 0x00000004U /*!< DMAMUX Channel 4 connected to DMA1 Channel 5 */
  257. #if defined(DMAMUX1_Channel5)
  258. #define LL_DMAMUX_CHANNEL_5 0x00000005U /*!< DMAMUX Channel 5 connected to DMA1 Channel 6 */
  259. #endif
  260. #if defined(DMAMUX1_Channel6)
  261. #define LL_DMAMUX_CHANNEL_6 0x00000006U /*!< DMAMUX Channel 6 connected to DMA1 Channel 7 */
  262. #endif
  263. #if defined(DMA2)
  264. #define LL_DMAMUX_CHANNEL_7 0x00000007U /*!< DMAMUX Channel 7 connected to DMA2 Channel 1 */
  265. #define LL_DMAMUX_CHANNEL_8 0x00000008U /*!< DMAMUX Channel 8 connected to DMA2 Channel 2 */
  266. #define LL_DMAMUX_CHANNEL_9 0x00000009U /*!< DMAMUX Channel 9 connected to DMA2 Channel 3 */
  267. #define LL_DMAMUX_CHANNEL_10 0x0000000AU /*!< DMAMUX Channel 10 connected to DMA2 Channel 4 */
  268. #define LL_DMAMUX_CHANNEL_11 0x0000000BU /*!< DMAMUX Channel 11 connected to DMA2 Channel 5 */
  269. #endif
  270. /**
  271. * @}
  272. */
  273. /** @defgroup DMAMUX_LL_EC_SYNC_NO Synchronization Signal Polarity
  274. * @{
  275. */
  276. #define LL_DMAMUX_SYNC_NO_EVENT 0x00000000U /*!< All requests are blocked */
  277. #define LL_DMAMUX_SYNC_POL_RISING DMAMUX_CxCR_SPOL_0 /*!< Synchronization on event on rising edge */
  278. #define LL_DMAMUX_SYNC_POL_FALLING DMAMUX_CxCR_SPOL_1 /*!< Synchronization on event on falling edge */
  279. #define LL_DMAMUX_SYNC_POL_RISING_FALLING (DMAMUX_CxCR_SPOL_0 | DMAMUX_CxCR_SPOL_1) /*!< Synchronization on event on rising and falling edge */
  280. /**
  281. * @}
  282. */
  283. /** @defgroup DMAMUX_LL_EC_SYNC_EVT Synchronization Signal Event
  284. * @{
  285. */
  286. #define LL_DMAMUX_SYNC_EXTI_LINE0 0x00000000U /*!< Synchronization signal from EXTI Line0 */
  287. #define LL_DMAMUX_SYNC_EXTI_LINE1 DMAMUX_CxCR_SYNC_ID_0 /*!< Synchronization signal from EXTI Line1 */
  288. #define LL_DMAMUX_SYNC_EXTI_LINE2 DMAMUX_CxCR_SYNC_ID_1 /*!< Synchronization signal from EXTI Line2 */
  289. #define LL_DMAMUX_SYNC_EXTI_LINE3 (DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line3 */
  290. #define LL_DMAMUX_SYNC_EXTI_LINE4 DMAMUX_CxCR_SYNC_ID_2 /*!< Synchronization signal from EXTI Line4 */
  291. #define LL_DMAMUX_SYNC_EXTI_LINE5 (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line5 */
  292. #define LL_DMAMUX_SYNC_EXTI_LINE6 (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1) /*!< Synchronization signal from EXTI Line6 */
  293. #define LL_DMAMUX_SYNC_EXTI_LINE7 (DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line7 */
  294. #define LL_DMAMUX_SYNC_EXTI_LINE8 DMAMUX_CxCR_SYNC_ID_3 /*!< Synchronization signal from EXTI Line8 */
  295. #define LL_DMAMUX_SYNC_EXTI_LINE9 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line9 */
  296. #define LL_DMAMUX_SYNC_EXTI_LINE10 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_1) /*!< Synchronization signal from EXTI Line10 */
  297. #define LL_DMAMUX_SYNC_EXTI_LINE11 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line11 */
  298. #define LL_DMAMUX_SYNC_EXTI_LINE12 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2) /*!< Synchronization signal from EXTI Line12 */
  299. #define LL_DMAMUX_SYNC_EXTI_LINE13 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line1 3 */
  300. #define LL_DMAMUX_SYNC_EXTI_LINE14 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1) /*!< Synchronization signal from EXTI Line1 4 */
  301. #define LL_DMAMUX_SYNC_EXTI_LINE15 (DMAMUX_CxCR_SYNC_ID_3 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from EXTI Line1 5 */
  302. #define LL_DMAMUX_SYNC_DMAMUX_CH0 DMAMUX_CxCR_SYNC_ID_4 /*!< Synchronization signal from DMAMUX channel0 Event */
  303. #define LL_DMAMUX_SYNC_DMAMUX_CH1 (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from DMAMUX channel1 Event */
  304. #define LL_DMAMUX_SYNC_DMAMUX_CH2 (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_1) /*!< Synchronization signal from DMAMUX channel2 Event */
  305. #define LL_DMAMUX_SYNC_DMAMUX_CH3 (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_1 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from DMAMUX channel3 Event */
  306. #if defined(LPTIM1)
  307. #define LL_DMAMUX_SYNC_LPTIM1_OUT (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_2) /*!< Synchronization signal from LPTIM1 Output */
  308. #endif
  309. #if defined(LPTIM2)
  310. #define LL_DMAMUX_SYNC_LPTIM2_OUT (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_0) /*!< Synchronization signal from LPTIM2 Output */
  311. #endif
  312. #define LL_DMAMUX_SYNC_TIM14_OC (DMAMUX_CxCR_SYNC_ID_4 | DMAMUX_CxCR_SYNC_ID_2 | DMAMUX_CxCR_SYNC_ID_1) /*!< Synchronization signal from TIM14 OC */
  313. /**
  314. * @}
  315. */
  316. /** @defgroup DMAMUX_LL_EC_REQUEST_GENERATOR Request Generator Channel
  317. * @{
  318. */
  319. #define LL_DMAMUX_REQ_GEN_0 0x00000000U
  320. #define LL_DMAMUX_REQ_GEN_1 0x00000001U
  321. #define LL_DMAMUX_REQ_GEN_2 0x00000002U
  322. #define LL_DMAMUX_REQ_GEN_3 0x00000003U
  323. /**
  324. * @}
  325. */
  326. /** @defgroup DMAMUX_LL_EC_REQUEST_GEN_POLARITY External Request Signal Generation Polarity
  327. * @{
  328. */
  329. #define LL_DMAMUX_REQ_GEN_NO_EVENT 0x00000000U /*!< No external DMA request generation */
  330. #define LL_DMAMUX_REQ_GEN_POL_RISING DMAMUX_RGxCR_GPOL_0 /*!< External DMA request generation on event on rising edge */
  331. #define LL_DMAMUX_REQ_GEN_POL_FALLING DMAMUX_RGxCR_GPOL_1 /*!< External DMA request generation on event on falling edge */
  332. #define LL_DMAMUX_REQ_GEN_POL_RISING_FALLING (DMAMUX_RGxCR_GPOL_0 | DMAMUX_RGxCR_GPOL_1) /*!< External DMA request generation on rising and falling edge */
  333. /**
  334. * @}
  335. */
  336. /** @defgroup DMAMUX_LL_EC_REQUEST_GEN External Request Signal Generation
  337. * @{
  338. */
  339. #define LL_DMAMUX_REQ_GEN_EXTI_LINE0 0x00000000U /*!< Request signal generation from EXTI Line0 */
  340. #define LL_DMAMUX_REQ_GEN_EXTI_LINE1 DMAMUX_RGxCR_SIG_ID_0 /*!< Request signal generation from EXTI Line1 */
  341. #define LL_DMAMUX_REQ_GEN_EXTI_LINE2 DMAMUX_RGxCR_SIG_ID_1 /*!< Request signal generation from EXTI Line2 */
  342. #define LL_DMAMUX_REQ_GEN_EXTI_LINE3 (DMAMUX_RGxCR_SIG_ID_1 |DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line3 */
  343. #define LL_DMAMUX_REQ_GEN_EXTI_LINE4 DMAMUX_RGxCR_SIG_ID_2 /*!< Request signal generation from EXTI Line4 */
  344. #define LL_DMAMUX_REQ_GEN_EXTI_LINE5 (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line5 */
  345. #define LL_DMAMUX_REQ_GEN_EXTI_LINE6 (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1) /*!< Request signal generation from EXTI Line6 */
  346. #define LL_DMAMUX_REQ_GEN_EXTI_LINE7 (DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line7 */
  347. #define LL_DMAMUX_REQ_GEN_EXTI_LINE8 DMAMUX_RGxCR_SIG_ID_3 /*!< Request signal generation from EXTI Line8 */
  348. #define LL_DMAMUX_REQ_GEN_EXTI_LINE9 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line9 */
  349. #define LL_DMAMUX_REQ_GEN_EXTI_LINE10 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_1) /*!< Request signal generation from EXTI Line10 */
  350. #define LL_DMAMUX_REQ_GEN_EXTI_LINE11 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line11 */
  351. #define LL_DMAMUX_REQ_GEN_EXTI_LINE12 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2) /*!< Request signal generation from EXTI Line12 */
  352. #define LL_DMAMUX_REQ_GEN_EXTI_LINE13 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line13 */
  353. #define LL_DMAMUX_REQ_GEN_EXTI_LINE14 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1) /*!< Request signal generation from EXTI Line14 */
  354. #define LL_DMAMUX_REQ_GEN_EXTI_LINE15 (DMAMUX_RGxCR_SIG_ID_3 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from EXTI Line15 */
  355. #define LL_DMAMUX_REQ_GEN_DMAMUX_CH0 DMAMUX_RGxCR_SIG_ID_4 /*!< Request signal generation from DMAMUX channel0 Event */
  356. #define LL_DMAMUX_REQ_GEN_DMAMUX_CH1 (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from DMAMUX channel1 Event */
  357. #define LL_DMAMUX_REQ_GEN_DMAMUX_CH2 (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_1) /*!< Request signal generation from DMAMUX channel2 Event */
  358. #define LL_DMAMUX_REQ_GEN_DMAMUX_CH3 (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_1 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from DMAMUX channel3 Event */
  359. #if defined(LPTIM1)
  360. #define LL_DMAMUX_REQ_GEN_LPTIM1_OUT (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_2) /*!< Request signal generation from LPTIM1 Output */
  361. #endif
  362. #if defined(LPTIM2)
  363. #define LL_DMAMUX_REQ_GEN_LPTIM2_OUT (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_0) /*!< Request signal generation from LPTIM2 Output */
  364. #endif
  365. #define LL_DMAMUX_REQ_GEN_TIM14_OC (DMAMUX_RGxCR_SIG_ID_4 | DMAMUX_RGxCR_SIG_ID_2 | DMAMUX_RGxCR_SIG_ID_1) /*!< Request signal generation from TIM14 OC */
  366. /**
  367. * @}
  368. */
  369. /**
  370. * @}
  371. */
  372. /* Exported macro ------------------------------------------------------------*/
  373. /** @defgroup DMAMUX_LL_Exported_Macros DMAMUX Exported Macros
  374. * @{
  375. */
  376. /** @defgroup DMAMUX_LL_EM_WRITE_READ Common Write and read registers macros
  377. * @{
  378. */
  379. /**
  380. * @brief Write a value in DMAMUX register
  381. * @param __INSTANCE__ DMAMUX Instance
  382. * @param __REG__ Register to be written
  383. * @param __VALUE__ Value to be written in the register
  384. * @retval None
  385. */
  386. #define LL_DMAMUX_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
  387. /**
  388. * @brief Read a value in DMAMUX register
  389. * @param __INSTANCE__ DMAMUX Instance
  390. * @param __REG__ Register to be read
  391. * @retval Register value
  392. */
  393. #define LL_DMAMUX_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
  394. /**
  395. * @}
  396. */
  397. /**
  398. * @}
  399. */
  400. /* Exported functions --------------------------------------------------------*/
  401. /** @defgroup DMAMUX_LL_Exported_Functions DMAMUX Exported Functions
  402. * @{
  403. */
  404. /** @defgroup DMAMUX_LL_EF_Configuration Configuration
  405. * @{
  406. */
  407. /**
  408. * @brief Set DMAMUX request ID for DMAMUX Channel x.
  409. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  410. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  411. * @rmtoll CxCR DMAREQ_ID LL_DMAMUX_SetRequestID
  412. * @param DMAMUXx DMAMUXx Instance
  413. * @param Channel This parameter can be one of the following values:
  414. * @arg @ref LL_DMAMUX_CHANNEL_0
  415. * @arg @ref LL_DMAMUX_CHANNEL_1
  416. * @arg @ref LL_DMAMUX_CHANNEL_2
  417. * @arg @ref LL_DMAMUX_CHANNEL_3
  418. * @arg @ref LL_DMAMUX_CHANNEL_4
  419. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  420. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  421. *
  422. * @arg All the next values are only available on chip which support DMA2:
  423. * @arg @ref LL_DMAMUX_CHANNEL_7
  424. * @arg @ref LL_DMAMUX_CHANNEL_8
  425. * @arg @ref LL_DMAMUX_CHANNEL_9
  426. * @arg @ref LL_DMAMUX_CHANNEL_10
  427. * @arg @ref LL_DMAMUX_CHANNEL_11
  428. * @param Request This parameter can be one of the following values:
  429. * @arg @ref LL_DMAMUX_REQ_MEM2MEM
  430. * @arg @ref LL_DMAMUX_REQ_GENERATOR0
  431. * @arg @ref LL_DMAMUX_REQ_GENERATOR1
  432. * @arg @ref LL_DMAMUX_REQ_GENERATOR2
  433. * @arg @ref LL_DMAMUX_REQ_GENERATOR3
  434. * @arg @ref LL_DMAMUX_REQ_ADC1
  435. * @arg @ref LL_DMAMUX_REQ_AES_IN
  436. * @arg @ref LL_DMAMUX_REQ_AES_OUT
  437. * @arg @ref LL_DMAMUX_REQ_DAC1_CH1
  438. * @arg @ref LL_DMAMUX_REQ_DAC1_CH2
  439. * @arg @ref LL_DMAMUX_REQ_I2C1_RX
  440. * @arg @ref LL_DMAMUX_REQ_I2C1_TX
  441. * @arg @ref LL_DMAMUX_REQ_I2C2_RX
  442. * @arg @ref LL_DMAMUX_REQ_I2C2_TX
  443. * @arg @ref LL_DMAMUX_REQ_LPUART1_RX
  444. * @arg @ref LL_DMAMUX_REQ_LPUART1_TX
  445. * @arg @ref LL_DMAMUX_REQ_SPI1_RX
  446. * @arg @ref LL_DMAMUX_REQ_SPI1_TX
  447. * @arg @ref LL_DMAMUX_REQ_SPI2_RX
  448. * @arg @ref LL_DMAMUX_REQ_SPI2_TX
  449. * @arg @ref LL_DMAMUX_REQ_TIM1_CH1
  450. * @arg @ref LL_DMAMUX_REQ_TIM1_CH2
  451. * @arg @ref LL_DMAMUX_REQ_TIM1_CH3
  452. * @arg @ref LL_DMAMUX_REQ_TIM1_CH4
  453. * @arg @ref LL_DMAMUX_REQ_TIM1_TRIG_COM
  454. * @arg @ref LL_DMAMUX_REQ_TIM1_UP
  455. * @arg @ref LL_DMAMUX_REQ_TIM2_CH1
  456. * @arg @ref LL_DMAMUX_REQ_TIM2_CH2
  457. * @arg @ref LL_DMAMUX_REQ_TIM2_CH3
  458. * @arg @ref LL_DMAMUX_REQ_TIM2_CH4
  459. * @arg @ref LL_DMAMUX_REQ_TIM2_TRIG
  460. * @arg @ref LL_DMAMUX_REQ_TIM2_UP
  461. * @arg @ref LL_DMAMUX_REQ_TIM3_CH1
  462. * @arg @ref LL_DMAMUX_REQ_TIM3_CH2
  463. * @arg @ref LL_DMAMUX_REQ_TIM3_CH3
  464. * @arg @ref LL_DMAMUX_REQ_TIM3_CH4
  465. * @arg @ref LL_DMAMUX_REQ_TIM3_TRIG
  466. * @arg @ref LL_DMAMUX_REQ_TIM3_UP
  467. * @arg @ref LL_DMAMUX_REQ_TIM6_UP
  468. * @arg @ref LL_DMAMUX_REQ_TIM7_UP
  469. * @arg @ref LL_DMAMUX_REQ_TIM15_CH1
  470. * @arg @ref LL_DMAMUX_REQ_TIM15_CH2
  471. * @arg @ref LL_DMAMUX_REQ_TIM15_TRIG_COM
  472. * @arg @ref LL_DMAMUX_REQ_TIM15_UP
  473. * @arg @ref LL_DMAMUX_REQ_TIM16_CH1
  474. * @arg @ref LL_DMAMUX_REQ_TIM16_COM
  475. * @arg @ref LL_DMAMUX_REQ_TIM16_UP
  476. * @arg @ref LL_DMAMUX_REQ_TIM17_CH1
  477. * @arg @ref LL_DMAMUX_REQ_TIM17_COM
  478. * @arg @ref LL_DMAMUX_REQ_TIM17_UP
  479. * @arg @ref LL_DMAMUX_REQ_USART1_RX
  480. * @arg @ref LL_DMAMUX_REQ_USART1_TX
  481. * @arg @ref LL_DMAMUX_REQ_USART2_RX
  482. * @arg @ref LL_DMAMUX_REQ_USART2_TX
  483. * @arg @ref LL_DMAMUX_REQ_USART3_RX
  484. * @arg @ref LL_DMAMUX_REQ_USART3_TX
  485. * @arg @ref LL_DMAMUX_REQ_USART4_RX
  486. * @arg @ref LL_DMAMUX_REQ_USART4_TX
  487. * @arg @ref LL_DMAMUX_REQ_UCPD1_RX
  488. * @arg @ref LL_DMAMUX_REQ_UCPD1_TX
  489. * @arg @ref LL_DMAMUX_REQ_UCPD2_RX
  490. * @arg @ref LL_DMAMUX_REQ_UCPD2_TX
  491. * @retval None
  492. */
  493. __STATIC_INLINE void LL_DMAMUX_SetRequestID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t Request)
  494. {
  495. (void)(DMAMUXx);
  496. MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_DMAREQ_ID, Request);
  497. }
  498. /**
  499. * @brief Get DMAMUX request ID for DMAMUX Channel x.
  500. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  501. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  502. * @rmtoll CxCR DMAREQ_ID LL_DMAMUX_GetRequestID
  503. * @param DMAMUXx DMAMUXx Instance
  504. * @param Channel This parameter can be one of the following values:
  505. * @arg @ref LL_DMAMUX_CHANNEL_0
  506. * @arg @ref LL_DMAMUX_CHANNEL_1
  507. * @arg @ref LL_DMAMUX_CHANNEL_2
  508. * @arg @ref LL_DMAMUX_CHANNEL_3
  509. * @arg @ref LL_DMAMUX_CHANNEL_4
  510. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  511. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  512. *
  513. * @arg All the next values are only available on chip which support DMA2:
  514. * @arg @ref LL_DMAMUX_CHANNEL_7
  515. * @arg @ref LL_DMAMUX_CHANNEL_8
  516. * @arg @ref LL_DMAMUX_CHANNEL_9
  517. * @arg @ref LL_DMAMUX_CHANNEL_10
  518. * @arg @ref LL_DMAMUX_CHANNEL_11
  519. * @retval Returned value can be one of the following values:
  520. * @arg @ref LL_DMAMUX_REQ_MEM2MEM
  521. * @arg @ref LL_DMAMUX_REQ_GENERATOR0
  522. * @arg @ref LL_DMAMUX_REQ_GENERATOR1
  523. * @arg @ref LL_DMAMUX_REQ_GENERATOR2
  524. * @arg @ref LL_DMAMUX_REQ_GENERATOR3
  525. * @arg @ref LL_DMAMUX_REQ_ADC1
  526. * @arg @ref LL_DMAMUX_REQ_AES_IN
  527. * @arg @ref LL_DMAMUX_REQ_AES_OUT
  528. * @arg @ref LL_DMAMUX_REQ_DAC1_CH1
  529. * @arg @ref LL_DMAMUX_REQ_DAC1_CH2
  530. * @arg @ref LL_DMAMUX_REQ_I2C1_RX
  531. * @arg @ref LL_DMAMUX_REQ_I2C1_TX
  532. * @arg @ref LL_DMAMUX_REQ_I2C2_RX
  533. * @arg @ref LL_DMAMUX_REQ_I2C2_TX
  534. * @arg @ref LL_DMAMUX_REQ_LPUART1_RX
  535. * @arg @ref LL_DMAMUX_REQ_LPUART1_TX
  536. * @arg @ref LL_DMAMUX_REQ_SPI1_RX
  537. * @arg @ref LL_DMAMUX_REQ_SPI1_TX
  538. * @arg @ref LL_DMAMUX_REQ_SPI2_RX
  539. * @arg @ref LL_DMAMUX_REQ_SPI2_TX
  540. * @arg @ref LL_DMAMUX_REQ_TIM1_CH1
  541. * @arg @ref LL_DMAMUX_REQ_TIM1_CH2
  542. * @arg @ref LL_DMAMUX_REQ_TIM1_CH3
  543. * @arg @ref LL_DMAMUX_REQ_TIM1_CH4
  544. * @arg @ref LL_DMAMUX_REQ_TIM1_TRIG_COM
  545. * @arg @ref LL_DMAMUX_REQ_TIM1_UP
  546. * @arg @ref LL_DMAMUX_REQ_TIM2_CH1
  547. * @arg @ref LL_DMAMUX_REQ_TIM2_CH2
  548. * @arg @ref LL_DMAMUX_REQ_TIM2_CH3
  549. * @arg @ref LL_DMAMUX_REQ_TIM2_CH4
  550. * @arg @ref LL_DMAMUX_REQ_TIM2_TRIG
  551. * @arg @ref LL_DMAMUX_REQ_TIM2_UP
  552. * @arg @ref LL_DMAMUX_REQ_TIM3_CH1
  553. * @arg @ref LL_DMAMUX_REQ_TIM3_CH2
  554. * @arg @ref LL_DMAMUX_REQ_TIM3_CH3
  555. * @arg @ref LL_DMAMUX_REQ_TIM3_CH4
  556. * @arg @ref LL_DMAMUX_REQ_TIM3_TRIG
  557. * @arg @ref LL_DMAMUX_REQ_TIM3_UP
  558. * @arg @ref LL_DMAMUX_REQ_TIM6_UP
  559. * @arg @ref LL_DMAMUX_REQ_TIM7_UP
  560. * @arg @ref LL_DMAMUX_REQ_TIM15_CH1
  561. * @arg @ref LL_DMAMUX_REQ_TIM15_CH2
  562. * @arg @ref LL_DMAMUX_REQ_TIM15_TRIG_COM
  563. * @arg @ref LL_DMAMUX_REQ_TIM15_UP
  564. * @arg @ref LL_DMAMUX_REQ_TIM16_CH1
  565. * @arg @ref LL_DMAMUX_REQ_TIM16_COM
  566. * @arg @ref LL_DMAMUX_REQ_TIM16_UP
  567. * @arg @ref LL_DMAMUX_REQ_TIM17_CH1
  568. * @arg @ref LL_DMAMUX_REQ_TIM17_COM
  569. * @arg @ref LL_DMAMUX_REQ_TIM17_UP
  570. * @arg @ref LL_DMAMUX_REQ_USART1_RX
  571. * @arg @ref LL_DMAMUX_REQ_USART1_TX
  572. * @arg @ref LL_DMAMUX_REQ_USART2_RX
  573. * @arg @ref LL_DMAMUX_REQ_USART2_TX
  574. * @arg @ref LL_DMAMUX_REQ_USART3_RX
  575. * @arg @ref LL_DMAMUX_REQ_USART3_TX
  576. * @arg @ref LL_DMAMUX_REQ_USART4_RX
  577. * @arg @ref LL_DMAMUX_REQ_USART4_TX
  578. * @arg @ref LL_DMAMUX_REQ_UCPD1_RX
  579. * @arg @ref LL_DMAMUX_REQ_UCPD1_TX
  580. * @arg @ref LL_DMAMUX_REQ_UCPD2_RX
  581. * @arg @ref LL_DMAMUX_REQ_UCPD2_TX
  582. */
  583. __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  584. {
  585. (void)(DMAMUXx);
  586. return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_DMAREQ_ID));
  587. }
  588. /**
  589. * @brief Set the number of DMA request that will be autorized after a synchronization event and/or the number of DMA request needed to generate an event.
  590. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  591. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  592. * @rmtoll CxCR NBREQ LL_DMAMUX_SetSyncRequestNb
  593. * @param DMAMUXx DMAMUXx Instance
  594. * @param Channel This parameter can be one of the following values:
  595. * @arg @ref LL_DMAMUX_CHANNEL_0
  596. * @arg @ref LL_DMAMUX_CHANNEL_1
  597. * @arg @ref LL_DMAMUX_CHANNEL_2
  598. * @arg @ref LL_DMAMUX_CHANNEL_3
  599. * @arg @ref LL_DMAMUX_CHANNEL_4
  600. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  601. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  602. *
  603. * @arg All the next values are only available on chip which support DMA2:
  604. * @arg @ref LL_DMAMUX_CHANNEL_7
  605. * @arg @ref LL_DMAMUX_CHANNEL_8
  606. * @arg @ref LL_DMAMUX_CHANNEL_9
  607. * @arg @ref LL_DMAMUX_CHANNEL_10
  608. * @arg @ref LL_DMAMUX_CHANNEL_11
  609. * @param RequestNb This parameter must be a value between Min_Data = 1 and Max_Data = 32.
  610. * @retval None
  611. */
  612. __STATIC_INLINE void LL_DMAMUX_SetSyncRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t RequestNb)
  613. {
  614. (void)(DMAMUXx);
  615. MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_NBREQ, ((RequestNb - 1U) << DMAMUX_CxCR_NBREQ_Pos));
  616. }
  617. /**
  618. * @brief Get the number of DMA request that will be autorized after a synchronization event and/or the number of DMA request needed to generate an event.
  619. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  620. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  621. * @rmtoll CxCR NBREQ LL_DMAMUX_GetSyncRequestNb
  622. * @param DMAMUXx DMAMUXx Instance
  623. * @param Channel This parameter can be one of the following values:
  624. * @arg @ref LL_DMAMUX_CHANNEL_0
  625. * @arg @ref LL_DMAMUX_CHANNEL_1
  626. * @arg @ref LL_DMAMUX_CHANNEL_2
  627. * @arg @ref LL_DMAMUX_CHANNEL_3
  628. * @arg @ref LL_DMAMUX_CHANNEL_4
  629. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  630. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  631. *
  632. * @arg All the next values are only available on chip which support DMA2:
  633. * @arg @ref LL_DMAMUX_CHANNEL_7
  634. * @arg @ref LL_DMAMUX_CHANNEL_8
  635. * @arg @ref LL_DMAMUX_CHANNEL_9
  636. * @arg @ref LL_DMAMUX_CHANNEL_10
  637. * @arg @ref LL_DMAMUX_CHANNEL_11
  638. * @retval Between Min_Data = 1 and Max_Data = 32
  639. */
  640. __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  641. {
  642. (void)(DMAMUXx);
  643. return (uint32_t)(((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_NBREQ)) >> DMAMUX_CxCR_NBREQ_Pos) + 1U);
  644. }
  645. /**
  646. * @brief Set the polarity of the signal on which the DMA request is synchronized.
  647. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  648. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  649. * @rmtoll CxCR SPOL LL_DMAMUX_SetSyncPolarity
  650. * @param DMAMUXx DMAMUXx Instance
  651. * @param Channel This parameter can be one of the following values:
  652. * @arg @ref LL_DMAMUX_CHANNEL_0
  653. * @arg @ref LL_DMAMUX_CHANNEL_1
  654. * @arg @ref LL_DMAMUX_CHANNEL_2
  655. * @arg @ref LL_DMAMUX_CHANNEL_3
  656. * @arg @ref LL_DMAMUX_CHANNEL_4
  657. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  658. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  659. *
  660. * @arg All the next values are only available on chip which support DMA2:
  661. * @arg @ref LL_DMAMUX_CHANNEL_7
  662. * @arg @ref LL_DMAMUX_CHANNEL_8
  663. * @arg @ref LL_DMAMUX_CHANNEL_9
  664. * @arg @ref LL_DMAMUX_CHANNEL_10
  665. * @arg @ref LL_DMAMUX_CHANNEL_11
  666. * @param Polarity This parameter can be one of the following values:
  667. * @arg @ref LL_DMAMUX_SYNC_NO_EVENT
  668. * @arg @ref LL_DMAMUX_SYNC_POL_RISING
  669. * @arg @ref LL_DMAMUX_SYNC_POL_FALLING
  670. * @arg @ref LL_DMAMUX_SYNC_POL_RISING_FALLING
  671. * @retval None
  672. */
  673. __STATIC_INLINE void LL_DMAMUX_SetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t Polarity)
  674. {
  675. (void)(DMAMUXx);
  676. MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SPOL, Polarity);
  677. }
  678. /**
  679. * @brief Get the polarity of the signal on which the DMA request is synchronized.
  680. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  681. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  682. * @rmtoll CxCR SPOL LL_DMAMUX_GetSyncPolarity
  683. * @param DMAMUXx DMAMUXx Instance
  684. * @param Channel This parameter can be one of the following values:
  685. * @arg @ref LL_DMAMUX_CHANNEL_0
  686. * @arg @ref LL_DMAMUX_CHANNEL_1
  687. * @arg @ref LL_DMAMUX_CHANNEL_2
  688. * @arg @ref LL_DMAMUX_CHANNEL_3
  689. * @arg @ref LL_DMAMUX_CHANNEL_4
  690. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  691. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  692. *
  693. * @arg All the next values are only available on chip which support DMA2:
  694. * @arg @ref LL_DMAMUX_CHANNEL_7
  695. * @arg @ref LL_DMAMUX_CHANNEL_8
  696. * @arg @ref LL_DMAMUX_CHANNEL_9
  697. * @arg @ref LL_DMAMUX_CHANNEL_10
  698. * @arg @ref LL_DMAMUX_CHANNEL_11
  699. * @retval Returned value can be one of the following values:
  700. * @arg @ref LL_DMAMUX_SYNC_NO_EVENT
  701. * @arg @ref LL_DMAMUX_SYNC_POL_RISING
  702. * @arg @ref LL_DMAMUX_SYNC_POL_FALLING
  703. * @arg @ref LL_DMAMUX_SYNC_POL_RISING_FALLING
  704. */
  705. __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  706. {
  707. (void)(DMAMUXx);
  708. return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SPOL));
  709. }
  710. /**
  711. * @brief Enable the Event Generation on DMAMUX channel x.
  712. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  713. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  714. * @rmtoll CxCR EGE LL_DMAMUX_EnableEventGeneration
  715. * @param DMAMUXx DMAMUXx Instance
  716. * @param Channel This parameter can be one of the following values:
  717. * @arg @ref LL_DMAMUX_CHANNEL_0
  718. * @arg @ref LL_DMAMUX_CHANNEL_1
  719. * @arg @ref LL_DMAMUX_CHANNEL_2
  720. * @arg @ref LL_DMAMUX_CHANNEL_3
  721. * @arg @ref LL_DMAMUX_CHANNEL_4
  722. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  723. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  724. *
  725. * @arg All the next values are only available on chip which support DMA2:
  726. * @arg @ref LL_DMAMUX_CHANNEL_7
  727. * @arg @ref LL_DMAMUX_CHANNEL_8
  728. * @arg @ref LL_DMAMUX_CHANNEL_9
  729. * @arg @ref LL_DMAMUX_CHANNEL_10
  730. * @arg @ref LL_DMAMUX_CHANNEL_11
  731. * @retval None
  732. */
  733. __STATIC_INLINE void LL_DMAMUX_EnableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  734. {
  735. (void)(DMAMUXx);
  736. SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE);
  737. }
  738. /**
  739. * @brief Disable the Event Generation on DMAMUX channel x.
  740. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  741. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  742. * @rmtoll CxCR EGE LL_DMAMUX_DisableEventGeneration
  743. * @param DMAMUXx DMAMUXx Instance
  744. * @param Channel This parameter can be one of the following values:
  745. * @arg @ref LL_DMAMUX_CHANNEL_0
  746. * @arg @ref LL_DMAMUX_CHANNEL_1
  747. * @arg @ref LL_DMAMUX_CHANNEL_2
  748. * @arg @ref LL_DMAMUX_CHANNEL_3
  749. * @arg @ref LL_DMAMUX_CHANNEL_4
  750. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  751. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  752. *
  753. * @arg All the next values are only available on chip which support DMA2:
  754. * @arg @ref LL_DMAMUX_CHANNEL_7
  755. * @arg @ref LL_DMAMUX_CHANNEL_8
  756. * @arg @ref LL_DMAMUX_CHANNEL_9
  757. * @arg @ref LL_DMAMUX_CHANNEL_10
  758. * @arg @ref LL_DMAMUX_CHANNEL_11
  759. * @retval None
  760. */
  761. __STATIC_INLINE void LL_DMAMUX_DisableEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  762. {
  763. (void)(DMAMUXx);
  764. CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE);
  765. }
  766. /**
  767. * @brief Check if the Event Generation on DMAMUX channel x is enabled or disabled.
  768. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  769. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  770. * @rmtoll CxCR EGE LL_DMAMUX_IsEnabledEventGeneration
  771. * @param DMAMUXx DMAMUXx Instance
  772. * @param Channel This parameter can be one of the following values:
  773. * @arg @ref LL_DMAMUX_CHANNEL_0
  774. * @arg @ref LL_DMAMUX_CHANNEL_1
  775. * @arg @ref LL_DMAMUX_CHANNEL_2
  776. * @arg @ref LL_DMAMUX_CHANNEL_3
  777. * @arg @ref LL_DMAMUX_CHANNEL_4
  778. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  779. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  780. *
  781. * @arg All the next values are only available on chip which support DMA2:
  782. * @arg @ref LL_DMAMUX_CHANNEL_7
  783. * @arg @ref LL_DMAMUX_CHANNEL_8
  784. * @arg @ref LL_DMAMUX_CHANNEL_9
  785. * @arg @ref LL_DMAMUX_CHANNEL_10
  786. * @arg @ref LL_DMAMUX_CHANNEL_11
  787. * @retval State of bit (1 or 0).
  788. */
  789. __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledEventGeneration(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  790. {
  791. (void)(DMAMUXx);
  792. return ((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_EGE) == (DMAMUX_CxCR_EGE)) ? 1UL : 0UL);
  793. }
  794. /**
  795. * @brief Enable the synchronization mode.
  796. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  797. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  798. * @rmtoll CxCR SE LL_DMAMUX_EnableSync
  799. * @param DMAMUXx DMAMUXx Instance
  800. * @param Channel This parameter can be one of the following values:
  801. * @arg @ref LL_DMAMUX_CHANNEL_0
  802. * @arg @ref LL_DMAMUX_CHANNEL_1
  803. * @arg @ref LL_DMAMUX_CHANNEL_2
  804. * @arg @ref LL_DMAMUX_CHANNEL_3
  805. * @arg @ref LL_DMAMUX_CHANNEL_4
  806. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  807. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  808. *
  809. * @arg All the next values are only available on chip which support DMA2:
  810. * @arg @ref LL_DMAMUX_CHANNEL_7
  811. * @arg @ref LL_DMAMUX_CHANNEL_8
  812. * @arg @ref LL_DMAMUX_CHANNEL_9
  813. * @arg @ref LL_DMAMUX_CHANNEL_10
  814. * @arg @ref LL_DMAMUX_CHANNEL_11
  815. * @retval None
  816. */
  817. __STATIC_INLINE void LL_DMAMUX_EnableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  818. {
  819. (void)(DMAMUXx);
  820. SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE);
  821. }
  822. /**
  823. * @brief Disable the synchronization mode.
  824. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  825. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  826. * @rmtoll CxCR SE LL_DMAMUX_DisableSync
  827. * @param DMAMUXx DMAMUXx Instance
  828. * @param Channel This parameter can be one of the following values:
  829. * @arg @ref LL_DMAMUX_CHANNEL_0
  830. * @arg @ref LL_DMAMUX_CHANNEL_1
  831. * @arg @ref LL_DMAMUX_CHANNEL_2
  832. * @arg @ref LL_DMAMUX_CHANNEL_3
  833. * @arg @ref LL_DMAMUX_CHANNEL_4
  834. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  835. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  836. *
  837. * @arg All the next values are only available on chip which support DMA2:
  838. * @arg @ref LL_DMAMUX_CHANNEL_7
  839. * @arg @ref LL_DMAMUX_CHANNEL_8
  840. * @arg @ref LL_DMAMUX_CHANNEL_9
  841. * @arg @ref LL_DMAMUX_CHANNEL_10
  842. * @arg @ref LL_DMAMUX_CHANNEL_11
  843. * @retval None
  844. */
  845. __STATIC_INLINE void LL_DMAMUX_DisableSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  846. {
  847. (void)(DMAMUXx);
  848. CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE);
  849. }
  850. /**
  851. * @brief Check if the synchronization mode is enabled or disabled.
  852. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  853. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  854. * @rmtoll CxCR SE LL_DMAMUX_IsEnabledSync
  855. * @param DMAMUXx DMAMUXx Instance
  856. * @param Channel This parameter can be one of the following values:
  857. * @arg @ref LL_DMAMUX_CHANNEL_0
  858. * @arg @ref LL_DMAMUX_CHANNEL_1
  859. * @arg @ref LL_DMAMUX_CHANNEL_2
  860. * @arg @ref LL_DMAMUX_CHANNEL_3
  861. * @arg @ref LL_DMAMUX_CHANNEL_4
  862. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  863. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  864. *
  865. * @arg All the next values are only available on chip which support DMA2:
  866. * @arg @ref LL_DMAMUX_CHANNEL_7
  867. * @arg @ref LL_DMAMUX_CHANNEL_8
  868. * @arg @ref LL_DMAMUX_CHANNEL_9
  869. * @arg @ref LL_DMAMUX_CHANNEL_10
  870. * @arg @ref LL_DMAMUX_CHANNEL_11
  871. * @retval State of bit (1 or 0).
  872. */
  873. __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledSync(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  874. {
  875. (void)(DMAMUXx);
  876. return ((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SE) == (DMAMUX_CxCR_SE)) ? 1UL : 0UL);
  877. }
  878. /**
  879. * @brief Set DMAMUX synchronization ID on DMAMUX Channel x.
  880. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  881. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  882. * @rmtoll CxCR SYNC_ID LL_DMAMUX_SetSyncID
  883. * @param DMAMUXx DMAMUXx Instance
  884. * @param Channel This parameter can be one of the following values:
  885. * @arg @ref LL_DMAMUX_CHANNEL_0
  886. * @arg @ref LL_DMAMUX_CHANNEL_1
  887. * @arg @ref LL_DMAMUX_CHANNEL_2
  888. * @arg @ref LL_DMAMUX_CHANNEL_3
  889. * @arg @ref LL_DMAMUX_CHANNEL_4
  890. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  891. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  892. *
  893. * @arg All the next values are only available on chip which support DMA2:
  894. * @arg @ref LL_DMAMUX_CHANNEL_7
  895. * @arg @ref LL_DMAMUX_CHANNEL_8
  896. * @arg @ref LL_DMAMUX_CHANNEL_9
  897. * @arg @ref LL_DMAMUX_CHANNEL_10
  898. * @arg @ref LL_DMAMUX_CHANNEL_11
  899. * @param SyncID This parameter can be one of the following values:
  900. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0
  901. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1
  902. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE2
  903. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE3
  904. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE4
  905. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE5
  906. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE6
  907. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE7
  908. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE8
  909. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE9
  910. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE10
  911. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE11
  912. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE12
  913. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE13
  914. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE14
  915. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE15
  916. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH0
  917. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH1
  918. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH2
  919. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH3
  920. * @arg @ref LL_DMAMUX_SYNC_LPTIM1_OUT
  921. * @arg @ref LL_DMAMUX_SYNC_LPTIM2_OUT
  922. * @arg @ref LL_DMAMUX_SYNC_TIM14_OC
  923. * @retval None
  924. */
  925. __STATIC_INLINE void LL_DMAMUX_SetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel, uint32_t SyncID)
  926. {
  927. (void)(DMAMUXx);
  928. MODIFY_REG((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SYNC_ID, SyncID);
  929. }
  930. /**
  931. * @brief Get DMAMUX synchronization ID on DMAMUX Channel x.
  932. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  933. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  934. * @rmtoll CxCR SYNC_ID LL_DMAMUX_GetSyncID
  935. * @param DMAMUXx DMAMUXx Instance
  936. * @param Channel This parameter can be one of the following values:
  937. * @arg @ref LL_DMAMUX_CHANNEL_0
  938. * @arg @ref LL_DMAMUX_CHANNEL_1
  939. * @arg @ref LL_DMAMUX_CHANNEL_2
  940. * @arg @ref LL_DMAMUX_CHANNEL_3
  941. * @arg @ref LL_DMAMUX_CHANNEL_4
  942. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  943. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  944. *
  945. * @arg All the next values are only available on chip which support DMA2:
  946. * @arg @ref LL_DMAMUX_CHANNEL_7
  947. * @arg @ref LL_DMAMUX_CHANNEL_8
  948. * @arg @ref LL_DMAMUX_CHANNEL_9
  949. * @arg @ref LL_DMAMUX_CHANNEL_10
  950. * @arg @ref LL_DMAMUX_CHANNEL_11
  951. * @retval Returned value can be one of the following values:
  952. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE0
  953. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE1
  954. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE2
  955. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE3
  956. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE4
  957. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE5
  958. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE6
  959. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE7
  960. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE8
  961. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE9
  962. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE10
  963. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE11
  964. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE12
  965. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE13
  966. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE14
  967. * @arg @ref LL_DMAMUX_SYNC_EXTI_LINE15
  968. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH0
  969. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH1
  970. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH2
  971. * @arg @ref LL_DMAMUX_SYNC_DMAMUX_CH3
  972. * @arg @ref LL_DMAMUX_SYNC_LPTIM1_OUT
  973. * @arg @ref LL_DMAMUX_SYNC_LPTIM2_OUT
  974. * @arg @ref LL_DMAMUX_SYNC_TIM14_OC
  975. */
  976. __STATIC_INLINE uint32_t LL_DMAMUX_GetSyncID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  977. {
  978. (void)(DMAMUXx);
  979. return (uint32_t)(READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SYNC_ID));
  980. }
  981. /**
  982. * @brief Enable the Request Generator.
  983. * @rmtoll RGxCR GE LL_DMAMUX_EnableRequestGen
  984. * @param DMAMUXx DMAMUXx Instance
  985. * @param RequestGenChannel This parameter can be one of the following values:
  986. * @arg @ref LL_DMAMUX_REQ_GEN_0
  987. * @arg @ref LL_DMAMUX_REQ_GEN_1
  988. * @arg @ref LL_DMAMUX_REQ_GEN_2
  989. * @arg @ref LL_DMAMUX_REQ_GEN_3
  990. * @retval None
  991. */
  992. __STATIC_INLINE void LL_DMAMUX_EnableRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  993. {
  994. (void)(DMAMUXx);
  995. SET_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GE);
  996. }
  997. /**
  998. * @brief Disable the Request Generator.
  999. * @rmtoll RGxCR GE LL_DMAMUX_DisableRequestGen
  1000. * @param DMAMUXx DMAMUXx Instance
  1001. * @param RequestGenChannel This parameter can be one of the following values:
  1002. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1003. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1004. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1005. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1006. * @retval None
  1007. */
  1008. __STATIC_INLINE void LL_DMAMUX_DisableRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1009. {
  1010. (void)(DMAMUXx);
  1011. CLEAR_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GE);
  1012. }
  1013. /**
  1014. * @brief Check if the Request Generator is enabled or disabled.
  1015. * @rmtoll RGxCR GE LL_DMAMUX_IsEnabledRequestGen
  1016. * @param DMAMUXx DMAMUXx Instance
  1017. * @param RequestGenChannel This parameter can be one of the following values:
  1018. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1019. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1020. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1021. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1022. * @retval State of bit (1 or 0).
  1023. */
  1024. __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledRequestGen(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1025. {
  1026. (void)(DMAMUXx);
  1027. return ((READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GE) == (DMAMUX_RGxCR_GE)) ? 1UL : 0UL);
  1028. }
  1029. /**
  1030. * @brief Set the polarity of the signal on which the DMA request is generated.
  1031. * @rmtoll RGxCR GPOL LL_DMAMUX_SetRequestGenPolarity
  1032. * @param DMAMUXx DMAMUXx Instance
  1033. * @param RequestGenChannel This parameter can be one of the following values:
  1034. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1035. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1036. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1037. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1038. * @param Polarity This parameter can be one of the following values:
  1039. * @arg @ref LL_DMAMUX_REQ_GEN_NO_EVENT
  1040. * @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING
  1041. * @arg @ref LL_DMAMUX_REQ_GEN_POL_FALLING
  1042. * @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING_FALLING
  1043. * @retval None
  1044. */
  1045. __STATIC_INLINE void LL_DMAMUX_SetRequestGenPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel, uint32_t Polarity)
  1046. {
  1047. (void)(DMAMUXx);
  1048. MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GPOL, Polarity);
  1049. }
  1050. /**
  1051. * @brief Get the polarity of the signal on which the DMA request is generated.
  1052. * @rmtoll RGxCR GPOL LL_DMAMUX_GetRequestGenPolarity
  1053. * @param DMAMUXx DMAMUXx Instance
  1054. * @param RequestGenChannel This parameter can be one of the following values:
  1055. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1056. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1057. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1058. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1059. * @retval Returned value can be one of the following values:
  1060. * @arg @ref LL_DMAMUX_REQ_GEN_NO_EVENT
  1061. * @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING
  1062. * @arg @ref LL_DMAMUX_REQ_GEN_POL_FALLING
  1063. * @arg @ref LL_DMAMUX_REQ_GEN_POL_RISING_FALLING
  1064. */
  1065. __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestGenPolarity(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1066. {
  1067. (void)(DMAMUXx);
  1068. return (uint32_t)(READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GPOL));
  1069. }
  1070. /**
  1071. * @brief Set the number of DMA request that will be autorized after a generation event.
  1072. * @note This field can only be written when Generator is disabled.
  1073. * @rmtoll RGxCR GNBREQ LL_DMAMUX_SetGenRequestNb
  1074. * @param DMAMUXx DMAMUXx Instance
  1075. * @param RequestGenChannel This parameter can be one of the following values:
  1076. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1077. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1078. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1079. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1080. * @param RequestNb This parameter must be a value between Min_Data = 1 and Max_Data = 32.
  1081. * @retval None
  1082. */
  1083. __STATIC_INLINE void LL_DMAMUX_SetGenRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel, uint32_t RequestNb)
  1084. {
  1085. (void)(DMAMUXx);
  1086. MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GNBREQ, (RequestNb - 1U) << DMAMUX_RGxCR_GNBREQ_Pos);
  1087. }
  1088. /**
  1089. * @brief Get the number of DMA request that will be autorized after a generation event.
  1090. * @rmtoll RGxCR GNBREQ LL_DMAMUX_GetGenRequestNb
  1091. * @param DMAMUXx DMAMUXx Instance
  1092. * @param RequestGenChannel This parameter can be one of the following values:
  1093. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1094. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1095. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1096. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1097. * @retval Between Min_Data = 1 and Max_Data = 32
  1098. */
  1099. __STATIC_INLINE uint32_t LL_DMAMUX_GetGenRequestNb(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1100. {
  1101. (void)(DMAMUXx);
  1102. return (uint32_t)((READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_GNBREQ) >> DMAMUX_RGxCR_GNBREQ_Pos) + 1U);
  1103. }
  1104. /**
  1105. * @brief Set DMAMUX external Request Signal ID on DMAMUX Request Generation Trigger Event Channel x.
  1106. * @rmtoll RGxCR SIG_ID LL_DMAMUX_SetRequestSignalID
  1107. * @param DMAMUXx DMAMUXx Instance
  1108. * @param RequestGenChannel This parameter can be one of the following values:
  1109. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1110. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1111. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1112. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1113. * @param RequestSignalID This parameter can be one of the following values:
  1114. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE0
  1115. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE1
  1116. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE2
  1117. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE3
  1118. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE4
  1119. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE5
  1120. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE6
  1121. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE7
  1122. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE8
  1123. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE9
  1124. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE10
  1125. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE11
  1126. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE12
  1127. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE13
  1128. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE14
  1129. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE15
  1130. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH0
  1131. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH1
  1132. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH2
  1133. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH3
  1134. * @arg @ref LL_DMAMUX_REQ_GEN_LPTIM1_OUT
  1135. * @arg @ref LL_DMAMUX_REQ_GEN_LPTIM2_OUT
  1136. * @arg @ref LL_DMAMUX_REQ_GEN_TIM14_OC
  1137. * @retval None
  1138. */
  1139. __STATIC_INLINE void LL_DMAMUX_SetRequestSignalID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel, uint32_t RequestSignalID)
  1140. {
  1141. (void)(DMAMUXx);
  1142. MODIFY_REG(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_SIG_ID, RequestSignalID);
  1143. }
  1144. /**
  1145. * @brief Get DMAMUX external Request Signal ID set on DMAMUX Channel x.
  1146. * @rmtoll RGxCR SIG_ID LL_DMAMUX_GetRequestSignalID
  1147. * @param DMAMUXx DMAMUXx Instance
  1148. * @param RequestGenChannel This parameter can be one of the following values:
  1149. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1150. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1151. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1152. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1153. * @retval Returned value can be one of the following values:
  1154. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE0
  1155. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE1
  1156. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE2
  1157. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE3
  1158. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE4
  1159. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE5
  1160. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE6
  1161. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE7
  1162. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE8
  1163. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE9
  1164. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE10
  1165. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE11
  1166. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE12
  1167. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE13
  1168. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE14
  1169. * @arg @ref LL_DMAMUX_REQ_GEN_EXTI_LINE15
  1170. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH0
  1171. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH1
  1172. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH2
  1173. * @arg @ref LL_DMAMUX_REQ_GEN_DMAMUX_CH3
  1174. * @arg @ref LL_DMAMUX_REQ_GEN_LPTIM1_OUT
  1175. * @arg @ref LL_DMAMUX_REQ_GEN_LPTIM2_OUT
  1176. * @arg @ref LL_DMAMUX_REQ_GEN_TIM14_OC
  1177. */
  1178. __STATIC_INLINE uint32_t LL_DMAMUX_GetRequestSignalID(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1179. {
  1180. (void)(DMAMUXx);
  1181. return (uint32_t)(READ_BIT(((DMAMUX_RequestGen_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_RequestGenerator0 + (DMAMUX_RGCR_SIZE * (RequestGenChannel)))))->RGCR, DMAMUX_RGxCR_SIG_ID));
  1182. }
  1183. /**
  1184. * @}
  1185. */
  1186. /** @defgroup DMAMUX_LL_EF_FLAG_Management FLAG_Management
  1187. * @{
  1188. */
  1189. /**
  1190. * @brief Get Synchronization Event Overrun Flag Channel 0.
  1191. * @rmtoll CSR SOF0 LL_DMAMUX_IsActiveFlag_SO0
  1192. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1193. * @retval State of bit (1 or 0).
  1194. */
  1195. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO0(DMAMUX_Channel_TypeDef *DMAMUXx)
  1196. {
  1197. (void)(DMAMUXx);
  1198. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF0) == (DMAMUX_CSR_SOF0)) ? 1UL : 0UL);
  1199. }
  1200. /**
  1201. * @brief Get Synchronization Event Overrun Flag Channel 1.
  1202. * @rmtoll CSR SOF1 LL_DMAMUX_IsActiveFlag_SO1
  1203. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1204. * @retval State of bit (1 or 0).
  1205. */
  1206. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO1(DMAMUX_Channel_TypeDef *DMAMUXx)
  1207. {
  1208. (void)(DMAMUXx);
  1209. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF1) == (DMAMUX_CSR_SOF1)) ? 1UL : 0UL);
  1210. }
  1211. /**
  1212. * @brief Get Synchronization Event Overrun Flag Channel 2.
  1213. * @rmtoll CSR SOF2 LL_DMAMUX_IsActiveFlag_SO2
  1214. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1215. * @retval State of bit (1 or 0).
  1216. */
  1217. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO2(DMAMUX_Channel_TypeDef *DMAMUXx)
  1218. {
  1219. (void)(DMAMUXx);
  1220. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF2) == (DMAMUX_CSR_SOF2)) ? 1UL : 0UL);
  1221. }
  1222. /**
  1223. * @brief Get Synchronization Event Overrun Flag Channel 3.
  1224. * @rmtoll CSR SOF3 LL_DMAMUX_IsActiveFlag_SO3
  1225. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1226. * @retval State of bit (1 or 0).
  1227. */
  1228. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO3(DMAMUX_Channel_TypeDef *DMAMUXx)
  1229. {
  1230. (void)(DMAMUXx);
  1231. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF3) == (DMAMUX_CSR_SOF3)) ? 1UL : 0UL);
  1232. }
  1233. /**
  1234. * @brief Get Synchronization Event Overrun Flag Channel 4.
  1235. * @rmtoll CSR SOF4 LL_DMAMUX_IsActiveFlag_SO4
  1236. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1237. * @retval State of bit (1 or 0).
  1238. */
  1239. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO4(DMAMUX_Channel_TypeDef *DMAMUXx)
  1240. {
  1241. (void)(DMAMUXx);
  1242. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF4) == (DMAMUX_CSR_SOF4)) ? 1UL : 0UL);
  1243. }
  1244. #if defined(DMAMUX1_Channel5)
  1245. /**
  1246. * @brief Get Synchronization Event Overrun Flag Channel 5.
  1247. * @rmtoll CSR SOF5 LL_DMAMUX_IsActiveFlag_SO5
  1248. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1249. * @retval State of bit (1 or 0).
  1250. */
  1251. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO5(DMAMUX_Channel_TypeDef *DMAMUXx)
  1252. {
  1253. (void)(DMAMUXx);
  1254. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF5) == (DMAMUX_CSR_SOF5)) ? 1UL : 0UL);
  1255. }
  1256. #endif
  1257. #if defined(DMAMUX1_Channel6)
  1258. /**
  1259. * @brief Get Synchronization Event Overrun Flag Channel 6.
  1260. * @rmtoll CSR SOF6 LL_DMAMUX_IsActiveFlag_SO6
  1261. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1262. * @retval State of bit (1 or 0).
  1263. */
  1264. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO6(DMAMUX_Channel_TypeDef *DMAMUXx)
  1265. {
  1266. (void)(DMAMUXx);
  1267. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF6) == (DMAMUX_CSR_SOF6)) ? 1UL : 0UL);
  1268. }
  1269. #endif
  1270. #if defined(DMAMUX1_Channel7)
  1271. /**
  1272. * @brief Get Synchronization Event Overrun Flag Channel 7.
  1273. * @rmtoll CSR SOF7 LL_DMAMUX_IsActiveFlag_SO7
  1274. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1275. * @retval State of bit (1 or 0).
  1276. */
  1277. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO7(DMAMUX_Channel_TypeDef *DMAMUXx)
  1278. {
  1279. (void)(DMAMUXx);
  1280. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF7) == (DMAMUX_CSR_SOF7)) ? 1UL : 0UL);
  1281. }
  1282. #endif
  1283. #if defined(DMAMUX1_Channel8)
  1284. /**
  1285. * @brief Get Synchronization Event Overrun Flag Channel 8.
  1286. * @rmtoll CSR SOF8 LL_DMAMUX_IsActiveFlag_SO8
  1287. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1288. * @retval State of bit (1 or 0).
  1289. */
  1290. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO8(DMAMUX_Channel_TypeDef *DMAMUXx)
  1291. {
  1292. (void)(DMAMUXx);
  1293. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF8) == (DMAMUX_CSR_SOF8)) ? 1UL : 0UL);
  1294. }
  1295. #endif
  1296. #if defined(DMAMUX1_Channel9)
  1297. /**
  1298. * @brief Get Synchronization Event Overrun Flag Channel 9.
  1299. * @rmtoll CSR SOF9 LL_DMAMUX_IsActiveFlag_SO9
  1300. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1301. * @retval State of bit (1 or 0).
  1302. */
  1303. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO9(DMAMUX_Channel_TypeDef *DMAMUXx)
  1304. {
  1305. (void)(DMAMUXx);
  1306. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF9) == (DMAMUX_CSR_SOF9)) ? 1UL : 0UL);
  1307. }
  1308. #endif
  1309. #if defined(DMAMUX1_Channel10)
  1310. /**
  1311. * @brief Get Synchronization Event Overrun Flag Channel 10.
  1312. * @rmtoll CSR SOF10 LL_DMAMUX_IsActiveFlag_SO10
  1313. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1314. * @retval State of bit (1 or 0).
  1315. */
  1316. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO10(DMAMUX_Channel_TypeDef *DMAMUXx)
  1317. {
  1318. (void)(DMAMUXx);
  1319. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF10) == (DMAMUX_CSR_SOF10)) ? 1UL : 0UL);
  1320. }
  1321. #endif
  1322. #if defined(DMAMUX1_Channel11)
  1323. /**
  1324. * @brief Get Synchronization Event Overrun Flag Channel 11.
  1325. * @rmtoll CSR SOF11 LL_DMAMUX_IsActiveFlag_SO11
  1326. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1327. * @retval State of bit (1 or 0).
  1328. */
  1329. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_SO11(DMAMUX_Channel_TypeDef *DMAMUXx)
  1330. {
  1331. (void)(DMAMUXx);
  1332. return ((READ_BIT(DMAMUX1_ChannelStatus->CSR, DMAMUX_CSR_SOF11) == (DMAMUX_CSR_SOF11)) ? 1UL : 0UL);
  1333. }
  1334. #endif
  1335. /**
  1336. * @brief Get Request Generator 0 Trigger Event Overrun Flag.
  1337. * @rmtoll RGSR OF0 LL_DMAMUX_IsActiveFlag_RGO0
  1338. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1339. * @retval State of bit (1 or 0).
  1340. */
  1341. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO0(DMAMUX_Channel_TypeDef *DMAMUXx)
  1342. {
  1343. (void)(DMAMUXx);
  1344. return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF0) == (DMAMUX_RGSR_OF0)) ? 1UL : 0UL);
  1345. }
  1346. /**
  1347. * @brief Get Request Generator 1 Trigger Event Overrun Flag.
  1348. * @rmtoll RGSR OF1 LL_DMAMUX_IsActiveFlag_RGO1
  1349. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1350. * @retval State of bit (1 or 0).
  1351. */
  1352. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO1(DMAMUX_Channel_TypeDef *DMAMUXx)
  1353. {
  1354. (void)(DMAMUXx);
  1355. return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF1) == (DMAMUX_RGSR_OF1)) ? 1UL : 0UL);
  1356. }
  1357. /**
  1358. * @brief Get Request Generator 2 Trigger Event Overrun Flag.
  1359. * @rmtoll RGSR OF2 LL_DMAMUX_IsActiveFlag_RGO2
  1360. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1361. * @retval State of bit (1 or 0).
  1362. */
  1363. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO2(DMAMUX_Channel_TypeDef *DMAMUXx)
  1364. {
  1365. (void)(DMAMUXx);
  1366. return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF2) == (DMAMUX_RGSR_OF2)) ? 1UL : 0UL);
  1367. }
  1368. /**
  1369. * @brief Get Request Generator 3 Trigger Event Overrun Flag.
  1370. * @rmtoll RGSR OF3 LL_DMAMUX_IsActiveFlag_RGO3
  1371. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1372. * @retval State of bit (1 or 0).
  1373. */
  1374. __STATIC_INLINE uint32_t LL_DMAMUX_IsActiveFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx)
  1375. {
  1376. (void)(DMAMUXx);
  1377. return ((READ_BIT(DMAMUX1_RequestGenStatus->RGSR, DMAMUX_RGSR_OF3) == (DMAMUX_RGSR_OF3)) ? 1UL : 0UL);
  1378. }
  1379. /**
  1380. * @brief Clear Synchronization Event Overrun Flag Channel 0.
  1381. * @rmtoll CFR CSOF0 LL_DMAMUX_ClearFlag_SO0
  1382. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1383. * @retval None
  1384. */
  1385. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO0(DMAMUX_Channel_TypeDef *DMAMUXx)
  1386. {
  1387. (void)(DMAMUXx);
  1388. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF0);
  1389. }
  1390. /**
  1391. * @brief Clear Synchronization Event Overrun Flag Channel 1.
  1392. * @rmtoll CFR CSOF1 LL_DMAMUX_ClearFlag_SO1
  1393. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1394. * @retval None
  1395. */
  1396. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO1(DMAMUX_Channel_TypeDef *DMAMUXx)
  1397. {
  1398. (void)(DMAMUXx);
  1399. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF1);
  1400. }
  1401. /**
  1402. * @brief Clear Synchronization Event Overrun Flag Channel 2.
  1403. * @rmtoll CFR CSOF2 LL_DMAMUX_ClearFlag_SO2
  1404. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1405. * @retval None
  1406. */
  1407. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO2(DMAMUX_Channel_TypeDef *DMAMUXx)
  1408. {
  1409. (void)(DMAMUXx);
  1410. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF2);
  1411. }
  1412. /**
  1413. * @brief Clear Synchronization Event Overrun Flag Channel 3.
  1414. * @rmtoll CFR CSOF3 LL_DMAMUX_ClearFlag_SO3
  1415. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1416. * @retval None
  1417. */
  1418. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO3(DMAMUX_Channel_TypeDef *DMAMUXx)
  1419. {
  1420. (void)(DMAMUXx);
  1421. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF3);
  1422. }
  1423. /**
  1424. * @brief Clear Synchronization Event Overrun Flag Channel 4.
  1425. * @rmtoll CFR CSOF4 LL_DMAMUX_ClearFlag_SO4
  1426. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1427. * @retval None
  1428. */
  1429. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO4(DMAMUX_Channel_TypeDef *DMAMUXx)
  1430. {
  1431. (void)(DMAMUXx);
  1432. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF4);
  1433. }
  1434. #if defined(DMAMUX1_Channel5)
  1435. /**
  1436. * @brief Clear Synchronization Event Overrun Flag Channel 5.
  1437. * @rmtoll CFR CSOF5 LL_DMAMUX_ClearFlag_SO5
  1438. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1439. * @retval None
  1440. */
  1441. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO5(DMAMUX_Channel_TypeDef *DMAMUXx)
  1442. {
  1443. (void)(DMAMUXx);
  1444. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF5);
  1445. }
  1446. #endif
  1447. #if defined(DMAMUX1_Channel6)
  1448. /**
  1449. * @brief Clear Synchronization Event Overrun Flag Channel 6.
  1450. * @rmtoll CFR CSOF6 LL_DMAMUX_ClearFlag_SO6
  1451. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1452. * @retval None
  1453. */
  1454. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO6(DMAMUX_Channel_TypeDef *DMAMUXx)
  1455. {
  1456. (void)(DMAMUXx);
  1457. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF6);
  1458. }
  1459. #endif
  1460. #if defined(DMAMUX1_Channel7)
  1461. /**
  1462. * @brief Clear Synchronization Event Overrun Flag Channel 7.
  1463. * @rmtoll CFR CSOF7 LL_DMAMUX_ClearFlag_SO7
  1464. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1465. * @retval None
  1466. */
  1467. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO7(DMAMUX_Channel_TypeDef *DMAMUXx)
  1468. {
  1469. (void)(DMAMUXx);
  1470. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF7);
  1471. }
  1472. #endif
  1473. #if defined(DMAMUX1_Channel8)
  1474. /**
  1475. * @brief Clear Synchronization Event Overrun Flag Channel 8.
  1476. * @rmtoll CFR CSOF8 LL_DMAMUX_ClearFlag_SO8
  1477. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1478. * @retval None
  1479. */
  1480. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO8(DMAMUX_Channel_TypeDef *DMAMUXx)
  1481. {
  1482. (void)(DMAMUXx);
  1483. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF8);
  1484. }
  1485. #endif
  1486. #if defined(DMAMUX1_Channel9)
  1487. /**
  1488. * @brief Clear Synchronization Event Overrun Flag Channel 9.
  1489. * @rmtoll CFR CSOF9 LL_DMAMUX_ClearFlag_SO9
  1490. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1491. * @retval None
  1492. */
  1493. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO9(DMAMUX_Channel_TypeDef *DMAMUXx)
  1494. {
  1495. (void)(DMAMUXx);
  1496. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF9);
  1497. }
  1498. #endif
  1499. #if defined(DMAMUX1_Channel10)
  1500. /**
  1501. * @brief Clear Synchronization Event Overrun Flag Channel 10.
  1502. * @rmtoll CFR CSOF10 LL_DMAMUX_ClearFlag_SO10
  1503. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1504. * @retval None
  1505. */
  1506. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO10(DMAMUX_Channel_TypeDef *DMAMUXx)
  1507. {
  1508. (void)(DMAMUXx);
  1509. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF10);
  1510. }
  1511. #endif
  1512. #if defined(DMAMUX1_Channel11)
  1513. /**
  1514. * @brief Clear Synchronization Event Overrun Flag Channel 11.
  1515. * @rmtoll CFR CSOF11 LL_DMAMUX_ClearFlag_SO11
  1516. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1517. * @retval None
  1518. */
  1519. __STATIC_INLINE void LL_DMAMUX_ClearFlag_SO11(DMAMUX_Channel_TypeDef *DMAMUXx)
  1520. {
  1521. (void)(DMAMUXx);
  1522. SET_BIT(DMAMUX1_ChannelStatus->CFR, DMAMUX_CFR_CSOF11);
  1523. }
  1524. #endif
  1525. /**
  1526. * @brief Clear Request Generator 0 Trigger Event Overrun Flag.
  1527. * @rmtoll RGCFR COF0 LL_DMAMUX_ClearFlag_RGO0
  1528. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1529. * @retval None
  1530. */
  1531. __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO0(DMAMUX_Channel_TypeDef *DMAMUXx)
  1532. {
  1533. (void)(DMAMUXx);
  1534. SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF0);
  1535. }
  1536. /**
  1537. * @brief Clear Request Generator 1 Trigger Event Overrun Flag.
  1538. * @rmtoll RGCFR COF1 LL_DMAMUX_ClearFlag_RGO1
  1539. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1540. * @retval None
  1541. */
  1542. __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO1(DMAMUX_Channel_TypeDef *DMAMUXx)
  1543. {
  1544. (void)(DMAMUXx);
  1545. SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF1);
  1546. }
  1547. /**
  1548. * @brief Clear Request Generator 2 Trigger Event Overrun Flag.
  1549. * @rmtoll RGCFR COF2 LL_DMAMUX_ClearFlag_RGO2
  1550. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1551. * @retval None
  1552. */
  1553. __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO2(DMAMUX_Channel_TypeDef *DMAMUXx)
  1554. {
  1555. (void)(DMAMUXx);
  1556. SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF2);
  1557. }
  1558. /**
  1559. * @brief Clear Request Generator 3 Trigger Event Overrun Flag.
  1560. * @rmtoll RGCFR COF3 LL_DMAMUX_ClearFlag_RGO3
  1561. * @param DMAMUXx DMAMUXx DMAMUXx Instance
  1562. * @retval None
  1563. */
  1564. __STATIC_INLINE void LL_DMAMUX_ClearFlag_RGO3(DMAMUX_Channel_TypeDef *DMAMUXx)
  1565. {
  1566. (void)(DMAMUXx);
  1567. SET_BIT(DMAMUX1_RequestGenStatus->RGCFR, DMAMUX_RGCFR_COF3);
  1568. }
  1569. /**
  1570. * @}
  1571. */
  1572. /** @defgroup DMAMUX_LL_EF_IT_Management IT_Management
  1573. * @{
  1574. */
  1575. /**
  1576. * @brief Enable the Synchronization Event Overrun Interrupt on DMAMUX channel x.
  1577. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  1578. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  1579. * @rmtoll CxCR SOIE LL_DMAMUX_EnableIT_SO
  1580. * @param DMAMUXx DMAMUXx Instance
  1581. * @param Channel This parameter can be one of the following values:
  1582. * @arg @ref LL_DMAMUX_CHANNEL_0
  1583. * @arg @ref LL_DMAMUX_CHANNEL_1
  1584. * @arg @ref LL_DMAMUX_CHANNEL_2
  1585. * @arg @ref LL_DMAMUX_CHANNEL_3
  1586. * @arg @ref LL_DMAMUX_CHANNEL_4
  1587. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  1588. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  1589. *
  1590. * @arg All the next values are only available on chip which support DMA2:
  1591. * @arg @ref LL_DMAMUX_CHANNEL_7
  1592. * @arg @ref LL_DMAMUX_CHANNEL_8
  1593. * @arg @ref LL_DMAMUX_CHANNEL_9
  1594. * @arg @ref LL_DMAMUX_CHANNEL_10
  1595. * @arg @ref LL_DMAMUX_CHANNEL_11
  1596. * @retval None
  1597. */
  1598. __STATIC_INLINE void LL_DMAMUX_EnableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  1599. {
  1600. (void)(DMAMUXx);
  1601. SET_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE);
  1602. }
  1603. /**
  1604. * @brief Disable the Synchronization Event Overrun Interrupt on DMAMUX channel x.
  1605. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  1606. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  1607. * @rmtoll CxCR SOIE LL_DMAMUX_DisableIT_SO
  1608. * @param DMAMUXx DMAMUXx Instance
  1609. * @param Channel This parameter can be one of the following values:
  1610. * @arg @ref LL_DMAMUX_CHANNEL_0
  1611. * @arg @ref LL_DMAMUX_CHANNEL_1
  1612. * @arg @ref LL_DMAMUX_CHANNEL_2
  1613. * @arg @ref LL_DMAMUX_CHANNEL_3
  1614. * @arg @ref LL_DMAMUX_CHANNEL_4
  1615. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  1616. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  1617. *
  1618. * @arg All the next values are only available on chip which support DMA2:
  1619. * @arg @ref LL_DMAMUX_CHANNEL_7
  1620. * @arg @ref LL_DMAMUX_CHANNEL_8
  1621. * @arg @ref LL_DMAMUX_CHANNEL_9
  1622. * @arg @ref LL_DMAMUX_CHANNEL_10
  1623. * @arg @ref LL_DMAMUX_CHANNEL_11
  1624. * @retval None
  1625. */
  1626. __STATIC_INLINE void LL_DMAMUX_DisableIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  1627. {
  1628. (void)(DMAMUXx);
  1629. CLEAR_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE);
  1630. }
  1631. /**
  1632. * @brief Check if the Synchronization Event Overrun Interrupt on DMAMUX channel x is enabled or disabled.
  1633. * @note DMAMUX channel 0 to 6 are mapped to DMA1 channel 1 to 7.
  1634. * DMAMUX channel 7 to 11 are mapped to DMA2 channel 1 to 5 (**** only available on chip which support DMA2 ****).
  1635. * @rmtoll CxCR SOIE LL_DMAMUX_IsEnabledIT_SO
  1636. * @param DMAMUXx DMAMUXx Instance
  1637. * @param Channel This parameter can be one of the following values:
  1638. * @arg @ref LL_DMAMUX_CHANNEL_0
  1639. * @arg @ref LL_DMAMUX_CHANNEL_1
  1640. * @arg @ref LL_DMAMUX_CHANNEL_2
  1641. * @arg @ref LL_DMAMUX_CHANNEL_3
  1642. * @arg @ref LL_DMAMUX_CHANNEL_4
  1643. * @arg @ref LL_DMAMUX_CHANNEL_5 (**** only available on some devices ****)
  1644. * @arg @ref LL_DMAMUX_CHANNEL_6 (**** only available on some devices ****)
  1645. *
  1646. * @arg All the next values are only available on chip which support DMA2:
  1647. * @arg @ref LL_DMAMUX_CHANNEL_7
  1648. * @arg @ref LL_DMAMUX_CHANNEL_8
  1649. * @arg @ref LL_DMAMUX_CHANNEL_9
  1650. * @arg @ref LL_DMAMUX_CHANNEL_10
  1651. * @arg @ref LL_DMAMUX_CHANNEL_11
  1652. * @retval State of bit (1 or 0).
  1653. */
  1654. __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledIT_SO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t Channel)
  1655. {
  1656. (void)(DMAMUXx);
  1657. return (((READ_BIT((DMAMUX1_Channel0 + Channel)->CCR, DMAMUX_CxCR_SOIE)) == (DMAMUX_CxCR_SOIE)) ? 1UL : 0UL);
  1658. }
  1659. /**
  1660. * @brief Enable the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x.
  1661. * @rmtoll RGxCR OIE LL_DMAMUX_EnableIT_RGO
  1662. * @param DMAMUXx DMAMUXx Instance
  1663. * @param RequestGenChannel This parameter can be one of the following values:
  1664. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1665. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1666. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1667. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1668. * @retval None
  1669. */
  1670. __STATIC_INLINE void LL_DMAMUX_EnableIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1671. {
  1672. (void)(DMAMUXx);
  1673. SET_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE);
  1674. }
  1675. /**
  1676. * @brief Disable the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x.
  1677. * @rmtoll RGxCR OIE LL_DMAMUX_DisableIT_RGO
  1678. * @param DMAMUXx DMAMUXx Instance
  1679. * @param RequestGenChannel This parameter can be one of the following values:
  1680. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1681. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1682. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1683. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1684. * @retval None
  1685. */
  1686. __STATIC_INLINE void LL_DMAMUX_DisableIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1687. {
  1688. (void)(DMAMUXx);
  1689. CLEAR_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE);
  1690. }
  1691. /**
  1692. * @brief Check if the Request Generation Trigger Event Overrun Interrupt on DMAMUX channel x is enabled or disabled.
  1693. * @rmtoll RGxCR OIE LL_DMAMUX_IsEnabledIT_RGO
  1694. * @param DMAMUXx DMAMUXx Instance
  1695. * @param RequestGenChannel This parameter can be one of the following values:
  1696. * @arg @ref LL_DMAMUX_REQ_GEN_0
  1697. * @arg @ref LL_DMAMUX_REQ_GEN_1
  1698. * @arg @ref LL_DMAMUX_REQ_GEN_2
  1699. * @arg @ref LL_DMAMUX_REQ_GEN_3
  1700. * @retval State of bit (1 or 0).
  1701. */
  1702. __STATIC_INLINE uint32_t LL_DMAMUX_IsEnabledIT_RGO(DMAMUX_Channel_TypeDef *DMAMUXx, uint32_t RequestGenChannel)
  1703. {
  1704. (void)(DMAMUXx);
  1705. return ((READ_BIT((DMAMUX1_RequestGenerator0 + RequestGenChannel)->RGCR, DMAMUX_RGxCR_OIE) == (DMAMUX_RGxCR_OIE)) ? 1UL : 0UL);
  1706. }
  1707. /**
  1708. * @}
  1709. */
  1710. /**
  1711. * @}
  1712. */
  1713. /**
  1714. * @}
  1715. */
  1716. #endif /* DMAMUX1 */
  1717. /**
  1718. * @}
  1719. */
  1720. #ifdef __cplusplus
  1721. }
  1722. #endif
  1723. #endif /* STM32G0xx_LL_DMAMUX_H */
  1724. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/