stm32h7xx_ll_dma.h 125 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322
  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_ll_dma.h
  4. * @author MCD Application Team
  5. * @brief Header file of DMA LL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32H7xx_LL_DMA_H
  20. #define STM32H7xx_LL_DMA_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32h7xx.h"
  26. #include "stm32h7xx_ll_dmamux.h"
  27. /** @addtogroup STM32H7xx_LL_Driver
  28. * @{
  29. */
  30. #if defined (DMA1) || defined (DMA2)
  31. /** @defgroup DMA_LL DMA
  32. * @{
  33. */
  34. /* Private types -------------------------------------------------------------*/
  35. /* Private variables ---------------------------------------------------------*/
  36. /** @defgroup DMA_LL_Private_Variables DMA Private Variables
  37. * @{
  38. */
  39. /* Array used to get the DMA stream register offset versus stream index LL_DMA_STREAM_x */
  40. static const uint8_t LL_DMA_STR_OFFSET_TAB[] =
  41. {
  42. (uint8_t)(DMA1_Stream0_BASE - DMA1_BASE),
  43. (uint8_t)(DMA1_Stream1_BASE - DMA1_BASE),
  44. (uint8_t)(DMA1_Stream2_BASE - DMA1_BASE),
  45. (uint8_t)(DMA1_Stream3_BASE - DMA1_BASE),
  46. (uint8_t)(DMA1_Stream4_BASE - DMA1_BASE),
  47. (uint8_t)(DMA1_Stream5_BASE - DMA1_BASE),
  48. (uint8_t)(DMA1_Stream6_BASE - DMA1_BASE),
  49. (uint8_t)(DMA1_Stream7_BASE - DMA1_BASE)
  50. };
  51. /**
  52. * @}
  53. */
  54. /* Private macros ------------------------------------------------------------*/
  55. /** @defgroup DMA_LL_Private_Macros DMA LL Private Macros
  56. * @{
  57. */
  58. /**
  59. * @brief Helper macro to convert DMA Instance DMAx into DMAMUX channel
  60. * @note DMAMUX channel 0 to 7 are mapped to DMA1 stream 0 to 7.
  61. * DMAMUX channel 8 to 15 are mapped to DMA2 stream 0 to 7.
  62. * @param __DMA_INSTANCE__ DMAx
  63. * @retval Channel_Offset (LL_DMAMUX_CHANNEL_8 or 0).
  64. */
  65. #define LL_DMA_INSTANCE_TO_DMAMUX_CHANNEL(__DMA_INSTANCE__) \
  66. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) ? 0UL : 8UL)
  67. /**
  68. * @}
  69. */
  70. /* Exported types ------------------------------------------------------------*/
  71. #if defined(USE_FULL_LL_DRIVER)
  72. /** @defgroup DMA_LL_ES_INIT DMA Exported Init structure
  73. * @{
  74. */
  75. typedef struct
  76. {
  77. uint32_t PeriphOrM2MSrcAddress; /*!< Specifies the peripheral base address for DMA transfer
  78. or as Source base address in case of memory to memory transfer direction.
  79. This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */
  80. uint32_t MemoryOrM2MDstAddress; /*!< Specifies the memory base address for DMA transfer
  81. or as Destination base address in case of memory to memory transfer direction.
  82. This parameter must be a value between Min_Data = 0 and Max_Data = 0xFFFFFFFF. */
  83. uint32_t Direction; /*!< Specifies if the data will be transferred from memory to peripheral,
  84. from memory to memory or from peripheral to memory.
  85. This parameter can be a value of @ref DMA_LL_EC_DIRECTION
  86. This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataTransferDirection(). */
  87. uint32_t Mode; /*!< Specifies the normal or circular operation mode.
  88. This parameter can be a value of @ref DMA_LL_EC_MODE
  89. @note The circular buffer mode cannot be used if the memory to memory
  90. data transfer direction is configured on the selected Stream
  91. This feature can be modified afterwards using unitary function @ref LL_DMA_SetMode(). */
  92. uint32_t PeriphOrM2MSrcIncMode; /*!< Specifies whether the Peripheral address or Source address in case of memory to memory transfer direction
  93. is incremented or not.
  94. This parameter can be a value of @ref DMA_LL_EC_PERIPH
  95. This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphIncMode(). */
  96. uint32_t MemoryOrM2MDstIncMode; /*!< Specifies whether the Memory address or Destination address in case of memory to memory transfer direction
  97. is incremented or not.
  98. This parameter can be a value of @ref DMA_LL_EC_MEMORY
  99. This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemoryIncMode(). */
  100. uint32_t PeriphOrM2MSrcDataSize; /*!< Specifies the Peripheral data size alignment or Source data size alignment (byte, half word, word)
  101. in case of memory to memory transfer direction.
  102. This parameter can be a value of @ref DMA_LL_EC_PDATAALIGN
  103. This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphSize(). */
  104. uint32_t MemoryOrM2MDstDataSize; /*!< Specifies the Memory data size alignment or Destination data size alignment (byte, half word, word)
  105. in case of memory to memory transfer direction.
  106. This parameter can be a value of @ref DMA_LL_EC_MDATAALIGN
  107. This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemorySize(). */
  108. uint32_t NbData; /*!< Specifies the number of data to transfer, in data unit.
  109. The data unit is equal to the source buffer configuration set in PeripheralSize
  110. or MemorySize parameters depending in the transfer direction.
  111. This parameter must be a value between Min_Data = 0 and Max_Data = 0x0000FFFF
  112. This feature can be modified afterwards using unitary function @ref LL_DMA_SetDataLength(). */
  113. uint32_t PeriphRequest; /*!< Specifies the peripheral request.
  114. This parameter can be a value of @ref DMAMUX1_Request_selection
  115. This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphRequest(). */
  116. uint32_t Priority; /*!< Specifies the channel priority level.
  117. This parameter can be a value of @ref DMA_LL_EC_PRIORITY
  118. This feature can be modified afterwards using unitary function @ref LL_DMA_SetStreamPriorityLevel(). */
  119. uint32_t FIFOMode; /*!< Specifies if the FIFO mode or Direct mode will be used for the specified stream.
  120. This parameter can be a value of @ref DMA_LL_FIFOMODE
  121. @note The Direct mode (FIFO mode disabled) cannot be used if the
  122. memory-to-memory data transfer is configured on the selected stream
  123. This feature can be modified afterwards using unitary functions @ref LL_DMA_EnableFifoMode() or @ref LL_DMA_EnableFifoMode() . */
  124. uint32_t FIFOThreshold; /*!< Specifies the FIFO threshold level.
  125. This parameter can be a value of @ref DMA_LL_EC_FIFOTHRESHOLD
  126. This feature can be modified afterwards using unitary function @ref LL_DMA_SetFIFOThreshold(). */
  127. uint32_t MemBurst; /*!< Specifies the Burst transfer configuration for the memory transfers.
  128. It specifies the amount of data to be transferred in a single non interruptible
  129. transaction.
  130. This parameter can be a value of @ref DMA_LL_EC_MBURST
  131. @note The burst mode is possible only if the address Increment mode is enabled.
  132. This feature can be modified afterwards using unitary function @ref LL_DMA_SetMemoryBurstxfer(). */
  133. uint32_t PeriphBurst; /*!< Specifies the Burst transfer configuration for the peripheral transfers.
  134. It specifies the amount of data to be transferred in a single non interruptible
  135. transaction.
  136. This parameter can be a value of @ref DMA_LL_EC_PBURST
  137. @note The burst mode is possible only if the address Increment mode is enabled.
  138. This feature can be modified afterwards using unitary function @ref LL_DMA_SetPeriphBurstxfer(). */
  139. uint32_t DoubleBufferMode; /*!< Specifies the double buffer mode.
  140. This parameter can be a value of @ref DMA_LL_EC_DOUBLEBUFFER_MODE
  141. This feature can be modified afterwards using unitary function @ref LL_DMA_EnableDoubleBufferMode() & LL_DMA_DisableDoubleBufferMode(). */
  142. uint32_t TargetMemInDoubleBufferMode; /*!< Specifies the target memory in double buffer mode.
  143. This parameter can be a value of @ref DMA_LL_EC_CURRENTTARGETMEM
  144. This feature can be modified afterwards using unitary function @ref LL_DMA_SetCurrentTargetMem(). */
  145. } LL_DMA_InitTypeDef;
  146. /**
  147. * @}
  148. */
  149. #endif /*USE_FULL_LL_DRIVER*/
  150. /* Exported constants --------------------------------------------------------*/
  151. /** @defgroup DMA_LL_Exported_Constants DMA Exported Constants
  152. * @{
  153. */
  154. /** @defgroup DMA_LL_EC_STREAM STREAM
  155. * @{
  156. */
  157. #define LL_DMA_STREAM_0 0x00000000U
  158. #define LL_DMA_STREAM_1 0x00000001U
  159. #define LL_DMA_STREAM_2 0x00000002U
  160. #define LL_DMA_STREAM_3 0x00000003U
  161. #define LL_DMA_STREAM_4 0x00000004U
  162. #define LL_DMA_STREAM_5 0x00000005U
  163. #define LL_DMA_STREAM_6 0x00000006U
  164. #define LL_DMA_STREAM_7 0x00000007U
  165. #define LL_DMA_STREAM_ALL 0xFFFF0000U
  166. /**
  167. * @}
  168. */
  169. /** @defgroup DMA_LL_EC_DIRECTION DIRECTION
  170. * @{
  171. */
  172. #define LL_DMA_DIRECTION_PERIPH_TO_MEMORY 0x00000000U /*!< Peripheral to memory direction */
  173. #define LL_DMA_DIRECTION_MEMORY_TO_PERIPH DMA_SxCR_DIR_0 /*!< Memory to peripheral direction */
  174. #define LL_DMA_DIRECTION_MEMORY_TO_MEMORY DMA_SxCR_DIR_1 /*!< Memory to memory direction */
  175. /**
  176. * @}
  177. */
  178. /** @defgroup DMA_LL_EC_MODE MODE
  179. * @{
  180. */
  181. #define LL_DMA_MODE_NORMAL 0x00000000U /*!< Normal Mode */
  182. #define LL_DMA_MODE_CIRCULAR DMA_SxCR_CIRC /*!< Circular Mode */
  183. #define LL_DMA_MODE_PFCTRL DMA_SxCR_PFCTRL /*!< Peripheral flow control mode */
  184. /**
  185. * @}
  186. */
  187. /** @defgroup DMA_LL_EC_DOUBLEBUFFER_MODE DOUBLE BUFFER MODE
  188. * @{
  189. */
  190. #define LL_DMA_DOUBLEBUFFER_MODE_DISABLE 0x00000000U /*!< Disable double buffering mode */
  191. #define LL_DMA_DOUBLEBUFFER_MODE_ENABLE DMA_SxCR_DBM /*!< Enable double buffering mode */
  192. /**
  193. * @}
  194. */
  195. /** @defgroup DMA_LL_EC_CURRENTTARGETMEM CURRENTTARGETMEM
  196. * @{
  197. */
  198. #define LL_DMA_CURRENTTARGETMEM0 0x00000000U /*!< Set CurrentTarget Memory to Memory 0 */
  199. #define LL_DMA_CURRENTTARGETMEM1 DMA_SxCR_CT /*!< Set CurrentTarget Memory to Memory 1 */
  200. /**
  201. * @}
  202. */
  203. /** @defgroup DMA_LL_EC_PERIPH PERIPH
  204. * @{
  205. */
  206. #define LL_DMA_PERIPH_NOINCREMENT 0x00000000U /*!< Peripheral increment mode Disable */
  207. #define LL_DMA_PERIPH_INCREMENT DMA_SxCR_PINC /*!< Peripheral increment mode Enable */
  208. /**
  209. * @}
  210. */
  211. /** @defgroup DMA_LL_EC_MEMORY MEMORY
  212. * @{
  213. */
  214. #define LL_DMA_MEMORY_NOINCREMENT 0x00000000U /*!< Memory increment mode Disable */
  215. #define LL_DMA_MEMORY_INCREMENT DMA_SxCR_MINC /*!< Memory increment mode Enable */
  216. /**
  217. * @}
  218. */
  219. /** @defgroup DMA_LL_EC_PDATAALIGN PDATAALIGN
  220. * @{
  221. */
  222. #define LL_DMA_PDATAALIGN_BYTE 0x00000000U /*!< Peripheral data alignment : Byte */
  223. #define LL_DMA_PDATAALIGN_HALFWORD DMA_SxCR_PSIZE_0 /*!< Peripheral data alignment : HalfWord */
  224. #define LL_DMA_PDATAALIGN_WORD DMA_SxCR_PSIZE_1 /*!< Peripheral data alignment : Word */
  225. /**
  226. * @}
  227. */
  228. /** @defgroup DMA_LL_EC_MDATAALIGN MDATAALIGN
  229. * @{
  230. */
  231. #define LL_DMA_MDATAALIGN_BYTE 0x00000000U /*!< Memory data alignment : Byte */
  232. #define LL_DMA_MDATAALIGN_HALFWORD DMA_SxCR_MSIZE_0 /*!< Memory data alignment : HalfWord */
  233. #define LL_DMA_MDATAALIGN_WORD DMA_SxCR_MSIZE_1 /*!< Memory data alignment : Word */
  234. /**
  235. * @}
  236. */
  237. /** @defgroup DMA_LL_EC_OFFSETSIZE OFFSETSIZE
  238. * @{
  239. */
  240. #define LL_DMA_OFFSETSIZE_PSIZE 0x00000000U /*!< Peripheral increment offset size is linked to the PSIZE */
  241. #define LL_DMA_OFFSETSIZE_FIXEDTO4 DMA_SxCR_PINCOS /*!< Peripheral increment offset size is fixed to 4 (32-bit alignment) */
  242. /**
  243. * @}
  244. */
  245. /** @defgroup DMA_LL_EC_PRIORITY PRIORITY
  246. * @{
  247. */
  248. #define LL_DMA_PRIORITY_LOW 0x00000000U /*!< Priority level : Low */
  249. #define LL_DMA_PRIORITY_MEDIUM DMA_SxCR_PL_0 /*!< Priority level : Medium */
  250. #define LL_DMA_PRIORITY_HIGH DMA_SxCR_PL_1 /*!< Priority level : High */
  251. #define LL_DMA_PRIORITY_VERYHIGH DMA_SxCR_PL /*!< Priority level : Very_High */
  252. /**
  253. * @}
  254. */
  255. /** @defgroup DMA_LL_EC_MBURST MBURST
  256. * @{
  257. */
  258. #define LL_DMA_MBURST_SINGLE 0x00000000U /*!< Memory burst single transfer configuration */
  259. #define LL_DMA_MBURST_INC4 DMA_SxCR_MBURST_0 /*!< Memory burst of 4 beats transfer configuration */
  260. #define LL_DMA_MBURST_INC8 DMA_SxCR_MBURST_1 /*!< Memory burst of 8 beats transfer configuration */
  261. #define LL_DMA_MBURST_INC16 (DMA_SxCR_MBURST_0 | DMA_SxCR_MBURST_1) /*!< Memory burst of 16 beats transfer configuration */
  262. /**
  263. * @}
  264. */
  265. /** @defgroup DMA_LL_EC_PBURST PBURST
  266. * @{
  267. */
  268. #define LL_DMA_PBURST_SINGLE 0x00000000U /*!< Peripheral burst single transfer configuration */
  269. #define LL_DMA_PBURST_INC4 DMA_SxCR_PBURST_0 /*!< Peripheral burst of 4 beats transfer configuration */
  270. #define LL_DMA_PBURST_INC8 DMA_SxCR_PBURST_1 /*!< Peripheral burst of 8 beats transfer configuration */
  271. #define LL_DMA_PBURST_INC16 (DMA_SxCR_PBURST_0 | DMA_SxCR_PBURST_1) /*!< Peripheral burst of 16 beats transfer configuration */
  272. /**
  273. * @}
  274. */
  275. /** @defgroup DMA_LL_FIFOMODE DMA_LL_FIFOMODE
  276. * @{
  277. */
  278. #define LL_DMA_FIFOMODE_DISABLE 0x00000000U /*!< FIFO mode disable (direct mode is enabled) */
  279. #define LL_DMA_FIFOMODE_ENABLE DMA_SxFCR_DMDIS /*!< FIFO mode enable */
  280. /**
  281. * @}
  282. */
  283. /** @defgroup DMA_LL_EC_FIFOSTATUS_0 FIFOSTATUS 0
  284. * @{
  285. */
  286. #define LL_DMA_FIFOSTATUS_0_25 0x00000000U /*!< 0 < fifo_level < 1/4 */
  287. #define LL_DMA_FIFOSTATUS_25_50 DMA_SxFCR_FS_0 /*!< 1/4 < fifo_level < 1/2 */
  288. #define LL_DMA_FIFOSTATUS_50_75 DMA_SxFCR_FS_1 /*!< 1/2 < fifo_level < 3/4 */
  289. #define LL_DMA_FIFOSTATUS_75_100 (DMA_SxFCR_FS_1 | DMA_SxFCR_FS_0) /*!< 3/4 < fifo_level < full */
  290. #define LL_DMA_FIFOSTATUS_EMPTY DMA_SxFCR_FS_2 /*!< FIFO is empty */
  291. #define LL_DMA_FIFOSTATUS_FULL (DMA_SxFCR_FS_2 | DMA_SxFCR_FS_0) /*!< FIFO is full */
  292. /**
  293. * @}
  294. */
  295. /** @defgroup DMA_LL_EC_FIFOTHRESHOLD FIFOTHRESHOLD
  296. * @{
  297. */
  298. #define LL_DMA_FIFOTHRESHOLD_1_4 0x00000000U /*!< FIFO threshold 1 quart full configuration */
  299. #define LL_DMA_FIFOTHRESHOLD_1_2 DMA_SxFCR_FTH_0 /*!< FIFO threshold half full configuration */
  300. #define LL_DMA_FIFOTHRESHOLD_3_4 DMA_SxFCR_FTH_1 /*!< FIFO threshold 3 quarts full configuration */
  301. #define LL_DMA_FIFOTHRESHOLD_FULL DMA_SxFCR_FTH /*!< FIFO threshold full configuration */
  302. /**
  303. * @}
  304. */
  305. /**
  306. * @}
  307. */
  308. /* Exported macro ------------------------------------------------------------*/
  309. /** @defgroup DMA_LL_Exported_Macros DMA Exported Macros
  310. * @{
  311. */
  312. /** @defgroup DMA_LL_EM_WRITE_READ Common Write and read registers macros
  313. * @{
  314. */
  315. /**
  316. * @brief Write a value in DMA register
  317. * @param __INSTANCE__ DMA Instance
  318. * @param __REG__ Register to be written
  319. * @param __VALUE__ Value to be written in the register
  320. * @retval None
  321. */
  322. #define LL_DMA_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG((__INSTANCE__)->__REG__, (__VALUE__))
  323. /**
  324. * @brief Read a value in DMA register
  325. * @param __INSTANCE__ DMA Instance
  326. * @param __REG__ Register to be read
  327. * @retval Register value
  328. */
  329. #define LL_DMA_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
  330. /**
  331. * @}
  332. */
  333. /** @defgroup DMA_LL_EM_CONVERT_DMAxCHANNELy Convert DMAxStreamy
  334. * @{
  335. */
  336. /**
  337. * @brief Convert DMAx_Streamy into DMAx
  338. * @param __STREAM_INSTANCE__ DMAx_Streamy
  339. * @retval DMAx
  340. */
  341. #define __LL_DMA_GET_INSTANCE(__STREAM_INSTANCE__) \
  342. (((uint32_t)(__STREAM_INSTANCE__) > ((uint32_t)DMA1_Stream7)) ? DMA2 : DMA1)
  343. /**
  344. * @brief Convert DMAx_Streamy into LL_DMA_STREAM_y
  345. * @param __STREAM_INSTANCE__ DMAx_Streamy
  346. * @retval LL_DMA_STREAM_y
  347. */
  348. #define __LL_DMA_GET_STREAM(__STREAM_INSTANCE__) \
  349. (((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream0)) ? LL_DMA_STREAM_0 : \
  350. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream0)) ? LL_DMA_STREAM_0 : \
  351. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream1)) ? LL_DMA_STREAM_1 : \
  352. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream1)) ? LL_DMA_STREAM_1 : \
  353. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream2)) ? LL_DMA_STREAM_2 : \
  354. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream2)) ? LL_DMA_STREAM_2 : \
  355. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream3)) ? LL_DMA_STREAM_3 : \
  356. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream3)) ? LL_DMA_STREAM_3 : \
  357. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream4)) ? LL_DMA_STREAM_4 : \
  358. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream4)) ? LL_DMA_STREAM_4 : \
  359. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream5)) ? LL_DMA_STREAM_5 : \
  360. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream5)) ? LL_DMA_STREAM_5 : \
  361. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA1_Stream6)) ? LL_DMA_STREAM_6 : \
  362. ((uint32_t)(__STREAM_INSTANCE__) == ((uint32_t)DMA2_Stream6)) ? LL_DMA_STREAM_6 : \
  363. LL_DMA_STREAM_7)
  364. /**
  365. * @brief Convert DMA Instance DMAx and LL_DMA_STREAM_y into DMAx_Streamy
  366. * @param __DMA_INSTANCE__ DMAx
  367. * @param __STREAM__ LL_DMA_STREAM_y
  368. * @retval DMAx_Streamy
  369. */
  370. #define __LL_DMA_GET_STREAM_INSTANCE(__DMA_INSTANCE__, __STREAM__) \
  371. ((((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_0))) ? DMA1_Stream0 : \
  372. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_0))) ? DMA2_Stream0 : \
  373. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_1))) ? DMA1_Stream1 : \
  374. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_1))) ? DMA2_Stream1 : \
  375. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_2))) ? DMA1_Stream2 : \
  376. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_2))) ? DMA2_Stream2 : \
  377. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_3))) ? DMA1_Stream3 : \
  378. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_3))) ? DMA2_Stream3 : \
  379. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_4))) ? DMA1_Stream4 : \
  380. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_4))) ? DMA2_Stream4 : \
  381. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_5))) ? DMA1_Stream5 : \
  382. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_5))) ? DMA2_Stream5 : \
  383. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_6))) ? DMA1_Stream6 : \
  384. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA2)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_6))) ? DMA2_Stream6 : \
  385. (((uint32_t)(__DMA_INSTANCE__) == ((uint32_t)DMA1)) && ((uint32_t)(__STREAM__) == ((uint32_t)LL_DMA_STREAM_7))) ? DMA1_Stream7 : \
  386. DMA2_Stream7)
  387. /**
  388. * @}
  389. */
  390. /**
  391. * @}
  392. */
  393. /* Exported functions --------------------------------------------------------*/
  394. /** @defgroup DMA_LL_Exported_Functions DMA Exported Functions
  395. * @{
  396. */
  397. /** @defgroup DMA_LL_EF_Configuration Configuration
  398. * @{
  399. */
  400. /**
  401. * @brief Enable DMA stream.
  402. * @rmtoll CR EN LL_DMA_EnableStream
  403. * @param DMAx DMAx Instance
  404. * @param Stream This parameter can be one of the following values:
  405. * @arg @ref LL_DMA_STREAM_0
  406. * @arg @ref LL_DMA_STREAM_1
  407. * @arg @ref LL_DMA_STREAM_2
  408. * @arg @ref LL_DMA_STREAM_3
  409. * @arg @ref LL_DMA_STREAM_4
  410. * @arg @ref LL_DMA_STREAM_5
  411. * @arg @ref LL_DMA_STREAM_6
  412. * @arg @ref LL_DMA_STREAM_7
  413. * @retval None
  414. */
  415. __STATIC_INLINE void LL_DMA_EnableStream(DMA_TypeDef *DMAx, uint32_t Stream)
  416. {
  417. uint32_t dma_base_addr = (uint32_t)DMAx;
  418. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_EN);
  419. }
  420. /**
  421. * @brief Disable DMA stream.
  422. * @rmtoll CR EN LL_DMA_DisableStream
  423. * @param DMAx DMAx Instance
  424. * @param Stream This parameter can be one of the following values:
  425. * @arg @ref LL_DMA_STREAM_0
  426. * @arg @ref LL_DMA_STREAM_1
  427. * @arg @ref LL_DMA_STREAM_2
  428. * @arg @ref LL_DMA_STREAM_3
  429. * @arg @ref LL_DMA_STREAM_4
  430. * @arg @ref LL_DMA_STREAM_5
  431. * @arg @ref LL_DMA_STREAM_6
  432. * @arg @ref LL_DMA_STREAM_7
  433. * @retval None
  434. */
  435. __STATIC_INLINE void LL_DMA_DisableStream(DMA_TypeDef *DMAx, uint32_t Stream)
  436. {
  437. uint32_t dma_base_addr = (uint32_t)DMAx;
  438. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_EN);
  439. }
  440. /**
  441. * @brief Check if DMA stream is enabled or disabled.
  442. * @rmtoll CR EN LL_DMA_IsEnabledStream
  443. * @param DMAx DMAx Instance
  444. * @param Stream This parameter can be one of the following values:
  445. * @arg @ref LL_DMA_STREAM_0
  446. * @arg @ref LL_DMA_STREAM_1
  447. * @arg @ref LL_DMA_STREAM_2
  448. * @arg @ref LL_DMA_STREAM_3
  449. * @arg @ref LL_DMA_STREAM_4
  450. * @arg @ref LL_DMA_STREAM_5
  451. * @arg @ref LL_DMA_STREAM_6
  452. * @arg @ref LL_DMA_STREAM_7
  453. * @retval State of bit (1 or 0).
  454. */
  455. __STATIC_INLINE uint32_t LL_DMA_IsEnabledStream(DMA_TypeDef *DMAx, uint32_t Stream)
  456. {
  457. uint32_t dma_base_addr = (uint32_t)DMAx;
  458. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_EN) == (DMA_SxCR_EN)) ? 1UL : 0UL);
  459. }
  460. /**
  461. * @brief Configure all parameters linked to DMA transfer.
  462. * @rmtoll CR DIR LL_DMA_ConfigTransfer\n
  463. * CR CIRC LL_DMA_ConfigTransfer\n
  464. * CR PINC LL_DMA_ConfigTransfer\n
  465. * CR MINC LL_DMA_ConfigTransfer\n
  466. * CR PSIZE LL_DMA_ConfigTransfer\n
  467. * CR MSIZE LL_DMA_ConfigTransfer\n
  468. * CR PL LL_DMA_ConfigTransfer\n
  469. * CR PFCTRL LL_DMA_ConfigTransfer\n
  470. * CR DBM LL_DMA_ConfigTransfer\n
  471. * CR CT LL_DMA_ConfigTransfer
  472. * @param DMAx DMAx Instance
  473. * @param Stream This parameter can be one of the following values:
  474. * @arg @ref LL_DMA_STREAM_0
  475. * @arg @ref LL_DMA_STREAM_1
  476. * @arg @ref LL_DMA_STREAM_2
  477. * @arg @ref LL_DMA_STREAM_3
  478. * @arg @ref LL_DMA_STREAM_4
  479. * @arg @ref LL_DMA_STREAM_5
  480. * @arg @ref LL_DMA_STREAM_6
  481. * @arg @ref LL_DMA_STREAM_7
  482. * @param Configuration This parameter must be a combination of all the following values:
  483. * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY or @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH or @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY
  484. * @arg @ref LL_DMA_MODE_NORMAL or @ref LL_DMA_MODE_CIRCULAR or @ref LL_DMA_MODE_PFCTRL
  485. * @arg @ref LL_DMA_PERIPH_INCREMENT or @ref LL_DMA_PERIPH_NOINCREMENT
  486. * @arg @ref LL_DMA_MEMORY_INCREMENT or @ref LL_DMA_MEMORY_NOINCREMENT
  487. * @arg @ref LL_DMA_PDATAALIGN_BYTE or @ref LL_DMA_PDATAALIGN_HALFWORD or @ref LL_DMA_PDATAALIGN_WORD
  488. * @arg @ref LL_DMA_MDATAALIGN_BYTE or @ref LL_DMA_MDATAALIGN_HALFWORD or @ref LL_DMA_MDATAALIGN_WORD
  489. * @arg @ref LL_DMA_PRIORITY_LOW or @ref LL_DMA_PRIORITY_MEDIUM or @ref LL_DMA_PRIORITY_HIGH or @ref LL_DMA_PRIORITY_VERYHIGH
  490. * @arg @ref LL_DMA_DOUBLEBUFFER_MODE_DISABLE or @ref LL_DMA_DOUBLEBUFFER_MODE_ENABLE
  491. * @arg @ref LL_DMA_CURRENTTARGETMEM0 or @ref LL_DMA_CURRENTTARGETMEM1
  492. *@retval None
  493. */
  494. __STATIC_INLINE void LL_DMA_ConfigTransfer(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Configuration)
  495. {
  496. uint32_t dma_base_addr = (uint32_t)DMAx;
  497. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR,
  498. DMA_SxCR_DIR | DMA_SxCR_CIRC | DMA_SxCR_PINC | DMA_SxCR_MINC | DMA_SxCR_PSIZE | DMA_SxCR_MSIZE | DMA_SxCR_PL | \
  499. DMA_SxCR_PFCTRL | DMA_SxCR_DBM | DMA_SxCR_CT, Configuration);
  500. }
  501. /**
  502. * @brief Set Data transfer direction (read from peripheral or from memory).
  503. * @rmtoll CR DIR LL_DMA_SetDataTransferDirection
  504. * @param DMAx DMAx Instance
  505. * @param Stream This parameter can be one of the following values:
  506. * @arg @ref LL_DMA_STREAM_0
  507. * @arg @ref LL_DMA_STREAM_1
  508. * @arg @ref LL_DMA_STREAM_2
  509. * @arg @ref LL_DMA_STREAM_3
  510. * @arg @ref LL_DMA_STREAM_4
  511. * @arg @ref LL_DMA_STREAM_5
  512. * @arg @ref LL_DMA_STREAM_6
  513. * @arg @ref LL_DMA_STREAM_7
  514. * @param Direction This parameter can be one of the following values:
  515. * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY
  516. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH
  517. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY
  518. * @retval None
  519. */
  520. __STATIC_INLINE void LL_DMA_SetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Direction)
  521. {
  522. uint32_t dma_base_addr = (uint32_t)DMAx;
  523. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DIR, Direction);
  524. }
  525. /**
  526. * @brief Get Data transfer direction (read from peripheral or from memory).
  527. * @rmtoll CR DIR LL_DMA_GetDataTransferDirection
  528. * @param DMAx DMAx Instance
  529. * @param Stream This parameter can be one of the following values:
  530. * @arg @ref LL_DMA_STREAM_0
  531. * @arg @ref LL_DMA_STREAM_1
  532. * @arg @ref LL_DMA_STREAM_2
  533. * @arg @ref LL_DMA_STREAM_3
  534. * @arg @ref LL_DMA_STREAM_4
  535. * @arg @ref LL_DMA_STREAM_5
  536. * @arg @ref LL_DMA_STREAM_6
  537. * @arg @ref LL_DMA_STREAM_7
  538. * @retval Returned value can be one of the following values:
  539. * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY
  540. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH
  541. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY
  542. */
  543. __STATIC_INLINE uint32_t LL_DMA_GetDataTransferDirection(DMA_TypeDef *DMAx, uint32_t Stream)
  544. {
  545. uint32_t dma_base_addr = (uint32_t)DMAx;
  546. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DIR));
  547. }
  548. /**
  549. * @brief Set DMA mode normal, circular or peripheral flow control.
  550. * @rmtoll CR CIRC LL_DMA_SetMode\n
  551. * CR PFCTRL LL_DMA_SetMode
  552. * @param DMAx DMAx Instance
  553. * @param Stream This parameter can be one of the following values:
  554. * @arg @ref LL_DMA_STREAM_0
  555. * @arg @ref LL_DMA_STREAM_1
  556. * @arg @ref LL_DMA_STREAM_2
  557. * @arg @ref LL_DMA_STREAM_3
  558. * @arg @ref LL_DMA_STREAM_4
  559. * @arg @ref LL_DMA_STREAM_5
  560. * @arg @ref LL_DMA_STREAM_6
  561. * @arg @ref LL_DMA_STREAM_7
  562. * @param Mode This parameter can be one of the following values:
  563. * @arg @ref LL_DMA_MODE_NORMAL
  564. * @arg @ref LL_DMA_MODE_CIRCULAR
  565. * @arg @ref LL_DMA_MODE_PFCTRL
  566. * @retval None
  567. */
  568. __STATIC_INLINE void LL_DMA_SetMode(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Mode)
  569. {
  570. uint32_t dma_base_addr = (uint32_t)DMAx;
  571. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_CIRC | DMA_SxCR_PFCTRL, Mode);
  572. }
  573. /**
  574. * @brief Get DMA mode normal, circular or peripheral flow control.
  575. * @rmtoll CR CIRC LL_DMA_GetMode\n
  576. * CR PFCTRL LL_DMA_GetMode
  577. * @param DMAx DMAx Instance
  578. * @param Stream This parameter can be one of the following values:
  579. * @arg @ref LL_DMA_STREAM_0
  580. * @arg @ref LL_DMA_STREAM_1
  581. * @arg @ref LL_DMA_STREAM_2
  582. * @arg @ref LL_DMA_STREAM_3
  583. * @arg @ref LL_DMA_STREAM_4
  584. * @arg @ref LL_DMA_STREAM_5
  585. * @arg @ref LL_DMA_STREAM_6
  586. * @arg @ref LL_DMA_STREAM_7
  587. * @retval Returned value can be one of the following values:
  588. * @arg @ref LL_DMA_MODE_NORMAL
  589. * @arg @ref LL_DMA_MODE_CIRCULAR
  590. * @arg @ref LL_DMA_MODE_PFCTRL
  591. */
  592. __STATIC_INLINE uint32_t LL_DMA_GetMode(DMA_TypeDef *DMAx, uint32_t Stream)
  593. {
  594. uint32_t dma_base_addr = (uint32_t)DMAx;
  595. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_CIRC | DMA_SxCR_PFCTRL));
  596. }
  597. /**
  598. * @brief Set Peripheral increment mode.
  599. * @rmtoll CR PINC LL_DMA_SetPeriphIncMode
  600. * @param DMAx DMAx Instance
  601. * @param Stream This parameter can be one of the following values:
  602. * @arg @ref LL_DMA_STREAM_0
  603. * @arg @ref LL_DMA_STREAM_1
  604. * @arg @ref LL_DMA_STREAM_2
  605. * @arg @ref LL_DMA_STREAM_3
  606. * @arg @ref LL_DMA_STREAM_4
  607. * @arg @ref LL_DMA_STREAM_5
  608. * @arg @ref LL_DMA_STREAM_6
  609. * @arg @ref LL_DMA_STREAM_7
  610. * @param IncrementMode This parameter can be one of the following values:
  611. * @arg @ref LL_DMA_PERIPH_NOINCREMENT
  612. * @arg @ref LL_DMA_PERIPH_INCREMENT
  613. * @retval None
  614. */
  615. __STATIC_INLINE void LL_DMA_SetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t IncrementMode)
  616. {
  617. uint32_t dma_base_addr = (uint32_t)DMAx;
  618. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PINC, IncrementMode);
  619. }
  620. /**
  621. * @brief Get Peripheral increment mode.
  622. * @rmtoll CR PINC LL_DMA_GetPeriphIncMode
  623. * @param DMAx DMAx Instance
  624. * @param Stream This parameter can be one of the following values:
  625. * @arg @ref LL_DMA_STREAM_0
  626. * @arg @ref LL_DMA_STREAM_1
  627. * @arg @ref LL_DMA_STREAM_2
  628. * @arg @ref LL_DMA_STREAM_3
  629. * @arg @ref LL_DMA_STREAM_4
  630. * @arg @ref LL_DMA_STREAM_5
  631. * @arg @ref LL_DMA_STREAM_6
  632. * @arg @ref LL_DMA_STREAM_7
  633. * @retval Returned value can be one of the following values:
  634. * @arg @ref LL_DMA_PERIPH_NOINCREMENT
  635. * @arg @ref LL_DMA_PERIPH_INCREMENT
  636. */
  637. __STATIC_INLINE uint32_t LL_DMA_GetPeriphIncMode(DMA_TypeDef *DMAx, uint32_t Stream)
  638. {
  639. uint32_t dma_base_addr = (uint32_t)DMAx;
  640. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PINC));
  641. }
  642. /**
  643. * @brief Set Memory increment mode.
  644. * @rmtoll CR MINC LL_DMA_SetMemoryIncMode
  645. * @param DMAx DMAx Instance
  646. * @param Stream This parameter can be one of the following values:
  647. * @arg @ref LL_DMA_STREAM_0
  648. * @arg @ref LL_DMA_STREAM_1
  649. * @arg @ref LL_DMA_STREAM_2
  650. * @arg @ref LL_DMA_STREAM_3
  651. * @arg @ref LL_DMA_STREAM_4
  652. * @arg @ref LL_DMA_STREAM_5
  653. * @arg @ref LL_DMA_STREAM_6
  654. * @arg @ref LL_DMA_STREAM_7
  655. * @param IncrementMode This parameter can be one of the following values:
  656. * @arg @ref LL_DMA_MEMORY_NOINCREMENT
  657. * @arg @ref LL_DMA_MEMORY_INCREMENT
  658. * @retval None
  659. */
  660. __STATIC_INLINE void LL_DMA_SetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t IncrementMode)
  661. {
  662. uint32_t dma_base_addr = (uint32_t)DMAx;
  663. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MINC, IncrementMode);
  664. }
  665. /**
  666. * @brief Get Memory increment mode.
  667. * @rmtoll CR MINC LL_DMA_GetMemoryIncMode
  668. * @param DMAx DMAx Instance
  669. * @param Stream This parameter can be one of the following values:
  670. * @arg @ref LL_DMA_STREAM_0
  671. * @arg @ref LL_DMA_STREAM_1
  672. * @arg @ref LL_DMA_STREAM_2
  673. * @arg @ref LL_DMA_STREAM_3
  674. * @arg @ref LL_DMA_STREAM_4
  675. * @arg @ref LL_DMA_STREAM_5
  676. * @arg @ref LL_DMA_STREAM_6
  677. * @arg @ref LL_DMA_STREAM_7
  678. * @retval Returned value can be one of the following values:
  679. * @arg @ref LL_DMA_MEMORY_NOINCREMENT
  680. * @arg @ref LL_DMA_MEMORY_INCREMENT
  681. */
  682. __STATIC_INLINE uint32_t LL_DMA_GetMemoryIncMode(DMA_TypeDef *DMAx, uint32_t Stream)
  683. {
  684. uint32_t dma_base_addr = (uint32_t)DMAx;
  685. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MINC));
  686. }
  687. /**
  688. * @brief Set Peripheral size.
  689. * @rmtoll CR PSIZE LL_DMA_SetPeriphSize
  690. * @param DMAx DMAx Instance
  691. * @param Stream This parameter can be one of the following values:
  692. * @arg @ref LL_DMA_STREAM_0
  693. * @arg @ref LL_DMA_STREAM_1
  694. * @arg @ref LL_DMA_STREAM_2
  695. * @arg @ref LL_DMA_STREAM_3
  696. * @arg @ref LL_DMA_STREAM_4
  697. * @arg @ref LL_DMA_STREAM_5
  698. * @arg @ref LL_DMA_STREAM_6
  699. * @arg @ref LL_DMA_STREAM_7
  700. * @param Size This parameter can be one of the following values:
  701. * @arg @ref LL_DMA_PDATAALIGN_BYTE
  702. * @arg @ref LL_DMA_PDATAALIGN_HALFWORD
  703. * @arg @ref LL_DMA_PDATAALIGN_WORD
  704. * @retval None
  705. */
  706. __STATIC_INLINE void LL_DMA_SetPeriphSize(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Size)
  707. {
  708. uint32_t dma_base_addr = (uint32_t)DMAx;
  709. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PSIZE, Size);
  710. }
  711. /**
  712. * @brief Get Peripheral size.
  713. * @rmtoll CR PSIZE LL_DMA_GetPeriphSize
  714. * @param DMAx DMAx Instance
  715. * @param Stream This parameter can be one of the following values:
  716. * @arg @ref LL_DMA_STREAM_0
  717. * @arg @ref LL_DMA_STREAM_1
  718. * @arg @ref LL_DMA_STREAM_2
  719. * @arg @ref LL_DMA_STREAM_3
  720. * @arg @ref LL_DMA_STREAM_4
  721. * @arg @ref LL_DMA_STREAM_5
  722. * @arg @ref LL_DMA_STREAM_6
  723. * @arg @ref LL_DMA_STREAM_7
  724. * @retval Returned value can be one of the following values:
  725. * @arg @ref LL_DMA_PDATAALIGN_BYTE
  726. * @arg @ref LL_DMA_PDATAALIGN_HALFWORD
  727. * @arg @ref LL_DMA_PDATAALIGN_WORD
  728. */
  729. __STATIC_INLINE uint32_t LL_DMA_GetPeriphSize(DMA_TypeDef *DMAx, uint32_t Stream)
  730. {
  731. uint32_t dma_base_addr = (uint32_t)DMAx;
  732. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PSIZE));
  733. }
  734. /**
  735. * @brief Set Memory size.
  736. * @rmtoll CR MSIZE LL_DMA_SetMemorySize
  737. * @param DMAx DMAx Instance
  738. * @param Stream This parameter can be one of the following values:
  739. * @arg @ref LL_DMA_STREAM_0
  740. * @arg @ref LL_DMA_STREAM_1
  741. * @arg @ref LL_DMA_STREAM_2
  742. * @arg @ref LL_DMA_STREAM_3
  743. * @arg @ref LL_DMA_STREAM_4
  744. * @arg @ref LL_DMA_STREAM_5
  745. * @arg @ref LL_DMA_STREAM_6
  746. * @arg @ref LL_DMA_STREAM_7
  747. * @param Size This parameter can be one of the following values:
  748. * @arg @ref LL_DMA_MDATAALIGN_BYTE
  749. * @arg @ref LL_DMA_MDATAALIGN_HALFWORD
  750. * @arg @ref LL_DMA_MDATAALIGN_WORD
  751. * @retval None
  752. */
  753. __STATIC_INLINE void LL_DMA_SetMemorySize(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Size)
  754. {
  755. uint32_t dma_base_addr = (uint32_t)DMAx;
  756. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MSIZE, Size);
  757. }
  758. /**
  759. * @brief Get Memory size.
  760. * @rmtoll CR MSIZE LL_DMA_GetMemorySize
  761. * @param DMAx DMAx Instance
  762. * @param Stream This parameter can be one of the following values:
  763. * @arg @ref LL_DMA_STREAM_0
  764. * @arg @ref LL_DMA_STREAM_1
  765. * @arg @ref LL_DMA_STREAM_2
  766. * @arg @ref LL_DMA_STREAM_3
  767. * @arg @ref LL_DMA_STREAM_4
  768. * @arg @ref LL_DMA_STREAM_5
  769. * @arg @ref LL_DMA_STREAM_6
  770. * @arg @ref LL_DMA_STREAM_7
  771. * @retval Returned value can be one of the following values:
  772. * @arg @ref LL_DMA_MDATAALIGN_BYTE
  773. * @arg @ref LL_DMA_MDATAALIGN_HALFWORD
  774. * @arg @ref LL_DMA_MDATAALIGN_WORD
  775. */
  776. __STATIC_INLINE uint32_t LL_DMA_GetMemorySize(DMA_TypeDef *DMAx, uint32_t Stream)
  777. {
  778. uint32_t dma_base_addr = (uint32_t)DMAx;
  779. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MSIZE));
  780. }
  781. /**
  782. * @brief Set Peripheral increment offset size.
  783. * @rmtoll CR PINCOS LL_DMA_SetIncOffsetSize
  784. * @param DMAx DMAx Instance
  785. * @param Stream This parameter can be one of the following values:
  786. * @arg @ref LL_DMA_STREAM_0
  787. * @arg @ref LL_DMA_STREAM_1
  788. * @arg @ref LL_DMA_STREAM_2
  789. * @arg @ref LL_DMA_STREAM_3
  790. * @arg @ref LL_DMA_STREAM_4
  791. * @arg @ref LL_DMA_STREAM_5
  792. * @arg @ref LL_DMA_STREAM_6
  793. * @arg @ref LL_DMA_STREAM_7
  794. * @param OffsetSize This parameter can be one of the following values:
  795. * @arg @ref LL_DMA_OFFSETSIZE_PSIZE
  796. * @arg @ref LL_DMA_OFFSETSIZE_FIXEDTO4
  797. * @retval None
  798. */
  799. __STATIC_INLINE void LL_DMA_SetIncOffsetSize(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t OffsetSize)
  800. {
  801. uint32_t dma_base_addr = (uint32_t)DMAx;
  802. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PINCOS, OffsetSize);
  803. }
  804. /**
  805. * @brief Get Peripheral increment offset size.
  806. * @rmtoll CR PINCOS LL_DMA_GetIncOffsetSize
  807. * @param DMAx DMAx Instance
  808. * @param Stream This parameter can be one of the following values:
  809. * @arg @ref LL_DMA_STREAM_0
  810. * @arg @ref LL_DMA_STREAM_1
  811. * @arg @ref LL_DMA_STREAM_2
  812. * @arg @ref LL_DMA_STREAM_3
  813. * @arg @ref LL_DMA_STREAM_4
  814. * @arg @ref LL_DMA_STREAM_5
  815. * @arg @ref LL_DMA_STREAM_6
  816. * @arg @ref LL_DMA_STREAM_7
  817. * @retval Returned value can be one of the following values:
  818. * @arg @ref LL_DMA_OFFSETSIZE_PSIZE
  819. * @arg @ref LL_DMA_OFFSETSIZE_FIXEDTO4
  820. */
  821. __STATIC_INLINE uint32_t LL_DMA_GetIncOffsetSize(DMA_TypeDef *DMAx, uint32_t Stream)
  822. {
  823. uint32_t dma_base_addr = (uint32_t)DMAx;
  824. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PINCOS));
  825. }
  826. /**
  827. * @brief Set Stream priority level.
  828. * @rmtoll CR PL LL_DMA_SetStreamPriorityLevel
  829. * @param DMAx DMAx Instance
  830. * @param Stream This parameter can be one of the following values:
  831. * @arg @ref LL_DMA_STREAM_0
  832. * @arg @ref LL_DMA_STREAM_1
  833. * @arg @ref LL_DMA_STREAM_2
  834. * @arg @ref LL_DMA_STREAM_3
  835. * @arg @ref LL_DMA_STREAM_4
  836. * @arg @ref LL_DMA_STREAM_5
  837. * @arg @ref LL_DMA_STREAM_6
  838. * @arg @ref LL_DMA_STREAM_7
  839. * @param Priority This parameter can be one of the following values:
  840. * @arg @ref LL_DMA_PRIORITY_LOW
  841. * @arg @ref LL_DMA_PRIORITY_MEDIUM
  842. * @arg @ref LL_DMA_PRIORITY_HIGH
  843. * @arg @ref LL_DMA_PRIORITY_VERYHIGH
  844. * @retval None
  845. */
  846. __STATIC_INLINE void LL_DMA_SetStreamPriorityLevel(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Priority)
  847. {
  848. uint32_t dma_base_addr = (uint32_t)DMAx;
  849. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PL, Priority);
  850. }
  851. /**
  852. * @brief Get Stream priority level.
  853. * @rmtoll CR PL LL_DMA_GetStreamPriorityLevel
  854. * @param DMAx DMAx Instance
  855. * @param Stream This parameter can be one of the following values:
  856. * @arg @ref LL_DMA_STREAM_0
  857. * @arg @ref LL_DMA_STREAM_1
  858. * @arg @ref LL_DMA_STREAM_2
  859. * @arg @ref LL_DMA_STREAM_3
  860. * @arg @ref LL_DMA_STREAM_4
  861. * @arg @ref LL_DMA_STREAM_5
  862. * @arg @ref LL_DMA_STREAM_6
  863. * @arg @ref LL_DMA_STREAM_7
  864. * @retval Returned value can be one of the following values:
  865. * @arg @ref LL_DMA_PRIORITY_LOW
  866. * @arg @ref LL_DMA_PRIORITY_MEDIUM
  867. * @arg @ref LL_DMA_PRIORITY_HIGH
  868. * @arg @ref LL_DMA_PRIORITY_VERYHIGH
  869. */
  870. __STATIC_INLINE uint32_t LL_DMA_GetStreamPriorityLevel(DMA_TypeDef *DMAx, uint32_t Stream)
  871. {
  872. uint32_t dma_base_addr = (uint32_t)DMAx;
  873. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PL));
  874. }
  875. /**
  876. * @brief Enable DMA stream bufferable transfer.
  877. * @rmtoll CR TRBUFF LL_DMA_EnableBufferableTransfer
  878. * @param DMAx DMAx Instance
  879. * @param Stream This parameter can be one of the following values:
  880. * @arg @ref LL_DMA_STREAM_0
  881. * @arg @ref LL_DMA_STREAM_1
  882. * @arg @ref LL_DMA_STREAM_2
  883. * @arg @ref LL_DMA_STREAM_3
  884. * @arg @ref LL_DMA_STREAM_4
  885. * @arg @ref LL_DMA_STREAM_5
  886. * @arg @ref LL_DMA_STREAM_6
  887. * @arg @ref LL_DMA_STREAM_7
  888. * @retval None
  889. */
  890. __STATIC_INLINE void LL_DMA_EnableBufferableTransfer(DMA_TypeDef *DMAx, uint32_t Stream)
  891. {
  892. uint32_t dma_base_addr = (uint32_t)DMAx;
  893. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TRBUFF);
  894. }
  895. /**
  896. * @brief Disable DMA stream bufferable transfer.
  897. * @rmtoll CR TRBUFF LL_DMA_DisableBufferableTransfer
  898. * @param DMAx DMAx Instance
  899. * @param Stream This parameter can be one of the following values:
  900. * @arg @ref LL_DMA_STREAM_0
  901. * @arg @ref LL_DMA_STREAM_1
  902. * @arg @ref LL_DMA_STREAM_2
  903. * @arg @ref LL_DMA_STREAM_3
  904. * @arg @ref LL_DMA_STREAM_4
  905. * @arg @ref LL_DMA_STREAM_5
  906. * @arg @ref LL_DMA_STREAM_6
  907. * @arg @ref LL_DMA_STREAM_7
  908. * @retval None
  909. */
  910. __STATIC_INLINE void LL_DMA_DisableBufferableTransfer(DMA_TypeDef *DMAx, uint32_t Stream)
  911. {
  912. uint32_t dma_base_addr = (uint32_t)DMAx;
  913. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TRBUFF);
  914. }
  915. /**
  916. * @brief Set Number of data to transfer.
  917. * @rmtoll NDTR NDT LL_DMA_SetDataLength
  918. * @note This action has no effect if
  919. * stream is enabled.
  920. * @param DMAx DMAx Instance
  921. * @param Stream This parameter can be one of the following values:
  922. * @arg @ref LL_DMA_STREAM_0
  923. * @arg @ref LL_DMA_STREAM_1
  924. * @arg @ref LL_DMA_STREAM_2
  925. * @arg @ref LL_DMA_STREAM_3
  926. * @arg @ref LL_DMA_STREAM_4
  927. * @arg @ref LL_DMA_STREAM_5
  928. * @arg @ref LL_DMA_STREAM_6
  929. * @arg @ref LL_DMA_STREAM_7
  930. * @param NbData Between 0 to 0xFFFFFFFF
  931. * @retval None
  932. */
  933. __STATIC_INLINE void LL_DMA_SetDataLength(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t NbData)
  934. {
  935. uint32_t dma_base_addr = (uint32_t)DMAx;
  936. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->NDTR, DMA_SxNDT, NbData);
  937. }
  938. /**
  939. * @brief Get Number of data to transfer.
  940. * @rmtoll NDTR NDT LL_DMA_GetDataLength
  941. * @note Once the stream is enabled, the return value indicate the
  942. * remaining bytes to be transmitted.
  943. * @param DMAx DMAx Instance
  944. * @param Stream This parameter can be one of the following values:
  945. * @arg @ref LL_DMA_STREAM_0
  946. * @arg @ref LL_DMA_STREAM_1
  947. * @arg @ref LL_DMA_STREAM_2
  948. * @arg @ref LL_DMA_STREAM_3
  949. * @arg @ref LL_DMA_STREAM_4
  950. * @arg @ref LL_DMA_STREAM_5
  951. * @arg @ref LL_DMA_STREAM_6
  952. * @arg @ref LL_DMA_STREAM_7
  953. * @retval Between 0 to 0xFFFFFFFF
  954. */
  955. __STATIC_INLINE uint32_t LL_DMA_GetDataLength(DMA_TypeDef *DMAx, uint32_t Stream)
  956. {
  957. uint32_t dma_base_addr = (uint32_t)DMAx;
  958. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->NDTR, DMA_SxNDT));
  959. }
  960. /**
  961. * @brief Set DMA request for DMA Streams on DMAMUX Channel x.
  962. * @note DMAMUX channel 0 to 7 are mapped to DMA1 stream 0 to 7.
  963. * DMAMUX channel 8 to 15 are mapped to DMA2 stream 0 to 7.
  964. * @rmtoll CxCR DMAREQ_ID LL_DMA_SetPeriphRequest
  965. * @param DMAx DMAx Instance
  966. * @param Stream This parameter can be one of the following values:
  967. * @arg @ref LL_DMA_STREAM_0
  968. * @arg @ref LL_DMA_STREAM_1
  969. * @arg @ref LL_DMA_STREAM_2
  970. * @arg @ref LL_DMA_STREAM_3
  971. * @arg @ref LL_DMA_STREAM_4
  972. * @arg @ref LL_DMA_STREAM_5
  973. * @arg @ref LL_DMA_STREAM_6
  974. * @arg @ref LL_DMA_STREAM_7
  975. * @param Request This parameter can be one of the following values:
  976. * @arg @ref LL_DMAMUX1_REQ_MEM2MEM
  977. * @arg @ref LL_DMAMUX1_REQ_GENERATOR0
  978. * @arg @ref LL_DMAMUX1_REQ_GENERATOR1
  979. * @arg @ref LL_DMAMUX1_REQ_GENERATOR2
  980. * @arg @ref LL_DMAMUX1_REQ_GENERATOR3
  981. * @arg @ref LL_DMAMUX1_REQ_GENERATOR4
  982. * @arg @ref LL_DMAMUX1_REQ_GENERATOR5
  983. * @arg @ref LL_DMAMUX1_REQ_GENERATOR6
  984. * @arg @ref LL_DMAMUX1_REQ_GENERATOR7
  985. * @arg @ref LL_DMAMUX1_REQ_ADC1
  986. * @arg @ref LL_DMAMUX1_REQ_ADC2
  987. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH1
  988. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH2
  989. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH3
  990. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH4
  991. * @arg @ref LL_DMAMUX1_REQ_TIM1_UP
  992. * @arg @ref LL_DMAMUX1_REQ_TIM1_TRIG
  993. * @arg @ref LL_DMAMUX1_REQ_TIM1_COM
  994. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH1
  995. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH2
  996. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH3
  997. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH4
  998. * @arg @ref LL_DMAMUX1_REQ_TIM2_UP
  999. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH1
  1000. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH2
  1001. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH3
  1002. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH4
  1003. * @arg @ref LL_DMAMUX1_REQ_TIM3_UP
  1004. * @arg @ref LL_DMAMUX1_REQ_TIM3_TRIG
  1005. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH1
  1006. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH2
  1007. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH3
  1008. * @arg @ref LL_DMAMUX1_REQ_TIM4_UP
  1009. * @arg @ref LL_DMAMUX1_REQ_I2C1_RX
  1010. * @arg @ref LL_DMAMUX1_REQ_I2C1_TX
  1011. * @arg @ref LL_DMAMUX1_REQ_I2C2_RX
  1012. * @arg @ref LL_DMAMUX1_REQ_I2C2_TX
  1013. * @arg @ref LL_DMAMUX1_REQ_SPI1_RX
  1014. * @arg @ref LL_DMAMUX1_REQ_SPI1_TX
  1015. * @arg @ref LL_DMAMUX1_REQ_SPI2_RX
  1016. * @arg @ref LL_DMAMUX1_REQ_SPI2_TX
  1017. * @arg @ref LL_DMAMUX1_REQ_USART1_RX
  1018. * @arg @ref LL_DMAMUX1_REQ_USART1_TX
  1019. * @arg @ref LL_DMAMUX1_REQ_USART2_RX
  1020. * @arg @ref LL_DMAMUX1_REQ_USART2_TX
  1021. * @arg @ref LL_DMAMUX1_REQ_USART3_RX
  1022. * @arg @ref LL_DMAMUX1_REQ_USART3_TX
  1023. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH1
  1024. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH2
  1025. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH3
  1026. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH4
  1027. * @arg @ref LL_DMAMUX1_REQ_TIM8_UP
  1028. * @arg @ref LL_DMAMUX1_REQ_TIM8_TRIG
  1029. * @arg @ref LL_DMAMUX1_REQ_TIM8_COM
  1030. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH1
  1031. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH2
  1032. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH3
  1033. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH4
  1034. * @arg @ref LL_DMAMUX1_REQ_TIM5_UP
  1035. * @arg @ref LL_DMAMUX1_REQ_TIM5_TRIG
  1036. * @arg @ref LL_DMAMUX1_REQ_SPI3_RX
  1037. * @arg @ref LL_DMAMUX1_REQ_SPI3_TX
  1038. * @arg @ref LL_DMAMUX1_REQ_UART4_RX
  1039. * @arg @ref LL_DMAMUX1_REQ_UART4_TX
  1040. * @arg @ref LL_DMAMUX1_REQ_UART5_RX
  1041. * @arg @ref LL_DMAMUX1_REQ_UART5_TX
  1042. * @arg @ref LL_DMAMUX1_REQ_DAC1_CH1
  1043. * @arg @ref LL_DMAMUX1_REQ_DAC1_CH2
  1044. * @arg @ref LL_DMAMUX1_REQ_TIM6_UP
  1045. * @arg @ref LL_DMAMUX1_REQ_TIM7_UP
  1046. * @arg @ref LL_DMAMUX1_REQ_USART6_RX
  1047. * @arg @ref LL_DMAMUX1_REQ_USART6_TX
  1048. * @arg @ref LL_DMAMUX1_REQ_I2C3_RX
  1049. * @arg @ref LL_DMAMUX1_REQ_I2C3_TX
  1050. * @arg @ref LL_DMAMUX1_REQ_DCMI_PSSI (*)
  1051. * @arg @ref LL_DMAMUX1_REQ_CRYP_IN
  1052. * @arg @ref LL_DMAMUX1_REQ_CRYP_OUT
  1053. * @arg @ref LL_DMAMUX1_REQ_HASH_IN
  1054. * @arg @ref LL_DMAMUX1_REQ_UART7_RX
  1055. * @arg @ref LL_DMAMUX1_REQ_UART7_TX
  1056. * @arg @ref LL_DMAMUX1_REQ_UART8_RX
  1057. * @arg @ref LL_DMAMUX1_REQ_UART8_TX
  1058. * @arg @ref LL_DMAMUX1_REQ_SPI4_RX
  1059. * @arg @ref LL_DMAMUX1_REQ_SPI4_TX
  1060. * @arg @ref LL_DMAMUX1_REQ_SPI5_RX
  1061. * @arg @ref LL_DMAMUX1_REQ_SPI5_TX
  1062. * @arg @ref LL_DMAMUX1_REQ_SAI1_A
  1063. * @arg @ref LL_DMAMUX1_REQ_SAI1_B
  1064. * @arg @ref LL_DMAMUX1_REQ_SAI2_A (*)
  1065. * @arg @ref LL_DMAMUX1_REQ_SAI2_B (*)
  1066. * @arg @ref LL_DMAMUX1_REQ_SWPMI_RX
  1067. * @arg @ref LL_DMAMUX1_REQ_SWPMI_TX
  1068. * @arg @ref LL_DMAMUX1_REQ_SPDIF_RX_DT
  1069. * @arg @ref LL_DMAMUX1_REQ_SPDIF_RX_CS
  1070. * @arg @ref LL_DMAMUX1_REQ_HRTIM_MASTER (*)
  1071. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_A (*)
  1072. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_B (*)
  1073. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_C (*)
  1074. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_D (*)
  1075. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_E (*)
  1076. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT0
  1077. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT1
  1078. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT2
  1079. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT3
  1080. * @arg @ref LL_DMAMUX1_REQ_TIM15_CH1
  1081. * @arg @ref LL_DMAMUX1_REQ_TIM15_UP
  1082. * @arg @ref LL_DMAMUX1_REQ_TIM15_TRIG
  1083. * @arg @ref LL_DMAMUX1_REQ_TIM15_COM
  1084. * @arg @ref LL_DMAMUX1_REQ_TIM16_CH1
  1085. * @arg @ref LL_DMAMUX1_REQ_TIM16_UP
  1086. * @arg @ref LL_DMAMUX1_REQ_TIM17_CH1
  1087. * @arg @ref LL_DMAMUX1_REQ_TIM17_UP
  1088. * @arg @ref LL_DMAMUX1_REQ_SAI3_A (*)
  1089. * @arg @ref LL_DMAMUX1_REQ_SAI3_B (*)
  1090. * @arg @ref LL_DMAMUX1_REQ_ADC3 (*)
  1091. * @arg @ref LL_DMAMUX1_REQ_UART9_RX (*)
  1092. * @arg @ref LL_DMAMUX1_REQ_UART9_TX (*)
  1093. * @arg @ref LL_DMAMUX1_REQ_USART10_RX (*)
  1094. * @arg @ref LL_DMAMUX1_REQ_USART10_TX (*)
  1095. * @arg @ref LL_DMAMUX1_REQ_FMAC_READ (*)
  1096. * @arg @ref LL_DMAMUX1_REQ_FMAC_WRITE (*)
  1097. * @arg @ref LL_DMAMUX1_REQ_CORDIC_READ (*)
  1098. * @arg @ref LL_DMAMUX1_REQ_CORDIC_WRITE(*)
  1099. * @arg @ref LL_DMAMUX1_REQ_I2C5_RX (*)
  1100. * @arg @ref LL_DMAMUX1_REQ_I2C5_TX (*)
  1101. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH1 (*)
  1102. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH2 (*)
  1103. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH3 (*)
  1104. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH4 (*)
  1105. * @arg @ref LL_DMAMUX1_REQ_TIM23_UP (*)
  1106. * @arg @ref LL_DMAMUX1_REQ_TIM23_TRIG (*)
  1107. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH1 (*)
  1108. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH2 (*)
  1109. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH3 (*)
  1110. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH4 (*)
  1111. * @arg @ref LL_DMAMUX1_REQ_TIM24_UP (*)
  1112. * @arg @ref LL_DMAMUX1_REQ_TIM24_TRIG (*)
  1113. *
  1114. * @note (*) Availability depends on devices.
  1115. * @retval None
  1116. */
  1117. __STATIC_INLINE void LL_DMA_SetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Request)
  1118. {
  1119. MODIFY_REG(((DMAMUX_Channel_TypeDef *)(uint32_t)((uint32_t)DMAMUX1_Channel0 + (DMAMUX_CCR_SIZE * (Stream)) + (uint32_t)(DMAMUX_CCR_SIZE * LL_DMA_INSTANCE_TO_DMAMUX_CHANNEL(DMAx))))->CCR, DMAMUX_CxCR_DMAREQ_ID, Request);
  1120. }
  1121. /**
  1122. * @brief Get DMA request for DMA Channels on DMAMUX Channel x.
  1123. * @note DMAMUX channel 0 to 7 are mapped to DMA1 stream 0 to 7.
  1124. * DMAMUX channel 8 to 15 are mapped to DMA2 stream 0 to 7.
  1125. * @rmtoll CxCR DMAREQ_ID LL_DMA_GetPeriphRequest
  1126. * @param DMAx DMAx Instance
  1127. * @param Stream This parameter can be one of the following values:
  1128. * @arg @ref LL_DMA_STREAM_0
  1129. * @arg @ref LL_DMA_STREAM_1
  1130. * @arg @ref LL_DMA_STREAM_2
  1131. * @arg @ref LL_DMA_STREAM_3
  1132. * @arg @ref LL_DMA_STREAM_4
  1133. * @arg @ref LL_DMA_STREAM_5
  1134. * @arg @ref LL_DMA_STREAM_6
  1135. * @arg @ref LL_DMA_STREAM_7
  1136. * @retval Returned value can be one of the following values:
  1137. * @arg @ref LL_DMAMUX1_REQ_MEM2MEM
  1138. * @arg @ref LL_DMAMUX1_REQ_GENERATOR0
  1139. * @arg @ref LL_DMAMUX1_REQ_GENERATOR1
  1140. * @arg @ref LL_DMAMUX1_REQ_GENERATOR2
  1141. * @arg @ref LL_DMAMUX1_REQ_GENERATOR3
  1142. * @arg @ref LL_DMAMUX1_REQ_GENERATOR4
  1143. * @arg @ref LL_DMAMUX1_REQ_GENERATOR5
  1144. * @arg @ref LL_DMAMUX1_REQ_GENERATOR6
  1145. * @arg @ref LL_DMAMUX1_REQ_GENERATOR7
  1146. * @arg @ref LL_DMAMUX1_REQ_ADC1
  1147. * @arg @ref LL_DMAMUX1_REQ_ADC2
  1148. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH1
  1149. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH2
  1150. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH3
  1151. * @arg @ref LL_DMAMUX1_REQ_TIM1_CH4
  1152. * @arg @ref LL_DMAMUX1_REQ_TIM1_UP
  1153. * @arg @ref LL_DMAMUX1_REQ_TIM1_TRIG
  1154. * @arg @ref LL_DMAMUX1_REQ_TIM1_COM
  1155. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH1
  1156. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH2
  1157. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH3
  1158. * @arg @ref LL_DMAMUX1_REQ_TIM2_CH4
  1159. * @arg @ref LL_DMAMUX1_REQ_TIM2_UP
  1160. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH1
  1161. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH2
  1162. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH3
  1163. * @arg @ref LL_DMAMUX1_REQ_TIM3_CH4
  1164. * @arg @ref LL_DMAMUX1_REQ_TIM3_UP
  1165. * @arg @ref LL_DMAMUX1_REQ_TIM3_TRIG
  1166. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH1
  1167. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH2
  1168. * @arg @ref LL_DMAMUX1_REQ_TIM4_CH3
  1169. * @arg @ref LL_DMAMUX1_REQ_TIM4_UP
  1170. * @arg @ref LL_DMAMUX1_REQ_I2C1_RX
  1171. * @arg @ref LL_DMAMUX1_REQ_I2C1_TX
  1172. * @arg @ref LL_DMAMUX1_REQ_I2C2_RX
  1173. * @arg @ref LL_DMAMUX1_REQ_I2C2_TX
  1174. * @arg @ref LL_DMAMUX1_REQ_SPI1_RX
  1175. * @arg @ref LL_DMAMUX1_REQ_SPI1_TX
  1176. * @arg @ref LL_DMAMUX1_REQ_SPI2_RX
  1177. * @arg @ref LL_DMAMUX1_REQ_SPI2_TX
  1178. * @arg @ref LL_DMAMUX1_REQ_USART1_RX
  1179. * @arg @ref LL_DMAMUX1_REQ_USART1_TX
  1180. * @arg @ref LL_DMAMUX1_REQ_USART2_RX
  1181. * @arg @ref LL_DMAMUX1_REQ_USART2_TX
  1182. * @arg @ref LL_DMAMUX1_REQ_USART3_RX
  1183. * @arg @ref LL_DMAMUX1_REQ_USART3_TX
  1184. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH1
  1185. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH2
  1186. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH3
  1187. * @arg @ref LL_DMAMUX1_REQ_TIM8_CH4
  1188. * @arg @ref LL_DMAMUX1_REQ_TIM8_UP
  1189. * @arg @ref LL_DMAMUX1_REQ_TIM8_TRIG
  1190. * @arg @ref LL_DMAMUX1_REQ_TIM8_COM
  1191. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH1
  1192. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH2
  1193. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH3
  1194. * @arg @ref LL_DMAMUX1_REQ_TIM5_CH4
  1195. * @arg @ref LL_DMAMUX1_REQ_TIM5_UP
  1196. * @arg @ref LL_DMAMUX1_REQ_TIM5_TRIG
  1197. * @arg @ref LL_DMAMUX1_REQ_SPI3_RX
  1198. * @arg @ref LL_DMAMUX1_REQ_SPI3_TX
  1199. * @arg @ref LL_DMAMUX1_REQ_UART4_RX
  1200. * @arg @ref LL_DMAMUX1_REQ_UART4_TX
  1201. * @arg @ref LL_DMAMUX1_REQ_UART5_RX
  1202. * @arg @ref LL_DMAMUX1_REQ_UART5_TX
  1203. * @arg @ref LL_DMAMUX1_REQ_DAC1_CH1
  1204. * @arg @ref LL_DMAMUX1_REQ_DAC1_CH2
  1205. * @arg @ref LL_DMAMUX1_REQ_TIM6_UP
  1206. * @arg @ref LL_DMAMUX1_REQ_TIM7_UP
  1207. * @arg @ref LL_DMAMUX1_REQ_USART6_RX
  1208. * @arg @ref LL_DMAMUX1_REQ_USART6_TX
  1209. * @arg @ref LL_DMAMUX1_REQ_I2C3_RX
  1210. * @arg @ref LL_DMAMUX1_REQ_I2C3_TX
  1211. * @arg @ref LL_DMAMUX1_REQ_DCMI_PSSI (*)
  1212. * @arg @ref LL_DMAMUX1_REQ_CRYP_IN
  1213. * @arg @ref LL_DMAMUX1_REQ_CRYP_OUT
  1214. * @arg @ref LL_DMAMUX1_REQ_HASH_IN
  1215. * @arg @ref LL_DMAMUX1_REQ_UART7_RX
  1216. * @arg @ref LL_DMAMUX1_REQ_UART7_TX
  1217. * @arg @ref LL_DMAMUX1_REQ_UART8_RX
  1218. * @arg @ref LL_DMAMUX1_REQ_UART8_TX
  1219. * @arg @ref LL_DMAMUX1_REQ_SPI4_RX
  1220. * @arg @ref LL_DMAMUX1_REQ_SPI4_TX
  1221. * @arg @ref LL_DMAMUX1_REQ_SPI5_RX
  1222. * @arg @ref LL_DMAMUX1_REQ_SPI5_TX
  1223. * @arg @ref LL_DMAMUX1_REQ_SAI1_A
  1224. * @arg @ref LL_DMAMUX1_REQ_SAI1_B
  1225. * @arg @ref LL_DMAMUX1_REQ_SAI2_A (*)
  1226. * @arg @ref LL_DMAMUX1_REQ_SAI2_B (*)
  1227. * @arg @ref LL_DMAMUX1_REQ_SWPMI_RX
  1228. * @arg @ref LL_DMAMUX1_REQ_SWPMI_TX
  1229. * @arg @ref LL_DMAMUX1_REQ_SPDIF_RX_DT
  1230. * @arg @ref LL_DMAMUX1_REQ_SPDIF_RX_CS
  1231. * @arg @ref LL_DMAMUX1_REQ_HRTIM_MASTER (*)
  1232. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_A (*)
  1233. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_B (*)
  1234. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_C (*)
  1235. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_D (*)
  1236. * @arg @ref LL_DMAMUX1_REQ_HRTIM_TIMER_E (*)
  1237. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT0
  1238. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT1
  1239. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT2
  1240. * @arg @ref LL_DMAMUX1_REQ_DFSDM1_FLT3
  1241. * @arg @ref LL_DMAMUX1_REQ_TIM15_CH1
  1242. * @arg @ref LL_DMAMUX1_REQ_TIM15_UP
  1243. * @arg @ref LL_DMAMUX1_REQ_TIM15_TRIG
  1244. * @arg @ref LL_DMAMUX1_REQ_TIM15_COM
  1245. * @arg @ref LL_DMAMUX1_REQ_TIM16_CH1
  1246. * @arg @ref LL_DMAMUX1_REQ_TIM16_UP
  1247. * @arg @ref LL_DMAMUX1_REQ_TIM17_CH1
  1248. * @arg @ref LL_DMAMUX1_REQ_TIM17_UP
  1249. * @arg @ref LL_DMAMUX1_REQ_SAI3_A (*)
  1250. * @arg @ref LL_DMAMUX1_REQ_SAI3_B (*)
  1251. * @arg @ref LL_DMAMUX1_REQ_ADC3 (*)
  1252. * @arg @ref LL_DMAMUX1_REQ_UART9_RX (*)
  1253. * @arg @ref LL_DMAMUX1_REQ_UART9_TX (*)
  1254. * @arg @ref LL_DMAMUX1_REQ_USART10_RX (*)
  1255. * @arg @ref LL_DMAMUX1_REQ_USART10_TX (*)
  1256. * @arg @ref LL_DMAMUX1_REQ_FMAC_READ (*)
  1257. * @arg @ref LL_DMAMUX1_REQ_FMAC_WRITE (*)
  1258. * @arg @ref LL_DMAMUX1_REQ_CORDIC_READ (*)
  1259. * @arg @ref LL_DMAMUX1_REQ_CORDIC_WRITE(*)
  1260. * @arg @ref LL_DMAMUX1_REQ_I2C5_RX (*)
  1261. * @arg @ref LL_DMAMUX1_REQ_I2C5_TX (*)
  1262. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH1 (*)
  1263. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH2 (*)
  1264. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH3 (*)
  1265. * @arg @ref LL_DMAMUX1_REQ_TIM23_CH4 (*)
  1266. * @arg @ref LL_DMAMUX1_REQ_TIM23_UP (*)
  1267. * @arg @ref LL_DMAMUX1_REQ_TIM23_TRIG (*)
  1268. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH1 (*)
  1269. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH2 (*)
  1270. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH3 (*)
  1271. * @arg @ref LL_DMAMUX1_REQ_TIM24_CH4 (*)
  1272. * @arg @ref LL_DMAMUX1_REQ_TIM24_UP (*)
  1273. * @arg @ref LL_DMAMUX1_REQ_TIM24_TRIG (*)
  1274. *
  1275. * @note (*) Availability depends on devices.
  1276. */
  1277. __STATIC_INLINE uint32_t LL_DMA_GetPeriphRequest(DMA_TypeDef *DMAx, uint32_t Stream)
  1278. {
  1279. return (READ_BIT(((DMAMUX_Channel_TypeDef *)((uint32_t)((uint32_t)DMAMUX1_Channel0 + (DMAMUX_CCR_SIZE * (Stream)) + (uint32_t)(DMAMUX_CCR_SIZE * LL_DMA_INSTANCE_TO_DMAMUX_CHANNEL(DMAx)))))->CCR, DMAMUX_CxCR_DMAREQ_ID));
  1280. }
  1281. /**
  1282. * @brief Set Memory burst transfer configuration.
  1283. * @rmtoll CR MBURST LL_DMA_SetMemoryBurstxfer
  1284. * @param DMAx DMAx Instance
  1285. * @param Stream This parameter can be one of the following values:
  1286. * @arg @ref LL_DMA_STREAM_0
  1287. * @arg @ref LL_DMA_STREAM_1
  1288. * @arg @ref LL_DMA_STREAM_2
  1289. * @arg @ref LL_DMA_STREAM_3
  1290. * @arg @ref LL_DMA_STREAM_4
  1291. * @arg @ref LL_DMA_STREAM_5
  1292. * @arg @ref LL_DMA_STREAM_6
  1293. * @arg @ref LL_DMA_STREAM_7
  1294. * @param Mburst This parameter can be one of the following values:
  1295. * @arg @ref LL_DMA_MBURST_SINGLE
  1296. * @arg @ref LL_DMA_MBURST_INC4
  1297. * @arg @ref LL_DMA_MBURST_INC8
  1298. * @arg @ref LL_DMA_MBURST_INC16
  1299. * @retval None
  1300. */
  1301. __STATIC_INLINE void LL_DMA_SetMemoryBurstxfer(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Mburst)
  1302. {
  1303. uint32_t dma_base_addr = (uint32_t)DMAx;
  1304. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MBURST, Mburst);
  1305. }
  1306. /**
  1307. * @brief Get Memory burst transfer configuration.
  1308. * @rmtoll CR MBURST LL_DMA_GetMemoryBurstxfer
  1309. * @param DMAx DMAx Instance
  1310. * @param Stream This parameter can be one of the following values:
  1311. * @arg @ref LL_DMA_STREAM_0
  1312. * @arg @ref LL_DMA_STREAM_1
  1313. * @arg @ref LL_DMA_STREAM_2
  1314. * @arg @ref LL_DMA_STREAM_3
  1315. * @arg @ref LL_DMA_STREAM_4
  1316. * @arg @ref LL_DMA_STREAM_5
  1317. * @arg @ref LL_DMA_STREAM_6
  1318. * @arg @ref LL_DMA_STREAM_7
  1319. * @retval Returned value can be one of the following values:
  1320. * @arg @ref LL_DMA_MBURST_SINGLE
  1321. * @arg @ref LL_DMA_MBURST_INC4
  1322. * @arg @ref LL_DMA_MBURST_INC8
  1323. * @arg @ref LL_DMA_MBURST_INC16
  1324. */
  1325. __STATIC_INLINE uint32_t LL_DMA_GetMemoryBurstxfer(DMA_TypeDef *DMAx, uint32_t Stream)
  1326. {
  1327. uint32_t dma_base_addr = (uint32_t)DMAx;
  1328. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_MBURST));
  1329. }
  1330. /**
  1331. * @brief Set Peripheral burst transfer configuration.
  1332. * @rmtoll CR PBURST LL_DMA_SetPeriphBurstxfer
  1333. * @param DMAx DMAx Instance
  1334. * @param Stream This parameter can be one of the following values:
  1335. * @arg @ref LL_DMA_STREAM_0
  1336. * @arg @ref LL_DMA_STREAM_1
  1337. * @arg @ref LL_DMA_STREAM_2
  1338. * @arg @ref LL_DMA_STREAM_3
  1339. * @arg @ref LL_DMA_STREAM_4
  1340. * @arg @ref LL_DMA_STREAM_5
  1341. * @arg @ref LL_DMA_STREAM_6
  1342. * @arg @ref LL_DMA_STREAM_7
  1343. * @param Pburst This parameter can be one of the following values:
  1344. * @arg @ref LL_DMA_PBURST_SINGLE
  1345. * @arg @ref LL_DMA_PBURST_INC4
  1346. * @arg @ref LL_DMA_PBURST_INC8
  1347. * @arg @ref LL_DMA_PBURST_INC16
  1348. * @retval None
  1349. */
  1350. __STATIC_INLINE void LL_DMA_SetPeriphBurstxfer(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Pburst)
  1351. {
  1352. uint32_t dma_base_addr = (uint32_t)DMAx;
  1353. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PBURST, Pburst);
  1354. }
  1355. /**
  1356. * @brief Get Peripheral burst transfer configuration.
  1357. * @rmtoll CR PBURST LL_DMA_GetPeriphBurstxfer
  1358. * @param DMAx DMAx Instance
  1359. * @param Stream This parameter can be one of the following values:
  1360. * @arg @ref LL_DMA_STREAM_0
  1361. * @arg @ref LL_DMA_STREAM_1
  1362. * @arg @ref LL_DMA_STREAM_2
  1363. * @arg @ref LL_DMA_STREAM_3
  1364. * @arg @ref LL_DMA_STREAM_4
  1365. * @arg @ref LL_DMA_STREAM_5
  1366. * @arg @ref LL_DMA_STREAM_6
  1367. * @arg @ref LL_DMA_STREAM_7
  1368. * @retval Returned value can be one of the following values:
  1369. * @arg @ref LL_DMA_PBURST_SINGLE
  1370. * @arg @ref LL_DMA_PBURST_INC4
  1371. * @arg @ref LL_DMA_PBURST_INC8
  1372. * @arg @ref LL_DMA_PBURST_INC16
  1373. */
  1374. __STATIC_INLINE uint32_t LL_DMA_GetPeriphBurstxfer(DMA_TypeDef *DMAx, uint32_t Stream)
  1375. {
  1376. uint32_t dma_base_addr = (uint32_t)DMAx;
  1377. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_PBURST));
  1378. }
  1379. /**
  1380. * @brief Set Current target (only in double buffer mode) to Memory 1 or Memory 0.
  1381. * @rmtoll CR CT LL_DMA_SetCurrentTargetMem
  1382. * @param DMAx DMAx Instance
  1383. * @param Stream This parameter can be one of the following values:
  1384. * @arg @ref LL_DMA_STREAM_0
  1385. * @arg @ref LL_DMA_STREAM_1
  1386. * @arg @ref LL_DMA_STREAM_2
  1387. * @arg @ref LL_DMA_STREAM_3
  1388. * @arg @ref LL_DMA_STREAM_4
  1389. * @arg @ref LL_DMA_STREAM_5
  1390. * @arg @ref LL_DMA_STREAM_6
  1391. * @arg @ref LL_DMA_STREAM_7
  1392. * @param CurrentMemory This parameter can be one of the following values:
  1393. * @arg @ref LL_DMA_CURRENTTARGETMEM0
  1394. * @arg @ref LL_DMA_CURRENTTARGETMEM1
  1395. * @retval None
  1396. */
  1397. __STATIC_INLINE void LL_DMA_SetCurrentTargetMem(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t CurrentMemory)
  1398. {
  1399. uint32_t dma_base_addr = (uint32_t)DMAx;
  1400. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_CT, CurrentMemory);
  1401. }
  1402. /**
  1403. * @brief Set Current target (only in double buffer mode) to Memory 1 or Memory 0.
  1404. * @rmtoll CR CT LL_DMA_GetCurrentTargetMem
  1405. * @param DMAx DMAx Instance
  1406. * @param Stream This parameter can be one of the following values:
  1407. * @arg @ref LL_DMA_STREAM_0
  1408. * @arg @ref LL_DMA_STREAM_1
  1409. * @arg @ref LL_DMA_STREAM_2
  1410. * @arg @ref LL_DMA_STREAM_3
  1411. * @arg @ref LL_DMA_STREAM_4
  1412. * @arg @ref LL_DMA_STREAM_5
  1413. * @arg @ref LL_DMA_STREAM_6
  1414. * @arg @ref LL_DMA_STREAM_7
  1415. * @retval Returned value can be one of the following values:
  1416. * @arg @ref LL_DMA_CURRENTTARGETMEM0
  1417. * @arg @ref LL_DMA_CURRENTTARGETMEM1
  1418. */
  1419. __STATIC_INLINE uint32_t LL_DMA_GetCurrentTargetMem(DMA_TypeDef *DMAx, uint32_t Stream)
  1420. {
  1421. uint32_t dma_base_addr = (uint32_t)DMAx;
  1422. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_CT));
  1423. }
  1424. /**
  1425. * @brief Enable the double buffer mode.
  1426. * @rmtoll CR DBM LL_DMA_EnableDoubleBufferMode
  1427. * @param DMAx DMAx Instance
  1428. * @param Stream This parameter can be one of the following values:
  1429. * @arg @ref LL_DMA_STREAM_0
  1430. * @arg @ref LL_DMA_STREAM_1
  1431. * @arg @ref LL_DMA_STREAM_2
  1432. * @arg @ref LL_DMA_STREAM_3
  1433. * @arg @ref LL_DMA_STREAM_4
  1434. * @arg @ref LL_DMA_STREAM_5
  1435. * @arg @ref LL_DMA_STREAM_6
  1436. * @arg @ref LL_DMA_STREAM_7
  1437. * @retval None
  1438. */
  1439. __STATIC_INLINE void LL_DMA_EnableDoubleBufferMode(DMA_TypeDef *DMAx, uint32_t Stream)
  1440. {
  1441. uint32_t dma_base_addr = (uint32_t)DMAx;
  1442. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DBM);
  1443. }
  1444. /**
  1445. * @brief Disable the double buffer mode.
  1446. * @rmtoll CR DBM LL_DMA_DisableDoubleBufferMode
  1447. * @param DMAx DMAx Instance
  1448. * @param Stream This parameter can be one of the following values:
  1449. * @arg @ref LL_DMA_STREAM_0
  1450. * @arg @ref LL_DMA_STREAM_1
  1451. * @arg @ref LL_DMA_STREAM_2
  1452. * @arg @ref LL_DMA_STREAM_3
  1453. * @arg @ref LL_DMA_STREAM_4
  1454. * @arg @ref LL_DMA_STREAM_5
  1455. * @arg @ref LL_DMA_STREAM_6
  1456. * @arg @ref LL_DMA_STREAM_7
  1457. * @retval None
  1458. */
  1459. __STATIC_INLINE void LL_DMA_DisableDoubleBufferMode(DMA_TypeDef *DMAx, uint32_t Stream)
  1460. {
  1461. uint32_t dma_base_addr = (uint32_t)DMAx;
  1462. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DBM);
  1463. }
  1464. /**
  1465. * @brief Check if double buffer mode is enabled or not.
  1466. * @rmtoll CR DBM LL_DMA_IsEnabledDoubleBufferMode
  1467. * @param DMAx DMAx Instance
  1468. * @param Stream This parameter can be one of the following values:
  1469. * @arg @ref LL_DMA_STREAM_0
  1470. * @arg @ref LL_DMA_STREAM_1
  1471. * @arg @ref LL_DMA_STREAM_2
  1472. * @arg @ref LL_DMA_STREAM_3
  1473. * @arg @ref LL_DMA_STREAM_4
  1474. * @arg @ref LL_DMA_STREAM_5
  1475. * @arg @ref LL_DMA_STREAM_6
  1476. * @arg @ref LL_DMA_STREAM_7
  1477. * @retval State of bit (1 or 0).
  1478. */
  1479. __STATIC_INLINE uint32_t LL_DMA_IsEnabledDoubleBufferMode(DMA_TypeDef *DMAx, uint32_t Stream)
  1480. {
  1481. register uint32_t dma_base_addr = (uint32_t)DMAx;
  1482. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DBM) == (DMA_SxCR_DBM)) ? 1UL : 0UL);
  1483. }
  1484. /**
  1485. * @brief Get FIFO status.
  1486. * @rmtoll FCR FS LL_DMA_GetFIFOStatus
  1487. * @param DMAx DMAx Instance
  1488. * @param Stream This parameter can be one of the following values:
  1489. * @arg @ref LL_DMA_STREAM_0
  1490. * @arg @ref LL_DMA_STREAM_1
  1491. * @arg @ref LL_DMA_STREAM_2
  1492. * @arg @ref LL_DMA_STREAM_3
  1493. * @arg @ref LL_DMA_STREAM_4
  1494. * @arg @ref LL_DMA_STREAM_5
  1495. * @arg @ref LL_DMA_STREAM_6
  1496. * @arg @ref LL_DMA_STREAM_7
  1497. * @retval Returned value can be one of the following values:
  1498. * @arg @ref LL_DMA_FIFOSTATUS_0_25
  1499. * @arg @ref LL_DMA_FIFOSTATUS_25_50
  1500. * @arg @ref LL_DMA_FIFOSTATUS_50_75
  1501. * @arg @ref LL_DMA_FIFOSTATUS_75_100
  1502. * @arg @ref LL_DMA_FIFOSTATUS_EMPTY
  1503. * @arg @ref LL_DMA_FIFOSTATUS_FULL
  1504. */
  1505. __STATIC_INLINE uint32_t LL_DMA_GetFIFOStatus(DMA_TypeDef *DMAx, uint32_t Stream)
  1506. {
  1507. uint32_t dma_base_addr = (uint32_t)DMAx;
  1508. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FS));
  1509. }
  1510. /**
  1511. * @brief Disable Fifo mode.
  1512. * @rmtoll FCR DMDIS LL_DMA_DisableFifoMode
  1513. * @param DMAx DMAx Instance
  1514. * @param Stream This parameter can be one of the following values:
  1515. * @arg @ref LL_DMA_STREAM_0
  1516. * @arg @ref LL_DMA_STREAM_1
  1517. * @arg @ref LL_DMA_STREAM_2
  1518. * @arg @ref LL_DMA_STREAM_3
  1519. * @arg @ref LL_DMA_STREAM_4
  1520. * @arg @ref LL_DMA_STREAM_5
  1521. * @arg @ref LL_DMA_STREAM_6
  1522. * @arg @ref LL_DMA_STREAM_7
  1523. * @retval None
  1524. */
  1525. __STATIC_INLINE void LL_DMA_DisableFifoMode(DMA_TypeDef *DMAx, uint32_t Stream)
  1526. {
  1527. uint32_t dma_base_addr = (uint32_t)DMAx;
  1528. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_DMDIS);
  1529. }
  1530. /**
  1531. * @brief Enable Fifo mode.
  1532. * @rmtoll FCR DMDIS LL_DMA_EnableFifoMode
  1533. * @param DMAx DMAx Instance
  1534. * @param Stream This parameter can be one of the following values:
  1535. * @arg @ref LL_DMA_STREAM_0
  1536. * @arg @ref LL_DMA_STREAM_1
  1537. * @arg @ref LL_DMA_STREAM_2
  1538. * @arg @ref LL_DMA_STREAM_3
  1539. * @arg @ref LL_DMA_STREAM_4
  1540. * @arg @ref LL_DMA_STREAM_5
  1541. * @arg @ref LL_DMA_STREAM_6
  1542. * @arg @ref LL_DMA_STREAM_7
  1543. * @retval None
  1544. */
  1545. __STATIC_INLINE void LL_DMA_EnableFifoMode(DMA_TypeDef *DMAx, uint32_t Stream)
  1546. {
  1547. uint32_t dma_base_addr = (uint32_t)DMAx;
  1548. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_DMDIS);
  1549. }
  1550. /**
  1551. * @brief Select FIFO threshold.
  1552. * @rmtoll FCR FTH LL_DMA_SetFIFOThreshold
  1553. * @param DMAx DMAx Instance
  1554. * @param Stream This parameter can be one of the following values:
  1555. * @arg @ref LL_DMA_STREAM_0
  1556. * @arg @ref LL_DMA_STREAM_1
  1557. * @arg @ref LL_DMA_STREAM_2
  1558. * @arg @ref LL_DMA_STREAM_3
  1559. * @arg @ref LL_DMA_STREAM_4
  1560. * @arg @ref LL_DMA_STREAM_5
  1561. * @arg @ref LL_DMA_STREAM_6
  1562. * @arg @ref LL_DMA_STREAM_7
  1563. * @param Threshold This parameter can be one of the following values:
  1564. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_4
  1565. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_2
  1566. * @arg @ref LL_DMA_FIFOTHRESHOLD_3_4
  1567. * @arg @ref LL_DMA_FIFOTHRESHOLD_FULL
  1568. * @retval None
  1569. */
  1570. __STATIC_INLINE void LL_DMA_SetFIFOThreshold(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Threshold)
  1571. {
  1572. uint32_t dma_base_addr = (uint32_t)DMAx;
  1573. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FTH, Threshold);
  1574. }
  1575. /**
  1576. * @brief Get FIFO threshold.
  1577. * @rmtoll FCR FTH LL_DMA_GetFIFOThreshold
  1578. * @param DMAx DMAx Instance
  1579. * @param Stream This parameter can be one of the following values:
  1580. * @arg @ref LL_DMA_STREAM_0
  1581. * @arg @ref LL_DMA_STREAM_1
  1582. * @arg @ref LL_DMA_STREAM_2
  1583. * @arg @ref LL_DMA_STREAM_3
  1584. * @arg @ref LL_DMA_STREAM_4
  1585. * @arg @ref LL_DMA_STREAM_5
  1586. * @arg @ref LL_DMA_STREAM_6
  1587. * @arg @ref LL_DMA_STREAM_7
  1588. * @retval Returned value can be one of the following values:
  1589. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_4
  1590. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_2
  1591. * @arg @ref LL_DMA_FIFOTHRESHOLD_3_4
  1592. * @arg @ref LL_DMA_FIFOTHRESHOLD_FULL
  1593. */
  1594. __STATIC_INLINE uint32_t LL_DMA_GetFIFOThreshold(DMA_TypeDef *DMAx, uint32_t Stream)
  1595. {
  1596. uint32_t dma_base_addr = (uint32_t)DMAx;
  1597. return (READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FTH));
  1598. }
  1599. /**
  1600. * @brief Configure the FIFO .
  1601. * @rmtoll FCR FTH LL_DMA_ConfigFifo\n
  1602. * FCR DMDIS LL_DMA_ConfigFifo
  1603. * @param DMAx DMAx Instance
  1604. * @param Stream This parameter can be one of the following values:
  1605. * @arg @ref LL_DMA_STREAM_0
  1606. * @arg @ref LL_DMA_STREAM_1
  1607. * @arg @ref LL_DMA_STREAM_2
  1608. * @arg @ref LL_DMA_STREAM_3
  1609. * @arg @ref LL_DMA_STREAM_4
  1610. * @arg @ref LL_DMA_STREAM_5
  1611. * @arg @ref LL_DMA_STREAM_6
  1612. * @arg @ref LL_DMA_STREAM_7
  1613. * @param FifoMode This parameter can be one of the following values:
  1614. * @arg @ref LL_DMA_FIFOMODE_ENABLE
  1615. * @arg @ref LL_DMA_FIFOMODE_DISABLE
  1616. * @param FifoThreshold This parameter can be one of the following values:
  1617. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_4
  1618. * @arg @ref LL_DMA_FIFOTHRESHOLD_1_2
  1619. * @arg @ref LL_DMA_FIFOTHRESHOLD_3_4
  1620. * @arg @ref LL_DMA_FIFOTHRESHOLD_FULL
  1621. * @retval None
  1622. */
  1623. __STATIC_INLINE void LL_DMA_ConfigFifo(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t FifoMode, uint32_t FifoThreshold)
  1624. {
  1625. uint32_t dma_base_addr = (uint32_t)DMAx;
  1626. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FTH | DMA_SxFCR_DMDIS, FifoMode | FifoThreshold);
  1627. }
  1628. /**
  1629. * @brief Configure the Source and Destination addresses.
  1630. * @note This API must not be called when the DMA stream is enabled.
  1631. * @rmtoll M0AR M0A LL_DMA_ConfigAddresses\n
  1632. * PAR PA LL_DMA_ConfigAddresses
  1633. * @param DMAx DMAx Instance
  1634. * @param Stream This parameter can be one of the following values:
  1635. * @arg @ref LL_DMA_STREAM_0
  1636. * @arg @ref LL_DMA_STREAM_1
  1637. * @arg @ref LL_DMA_STREAM_2
  1638. * @arg @ref LL_DMA_STREAM_3
  1639. * @arg @ref LL_DMA_STREAM_4
  1640. * @arg @ref LL_DMA_STREAM_5
  1641. * @arg @ref LL_DMA_STREAM_6
  1642. * @arg @ref LL_DMA_STREAM_7
  1643. * @param SrcAddress Between 0 to 0xFFFFFFFF
  1644. * @param DstAddress Between 0 to 0xFFFFFFFF
  1645. * @param Direction This parameter can be one of the following values:
  1646. * @arg @ref LL_DMA_DIRECTION_PERIPH_TO_MEMORY
  1647. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_PERIPH
  1648. * @arg @ref LL_DMA_DIRECTION_MEMORY_TO_MEMORY
  1649. * @retval None
  1650. */
  1651. __STATIC_INLINE void LL_DMA_ConfigAddresses(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t SrcAddress, uint32_t DstAddress, uint32_t Direction)
  1652. {
  1653. uint32_t dma_base_addr = (uint32_t)DMAx;
  1654. /* Direction Memory to Periph */
  1655. if (Direction == LL_DMA_DIRECTION_MEMORY_TO_PERIPH)
  1656. {
  1657. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR, SrcAddress);
  1658. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR, DstAddress);
  1659. }
  1660. /* Direction Periph to Memory and Memory to Memory */
  1661. else
  1662. {
  1663. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR, SrcAddress);
  1664. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR, DstAddress);
  1665. }
  1666. }
  1667. /**
  1668. * @brief Set the Memory address.
  1669. * @rmtoll M0AR M0A LL_DMA_SetMemoryAddress
  1670. * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.
  1671. * @note This API must not be called when the DMA stream is enabled.
  1672. * @param DMAx DMAx Instance
  1673. * @param Stream This parameter can be one of the following values:
  1674. * @arg @ref LL_DMA_STREAM_0
  1675. * @arg @ref LL_DMA_STREAM_1
  1676. * @arg @ref LL_DMA_STREAM_2
  1677. * @arg @ref LL_DMA_STREAM_3
  1678. * @arg @ref LL_DMA_STREAM_4
  1679. * @arg @ref LL_DMA_STREAM_5
  1680. * @arg @ref LL_DMA_STREAM_6
  1681. * @arg @ref LL_DMA_STREAM_7
  1682. * @param MemoryAddress Between 0 to 0xFFFFFFFF
  1683. * @retval None
  1684. */
  1685. __STATIC_INLINE void LL_DMA_SetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t MemoryAddress)
  1686. {
  1687. uint32_t dma_base_addr = (uint32_t)DMAx;
  1688. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR, MemoryAddress);
  1689. }
  1690. /**
  1691. * @brief Set the Peripheral address.
  1692. * @rmtoll PAR PA LL_DMA_SetPeriphAddress
  1693. * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.
  1694. * @note This API must not be called when the DMA stream is enabled.
  1695. * @param DMAx DMAx Instance
  1696. * @param Stream This parameter can be one of the following values:
  1697. * @arg @ref LL_DMA_STREAM_0
  1698. * @arg @ref LL_DMA_STREAM_1
  1699. * @arg @ref LL_DMA_STREAM_2
  1700. * @arg @ref LL_DMA_STREAM_3
  1701. * @arg @ref LL_DMA_STREAM_4
  1702. * @arg @ref LL_DMA_STREAM_5
  1703. * @arg @ref LL_DMA_STREAM_6
  1704. * @arg @ref LL_DMA_STREAM_7
  1705. * @param PeriphAddress Between 0 to 0xFFFFFFFF
  1706. * @retval None
  1707. */
  1708. __STATIC_INLINE void LL_DMA_SetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t PeriphAddress)
  1709. {
  1710. uint32_t dma_base_addr = (uint32_t)DMAx;
  1711. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR, PeriphAddress);
  1712. }
  1713. /**
  1714. * @brief Get the Memory address.
  1715. * @rmtoll M0AR M0A LL_DMA_GetMemoryAddress
  1716. * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.
  1717. * @param DMAx DMAx Instance
  1718. * @param Stream This parameter can be one of the following values:
  1719. * @arg @ref LL_DMA_STREAM_0
  1720. * @arg @ref LL_DMA_STREAM_1
  1721. * @arg @ref LL_DMA_STREAM_2
  1722. * @arg @ref LL_DMA_STREAM_3
  1723. * @arg @ref LL_DMA_STREAM_4
  1724. * @arg @ref LL_DMA_STREAM_5
  1725. * @arg @ref LL_DMA_STREAM_6
  1726. * @arg @ref LL_DMA_STREAM_7
  1727. * @retval Between 0 to 0xFFFFFFFF
  1728. */
  1729. __STATIC_INLINE uint32_t LL_DMA_GetMemoryAddress(DMA_TypeDef *DMAx, uint32_t Stream)
  1730. {
  1731. uint32_t dma_base_addr = (uint32_t)DMAx;
  1732. return (READ_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR));
  1733. }
  1734. /**
  1735. * @brief Get the Peripheral address.
  1736. * @rmtoll PAR PA LL_DMA_GetPeriphAddress
  1737. * @note Interface used for direction LL_DMA_DIRECTION_PERIPH_TO_MEMORY or LL_DMA_DIRECTION_MEMORY_TO_PERIPH only.
  1738. * @param DMAx DMAx Instance
  1739. * @param Stream This parameter can be one of the following values:
  1740. * @arg @ref LL_DMA_STREAM_0
  1741. * @arg @ref LL_DMA_STREAM_1
  1742. * @arg @ref LL_DMA_STREAM_2
  1743. * @arg @ref LL_DMA_STREAM_3
  1744. * @arg @ref LL_DMA_STREAM_4
  1745. * @arg @ref LL_DMA_STREAM_5
  1746. * @arg @ref LL_DMA_STREAM_6
  1747. * @arg @ref LL_DMA_STREAM_7
  1748. * @retval Between 0 to 0xFFFFFFFF
  1749. */
  1750. __STATIC_INLINE uint32_t LL_DMA_GetPeriphAddress(DMA_TypeDef *DMAx, uint32_t Stream)
  1751. {
  1752. uint32_t dma_base_addr = (uint32_t)DMAx;
  1753. return (READ_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR));
  1754. }
  1755. /**
  1756. * @brief Set the Memory to Memory Source address.
  1757. * @rmtoll PAR PA LL_DMA_SetM2MSrcAddress
  1758. * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.
  1759. * @note This API must not be called when the DMA stream is enabled.
  1760. * @param DMAx DMAx Instance
  1761. * @param Stream This parameter can be one of the following values:
  1762. * @arg @ref LL_DMA_STREAM_0
  1763. * @arg @ref LL_DMA_STREAM_1
  1764. * @arg @ref LL_DMA_STREAM_2
  1765. * @arg @ref LL_DMA_STREAM_3
  1766. * @arg @ref LL_DMA_STREAM_4
  1767. * @arg @ref LL_DMA_STREAM_5
  1768. * @arg @ref LL_DMA_STREAM_6
  1769. * @arg @ref LL_DMA_STREAM_7
  1770. * @param MemoryAddress Between 0 to 0xFFFFFFFF
  1771. * @retval None
  1772. */
  1773. __STATIC_INLINE void LL_DMA_SetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t MemoryAddress)
  1774. {
  1775. uint32_t dma_base_addr = (uint32_t)DMAx;
  1776. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR, MemoryAddress);
  1777. }
  1778. /**
  1779. * @brief Set the Memory to Memory Destination address.
  1780. * @rmtoll M0AR M0A LL_DMA_SetM2MDstAddress
  1781. * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.
  1782. * @note This API must not be called when the DMA stream is enabled.
  1783. * @param DMAx DMAx Instance
  1784. * @param Stream This parameter can be one of the following values:
  1785. * @arg @ref LL_DMA_STREAM_0
  1786. * @arg @ref LL_DMA_STREAM_1
  1787. * @arg @ref LL_DMA_STREAM_2
  1788. * @arg @ref LL_DMA_STREAM_3
  1789. * @arg @ref LL_DMA_STREAM_4
  1790. * @arg @ref LL_DMA_STREAM_5
  1791. * @arg @ref LL_DMA_STREAM_6
  1792. * @arg @ref LL_DMA_STREAM_7
  1793. * @param MemoryAddress Between 0 to 0xFFFFFFFF
  1794. * @retval None
  1795. */
  1796. __STATIC_INLINE void LL_DMA_SetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t MemoryAddress)
  1797. {
  1798. uint32_t dma_base_addr = (uint32_t)DMAx;
  1799. WRITE_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR, MemoryAddress);
  1800. }
  1801. /**
  1802. * @brief Get the Memory to Memory Source address.
  1803. * @rmtoll PAR PA LL_DMA_GetM2MSrcAddress
  1804. * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.
  1805. * @param DMAx DMAx Instance
  1806. * @param Stream This parameter can be one of the following values:
  1807. * @arg @ref LL_DMA_STREAM_0
  1808. * @arg @ref LL_DMA_STREAM_1
  1809. * @arg @ref LL_DMA_STREAM_2
  1810. * @arg @ref LL_DMA_STREAM_3
  1811. * @arg @ref LL_DMA_STREAM_4
  1812. * @arg @ref LL_DMA_STREAM_5
  1813. * @arg @ref LL_DMA_STREAM_6
  1814. * @arg @ref LL_DMA_STREAM_7
  1815. * @retval Between 0 to 0xFFFFFFFF
  1816. */
  1817. __STATIC_INLINE uint32_t LL_DMA_GetM2MSrcAddress(DMA_TypeDef *DMAx, uint32_t Stream)
  1818. {
  1819. uint32_t dma_base_addr = (uint32_t)DMAx;
  1820. return (READ_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->PAR));
  1821. }
  1822. /**
  1823. * @brief Get the Memory to Memory Destination address.
  1824. * @rmtoll M0AR M0A LL_DMA_GetM2MDstAddress
  1825. * @note Interface used for direction LL_DMA_DIRECTION_MEMORY_TO_MEMORY only.
  1826. * @param DMAx DMAx Instance
  1827. * @param Stream This parameter can be one of the following values:
  1828. * @arg @ref LL_DMA_STREAM_0
  1829. * @arg @ref LL_DMA_STREAM_1
  1830. * @arg @ref LL_DMA_STREAM_2
  1831. * @arg @ref LL_DMA_STREAM_3
  1832. * @arg @ref LL_DMA_STREAM_4
  1833. * @arg @ref LL_DMA_STREAM_5
  1834. * @arg @ref LL_DMA_STREAM_6
  1835. * @arg @ref LL_DMA_STREAM_7
  1836. * @retval Between 0 to 0xFFFFFFFF
  1837. */
  1838. __STATIC_INLINE uint32_t LL_DMA_GetM2MDstAddress(DMA_TypeDef *DMAx, uint32_t Stream)
  1839. {
  1840. uint32_t dma_base_addr = (uint32_t)DMAx;
  1841. return (READ_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M0AR));
  1842. }
  1843. /**
  1844. * @brief Set Memory 1 address (used in case of Double buffer mode).
  1845. * @rmtoll M1AR M1A LL_DMA_SetMemory1Address
  1846. * @param DMAx DMAx Instance
  1847. * @param Stream This parameter can be one of the following values:
  1848. * @arg @ref LL_DMA_STREAM_0
  1849. * @arg @ref LL_DMA_STREAM_1
  1850. * @arg @ref LL_DMA_STREAM_2
  1851. * @arg @ref LL_DMA_STREAM_3
  1852. * @arg @ref LL_DMA_STREAM_4
  1853. * @arg @ref LL_DMA_STREAM_5
  1854. * @arg @ref LL_DMA_STREAM_6
  1855. * @arg @ref LL_DMA_STREAM_7
  1856. * @param Address Between 0 to 0xFFFFFFFF
  1857. * @retval None
  1858. */
  1859. __STATIC_INLINE void LL_DMA_SetMemory1Address(DMA_TypeDef *DMAx, uint32_t Stream, uint32_t Address)
  1860. {
  1861. uint32_t dma_base_addr = (uint32_t)DMAx;
  1862. MODIFY_REG(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M1AR, DMA_SxM1AR_M1A, Address);
  1863. }
  1864. /**
  1865. * @brief Get Memory 1 address (used in case of Double buffer mode).
  1866. * @rmtoll M1AR M1A LL_DMA_GetMemory1Address
  1867. * @param DMAx DMAx Instance
  1868. * @param Stream This parameter can be one of the following values:
  1869. * @arg @ref LL_DMA_STREAM_0
  1870. * @arg @ref LL_DMA_STREAM_1
  1871. * @arg @ref LL_DMA_STREAM_2
  1872. * @arg @ref LL_DMA_STREAM_3
  1873. * @arg @ref LL_DMA_STREAM_4
  1874. * @arg @ref LL_DMA_STREAM_5
  1875. * @arg @ref LL_DMA_STREAM_6
  1876. * @arg @ref LL_DMA_STREAM_7
  1877. * @retval Between 0 to 0xFFFFFFFF
  1878. */
  1879. __STATIC_INLINE uint32_t LL_DMA_GetMemory1Address(DMA_TypeDef *DMAx, uint32_t Stream)
  1880. {
  1881. uint32_t dma_base_addr = (uint32_t)DMAx;
  1882. return (((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->M1AR);
  1883. }
  1884. /**
  1885. * @}
  1886. */
  1887. /** @defgroup DMA_LL_EF_FLAG_Management FLAG_Management
  1888. * @{
  1889. */
  1890. /**
  1891. * @brief Get Stream 0 half transfer flag.
  1892. * @rmtoll LISR HTIF0 LL_DMA_IsActiveFlag_HT0
  1893. * @param DMAx DMAx Instance
  1894. * @retval State of bit (1 or 0).
  1895. */
  1896. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT0(DMA_TypeDef *DMAx)
  1897. {
  1898. return ((READ_BIT(DMAx->LISR, DMA_LISR_HTIF0) == (DMA_LISR_HTIF0)) ? 1UL : 0UL);
  1899. }
  1900. /**
  1901. * @brief Get Stream 1 half transfer flag.
  1902. * @rmtoll LISR HTIF1 LL_DMA_IsActiveFlag_HT1
  1903. * @param DMAx DMAx Instance
  1904. * @retval State of bit (1 or 0).
  1905. */
  1906. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT1(DMA_TypeDef *DMAx)
  1907. {
  1908. return ((READ_BIT(DMAx->LISR, DMA_LISR_HTIF1) == (DMA_LISR_HTIF1)) ? 1UL : 0UL);
  1909. }
  1910. /**
  1911. * @brief Get Stream 2 half transfer flag.
  1912. * @rmtoll LISR HTIF2 LL_DMA_IsActiveFlag_HT2
  1913. * @param DMAx DMAx Instance
  1914. * @retval State of bit (1 or 0).
  1915. */
  1916. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT2(DMA_TypeDef *DMAx)
  1917. {
  1918. return ((READ_BIT(DMAx->LISR, DMA_LISR_HTIF2) == (DMA_LISR_HTIF2)) ? 1UL : 0UL);
  1919. }
  1920. /**
  1921. * @brief Get Stream 3 half transfer flag.
  1922. * @rmtoll LISR HTIF3 LL_DMA_IsActiveFlag_HT3
  1923. * @param DMAx DMAx Instance
  1924. * @retval State of bit (1 or 0).
  1925. */
  1926. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT3(DMA_TypeDef *DMAx)
  1927. {
  1928. return ((READ_BIT(DMAx->LISR, DMA_LISR_HTIF3) == (DMA_LISR_HTIF3)) ? 1UL : 0UL);
  1929. }
  1930. /**
  1931. * @brief Get Stream 4 half transfer flag.
  1932. * @rmtoll HISR HTIF4 LL_DMA_IsActiveFlag_HT4
  1933. * @param DMAx DMAx Instance
  1934. * @retval State of bit (1 or 0).
  1935. */
  1936. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT4(DMA_TypeDef *DMAx)
  1937. {
  1938. return ((READ_BIT(DMAx->HISR, DMA_HISR_HTIF4) == (DMA_HISR_HTIF4)) ? 1UL : 0UL);
  1939. }
  1940. /**
  1941. * @brief Get Stream 5 half transfer flag.
  1942. * @rmtoll HISR HTIF0 LL_DMA_IsActiveFlag_HT5
  1943. * @param DMAx DMAx Instance
  1944. * @retval State of bit (1 or 0).
  1945. */
  1946. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT5(DMA_TypeDef *DMAx)
  1947. {
  1948. return ((READ_BIT(DMAx->HISR, DMA_HISR_HTIF5) == (DMA_HISR_HTIF5)) ? 1UL : 0UL);
  1949. }
  1950. /**
  1951. * @brief Get Stream 6 half transfer flag.
  1952. * @rmtoll HISR HTIF6 LL_DMA_IsActiveFlag_HT6
  1953. * @param DMAx DMAx Instance
  1954. * @retval State of bit (1 or 0).
  1955. */
  1956. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT6(DMA_TypeDef *DMAx)
  1957. {
  1958. return ((READ_BIT(DMAx->HISR, DMA_HISR_HTIF6) == (DMA_HISR_HTIF6)) ? 1UL : 0UL);
  1959. }
  1960. /**
  1961. * @brief Get Stream 7 half transfer flag.
  1962. * @rmtoll HISR HTIF7 LL_DMA_IsActiveFlag_HT7
  1963. * @param DMAx DMAx Instance
  1964. * @retval State of bit (1 or 0).
  1965. */
  1966. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_HT7(DMA_TypeDef *DMAx)
  1967. {
  1968. return ((READ_BIT(DMAx->HISR, DMA_HISR_HTIF7) == (DMA_HISR_HTIF7)) ? 1UL : 0UL);
  1969. }
  1970. /**
  1971. * @brief Get Stream 0 transfer complete flag.
  1972. * @rmtoll LISR TCIF0 LL_DMA_IsActiveFlag_TC0
  1973. * @param DMAx DMAx Instance
  1974. * @retval State of bit (1 or 0).
  1975. */
  1976. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC0(DMA_TypeDef *DMAx)
  1977. {
  1978. return ((READ_BIT(DMAx->LISR, DMA_LISR_TCIF0) == (DMA_LISR_TCIF0)) ? 1UL : 0UL);
  1979. }
  1980. /**
  1981. * @brief Get Stream 1 transfer complete flag.
  1982. * @rmtoll LISR TCIF1 LL_DMA_IsActiveFlag_TC1
  1983. * @param DMAx DMAx Instance
  1984. * @retval State of bit (1 or 0).
  1985. */
  1986. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC1(DMA_TypeDef *DMAx)
  1987. {
  1988. return ((READ_BIT(DMAx->LISR, DMA_LISR_TCIF1) == (DMA_LISR_TCIF1)) ? 1UL : 0UL);
  1989. }
  1990. /**
  1991. * @brief Get Stream 2 transfer complete flag.
  1992. * @rmtoll LISR TCIF2 LL_DMA_IsActiveFlag_TC2
  1993. * @param DMAx DMAx Instance
  1994. * @retval State of bit (1 or 0).
  1995. */
  1996. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC2(DMA_TypeDef *DMAx)
  1997. {
  1998. return ((READ_BIT(DMAx->LISR, DMA_LISR_TCIF2) == (DMA_LISR_TCIF2)) ? 1UL : 0UL);
  1999. }
  2000. /**
  2001. * @brief Get Stream 3 transfer complete flag.
  2002. * @rmtoll LISR TCIF3 LL_DMA_IsActiveFlag_TC3
  2003. * @param DMAx DMAx Instance
  2004. * @retval State of bit (1 or 0).
  2005. */
  2006. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC3(DMA_TypeDef *DMAx)
  2007. {
  2008. return ((READ_BIT(DMAx->LISR, DMA_LISR_TCIF3) == (DMA_LISR_TCIF3)) ? 1UL : 0UL);
  2009. }
  2010. /**
  2011. * @brief Get Stream 4 transfer complete flag.
  2012. * @rmtoll HISR TCIF4 LL_DMA_IsActiveFlag_TC4
  2013. * @param DMAx DMAx Instance
  2014. * @retval State of bit (1 or 0).
  2015. */
  2016. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC4(DMA_TypeDef *DMAx)
  2017. {
  2018. return ((READ_BIT(DMAx->HISR, DMA_HISR_TCIF4) == (DMA_HISR_TCIF4)) ? 1UL : 0UL);
  2019. }
  2020. /**
  2021. * @brief Get Stream 5 transfer complete flag.
  2022. * @rmtoll HISR TCIF0 LL_DMA_IsActiveFlag_TC5
  2023. * @param DMAx DMAx Instance
  2024. * @retval State of bit (1 or 0).
  2025. */
  2026. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC5(DMA_TypeDef *DMAx)
  2027. {
  2028. return ((READ_BIT(DMAx->HISR, DMA_HISR_TCIF5) == (DMA_HISR_TCIF5)) ? 1UL : 0UL);
  2029. }
  2030. /**
  2031. * @brief Get Stream 6 transfer complete flag.
  2032. * @rmtoll HISR TCIF6 LL_DMA_IsActiveFlag_TC6
  2033. * @param DMAx DMAx Instance
  2034. * @retval State of bit (1 or 0).
  2035. */
  2036. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC6(DMA_TypeDef *DMAx)
  2037. {
  2038. return ((READ_BIT(DMAx->HISR, DMA_HISR_TCIF6) == (DMA_HISR_TCIF6)) ? 1UL : 0UL);
  2039. }
  2040. /**
  2041. * @brief Get Stream 7 transfer complete flag.
  2042. * @rmtoll HISR TCIF7 LL_DMA_IsActiveFlag_TC7
  2043. * @param DMAx DMAx Instance
  2044. * @retval State of bit (1 or 0).
  2045. */
  2046. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TC7(DMA_TypeDef *DMAx)
  2047. {
  2048. return ((READ_BIT(DMAx->HISR, DMA_HISR_TCIF7) == (DMA_HISR_TCIF7)) ? 1UL : 0UL);
  2049. }
  2050. /**
  2051. * @brief Get Stream 0 transfer error flag.
  2052. * @rmtoll LISR TEIF0 LL_DMA_IsActiveFlag_TE0
  2053. * @param DMAx DMAx Instance
  2054. * @retval State of bit (1 or 0).
  2055. */
  2056. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE0(DMA_TypeDef *DMAx)
  2057. {
  2058. return ((READ_BIT(DMAx->LISR, DMA_LISR_TEIF0) == (DMA_LISR_TEIF0)) ? 1UL : 0UL);
  2059. }
  2060. /**
  2061. * @brief Get Stream 1 transfer error flag.
  2062. * @rmtoll LISR TEIF1 LL_DMA_IsActiveFlag_TE1
  2063. * @param DMAx DMAx Instance
  2064. * @retval State of bit (1 or 0).
  2065. */
  2066. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE1(DMA_TypeDef *DMAx)
  2067. {
  2068. return ((READ_BIT(DMAx->LISR, DMA_LISR_TEIF1) == (DMA_LISR_TEIF1)) ? 1UL : 0UL);
  2069. }
  2070. /**
  2071. * @brief Get Stream 2 transfer error flag.
  2072. * @rmtoll LISR TEIF2 LL_DMA_IsActiveFlag_TE2
  2073. * @param DMAx DMAx Instance
  2074. * @retval State of bit (1 or 0).
  2075. */
  2076. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE2(DMA_TypeDef *DMAx)
  2077. {
  2078. return ((READ_BIT(DMAx->LISR, DMA_LISR_TEIF2) == (DMA_LISR_TEIF2)) ? 1UL : 0UL);
  2079. }
  2080. /**
  2081. * @brief Get Stream 3 transfer error flag.
  2082. * @rmtoll LISR TEIF3 LL_DMA_IsActiveFlag_TE3
  2083. * @param DMAx DMAx Instance
  2084. * @retval State of bit (1 or 0).
  2085. */
  2086. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE3(DMA_TypeDef *DMAx)
  2087. {
  2088. return ((READ_BIT(DMAx->LISR, DMA_LISR_TEIF3) == (DMA_LISR_TEIF3)) ? 1UL : 0UL);
  2089. }
  2090. /**
  2091. * @brief Get Stream 4 transfer error flag.
  2092. * @rmtoll HISR TEIF4 LL_DMA_IsActiveFlag_TE4
  2093. * @param DMAx DMAx Instance
  2094. * @retval State of bit (1 or 0).
  2095. */
  2096. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE4(DMA_TypeDef *DMAx)
  2097. {
  2098. return ((READ_BIT(DMAx->HISR, DMA_HISR_TEIF4) == (DMA_HISR_TEIF4)) ? 1UL : 0UL);
  2099. }
  2100. /**
  2101. * @brief Get Stream 5 transfer error flag.
  2102. * @rmtoll HISR TEIF0 LL_DMA_IsActiveFlag_TE5
  2103. * @param DMAx DMAx Instance
  2104. * @retval State of bit (1 or 0).
  2105. */
  2106. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE5(DMA_TypeDef *DMAx)
  2107. {
  2108. return ((READ_BIT(DMAx->HISR, DMA_HISR_TEIF5) == (DMA_HISR_TEIF5)) ? 1UL : 0UL);
  2109. }
  2110. /**
  2111. * @brief Get Stream 6 transfer error flag.
  2112. * @rmtoll HISR TEIF6 LL_DMA_IsActiveFlag_TE6
  2113. * @param DMAx DMAx Instance
  2114. * @retval State of bit (1 or 0).
  2115. */
  2116. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE6(DMA_TypeDef *DMAx)
  2117. {
  2118. return ((READ_BIT(DMAx->HISR, DMA_HISR_TEIF6) == (DMA_HISR_TEIF6)) ? 1UL : 0UL);
  2119. }
  2120. /**
  2121. * @brief Get Stream 7 transfer error flag.
  2122. * @rmtoll HISR TEIF7 LL_DMA_IsActiveFlag_TE7
  2123. * @param DMAx DMAx Instance
  2124. * @retval State of bit (1 or 0).
  2125. */
  2126. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_TE7(DMA_TypeDef *DMAx)
  2127. {
  2128. return ((READ_BIT(DMAx->HISR, DMA_HISR_TEIF7) == (DMA_HISR_TEIF7)) ? 1UL : 0UL);
  2129. }
  2130. /**
  2131. * @brief Get Stream 0 direct mode error flag.
  2132. * @rmtoll LISR DMEIF0 LL_DMA_IsActiveFlag_DME0
  2133. * @param DMAx DMAx Instance
  2134. * @retval State of bit (1 or 0).
  2135. */
  2136. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME0(DMA_TypeDef *DMAx)
  2137. {
  2138. return ((READ_BIT(DMAx->LISR, DMA_LISR_DMEIF0) == (DMA_LISR_DMEIF0)) ? 1UL : 0UL);
  2139. }
  2140. /**
  2141. * @brief Get Stream 1 direct mode error flag.
  2142. * @rmtoll LISR DMEIF1 LL_DMA_IsActiveFlag_DME1
  2143. * @param DMAx DMAx Instance
  2144. * @retval State of bit (1 or 0).
  2145. */
  2146. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME1(DMA_TypeDef *DMAx)
  2147. {
  2148. return ((READ_BIT(DMAx->LISR, DMA_LISR_DMEIF1) == (DMA_LISR_DMEIF1)) ? 1UL : 0UL);
  2149. }
  2150. /**
  2151. * @brief Get Stream 2 direct mode error flag.
  2152. * @rmtoll LISR DMEIF2 LL_DMA_IsActiveFlag_DME2
  2153. * @param DMAx DMAx Instance
  2154. * @retval State of bit (1 or 0).
  2155. */
  2156. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME2(DMA_TypeDef *DMAx)
  2157. {
  2158. return ((READ_BIT(DMAx->LISR, DMA_LISR_DMEIF2) == (DMA_LISR_DMEIF2)) ? 1UL : 0UL);
  2159. }
  2160. /**
  2161. * @brief Get Stream 3 direct mode error flag.
  2162. * @rmtoll LISR DMEIF3 LL_DMA_IsActiveFlag_DME3
  2163. * @param DMAx DMAx Instance
  2164. * @retval State of bit (1 or 0).
  2165. */
  2166. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME3(DMA_TypeDef *DMAx)
  2167. {
  2168. return ((READ_BIT(DMAx->LISR, DMA_LISR_DMEIF3) == (DMA_LISR_DMEIF3)) ? 1UL : 0UL);
  2169. }
  2170. /**
  2171. * @brief Get Stream 4 direct mode error flag.
  2172. * @rmtoll HISR DMEIF4 LL_DMA_IsActiveFlag_DME4
  2173. * @param DMAx DMAx Instance
  2174. * @retval State of bit (1 or 0).
  2175. */
  2176. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME4(DMA_TypeDef *DMAx)
  2177. {
  2178. return ((READ_BIT(DMAx->HISR, DMA_HISR_DMEIF4) == (DMA_HISR_DMEIF4)) ? 1UL : 0UL);
  2179. }
  2180. /**
  2181. * @brief Get Stream 5 direct mode error flag.
  2182. * @rmtoll HISR DMEIF0 LL_DMA_IsActiveFlag_DME5
  2183. * @param DMAx DMAx Instance
  2184. * @retval State of bit (1 or 0).
  2185. */
  2186. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME5(DMA_TypeDef *DMAx)
  2187. {
  2188. return ((READ_BIT(DMAx->HISR, DMA_HISR_DMEIF5) == (DMA_HISR_DMEIF5)) ? 1UL : 0UL);
  2189. }
  2190. /**
  2191. * @brief Get Stream 6 direct mode error flag.
  2192. * @rmtoll HISR DMEIF6 LL_DMA_IsActiveFlag_DME6
  2193. * @param DMAx DMAx Instance
  2194. * @retval State of bit (1 or 0).
  2195. */
  2196. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME6(DMA_TypeDef *DMAx)
  2197. {
  2198. return ((READ_BIT(DMAx->HISR, DMA_HISR_DMEIF6) == (DMA_HISR_DMEIF6)) ? 1UL : 0UL);
  2199. }
  2200. /**
  2201. * @brief Get Stream 7 direct mode error flag.
  2202. * @rmtoll HISR DMEIF7 LL_DMA_IsActiveFlag_DME7
  2203. * @param DMAx DMAx Instance
  2204. * @retval State of bit (1 or 0).
  2205. */
  2206. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_DME7(DMA_TypeDef *DMAx)
  2207. {
  2208. return ((READ_BIT(DMAx->HISR, DMA_HISR_DMEIF7) == (DMA_HISR_DMEIF7)) ? 1UL : 0UL);
  2209. }
  2210. /**
  2211. * @brief Get Stream 0 FIFO error flag.
  2212. * @rmtoll LISR FEIF0 LL_DMA_IsActiveFlag_FE0
  2213. * @param DMAx DMAx Instance
  2214. * @retval State of bit (1 or 0).
  2215. */
  2216. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE0(DMA_TypeDef *DMAx)
  2217. {
  2218. return ((READ_BIT(DMAx->LISR, DMA_LISR_FEIF0) == (DMA_LISR_FEIF0)) ? 1UL : 0UL);
  2219. }
  2220. /**
  2221. * @brief Get Stream 1 FIFO error flag.
  2222. * @rmtoll LISR FEIF1 LL_DMA_IsActiveFlag_FE1
  2223. * @param DMAx DMAx Instance
  2224. * @retval State of bit (1 or 0).
  2225. */
  2226. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE1(DMA_TypeDef *DMAx)
  2227. {
  2228. return ((READ_BIT(DMAx->LISR, DMA_LISR_FEIF1) == (DMA_LISR_FEIF1)) ? 1UL : 0UL);
  2229. }
  2230. /**
  2231. * @brief Get Stream 2 FIFO error flag.
  2232. * @rmtoll LISR FEIF2 LL_DMA_IsActiveFlag_FE2
  2233. * @param DMAx DMAx Instance
  2234. * @retval State of bit (1 or 0).
  2235. */
  2236. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE2(DMA_TypeDef *DMAx)
  2237. {
  2238. return ((READ_BIT(DMAx->LISR, DMA_LISR_FEIF2) == (DMA_LISR_FEIF2)) ? 1UL : 0UL);
  2239. }
  2240. /**
  2241. * @brief Get Stream 3 FIFO error flag.
  2242. * @rmtoll LISR FEIF3 LL_DMA_IsActiveFlag_FE3
  2243. * @param DMAx DMAx Instance
  2244. * @retval State of bit (1 or 0).
  2245. */
  2246. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE3(DMA_TypeDef *DMAx)
  2247. {
  2248. return ((READ_BIT(DMAx->LISR, DMA_LISR_FEIF3) == (DMA_LISR_FEIF3)) ? 1UL : 0UL);
  2249. }
  2250. /**
  2251. * @brief Get Stream 4 FIFO error flag.
  2252. * @rmtoll HISR FEIF4 LL_DMA_IsActiveFlag_FE4
  2253. * @param DMAx DMAx Instance
  2254. * @retval State of bit (1 or 0).
  2255. */
  2256. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE4(DMA_TypeDef *DMAx)
  2257. {
  2258. return ((READ_BIT(DMAx->HISR, DMA_HISR_FEIF4) == (DMA_HISR_FEIF4)) ? 1UL : 0UL);
  2259. }
  2260. /**
  2261. * @brief Get Stream 5 FIFO error flag.
  2262. * @rmtoll HISR FEIF0 LL_DMA_IsActiveFlag_FE5
  2263. * @param DMAx DMAx Instance
  2264. * @retval State of bit (1 or 0).
  2265. */
  2266. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE5(DMA_TypeDef *DMAx)
  2267. {
  2268. return ((READ_BIT(DMAx->HISR, DMA_HISR_FEIF5) == (DMA_HISR_FEIF5)) ? 1UL : 0UL);
  2269. }
  2270. /**
  2271. * @brief Get Stream 6 FIFO error flag.
  2272. * @rmtoll HISR FEIF6 LL_DMA_IsActiveFlag_FE6
  2273. * @param DMAx DMAx Instance
  2274. * @retval State of bit (1 or 0).
  2275. */
  2276. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE6(DMA_TypeDef *DMAx)
  2277. {
  2278. return ((READ_BIT(DMAx->HISR, DMA_HISR_FEIF6) == (DMA_HISR_FEIF6)) ? 1UL : 0UL);
  2279. }
  2280. /**
  2281. * @brief Get Stream 7 FIFO error flag.
  2282. * @rmtoll HISR FEIF7 LL_DMA_IsActiveFlag_FE7
  2283. * @param DMAx DMAx Instance
  2284. * @retval State of bit (1 or 0).
  2285. */
  2286. __STATIC_INLINE uint32_t LL_DMA_IsActiveFlag_FE7(DMA_TypeDef *DMAx)
  2287. {
  2288. return ((READ_BIT(DMAx->HISR, DMA_HISR_FEIF7) == (DMA_HISR_FEIF7)) ? 1UL : 0UL);
  2289. }
  2290. /**
  2291. * @brief Clear Stream 0 half transfer flag.
  2292. * @rmtoll LIFCR CHTIF0 LL_DMA_ClearFlag_HT0
  2293. * @param DMAx DMAx Instance
  2294. * @retval None
  2295. */
  2296. __STATIC_INLINE void LL_DMA_ClearFlag_HT0(DMA_TypeDef *DMAx)
  2297. {
  2298. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CHTIF0);
  2299. }
  2300. /**
  2301. * @brief Clear Stream 1 half transfer flag.
  2302. * @rmtoll LIFCR CHTIF1 LL_DMA_ClearFlag_HT1
  2303. * @param DMAx DMAx Instance
  2304. * @retval None
  2305. */
  2306. __STATIC_INLINE void LL_DMA_ClearFlag_HT1(DMA_TypeDef *DMAx)
  2307. {
  2308. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CHTIF1);
  2309. }
  2310. /**
  2311. * @brief Clear Stream 2 half transfer flag.
  2312. * @rmtoll LIFCR CHTIF2 LL_DMA_ClearFlag_HT2
  2313. * @param DMAx DMAx Instance
  2314. * @retval None
  2315. */
  2316. __STATIC_INLINE void LL_DMA_ClearFlag_HT2(DMA_TypeDef *DMAx)
  2317. {
  2318. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CHTIF2);
  2319. }
  2320. /**
  2321. * @brief Clear Stream 3 half transfer flag.
  2322. * @rmtoll LIFCR CHTIF3 LL_DMA_ClearFlag_HT3
  2323. * @param DMAx DMAx Instance
  2324. * @retval None
  2325. */
  2326. __STATIC_INLINE void LL_DMA_ClearFlag_HT3(DMA_TypeDef *DMAx)
  2327. {
  2328. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CHTIF3);
  2329. }
  2330. /**
  2331. * @brief Clear Stream 4 half transfer flag.
  2332. * @rmtoll HIFCR CHTIF4 LL_DMA_ClearFlag_HT4
  2333. * @param DMAx DMAx Instance
  2334. * @retval None
  2335. */
  2336. __STATIC_INLINE void LL_DMA_ClearFlag_HT4(DMA_TypeDef *DMAx)
  2337. {
  2338. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CHTIF4);
  2339. }
  2340. /**
  2341. * @brief Clear Stream 5 half transfer flag.
  2342. * @rmtoll HIFCR CHTIF5 LL_DMA_ClearFlag_HT5
  2343. * @param DMAx DMAx Instance
  2344. * @retval None
  2345. */
  2346. __STATIC_INLINE void LL_DMA_ClearFlag_HT5(DMA_TypeDef *DMAx)
  2347. {
  2348. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CHTIF5);
  2349. }
  2350. /**
  2351. * @brief Clear Stream 6 half transfer flag.
  2352. * @rmtoll HIFCR CHTIF6 LL_DMA_ClearFlag_HT6
  2353. * @param DMAx DMAx Instance
  2354. * @retval None
  2355. */
  2356. __STATIC_INLINE void LL_DMA_ClearFlag_HT6(DMA_TypeDef *DMAx)
  2357. {
  2358. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CHTIF6);
  2359. }
  2360. /**
  2361. * @brief Clear Stream 7 half transfer flag.
  2362. * @rmtoll HIFCR CHTIF7 LL_DMA_ClearFlag_HT7
  2363. * @param DMAx DMAx Instance
  2364. * @retval None
  2365. */
  2366. __STATIC_INLINE void LL_DMA_ClearFlag_HT7(DMA_TypeDef *DMAx)
  2367. {
  2368. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CHTIF7);
  2369. }
  2370. /**
  2371. * @brief Clear Stream 0 transfer complete flag.
  2372. * @rmtoll LIFCR CTCIF0 LL_DMA_ClearFlag_TC0
  2373. * @param DMAx DMAx Instance
  2374. * @retval None
  2375. */
  2376. __STATIC_INLINE void LL_DMA_ClearFlag_TC0(DMA_TypeDef *DMAx)
  2377. {
  2378. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTCIF0);
  2379. }
  2380. /**
  2381. * @brief Clear Stream 1 transfer complete flag.
  2382. * @rmtoll LIFCR CTCIF1 LL_DMA_ClearFlag_TC1
  2383. * @param DMAx DMAx Instance
  2384. * @retval None
  2385. */
  2386. __STATIC_INLINE void LL_DMA_ClearFlag_TC1(DMA_TypeDef *DMAx)
  2387. {
  2388. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTCIF1);
  2389. }
  2390. /**
  2391. * @brief Clear Stream 2 transfer complete flag.
  2392. * @rmtoll LIFCR CTCIF2 LL_DMA_ClearFlag_TC2
  2393. * @param DMAx DMAx Instance
  2394. * @retval None
  2395. */
  2396. __STATIC_INLINE void LL_DMA_ClearFlag_TC2(DMA_TypeDef *DMAx)
  2397. {
  2398. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTCIF2);
  2399. }
  2400. /**
  2401. * @brief Clear Stream 3 transfer complete flag.
  2402. * @rmtoll LIFCR CTCIF3 LL_DMA_ClearFlag_TC3
  2403. * @param DMAx DMAx Instance
  2404. * @retval None
  2405. */
  2406. __STATIC_INLINE void LL_DMA_ClearFlag_TC3(DMA_TypeDef *DMAx)
  2407. {
  2408. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTCIF3);
  2409. }
  2410. /**
  2411. * @brief Clear Stream 4 transfer complete flag.
  2412. * @rmtoll HIFCR CTCIF4 LL_DMA_ClearFlag_TC4
  2413. * @param DMAx DMAx Instance
  2414. * @retval None
  2415. */
  2416. __STATIC_INLINE void LL_DMA_ClearFlag_TC4(DMA_TypeDef *DMAx)
  2417. {
  2418. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTCIF4);
  2419. }
  2420. /**
  2421. * @brief Clear Stream 5 transfer complete flag.
  2422. * @rmtoll HIFCR CTCIF5 LL_DMA_ClearFlag_TC5
  2423. * @param DMAx DMAx Instance
  2424. * @retval None
  2425. */
  2426. __STATIC_INLINE void LL_DMA_ClearFlag_TC5(DMA_TypeDef *DMAx)
  2427. {
  2428. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTCIF5);
  2429. }
  2430. /**
  2431. * @brief Clear Stream 6 transfer complete flag.
  2432. * @rmtoll HIFCR CTCIF6 LL_DMA_ClearFlag_TC6
  2433. * @param DMAx DMAx Instance
  2434. * @retval None
  2435. */
  2436. __STATIC_INLINE void LL_DMA_ClearFlag_TC6(DMA_TypeDef *DMAx)
  2437. {
  2438. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTCIF6);
  2439. }
  2440. /**
  2441. * @brief Clear Stream 7 transfer complete flag.
  2442. * @rmtoll HIFCR CTCIF7 LL_DMA_ClearFlag_TC7
  2443. * @param DMAx DMAx Instance
  2444. * @retval None
  2445. */
  2446. __STATIC_INLINE void LL_DMA_ClearFlag_TC7(DMA_TypeDef *DMAx)
  2447. {
  2448. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTCIF7);
  2449. }
  2450. /**
  2451. * @brief Clear Stream 0 transfer error flag.
  2452. * @rmtoll LIFCR CTEIF0 LL_DMA_ClearFlag_TE0
  2453. * @param DMAx DMAx Instance
  2454. * @retval None
  2455. */
  2456. __STATIC_INLINE void LL_DMA_ClearFlag_TE0(DMA_TypeDef *DMAx)
  2457. {
  2458. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTEIF0);
  2459. }
  2460. /**
  2461. * @brief Clear Stream 1 transfer error flag.
  2462. * @rmtoll LIFCR CTEIF1 LL_DMA_ClearFlag_TE1
  2463. * @param DMAx DMAx Instance
  2464. * @retval None
  2465. */
  2466. __STATIC_INLINE void LL_DMA_ClearFlag_TE1(DMA_TypeDef *DMAx)
  2467. {
  2468. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTEIF1);
  2469. }
  2470. /**
  2471. * @brief Clear Stream 2 transfer error flag.
  2472. * @rmtoll LIFCR CTEIF2 LL_DMA_ClearFlag_TE2
  2473. * @param DMAx DMAx Instance
  2474. * @retval None
  2475. */
  2476. __STATIC_INLINE void LL_DMA_ClearFlag_TE2(DMA_TypeDef *DMAx)
  2477. {
  2478. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTEIF2);
  2479. }
  2480. /**
  2481. * @brief Clear Stream 3 transfer error flag.
  2482. * @rmtoll LIFCR CTEIF3 LL_DMA_ClearFlag_TE3
  2483. * @param DMAx DMAx Instance
  2484. * @retval None
  2485. */
  2486. __STATIC_INLINE void LL_DMA_ClearFlag_TE3(DMA_TypeDef *DMAx)
  2487. {
  2488. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CTEIF3);
  2489. }
  2490. /**
  2491. * @brief Clear Stream 4 transfer error flag.
  2492. * @rmtoll HIFCR CTEIF4 LL_DMA_ClearFlag_TE4
  2493. * @param DMAx DMAx Instance
  2494. * @retval None
  2495. */
  2496. __STATIC_INLINE void LL_DMA_ClearFlag_TE4(DMA_TypeDef *DMAx)
  2497. {
  2498. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTEIF4);
  2499. }
  2500. /**
  2501. * @brief Clear Stream 5 transfer error flag.
  2502. * @rmtoll HIFCR CTEIF5 LL_DMA_ClearFlag_TE5
  2503. * @param DMAx DMAx Instance
  2504. * @retval None
  2505. */
  2506. __STATIC_INLINE void LL_DMA_ClearFlag_TE5(DMA_TypeDef *DMAx)
  2507. {
  2508. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTEIF5);
  2509. }
  2510. /**
  2511. * @brief Clear Stream 6 transfer error flag.
  2512. * @rmtoll HIFCR CTEIF6 LL_DMA_ClearFlag_TE6
  2513. * @param DMAx DMAx Instance
  2514. * @retval None
  2515. */
  2516. __STATIC_INLINE void LL_DMA_ClearFlag_TE6(DMA_TypeDef *DMAx)
  2517. {
  2518. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTEIF6);
  2519. }
  2520. /**
  2521. * @brief Clear Stream 7 transfer error flag.
  2522. * @rmtoll HIFCR CTEIF7 LL_DMA_ClearFlag_TE7
  2523. * @param DMAx DMAx Instance
  2524. * @retval None
  2525. */
  2526. __STATIC_INLINE void LL_DMA_ClearFlag_TE7(DMA_TypeDef *DMAx)
  2527. {
  2528. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CTEIF7);
  2529. }
  2530. /**
  2531. * @brief Clear Stream 0 direct mode error flag.
  2532. * @rmtoll LIFCR CDMEIF0 LL_DMA_ClearFlag_DME0
  2533. * @param DMAx DMAx Instance
  2534. * @retval None
  2535. */
  2536. __STATIC_INLINE void LL_DMA_ClearFlag_DME0(DMA_TypeDef *DMAx)
  2537. {
  2538. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CDMEIF0);
  2539. }
  2540. /**
  2541. * @brief Clear Stream 1 direct mode error flag.
  2542. * @rmtoll LIFCR CDMEIF1 LL_DMA_ClearFlag_DME1
  2543. * @param DMAx DMAx Instance
  2544. * @retval None
  2545. */
  2546. __STATIC_INLINE void LL_DMA_ClearFlag_DME1(DMA_TypeDef *DMAx)
  2547. {
  2548. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CDMEIF1);
  2549. }
  2550. /**
  2551. * @brief Clear Stream 2 direct mode error flag.
  2552. * @rmtoll LIFCR CDMEIF2 LL_DMA_ClearFlag_DME2
  2553. * @param DMAx DMAx Instance
  2554. * @retval None
  2555. */
  2556. __STATIC_INLINE void LL_DMA_ClearFlag_DME2(DMA_TypeDef *DMAx)
  2557. {
  2558. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CDMEIF2);
  2559. }
  2560. /**
  2561. * @brief Clear Stream 3 direct mode error flag.
  2562. * @rmtoll LIFCR CDMEIF3 LL_DMA_ClearFlag_DME3
  2563. * @param DMAx DMAx Instance
  2564. * @retval None
  2565. */
  2566. __STATIC_INLINE void LL_DMA_ClearFlag_DME3(DMA_TypeDef *DMAx)
  2567. {
  2568. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CDMEIF3);
  2569. }
  2570. /**
  2571. * @brief Clear Stream 4 direct mode error flag.
  2572. * @rmtoll HIFCR CDMEIF4 LL_DMA_ClearFlag_DME4
  2573. * @param DMAx DMAx Instance
  2574. * @retval None
  2575. */
  2576. __STATIC_INLINE void LL_DMA_ClearFlag_DME4(DMA_TypeDef *DMAx)
  2577. {
  2578. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CDMEIF4);
  2579. }
  2580. /**
  2581. * @brief Clear Stream 5 direct mode error flag.
  2582. * @rmtoll HIFCR CDMEIF5 LL_DMA_ClearFlag_DME5
  2583. * @param DMAx DMAx Instance
  2584. * @retval None
  2585. */
  2586. __STATIC_INLINE void LL_DMA_ClearFlag_DME5(DMA_TypeDef *DMAx)
  2587. {
  2588. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CDMEIF5);
  2589. }
  2590. /**
  2591. * @brief Clear Stream 6 direct mode error flag.
  2592. * @rmtoll HIFCR CDMEIF6 LL_DMA_ClearFlag_DME6
  2593. * @param DMAx DMAx Instance
  2594. * @retval None
  2595. */
  2596. __STATIC_INLINE void LL_DMA_ClearFlag_DME6(DMA_TypeDef *DMAx)
  2597. {
  2598. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CDMEIF6);
  2599. }
  2600. /**
  2601. * @brief Clear Stream 7 direct mode error flag.
  2602. * @rmtoll HIFCR CDMEIF7 LL_DMA_ClearFlag_DME7
  2603. * @param DMAx DMAx Instance
  2604. * @retval None
  2605. */
  2606. __STATIC_INLINE void LL_DMA_ClearFlag_DME7(DMA_TypeDef *DMAx)
  2607. {
  2608. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CDMEIF7);
  2609. }
  2610. /**
  2611. * @brief Clear Stream 0 FIFO error flag.
  2612. * @rmtoll LIFCR CFEIF0 LL_DMA_ClearFlag_FE0
  2613. * @param DMAx DMAx Instance
  2614. * @retval None
  2615. */
  2616. __STATIC_INLINE void LL_DMA_ClearFlag_FE0(DMA_TypeDef *DMAx)
  2617. {
  2618. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CFEIF0);
  2619. }
  2620. /**
  2621. * @brief Clear Stream 1 FIFO error flag.
  2622. * @rmtoll LIFCR CFEIF1 LL_DMA_ClearFlag_FE1
  2623. * @param DMAx DMAx Instance
  2624. * @retval None
  2625. */
  2626. __STATIC_INLINE void LL_DMA_ClearFlag_FE1(DMA_TypeDef *DMAx)
  2627. {
  2628. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CFEIF1);
  2629. }
  2630. /**
  2631. * @brief Clear Stream 2 FIFO error flag.
  2632. * @rmtoll LIFCR CFEIF2 LL_DMA_ClearFlag_FE2
  2633. * @param DMAx DMAx Instance
  2634. * @retval None
  2635. */
  2636. __STATIC_INLINE void LL_DMA_ClearFlag_FE2(DMA_TypeDef *DMAx)
  2637. {
  2638. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CFEIF2);
  2639. }
  2640. /**
  2641. * @brief Clear Stream 3 FIFO error flag.
  2642. * @rmtoll LIFCR CFEIF3 LL_DMA_ClearFlag_FE3
  2643. * @param DMAx DMAx Instance
  2644. * @retval None
  2645. */
  2646. __STATIC_INLINE void LL_DMA_ClearFlag_FE3(DMA_TypeDef *DMAx)
  2647. {
  2648. WRITE_REG(DMAx->LIFCR, DMA_LIFCR_CFEIF3);
  2649. }
  2650. /**
  2651. * @brief Clear Stream 4 FIFO error flag.
  2652. * @rmtoll HIFCR CFEIF4 LL_DMA_ClearFlag_FE4
  2653. * @param DMAx DMAx Instance
  2654. * @retval None
  2655. */
  2656. __STATIC_INLINE void LL_DMA_ClearFlag_FE4(DMA_TypeDef *DMAx)
  2657. {
  2658. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CFEIF4);
  2659. }
  2660. /**
  2661. * @brief Clear Stream 5 FIFO error flag.
  2662. * @rmtoll HIFCR CFEIF5 LL_DMA_ClearFlag_FE5
  2663. * @param DMAx DMAx Instance
  2664. * @retval None
  2665. */
  2666. __STATIC_INLINE void LL_DMA_ClearFlag_FE5(DMA_TypeDef *DMAx)
  2667. {
  2668. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CFEIF5);
  2669. }
  2670. /**
  2671. * @brief Clear Stream 6 FIFO error flag.
  2672. * @rmtoll HIFCR CFEIF6 LL_DMA_ClearFlag_FE6
  2673. * @param DMAx DMAx Instance
  2674. * @retval None
  2675. */
  2676. __STATIC_INLINE void LL_DMA_ClearFlag_FE6(DMA_TypeDef *DMAx)
  2677. {
  2678. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CFEIF6);
  2679. }
  2680. /**
  2681. * @brief Clear Stream 7 FIFO error flag.
  2682. * @rmtoll HIFCR CFEIF7 LL_DMA_ClearFlag_FE7
  2683. * @param DMAx DMAx Instance
  2684. * @retval None
  2685. */
  2686. __STATIC_INLINE void LL_DMA_ClearFlag_FE7(DMA_TypeDef *DMAx)
  2687. {
  2688. WRITE_REG(DMAx->HIFCR, DMA_HIFCR_CFEIF7);
  2689. }
  2690. /**
  2691. * @}
  2692. */
  2693. /** @defgroup DMA_LL_EF_IT_Management IT_Management
  2694. * @{
  2695. */
  2696. /**
  2697. * @brief Enable Half transfer interrupt.
  2698. * @rmtoll CR HTIE LL_DMA_EnableIT_HT
  2699. * @param DMAx DMAx Instance
  2700. * @param Stream This parameter can be one of the following values:
  2701. * @arg @ref LL_DMA_STREAM_0
  2702. * @arg @ref LL_DMA_STREAM_1
  2703. * @arg @ref LL_DMA_STREAM_2
  2704. * @arg @ref LL_DMA_STREAM_3
  2705. * @arg @ref LL_DMA_STREAM_4
  2706. * @arg @ref LL_DMA_STREAM_5
  2707. * @arg @ref LL_DMA_STREAM_6
  2708. * @arg @ref LL_DMA_STREAM_7
  2709. * @retval None
  2710. */
  2711. __STATIC_INLINE void LL_DMA_EnableIT_HT(DMA_TypeDef *DMAx, uint32_t Stream)
  2712. {
  2713. uint32_t dma_base_addr = (uint32_t)DMAx;
  2714. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_HTIE);
  2715. }
  2716. /**
  2717. * @brief Enable Transfer error interrupt.
  2718. * @rmtoll CR TEIE LL_DMA_EnableIT_TE
  2719. * @param DMAx DMAx Instance
  2720. * @param Stream This parameter can be one of the following values:
  2721. * @arg @ref LL_DMA_STREAM_0
  2722. * @arg @ref LL_DMA_STREAM_1
  2723. * @arg @ref LL_DMA_STREAM_2
  2724. * @arg @ref LL_DMA_STREAM_3
  2725. * @arg @ref LL_DMA_STREAM_4
  2726. * @arg @ref LL_DMA_STREAM_5
  2727. * @arg @ref LL_DMA_STREAM_6
  2728. * @arg @ref LL_DMA_STREAM_7
  2729. * @retval None
  2730. */
  2731. __STATIC_INLINE void LL_DMA_EnableIT_TE(DMA_TypeDef *DMAx, uint32_t Stream)
  2732. {
  2733. uint32_t dma_base_addr = (uint32_t)DMAx;
  2734. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TEIE);
  2735. }
  2736. /**
  2737. * @brief Enable Transfer complete interrupt.
  2738. * @rmtoll CR TCIE LL_DMA_EnableIT_TC
  2739. * @param DMAx DMAx Instance
  2740. * @param Stream This parameter can be one of the following values:
  2741. * @arg @ref LL_DMA_STREAM_0
  2742. * @arg @ref LL_DMA_STREAM_1
  2743. * @arg @ref LL_DMA_STREAM_2
  2744. * @arg @ref LL_DMA_STREAM_3
  2745. * @arg @ref LL_DMA_STREAM_4
  2746. * @arg @ref LL_DMA_STREAM_5
  2747. * @arg @ref LL_DMA_STREAM_6
  2748. * @arg @ref LL_DMA_STREAM_7
  2749. * @retval None
  2750. */
  2751. __STATIC_INLINE void LL_DMA_EnableIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)
  2752. {
  2753. uint32_t dma_base_addr = (uint32_t)DMAx;
  2754. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TCIE);
  2755. }
  2756. /**
  2757. * @brief Enable Direct mode error interrupt.
  2758. * @rmtoll CR DMEIE LL_DMA_EnableIT_DME
  2759. * @param DMAx DMAx Instance
  2760. * @param Stream This parameter can be one of the following values:
  2761. * @arg @ref LL_DMA_STREAM_0
  2762. * @arg @ref LL_DMA_STREAM_1
  2763. * @arg @ref LL_DMA_STREAM_2
  2764. * @arg @ref LL_DMA_STREAM_3
  2765. * @arg @ref LL_DMA_STREAM_4
  2766. * @arg @ref LL_DMA_STREAM_5
  2767. * @arg @ref LL_DMA_STREAM_6
  2768. * @arg @ref LL_DMA_STREAM_7
  2769. * @retval None
  2770. */
  2771. __STATIC_INLINE void LL_DMA_EnableIT_DME(DMA_TypeDef *DMAx, uint32_t Stream)
  2772. {
  2773. uint32_t dma_base_addr = (uint32_t)DMAx;
  2774. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DMEIE);
  2775. }
  2776. /**
  2777. * @brief Enable FIFO error interrupt.
  2778. * @rmtoll FCR FEIE LL_DMA_EnableIT_FE
  2779. * @param DMAx DMAx Instance
  2780. * @param Stream This parameter can be one of the following values:
  2781. * @arg @ref LL_DMA_STREAM_0
  2782. * @arg @ref LL_DMA_STREAM_1
  2783. * @arg @ref LL_DMA_STREAM_2
  2784. * @arg @ref LL_DMA_STREAM_3
  2785. * @arg @ref LL_DMA_STREAM_4
  2786. * @arg @ref LL_DMA_STREAM_5
  2787. * @arg @ref LL_DMA_STREAM_6
  2788. * @arg @ref LL_DMA_STREAM_7
  2789. * @retval None
  2790. */
  2791. __STATIC_INLINE void LL_DMA_EnableIT_FE(DMA_TypeDef *DMAx, uint32_t Stream)
  2792. {
  2793. uint32_t dma_base_addr = (uint32_t)DMAx;
  2794. SET_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FEIE);
  2795. }
  2796. /**
  2797. * @brief Disable Half transfer interrupt.
  2798. * @rmtoll CR HTIE LL_DMA_DisableIT_HT
  2799. * @param DMAx DMAx Instance
  2800. * @param Stream This parameter can be one of the following values:
  2801. * @arg @ref LL_DMA_STREAM_0
  2802. * @arg @ref LL_DMA_STREAM_1
  2803. * @arg @ref LL_DMA_STREAM_2
  2804. * @arg @ref LL_DMA_STREAM_3
  2805. * @arg @ref LL_DMA_STREAM_4
  2806. * @arg @ref LL_DMA_STREAM_5
  2807. * @arg @ref LL_DMA_STREAM_6
  2808. * @arg @ref LL_DMA_STREAM_7
  2809. * @retval None
  2810. */
  2811. __STATIC_INLINE void LL_DMA_DisableIT_HT(DMA_TypeDef *DMAx, uint32_t Stream)
  2812. {
  2813. uint32_t dma_base_addr = (uint32_t)DMAx;
  2814. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_HTIE);
  2815. }
  2816. /**
  2817. * @brief Disable Transfer error interrupt.
  2818. * @rmtoll CR TEIE LL_DMA_DisableIT_TE
  2819. * @param DMAx DMAx Instance
  2820. * @param Stream This parameter can be one of the following values:
  2821. * @arg @ref LL_DMA_STREAM_0
  2822. * @arg @ref LL_DMA_STREAM_1
  2823. * @arg @ref LL_DMA_STREAM_2
  2824. * @arg @ref LL_DMA_STREAM_3
  2825. * @arg @ref LL_DMA_STREAM_4
  2826. * @arg @ref LL_DMA_STREAM_5
  2827. * @arg @ref LL_DMA_STREAM_6
  2828. * @arg @ref LL_DMA_STREAM_7
  2829. * @retval None
  2830. */
  2831. __STATIC_INLINE void LL_DMA_DisableIT_TE(DMA_TypeDef *DMAx, uint32_t Stream)
  2832. {
  2833. uint32_t dma_base_addr = (uint32_t)DMAx;
  2834. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TEIE);
  2835. }
  2836. /**
  2837. * @brief Disable Transfer complete interrupt.
  2838. * @rmtoll CR TCIE LL_DMA_DisableIT_TC
  2839. * @param DMAx DMAx Instance
  2840. * @param Stream This parameter can be one of the following values:
  2841. * @arg @ref LL_DMA_STREAM_0
  2842. * @arg @ref LL_DMA_STREAM_1
  2843. * @arg @ref LL_DMA_STREAM_2
  2844. * @arg @ref LL_DMA_STREAM_3
  2845. * @arg @ref LL_DMA_STREAM_4
  2846. * @arg @ref LL_DMA_STREAM_5
  2847. * @arg @ref LL_DMA_STREAM_6
  2848. * @arg @ref LL_DMA_STREAM_7
  2849. * @retval None
  2850. */
  2851. __STATIC_INLINE void LL_DMA_DisableIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)
  2852. {
  2853. uint32_t dma_base_addr = (uint32_t)DMAx;
  2854. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TCIE);
  2855. }
  2856. /**
  2857. * @brief Disable Direct mode error interrupt.
  2858. * @rmtoll CR DMEIE LL_DMA_DisableIT_DME
  2859. * @param DMAx DMAx Instance
  2860. * @param Stream This parameter can be one of the following values:
  2861. * @arg @ref LL_DMA_STREAM_0
  2862. * @arg @ref LL_DMA_STREAM_1
  2863. * @arg @ref LL_DMA_STREAM_2
  2864. * @arg @ref LL_DMA_STREAM_3
  2865. * @arg @ref LL_DMA_STREAM_4
  2866. * @arg @ref LL_DMA_STREAM_5
  2867. * @arg @ref LL_DMA_STREAM_6
  2868. * @arg @ref LL_DMA_STREAM_7
  2869. * @retval None
  2870. */
  2871. __STATIC_INLINE void LL_DMA_DisableIT_DME(DMA_TypeDef *DMAx, uint32_t Stream)
  2872. {
  2873. uint32_t dma_base_addr = (uint32_t)DMAx;
  2874. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DMEIE);
  2875. }
  2876. /**
  2877. * @brief Disable FIFO error interrupt.
  2878. * @rmtoll FCR FEIE LL_DMA_DisableIT_FE
  2879. * @param DMAx DMAx Instance
  2880. * @param Stream This parameter can be one of the following values:
  2881. * @arg @ref LL_DMA_STREAM_0
  2882. * @arg @ref LL_DMA_STREAM_1
  2883. * @arg @ref LL_DMA_STREAM_2
  2884. * @arg @ref LL_DMA_STREAM_3
  2885. * @arg @ref LL_DMA_STREAM_4
  2886. * @arg @ref LL_DMA_STREAM_5
  2887. * @arg @ref LL_DMA_STREAM_6
  2888. * @arg @ref LL_DMA_STREAM_7
  2889. * @retval None
  2890. */
  2891. __STATIC_INLINE void LL_DMA_DisableIT_FE(DMA_TypeDef *DMAx, uint32_t Stream)
  2892. {
  2893. uint32_t dma_base_addr = (uint32_t)DMAx;
  2894. CLEAR_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FEIE);
  2895. }
  2896. /**
  2897. * @brief Check if Half transfer interrupt is enabled.
  2898. * @rmtoll CR HTIE LL_DMA_IsEnabledIT_HT
  2899. * @param DMAx DMAx Instance
  2900. * @param Stream This parameter can be one of the following values:
  2901. * @arg @ref LL_DMA_STREAM_0
  2902. * @arg @ref LL_DMA_STREAM_1
  2903. * @arg @ref LL_DMA_STREAM_2
  2904. * @arg @ref LL_DMA_STREAM_3
  2905. * @arg @ref LL_DMA_STREAM_4
  2906. * @arg @ref LL_DMA_STREAM_5
  2907. * @arg @ref LL_DMA_STREAM_6
  2908. * @arg @ref LL_DMA_STREAM_7
  2909. * @retval State of bit (1 or 0).
  2910. */
  2911. __STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_HT(DMA_TypeDef *DMAx, uint32_t Stream)
  2912. {
  2913. uint32_t dma_base_addr = (uint32_t)DMAx;
  2914. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_HTIE) == DMA_SxCR_HTIE) ? 1UL : 0UL);
  2915. }
  2916. /**
  2917. * @brief Check if Transfer error nterrup is enabled.
  2918. * @rmtoll CR TEIE LL_DMA_IsEnabledIT_TE
  2919. * @param DMAx DMAx Instance
  2920. * @param Stream This parameter can be one of the following values:
  2921. * @arg @ref LL_DMA_STREAM_0
  2922. * @arg @ref LL_DMA_STREAM_1
  2923. * @arg @ref LL_DMA_STREAM_2
  2924. * @arg @ref LL_DMA_STREAM_3
  2925. * @arg @ref LL_DMA_STREAM_4
  2926. * @arg @ref LL_DMA_STREAM_5
  2927. * @arg @ref LL_DMA_STREAM_6
  2928. * @arg @ref LL_DMA_STREAM_7
  2929. * @retval State of bit (1 or 0).
  2930. */
  2931. __STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TE(DMA_TypeDef *DMAx, uint32_t Stream)
  2932. {
  2933. uint32_t dma_base_addr = (uint32_t)DMAx;
  2934. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TEIE) == DMA_SxCR_TEIE) ? 1UL : 0UL);
  2935. }
  2936. /**
  2937. * @brief Check if Transfer complete interrupt is enabled.
  2938. * @rmtoll CR TCIE LL_DMA_IsEnabledIT_TC
  2939. * @param DMAx DMAx Instance
  2940. * @param Stream This parameter can be one of the following values:
  2941. * @arg @ref LL_DMA_STREAM_0
  2942. * @arg @ref LL_DMA_STREAM_1
  2943. * @arg @ref LL_DMA_STREAM_2
  2944. * @arg @ref LL_DMA_STREAM_3
  2945. * @arg @ref LL_DMA_STREAM_4
  2946. * @arg @ref LL_DMA_STREAM_5
  2947. * @arg @ref LL_DMA_STREAM_6
  2948. * @arg @ref LL_DMA_STREAM_7
  2949. * @retval State of bit (1 or 0).
  2950. */
  2951. __STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_TC(DMA_TypeDef *DMAx, uint32_t Stream)
  2952. {
  2953. uint32_t dma_base_addr = (uint32_t)DMAx;
  2954. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_TCIE) == DMA_SxCR_TCIE) ? 1UL : 0UL);
  2955. }
  2956. /**
  2957. * @brief Check if Direct mode error interrupt is enabled.
  2958. * @rmtoll CR DMEIE LL_DMA_IsEnabledIT_DME
  2959. * @param DMAx DMAx Instance
  2960. * @param Stream This parameter can be one of the following values:
  2961. * @arg @ref LL_DMA_STREAM_0
  2962. * @arg @ref LL_DMA_STREAM_1
  2963. * @arg @ref LL_DMA_STREAM_2
  2964. * @arg @ref LL_DMA_STREAM_3
  2965. * @arg @ref LL_DMA_STREAM_4
  2966. * @arg @ref LL_DMA_STREAM_5
  2967. * @arg @ref LL_DMA_STREAM_6
  2968. * @arg @ref LL_DMA_STREAM_7
  2969. * @retval State of bit (1 or 0).
  2970. */
  2971. __STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_DME(DMA_TypeDef *DMAx, uint32_t Stream)
  2972. {
  2973. uint32_t dma_base_addr = (uint32_t)DMAx;
  2974. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->CR, DMA_SxCR_DMEIE) == DMA_SxCR_DMEIE) ? 1UL : 0UL);
  2975. }
  2976. /**
  2977. * @brief Check if FIFO error interrupt is enabled.
  2978. * @rmtoll FCR FEIE LL_DMA_IsEnabledIT_FE
  2979. * @param DMAx DMAx Instance
  2980. * @param Stream This parameter can be one of the following values:
  2981. * @arg @ref LL_DMA_STREAM_0
  2982. * @arg @ref LL_DMA_STREAM_1
  2983. * @arg @ref LL_DMA_STREAM_2
  2984. * @arg @ref LL_DMA_STREAM_3
  2985. * @arg @ref LL_DMA_STREAM_4
  2986. * @arg @ref LL_DMA_STREAM_5
  2987. * @arg @ref LL_DMA_STREAM_6
  2988. * @arg @ref LL_DMA_STREAM_7
  2989. * @retval State of bit (1 or 0).
  2990. */
  2991. __STATIC_INLINE uint32_t LL_DMA_IsEnabledIT_FE(DMA_TypeDef *DMAx, uint32_t Stream)
  2992. {
  2993. uint32_t dma_base_addr = (uint32_t)DMAx;
  2994. return ((READ_BIT(((DMA_Stream_TypeDef *)(dma_base_addr + LL_DMA_STR_OFFSET_TAB[Stream]))->FCR, DMA_SxFCR_FEIE) == DMA_SxFCR_FEIE) ? 1UL : 0UL);
  2995. }
  2996. /**
  2997. * @}
  2998. */
  2999. #if defined(USE_FULL_LL_DRIVER)
  3000. /** @defgroup DMA_LL_EF_Init Initialization and de-initialization functions
  3001. * @{
  3002. */
  3003. uint32_t LL_DMA_Init(DMA_TypeDef *DMAx, uint32_t Stream, LL_DMA_InitTypeDef *DMA_InitStruct);
  3004. uint32_t LL_DMA_DeInit(DMA_TypeDef *DMAx, uint32_t Stream);
  3005. void LL_DMA_StructInit(LL_DMA_InitTypeDef *DMA_InitStruct);
  3006. /**
  3007. * @}
  3008. */
  3009. #endif /* USE_FULL_LL_DRIVER */
  3010. /**
  3011. * @}
  3012. */
  3013. /**
  3014. * @}
  3015. */
  3016. #endif /* DMA1 || DMA2 */
  3017. /**
  3018. * @}
  3019. */
  3020. #ifdef __cplusplus
  3021. }
  3022. #endif
  3023. #endif /* __STM32H7xx_LL_DMA_H */