MK64F12_i2s.h 125 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463
  1. /*
  2. * Copyright (c) 2014, Freescale Semiconductor, Inc.
  3. * All rights reserved.
  4. *
  5. * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESS OR IMPLIED
  6. * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  7. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
  8. * SHALL FREESCALE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  9. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
  10. * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  11. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  12. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  13. * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
  14. * OF SUCH DAMAGE.
  15. */
  16. /*
  17. * WARNING! DO NOT EDIT THIS FILE DIRECTLY!
  18. *
  19. * This file was generated automatically and any changes may be lost.
  20. */
  21. #ifndef __HW_I2S_REGISTERS_H__
  22. #define __HW_I2S_REGISTERS_H__
  23. #include "regs.h"
  24. /*
  25. * MK64F12 I2S
  26. *
  27. * Inter-IC Sound / Synchronous Audio Interface
  28. *
  29. * Registers defined in this header file:
  30. * - HW_I2S_TCSR - SAI Transmit Control Register
  31. * - HW_I2S_TCR1 - SAI Transmit Configuration 1 Register
  32. * - HW_I2S_TCR2 - SAI Transmit Configuration 2 Register
  33. * - HW_I2S_TCR3 - SAI Transmit Configuration 3 Register
  34. * - HW_I2S_TCR4 - SAI Transmit Configuration 4 Register
  35. * - HW_I2S_TCR5 - SAI Transmit Configuration 5 Register
  36. * - HW_I2S_TDRn - SAI Transmit Data Register
  37. * - HW_I2S_TFRn - SAI Transmit FIFO Register
  38. * - HW_I2S_TMR - SAI Transmit Mask Register
  39. * - HW_I2S_RCSR - SAI Receive Control Register
  40. * - HW_I2S_RCR1 - SAI Receive Configuration 1 Register
  41. * - HW_I2S_RCR2 - SAI Receive Configuration 2 Register
  42. * - HW_I2S_RCR3 - SAI Receive Configuration 3 Register
  43. * - HW_I2S_RCR4 - SAI Receive Configuration 4 Register
  44. * - HW_I2S_RCR5 - SAI Receive Configuration 5 Register
  45. * - HW_I2S_RDRn - SAI Receive Data Register
  46. * - HW_I2S_RFRn - SAI Receive FIFO Register
  47. * - HW_I2S_RMR - SAI Receive Mask Register
  48. * - HW_I2S_MCR - SAI MCLK Control Register
  49. * - HW_I2S_MDR - SAI MCLK Divide Register
  50. *
  51. * - hw_i2s_t - Struct containing all module registers.
  52. */
  53. //! @name Module base addresses
  54. //@{
  55. #ifndef REGS_I2S_BASE
  56. #define HW_I2S_INSTANCE_COUNT (1U) //!< Number of instances of the I2S module.
  57. #define HW_I2S0 (0U) //!< Instance number for I2S0.
  58. #define REGS_I2S0_BASE (0x4002F000U) //!< Base address for I2S0.
  59. //! @brief Table of base addresses for I2S instances.
  60. static const uint32_t __g_regs_I2S_base_addresses[] = {
  61. REGS_I2S0_BASE,
  62. };
  63. //! @brief Get the base address of I2S by instance number.
  64. //! @param x I2S instance number, from 0 through 0.
  65. #define REGS_I2S_BASE(x) (__g_regs_I2S_base_addresses[(x)])
  66. //! @brief Get the instance number given a base address.
  67. //! @param b Base address for an instance of I2S.
  68. #define REGS_I2S_INSTANCE(b) ((b) == REGS_I2S0_BASE ? HW_I2S0 : 0)
  69. #endif
  70. //@}
  71. //-------------------------------------------------------------------------------------------
  72. // HW_I2S_TCSR - SAI Transmit Control Register
  73. //-------------------------------------------------------------------------------------------
  74. #ifndef __LANGUAGE_ASM__
  75. /*!
  76. * @brief HW_I2S_TCSR - SAI Transmit Control Register (RW)
  77. *
  78. * Reset value: 0x00000000U
  79. */
  80. typedef union _hw_i2s_tcsr
  81. {
  82. uint32_t U;
  83. struct _hw_i2s_tcsr_bitfields
  84. {
  85. uint32_t FRDE : 1; //!< [0] FIFO Request DMA Enable
  86. uint32_t FWDE : 1; //!< [1] FIFO Warning DMA Enable
  87. uint32_t RESERVED0 : 6; //!< [7:2]
  88. uint32_t FRIE : 1; //!< [8] FIFO Request Interrupt Enable
  89. uint32_t FWIE : 1; //!< [9] FIFO Warning Interrupt Enable
  90. uint32_t FEIE : 1; //!< [10] FIFO Error Interrupt Enable
  91. uint32_t SEIE : 1; //!< [11] Sync Error Interrupt Enable
  92. uint32_t WSIE : 1; //!< [12] Word Start Interrupt Enable
  93. uint32_t RESERVED1 : 3; //!< [15:13]
  94. uint32_t FRF : 1; //!< [16] FIFO Request Flag
  95. uint32_t FWF : 1; //!< [17] FIFO Warning Flag
  96. uint32_t FEF : 1; //!< [18] FIFO Error Flag
  97. uint32_t SEF : 1; //!< [19] Sync Error Flag
  98. uint32_t WSF : 1; //!< [20] Word Start Flag
  99. uint32_t RESERVED2 : 3; //!< [23:21]
  100. uint32_t SR : 1; //!< [24] Software Reset
  101. uint32_t FR : 1; //!< [25] FIFO Reset
  102. uint32_t RESERVED3 : 2; //!< [27:26]
  103. uint32_t BCE : 1; //!< [28] Bit Clock Enable
  104. uint32_t DBGE : 1; //!< [29] Debug Enable
  105. uint32_t STOPE : 1; //!< [30] Stop Enable
  106. uint32_t TE : 1; //!< [31] Transmitter Enable
  107. } B;
  108. } hw_i2s_tcsr_t;
  109. #endif
  110. /*!
  111. * @name Constants and macros for entire I2S_TCSR register
  112. */
  113. //@{
  114. #define HW_I2S_TCSR_ADDR(x) (REGS_I2S_BASE(x) + 0x0U)
  115. #ifndef __LANGUAGE_ASM__
  116. #define HW_I2S_TCSR(x) (*(__IO hw_i2s_tcsr_t *) HW_I2S_TCSR_ADDR(x))
  117. #define HW_I2S_TCSR_RD(x) (HW_I2S_TCSR(x).U)
  118. #define HW_I2S_TCSR_WR(x, v) (HW_I2S_TCSR(x).U = (v))
  119. #define HW_I2S_TCSR_SET(x, v) (HW_I2S_TCSR_WR(x, HW_I2S_TCSR_RD(x) | (v)))
  120. #define HW_I2S_TCSR_CLR(x, v) (HW_I2S_TCSR_WR(x, HW_I2S_TCSR_RD(x) & ~(v)))
  121. #define HW_I2S_TCSR_TOG(x, v) (HW_I2S_TCSR_WR(x, HW_I2S_TCSR_RD(x) ^ (v)))
  122. #endif
  123. //@}
  124. /*
  125. * Constants & macros for individual I2S_TCSR bitfields
  126. */
  127. /*!
  128. * @name Register I2S_TCSR, field FRDE[0] (RW)
  129. *
  130. * Enables/disables DMA requests.
  131. *
  132. * Values:
  133. * - 0 - Disables the DMA request.
  134. * - 1 - Enables the DMA request.
  135. */
  136. //@{
  137. #define BP_I2S_TCSR_FRDE (0U) //!< Bit position for I2S_TCSR_FRDE.
  138. #define BM_I2S_TCSR_FRDE (0x00000001U) //!< Bit mask for I2S_TCSR_FRDE.
  139. #define BS_I2S_TCSR_FRDE (1U) //!< Bit field size in bits for I2S_TCSR_FRDE.
  140. #ifndef __LANGUAGE_ASM__
  141. //! @brief Read current value of the I2S_TCSR_FRDE field.
  142. #define BR_I2S_TCSR_FRDE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FRDE))
  143. #endif
  144. //! @brief Format value for bitfield I2S_TCSR_FRDE.
  145. #define BF_I2S_TCSR_FRDE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FRDE), uint32_t) & BM_I2S_TCSR_FRDE)
  146. #ifndef __LANGUAGE_ASM__
  147. //! @brief Set the FRDE field to a new value.
  148. #define BW_I2S_TCSR_FRDE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FRDE) = (v))
  149. #endif
  150. //@}
  151. /*!
  152. * @name Register I2S_TCSR, field FWDE[1] (RW)
  153. *
  154. * Enables/disables DMA requests.
  155. *
  156. * Values:
  157. * - 0 - Disables the DMA request.
  158. * - 1 - Enables the DMA request.
  159. */
  160. //@{
  161. #define BP_I2S_TCSR_FWDE (1U) //!< Bit position for I2S_TCSR_FWDE.
  162. #define BM_I2S_TCSR_FWDE (0x00000002U) //!< Bit mask for I2S_TCSR_FWDE.
  163. #define BS_I2S_TCSR_FWDE (1U) //!< Bit field size in bits for I2S_TCSR_FWDE.
  164. #ifndef __LANGUAGE_ASM__
  165. //! @brief Read current value of the I2S_TCSR_FWDE field.
  166. #define BR_I2S_TCSR_FWDE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FWDE))
  167. #endif
  168. //! @brief Format value for bitfield I2S_TCSR_FWDE.
  169. #define BF_I2S_TCSR_FWDE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FWDE), uint32_t) & BM_I2S_TCSR_FWDE)
  170. #ifndef __LANGUAGE_ASM__
  171. //! @brief Set the FWDE field to a new value.
  172. #define BW_I2S_TCSR_FWDE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FWDE) = (v))
  173. #endif
  174. //@}
  175. /*!
  176. * @name Register I2S_TCSR, field FRIE[8] (RW)
  177. *
  178. * Enables/disables FIFO request interrupts.
  179. *
  180. * Values:
  181. * - 0 - Disables the interrupt.
  182. * - 1 - Enables the interrupt.
  183. */
  184. //@{
  185. #define BP_I2S_TCSR_FRIE (8U) //!< Bit position for I2S_TCSR_FRIE.
  186. #define BM_I2S_TCSR_FRIE (0x00000100U) //!< Bit mask for I2S_TCSR_FRIE.
  187. #define BS_I2S_TCSR_FRIE (1U) //!< Bit field size in bits for I2S_TCSR_FRIE.
  188. #ifndef __LANGUAGE_ASM__
  189. //! @brief Read current value of the I2S_TCSR_FRIE field.
  190. #define BR_I2S_TCSR_FRIE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FRIE))
  191. #endif
  192. //! @brief Format value for bitfield I2S_TCSR_FRIE.
  193. #define BF_I2S_TCSR_FRIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FRIE), uint32_t) & BM_I2S_TCSR_FRIE)
  194. #ifndef __LANGUAGE_ASM__
  195. //! @brief Set the FRIE field to a new value.
  196. #define BW_I2S_TCSR_FRIE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FRIE) = (v))
  197. #endif
  198. //@}
  199. /*!
  200. * @name Register I2S_TCSR, field FWIE[9] (RW)
  201. *
  202. * Enables/disables FIFO warning interrupts.
  203. *
  204. * Values:
  205. * - 0 - Disables the interrupt.
  206. * - 1 - Enables the interrupt.
  207. */
  208. //@{
  209. #define BP_I2S_TCSR_FWIE (9U) //!< Bit position for I2S_TCSR_FWIE.
  210. #define BM_I2S_TCSR_FWIE (0x00000200U) //!< Bit mask for I2S_TCSR_FWIE.
  211. #define BS_I2S_TCSR_FWIE (1U) //!< Bit field size in bits for I2S_TCSR_FWIE.
  212. #ifndef __LANGUAGE_ASM__
  213. //! @brief Read current value of the I2S_TCSR_FWIE field.
  214. #define BR_I2S_TCSR_FWIE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FWIE))
  215. #endif
  216. //! @brief Format value for bitfield I2S_TCSR_FWIE.
  217. #define BF_I2S_TCSR_FWIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FWIE), uint32_t) & BM_I2S_TCSR_FWIE)
  218. #ifndef __LANGUAGE_ASM__
  219. //! @brief Set the FWIE field to a new value.
  220. #define BW_I2S_TCSR_FWIE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FWIE) = (v))
  221. #endif
  222. //@}
  223. /*!
  224. * @name Register I2S_TCSR, field FEIE[10] (RW)
  225. *
  226. * Enables/disables FIFO error interrupts.
  227. *
  228. * Values:
  229. * - 0 - Disables the interrupt.
  230. * - 1 - Enables the interrupt.
  231. */
  232. //@{
  233. #define BP_I2S_TCSR_FEIE (10U) //!< Bit position for I2S_TCSR_FEIE.
  234. #define BM_I2S_TCSR_FEIE (0x00000400U) //!< Bit mask for I2S_TCSR_FEIE.
  235. #define BS_I2S_TCSR_FEIE (1U) //!< Bit field size in bits for I2S_TCSR_FEIE.
  236. #ifndef __LANGUAGE_ASM__
  237. //! @brief Read current value of the I2S_TCSR_FEIE field.
  238. #define BR_I2S_TCSR_FEIE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FEIE))
  239. #endif
  240. //! @brief Format value for bitfield I2S_TCSR_FEIE.
  241. #define BF_I2S_TCSR_FEIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FEIE), uint32_t) & BM_I2S_TCSR_FEIE)
  242. #ifndef __LANGUAGE_ASM__
  243. //! @brief Set the FEIE field to a new value.
  244. #define BW_I2S_TCSR_FEIE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FEIE) = (v))
  245. #endif
  246. //@}
  247. /*!
  248. * @name Register I2S_TCSR, field SEIE[11] (RW)
  249. *
  250. * Enables/disables sync error interrupts.
  251. *
  252. * Values:
  253. * - 0 - Disables interrupt.
  254. * - 1 - Enables interrupt.
  255. */
  256. //@{
  257. #define BP_I2S_TCSR_SEIE (11U) //!< Bit position for I2S_TCSR_SEIE.
  258. #define BM_I2S_TCSR_SEIE (0x00000800U) //!< Bit mask for I2S_TCSR_SEIE.
  259. #define BS_I2S_TCSR_SEIE (1U) //!< Bit field size in bits for I2S_TCSR_SEIE.
  260. #ifndef __LANGUAGE_ASM__
  261. //! @brief Read current value of the I2S_TCSR_SEIE field.
  262. #define BR_I2S_TCSR_SEIE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SEIE))
  263. #endif
  264. //! @brief Format value for bitfield I2S_TCSR_SEIE.
  265. #define BF_I2S_TCSR_SEIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_SEIE), uint32_t) & BM_I2S_TCSR_SEIE)
  266. #ifndef __LANGUAGE_ASM__
  267. //! @brief Set the SEIE field to a new value.
  268. #define BW_I2S_TCSR_SEIE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SEIE) = (v))
  269. #endif
  270. //@}
  271. /*!
  272. * @name Register I2S_TCSR, field WSIE[12] (RW)
  273. *
  274. * Enables/disables word start interrupts.
  275. *
  276. * Values:
  277. * - 0 - Disables interrupt.
  278. * - 1 - Enables interrupt.
  279. */
  280. //@{
  281. #define BP_I2S_TCSR_WSIE (12U) //!< Bit position for I2S_TCSR_WSIE.
  282. #define BM_I2S_TCSR_WSIE (0x00001000U) //!< Bit mask for I2S_TCSR_WSIE.
  283. #define BS_I2S_TCSR_WSIE (1U) //!< Bit field size in bits for I2S_TCSR_WSIE.
  284. #ifndef __LANGUAGE_ASM__
  285. //! @brief Read current value of the I2S_TCSR_WSIE field.
  286. #define BR_I2S_TCSR_WSIE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_WSIE))
  287. #endif
  288. //! @brief Format value for bitfield I2S_TCSR_WSIE.
  289. #define BF_I2S_TCSR_WSIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_WSIE), uint32_t) & BM_I2S_TCSR_WSIE)
  290. #ifndef __LANGUAGE_ASM__
  291. //! @brief Set the WSIE field to a new value.
  292. #define BW_I2S_TCSR_WSIE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_WSIE) = (v))
  293. #endif
  294. //@}
  295. /*!
  296. * @name Register I2S_TCSR, field FRF[16] (RO)
  297. *
  298. * Indicates that the number of words in an enabled transmit channel FIFO is
  299. * less than or equal to the transmit FIFO watermark.
  300. *
  301. * Values:
  302. * - 0 - Transmit FIFO watermark has not been reached.
  303. * - 1 - Transmit FIFO watermark has been reached.
  304. */
  305. //@{
  306. #define BP_I2S_TCSR_FRF (16U) //!< Bit position for I2S_TCSR_FRF.
  307. #define BM_I2S_TCSR_FRF (0x00010000U) //!< Bit mask for I2S_TCSR_FRF.
  308. #define BS_I2S_TCSR_FRF (1U) //!< Bit field size in bits for I2S_TCSR_FRF.
  309. #ifndef __LANGUAGE_ASM__
  310. //! @brief Read current value of the I2S_TCSR_FRF field.
  311. #define BR_I2S_TCSR_FRF(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FRF))
  312. #endif
  313. //@}
  314. /*!
  315. * @name Register I2S_TCSR, field FWF[17] (RO)
  316. *
  317. * Indicates that an enabled transmit FIFO is empty.
  318. *
  319. * Values:
  320. * - 0 - No enabled transmit FIFO is empty.
  321. * - 1 - Enabled transmit FIFO is empty.
  322. */
  323. //@{
  324. #define BP_I2S_TCSR_FWF (17U) //!< Bit position for I2S_TCSR_FWF.
  325. #define BM_I2S_TCSR_FWF (0x00020000U) //!< Bit mask for I2S_TCSR_FWF.
  326. #define BS_I2S_TCSR_FWF (1U) //!< Bit field size in bits for I2S_TCSR_FWF.
  327. #ifndef __LANGUAGE_ASM__
  328. //! @brief Read current value of the I2S_TCSR_FWF field.
  329. #define BR_I2S_TCSR_FWF(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FWF))
  330. #endif
  331. //@}
  332. /*!
  333. * @name Register I2S_TCSR, field FEF[18] (W1C)
  334. *
  335. * Indicates that an enabled transmit FIFO has underrun. Write a logic 1 to this
  336. * field to clear this flag.
  337. *
  338. * Values:
  339. * - 0 - Transmit underrun not detected.
  340. * - 1 - Transmit underrun detected.
  341. */
  342. //@{
  343. #define BP_I2S_TCSR_FEF (18U) //!< Bit position for I2S_TCSR_FEF.
  344. #define BM_I2S_TCSR_FEF (0x00040000U) //!< Bit mask for I2S_TCSR_FEF.
  345. #define BS_I2S_TCSR_FEF (1U) //!< Bit field size in bits for I2S_TCSR_FEF.
  346. #ifndef __LANGUAGE_ASM__
  347. //! @brief Read current value of the I2S_TCSR_FEF field.
  348. #define BR_I2S_TCSR_FEF(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FEF))
  349. #endif
  350. //! @brief Format value for bitfield I2S_TCSR_FEF.
  351. #define BF_I2S_TCSR_FEF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FEF), uint32_t) & BM_I2S_TCSR_FEF)
  352. #ifndef __LANGUAGE_ASM__
  353. //! @brief Set the FEF field to a new value.
  354. #define BW_I2S_TCSR_FEF(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FEF) = (v))
  355. #endif
  356. //@}
  357. /*!
  358. * @name Register I2S_TCSR, field SEF[19] (W1C)
  359. *
  360. * Indicates that an error in the externally-generated frame sync has been
  361. * detected. Write a logic 1 to this field to clear this flag.
  362. *
  363. * Values:
  364. * - 0 - Sync error not detected.
  365. * - 1 - Frame sync error detected.
  366. */
  367. //@{
  368. #define BP_I2S_TCSR_SEF (19U) //!< Bit position for I2S_TCSR_SEF.
  369. #define BM_I2S_TCSR_SEF (0x00080000U) //!< Bit mask for I2S_TCSR_SEF.
  370. #define BS_I2S_TCSR_SEF (1U) //!< Bit field size in bits for I2S_TCSR_SEF.
  371. #ifndef __LANGUAGE_ASM__
  372. //! @brief Read current value of the I2S_TCSR_SEF field.
  373. #define BR_I2S_TCSR_SEF(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SEF))
  374. #endif
  375. //! @brief Format value for bitfield I2S_TCSR_SEF.
  376. #define BF_I2S_TCSR_SEF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_SEF), uint32_t) & BM_I2S_TCSR_SEF)
  377. #ifndef __LANGUAGE_ASM__
  378. //! @brief Set the SEF field to a new value.
  379. #define BW_I2S_TCSR_SEF(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SEF) = (v))
  380. #endif
  381. //@}
  382. /*!
  383. * @name Register I2S_TCSR, field WSF[20] (W1C)
  384. *
  385. * Indicates that the start of the configured word has been detected. Write a
  386. * logic 1 to this field to clear this flag.
  387. *
  388. * Values:
  389. * - 0 - Start of word not detected.
  390. * - 1 - Start of word detected.
  391. */
  392. //@{
  393. #define BP_I2S_TCSR_WSF (20U) //!< Bit position for I2S_TCSR_WSF.
  394. #define BM_I2S_TCSR_WSF (0x00100000U) //!< Bit mask for I2S_TCSR_WSF.
  395. #define BS_I2S_TCSR_WSF (1U) //!< Bit field size in bits for I2S_TCSR_WSF.
  396. #ifndef __LANGUAGE_ASM__
  397. //! @brief Read current value of the I2S_TCSR_WSF field.
  398. #define BR_I2S_TCSR_WSF(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_WSF))
  399. #endif
  400. //! @brief Format value for bitfield I2S_TCSR_WSF.
  401. #define BF_I2S_TCSR_WSF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_WSF), uint32_t) & BM_I2S_TCSR_WSF)
  402. #ifndef __LANGUAGE_ASM__
  403. //! @brief Set the WSF field to a new value.
  404. #define BW_I2S_TCSR_WSF(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_WSF) = (v))
  405. #endif
  406. //@}
  407. /*!
  408. * @name Register I2S_TCSR, field SR[24] (RW)
  409. *
  410. * When set, resets the internal transmitter logic including the FIFO pointers.
  411. * Software-visible registers are not affected, except for the status registers.
  412. *
  413. * Values:
  414. * - 0 - No effect.
  415. * - 1 - Software reset.
  416. */
  417. //@{
  418. #define BP_I2S_TCSR_SR (24U) //!< Bit position for I2S_TCSR_SR.
  419. #define BM_I2S_TCSR_SR (0x01000000U) //!< Bit mask for I2S_TCSR_SR.
  420. #define BS_I2S_TCSR_SR (1U) //!< Bit field size in bits for I2S_TCSR_SR.
  421. #ifndef __LANGUAGE_ASM__
  422. //! @brief Read current value of the I2S_TCSR_SR field.
  423. #define BR_I2S_TCSR_SR(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SR))
  424. #endif
  425. //! @brief Format value for bitfield I2S_TCSR_SR.
  426. #define BF_I2S_TCSR_SR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_SR), uint32_t) & BM_I2S_TCSR_SR)
  427. #ifndef __LANGUAGE_ASM__
  428. //! @brief Set the SR field to a new value.
  429. #define BW_I2S_TCSR_SR(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_SR) = (v))
  430. #endif
  431. //@}
  432. /*!
  433. * @name Register I2S_TCSR, field FR[25] (WORZ)
  434. *
  435. * Resets the FIFO pointers. Reading this field will always return zero. FIFO
  436. * pointers should only be reset when the transmitter is disabled or the FIFO error
  437. * flag is set.
  438. *
  439. * Values:
  440. * - 0 - No effect.
  441. * - 1 - FIFO reset.
  442. */
  443. //@{
  444. #define BP_I2S_TCSR_FR (25U) //!< Bit position for I2S_TCSR_FR.
  445. #define BM_I2S_TCSR_FR (0x02000000U) //!< Bit mask for I2S_TCSR_FR.
  446. #define BS_I2S_TCSR_FR (1U) //!< Bit field size in bits for I2S_TCSR_FR.
  447. //! @brief Format value for bitfield I2S_TCSR_FR.
  448. #define BF_I2S_TCSR_FR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_FR), uint32_t) & BM_I2S_TCSR_FR)
  449. #ifndef __LANGUAGE_ASM__
  450. //! @brief Set the FR field to a new value.
  451. #define BW_I2S_TCSR_FR(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_FR) = (v))
  452. #endif
  453. //@}
  454. /*!
  455. * @name Register I2S_TCSR, field BCE[28] (RW)
  456. *
  457. * Enables the transmit bit clock, separately from the TE. This field is
  458. * automatically set whenever TE is set. When software clears this field, the transmit
  459. * bit clock remains enabled, and this bit remains set, until the end of the
  460. * current frame.
  461. *
  462. * Values:
  463. * - 0 - Transmit bit clock is disabled.
  464. * - 1 - Transmit bit clock is enabled.
  465. */
  466. //@{
  467. #define BP_I2S_TCSR_BCE (28U) //!< Bit position for I2S_TCSR_BCE.
  468. #define BM_I2S_TCSR_BCE (0x10000000U) //!< Bit mask for I2S_TCSR_BCE.
  469. #define BS_I2S_TCSR_BCE (1U) //!< Bit field size in bits for I2S_TCSR_BCE.
  470. #ifndef __LANGUAGE_ASM__
  471. //! @brief Read current value of the I2S_TCSR_BCE field.
  472. #define BR_I2S_TCSR_BCE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_BCE))
  473. #endif
  474. //! @brief Format value for bitfield I2S_TCSR_BCE.
  475. #define BF_I2S_TCSR_BCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_BCE), uint32_t) & BM_I2S_TCSR_BCE)
  476. #ifndef __LANGUAGE_ASM__
  477. //! @brief Set the BCE field to a new value.
  478. #define BW_I2S_TCSR_BCE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_BCE) = (v))
  479. #endif
  480. //@}
  481. /*!
  482. * @name Register I2S_TCSR, field DBGE[29] (RW)
  483. *
  484. * Enables/disables transmitter operation in Debug mode. The transmit bit clock
  485. * is not affected by debug mode.
  486. *
  487. * Values:
  488. * - 0 - Transmitter is disabled in Debug mode, after completing the current
  489. * frame.
  490. * - 1 - Transmitter is enabled in Debug mode.
  491. */
  492. //@{
  493. #define BP_I2S_TCSR_DBGE (29U) //!< Bit position for I2S_TCSR_DBGE.
  494. #define BM_I2S_TCSR_DBGE (0x20000000U) //!< Bit mask for I2S_TCSR_DBGE.
  495. #define BS_I2S_TCSR_DBGE (1U) //!< Bit field size in bits for I2S_TCSR_DBGE.
  496. #ifndef __LANGUAGE_ASM__
  497. //! @brief Read current value of the I2S_TCSR_DBGE field.
  498. #define BR_I2S_TCSR_DBGE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_DBGE))
  499. #endif
  500. //! @brief Format value for bitfield I2S_TCSR_DBGE.
  501. #define BF_I2S_TCSR_DBGE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_DBGE), uint32_t) & BM_I2S_TCSR_DBGE)
  502. #ifndef __LANGUAGE_ASM__
  503. //! @brief Set the DBGE field to a new value.
  504. #define BW_I2S_TCSR_DBGE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_DBGE) = (v))
  505. #endif
  506. //@}
  507. /*!
  508. * @name Register I2S_TCSR, field STOPE[30] (RW)
  509. *
  510. * Configures transmitter operation in Stop mode. This field is ignored and the
  511. * transmitter is disabled in all low-leakage stop modes.
  512. *
  513. * Values:
  514. * - 0 - Transmitter disabled in Stop mode.
  515. * - 1 - Transmitter enabled in Stop mode.
  516. */
  517. //@{
  518. #define BP_I2S_TCSR_STOPE (30U) //!< Bit position for I2S_TCSR_STOPE.
  519. #define BM_I2S_TCSR_STOPE (0x40000000U) //!< Bit mask for I2S_TCSR_STOPE.
  520. #define BS_I2S_TCSR_STOPE (1U) //!< Bit field size in bits for I2S_TCSR_STOPE.
  521. #ifndef __LANGUAGE_ASM__
  522. //! @brief Read current value of the I2S_TCSR_STOPE field.
  523. #define BR_I2S_TCSR_STOPE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_STOPE))
  524. #endif
  525. //! @brief Format value for bitfield I2S_TCSR_STOPE.
  526. #define BF_I2S_TCSR_STOPE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_STOPE), uint32_t) & BM_I2S_TCSR_STOPE)
  527. #ifndef __LANGUAGE_ASM__
  528. //! @brief Set the STOPE field to a new value.
  529. #define BW_I2S_TCSR_STOPE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_STOPE) = (v))
  530. #endif
  531. //@}
  532. /*!
  533. * @name Register I2S_TCSR, field TE[31] (RW)
  534. *
  535. * Enables/disables the transmitter. When software clears this field, the
  536. * transmitter remains enabled, and this bit remains set, until the end of the current
  537. * frame.
  538. *
  539. * Values:
  540. * - 0 - Transmitter is disabled.
  541. * - 1 - Transmitter is enabled, or transmitter has been disabled and has not
  542. * yet reached end of frame.
  543. */
  544. //@{
  545. #define BP_I2S_TCSR_TE (31U) //!< Bit position for I2S_TCSR_TE.
  546. #define BM_I2S_TCSR_TE (0x80000000U) //!< Bit mask for I2S_TCSR_TE.
  547. #define BS_I2S_TCSR_TE (1U) //!< Bit field size in bits for I2S_TCSR_TE.
  548. #ifndef __LANGUAGE_ASM__
  549. //! @brief Read current value of the I2S_TCSR_TE field.
  550. #define BR_I2S_TCSR_TE(x) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_TE))
  551. #endif
  552. //! @brief Format value for bitfield I2S_TCSR_TE.
  553. #define BF_I2S_TCSR_TE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCSR_TE), uint32_t) & BM_I2S_TCSR_TE)
  554. #ifndef __LANGUAGE_ASM__
  555. //! @brief Set the TE field to a new value.
  556. #define BW_I2S_TCSR_TE(x, v) (BITBAND_ACCESS32(HW_I2S_TCSR_ADDR(x), BP_I2S_TCSR_TE) = (v))
  557. #endif
  558. //@}
  559. //-------------------------------------------------------------------------------------------
  560. // HW_I2S_TCR1 - SAI Transmit Configuration 1 Register
  561. //-------------------------------------------------------------------------------------------
  562. #ifndef __LANGUAGE_ASM__
  563. /*!
  564. * @brief HW_I2S_TCR1 - SAI Transmit Configuration 1 Register (RW)
  565. *
  566. * Reset value: 0x00000000U
  567. */
  568. typedef union _hw_i2s_tcr1
  569. {
  570. uint32_t U;
  571. struct _hw_i2s_tcr1_bitfields
  572. {
  573. uint32_t TFW : 3; //!< [2:0] Transmit FIFO Watermark
  574. uint32_t RESERVED0 : 29; //!< [31:3]
  575. } B;
  576. } hw_i2s_tcr1_t;
  577. #endif
  578. /*!
  579. * @name Constants and macros for entire I2S_TCR1 register
  580. */
  581. //@{
  582. #define HW_I2S_TCR1_ADDR(x) (REGS_I2S_BASE(x) + 0x4U)
  583. #ifndef __LANGUAGE_ASM__
  584. #define HW_I2S_TCR1(x) (*(__IO hw_i2s_tcr1_t *) HW_I2S_TCR1_ADDR(x))
  585. #define HW_I2S_TCR1_RD(x) (HW_I2S_TCR1(x).U)
  586. #define HW_I2S_TCR1_WR(x, v) (HW_I2S_TCR1(x).U = (v))
  587. #define HW_I2S_TCR1_SET(x, v) (HW_I2S_TCR1_WR(x, HW_I2S_TCR1_RD(x) | (v)))
  588. #define HW_I2S_TCR1_CLR(x, v) (HW_I2S_TCR1_WR(x, HW_I2S_TCR1_RD(x) & ~(v)))
  589. #define HW_I2S_TCR1_TOG(x, v) (HW_I2S_TCR1_WR(x, HW_I2S_TCR1_RD(x) ^ (v)))
  590. #endif
  591. //@}
  592. /*
  593. * Constants & macros for individual I2S_TCR1 bitfields
  594. */
  595. /*!
  596. * @name Register I2S_TCR1, field TFW[2:0] (RW)
  597. *
  598. * Configures the watermark level for all enabled transmit channels.
  599. */
  600. //@{
  601. #define BP_I2S_TCR1_TFW (0U) //!< Bit position for I2S_TCR1_TFW.
  602. #define BM_I2S_TCR1_TFW (0x00000007U) //!< Bit mask for I2S_TCR1_TFW.
  603. #define BS_I2S_TCR1_TFW (3U) //!< Bit field size in bits for I2S_TCR1_TFW.
  604. #ifndef __LANGUAGE_ASM__
  605. //! @brief Read current value of the I2S_TCR1_TFW field.
  606. #define BR_I2S_TCR1_TFW(x) (HW_I2S_TCR1(x).B.TFW)
  607. #endif
  608. //! @brief Format value for bitfield I2S_TCR1_TFW.
  609. #define BF_I2S_TCR1_TFW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR1_TFW), uint32_t) & BM_I2S_TCR1_TFW)
  610. #ifndef __LANGUAGE_ASM__
  611. //! @brief Set the TFW field to a new value.
  612. #define BW_I2S_TCR1_TFW(x, v) (HW_I2S_TCR1_WR(x, (HW_I2S_TCR1_RD(x) & ~BM_I2S_TCR1_TFW) | BF_I2S_TCR1_TFW(v)))
  613. #endif
  614. //@}
  615. //-------------------------------------------------------------------------------------------
  616. // HW_I2S_TCR2 - SAI Transmit Configuration 2 Register
  617. //-------------------------------------------------------------------------------------------
  618. #ifndef __LANGUAGE_ASM__
  619. /*!
  620. * @brief HW_I2S_TCR2 - SAI Transmit Configuration 2 Register (RW)
  621. *
  622. * Reset value: 0x00000000U
  623. *
  624. * This register must not be altered when TCSR[TE] is set.
  625. */
  626. typedef union _hw_i2s_tcr2
  627. {
  628. uint32_t U;
  629. struct _hw_i2s_tcr2_bitfields
  630. {
  631. uint32_t DIV : 8; //!< [7:0] Bit Clock Divide
  632. uint32_t RESERVED0 : 16; //!< [23:8]
  633. uint32_t BCD : 1; //!< [24] Bit Clock Direction
  634. uint32_t BCP : 1; //!< [25] Bit Clock Polarity
  635. uint32_t MSEL : 2; //!< [27:26] MCLK Select
  636. uint32_t BCI : 1; //!< [28] Bit Clock Input
  637. uint32_t BCS : 1; //!< [29] Bit Clock Swap
  638. uint32_t SYNC : 2; //!< [31:30] Synchronous Mode
  639. } B;
  640. } hw_i2s_tcr2_t;
  641. #endif
  642. /*!
  643. * @name Constants and macros for entire I2S_TCR2 register
  644. */
  645. //@{
  646. #define HW_I2S_TCR2_ADDR(x) (REGS_I2S_BASE(x) + 0x8U)
  647. #ifndef __LANGUAGE_ASM__
  648. #define HW_I2S_TCR2(x) (*(__IO hw_i2s_tcr2_t *) HW_I2S_TCR2_ADDR(x))
  649. #define HW_I2S_TCR2_RD(x) (HW_I2S_TCR2(x).U)
  650. #define HW_I2S_TCR2_WR(x, v) (HW_I2S_TCR2(x).U = (v))
  651. #define HW_I2S_TCR2_SET(x, v) (HW_I2S_TCR2_WR(x, HW_I2S_TCR2_RD(x) | (v)))
  652. #define HW_I2S_TCR2_CLR(x, v) (HW_I2S_TCR2_WR(x, HW_I2S_TCR2_RD(x) & ~(v)))
  653. #define HW_I2S_TCR2_TOG(x, v) (HW_I2S_TCR2_WR(x, HW_I2S_TCR2_RD(x) ^ (v)))
  654. #endif
  655. //@}
  656. /*
  657. * Constants & macros for individual I2S_TCR2 bitfields
  658. */
  659. /*!
  660. * @name Register I2S_TCR2, field DIV[7:0] (RW)
  661. *
  662. * Divides down the audio master clock to generate the bit clock when configured
  663. * for an internal bit clock. The division value is (DIV + 1) * 2.
  664. */
  665. //@{
  666. #define BP_I2S_TCR2_DIV (0U) //!< Bit position for I2S_TCR2_DIV.
  667. #define BM_I2S_TCR2_DIV (0x000000FFU) //!< Bit mask for I2S_TCR2_DIV.
  668. #define BS_I2S_TCR2_DIV (8U) //!< Bit field size in bits for I2S_TCR2_DIV.
  669. #ifndef __LANGUAGE_ASM__
  670. //! @brief Read current value of the I2S_TCR2_DIV field.
  671. #define BR_I2S_TCR2_DIV(x) (HW_I2S_TCR2(x).B.DIV)
  672. #endif
  673. //! @brief Format value for bitfield I2S_TCR2_DIV.
  674. #define BF_I2S_TCR2_DIV(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_DIV), uint32_t) & BM_I2S_TCR2_DIV)
  675. #ifndef __LANGUAGE_ASM__
  676. //! @brief Set the DIV field to a new value.
  677. #define BW_I2S_TCR2_DIV(x, v) (HW_I2S_TCR2_WR(x, (HW_I2S_TCR2_RD(x) & ~BM_I2S_TCR2_DIV) | BF_I2S_TCR2_DIV(v)))
  678. #endif
  679. //@}
  680. /*!
  681. * @name Register I2S_TCR2, field BCD[24] (RW)
  682. *
  683. * Configures the direction of the bit clock.
  684. *
  685. * Values:
  686. * - 0 - Bit clock is generated externally in Slave mode.
  687. * - 1 - Bit clock is generated internally in Master mode.
  688. */
  689. //@{
  690. #define BP_I2S_TCR2_BCD (24U) //!< Bit position for I2S_TCR2_BCD.
  691. #define BM_I2S_TCR2_BCD (0x01000000U) //!< Bit mask for I2S_TCR2_BCD.
  692. #define BS_I2S_TCR2_BCD (1U) //!< Bit field size in bits for I2S_TCR2_BCD.
  693. #ifndef __LANGUAGE_ASM__
  694. //! @brief Read current value of the I2S_TCR2_BCD field.
  695. #define BR_I2S_TCR2_BCD(x) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCD))
  696. #endif
  697. //! @brief Format value for bitfield I2S_TCR2_BCD.
  698. #define BF_I2S_TCR2_BCD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_BCD), uint32_t) & BM_I2S_TCR2_BCD)
  699. #ifndef __LANGUAGE_ASM__
  700. //! @brief Set the BCD field to a new value.
  701. #define BW_I2S_TCR2_BCD(x, v) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCD) = (v))
  702. #endif
  703. //@}
  704. /*!
  705. * @name Register I2S_TCR2, field BCP[25] (RW)
  706. *
  707. * Configures the polarity of the bit clock.
  708. *
  709. * Values:
  710. * - 0 - Bit clock is active high with drive outputs on rising edge and sample
  711. * inputs on falling edge.
  712. * - 1 - Bit clock is active low with drive outputs on falling edge and sample
  713. * inputs on rising edge.
  714. */
  715. //@{
  716. #define BP_I2S_TCR2_BCP (25U) //!< Bit position for I2S_TCR2_BCP.
  717. #define BM_I2S_TCR2_BCP (0x02000000U) //!< Bit mask for I2S_TCR2_BCP.
  718. #define BS_I2S_TCR2_BCP (1U) //!< Bit field size in bits for I2S_TCR2_BCP.
  719. #ifndef __LANGUAGE_ASM__
  720. //! @brief Read current value of the I2S_TCR2_BCP field.
  721. #define BR_I2S_TCR2_BCP(x) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCP))
  722. #endif
  723. //! @brief Format value for bitfield I2S_TCR2_BCP.
  724. #define BF_I2S_TCR2_BCP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_BCP), uint32_t) & BM_I2S_TCR2_BCP)
  725. #ifndef __LANGUAGE_ASM__
  726. //! @brief Set the BCP field to a new value.
  727. #define BW_I2S_TCR2_BCP(x, v) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCP) = (v))
  728. #endif
  729. //@}
  730. /*!
  731. * @name Register I2S_TCR2, field MSEL[27:26] (RW)
  732. *
  733. * Selects the audio Master Clock option used to generate an internally
  734. * generated bit clock. This field has no effect when configured for an externally
  735. * generated bit clock. Depending on the device, some Master Clock options might not be
  736. * available. See the chip configuration details for the availability and
  737. * chip-specific meaning of each option.
  738. *
  739. * Values:
  740. * - 00 - Bus Clock selected.
  741. * - 01 - Master Clock (MCLK) 1 option selected.
  742. * - 10 - Master Clock (MCLK) 2 option selected.
  743. * - 11 - Master Clock (MCLK) 3 option selected.
  744. */
  745. //@{
  746. #define BP_I2S_TCR2_MSEL (26U) //!< Bit position for I2S_TCR2_MSEL.
  747. #define BM_I2S_TCR2_MSEL (0x0C000000U) //!< Bit mask for I2S_TCR2_MSEL.
  748. #define BS_I2S_TCR2_MSEL (2U) //!< Bit field size in bits for I2S_TCR2_MSEL.
  749. #ifndef __LANGUAGE_ASM__
  750. //! @brief Read current value of the I2S_TCR2_MSEL field.
  751. #define BR_I2S_TCR2_MSEL(x) (HW_I2S_TCR2(x).B.MSEL)
  752. #endif
  753. //! @brief Format value for bitfield I2S_TCR2_MSEL.
  754. #define BF_I2S_TCR2_MSEL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_MSEL), uint32_t) & BM_I2S_TCR2_MSEL)
  755. #ifndef __LANGUAGE_ASM__
  756. //! @brief Set the MSEL field to a new value.
  757. #define BW_I2S_TCR2_MSEL(x, v) (HW_I2S_TCR2_WR(x, (HW_I2S_TCR2_RD(x) & ~BM_I2S_TCR2_MSEL) | BF_I2S_TCR2_MSEL(v)))
  758. #endif
  759. //@}
  760. /*!
  761. * @name Register I2S_TCR2, field BCI[28] (RW)
  762. *
  763. * When this field is set and using an internally generated bit clock in either
  764. * synchronous or asynchronous mode, the bit clock actually used by the
  765. * transmitter is delayed by the pad output delay (the transmitter is clocked by the pad
  766. * input as if the clock was externally generated). This has the effect of
  767. * decreasing the data input setup time, but increasing the data output valid time. The
  768. * slave mode timing from the datasheet should be used for the transmitter when
  769. * this bit is set. In synchronous mode, this bit allows the transmitter to use
  770. * the slave mode timing from the datasheet, while the receiver uses the master
  771. * mode timing. This field has no effect when configured for an externally generated
  772. * bit clock or when synchronous to another SAI peripheral .
  773. *
  774. * Values:
  775. * - 0 - No effect.
  776. * - 1 - Internal logic is clocked as if bit clock was externally generated.
  777. */
  778. //@{
  779. #define BP_I2S_TCR2_BCI (28U) //!< Bit position for I2S_TCR2_BCI.
  780. #define BM_I2S_TCR2_BCI (0x10000000U) //!< Bit mask for I2S_TCR2_BCI.
  781. #define BS_I2S_TCR2_BCI (1U) //!< Bit field size in bits for I2S_TCR2_BCI.
  782. #ifndef __LANGUAGE_ASM__
  783. //! @brief Read current value of the I2S_TCR2_BCI field.
  784. #define BR_I2S_TCR2_BCI(x) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCI))
  785. #endif
  786. //! @brief Format value for bitfield I2S_TCR2_BCI.
  787. #define BF_I2S_TCR2_BCI(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_BCI), uint32_t) & BM_I2S_TCR2_BCI)
  788. #ifndef __LANGUAGE_ASM__
  789. //! @brief Set the BCI field to a new value.
  790. #define BW_I2S_TCR2_BCI(x, v) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCI) = (v))
  791. #endif
  792. //@}
  793. /*!
  794. * @name Register I2S_TCR2, field BCS[29] (RW)
  795. *
  796. * This field swaps the bit clock used by the transmitter. When the transmitter
  797. * is configured in asynchronous mode and this bit is set, the transmitter is
  798. * clocked by the receiver bit clock (SAI_RX_BCLK). This allows the transmitter and
  799. * receiver to share the same bit clock, but the transmitter continues to use the
  800. * transmit frame sync (SAI_TX_SYNC). When the transmitter is configured in
  801. * synchronous mode, the transmitter BCS field and receiver BCS field must be set to
  802. * the same value. When both are set, the transmitter and receiver are both
  803. * clocked by the transmitter bit clock (SAI_TX_BCLK) but use the receiver frame sync
  804. * (SAI_RX_SYNC). This field has no effect when synchronous to another SAI
  805. * peripheral.
  806. *
  807. * Values:
  808. * - 0 - Use the normal bit clock source.
  809. * - 1 - Swap the bit clock source.
  810. */
  811. //@{
  812. #define BP_I2S_TCR2_BCS (29U) //!< Bit position for I2S_TCR2_BCS.
  813. #define BM_I2S_TCR2_BCS (0x20000000U) //!< Bit mask for I2S_TCR2_BCS.
  814. #define BS_I2S_TCR2_BCS (1U) //!< Bit field size in bits for I2S_TCR2_BCS.
  815. #ifndef __LANGUAGE_ASM__
  816. //! @brief Read current value of the I2S_TCR2_BCS field.
  817. #define BR_I2S_TCR2_BCS(x) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCS))
  818. #endif
  819. //! @brief Format value for bitfield I2S_TCR2_BCS.
  820. #define BF_I2S_TCR2_BCS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_BCS), uint32_t) & BM_I2S_TCR2_BCS)
  821. #ifndef __LANGUAGE_ASM__
  822. //! @brief Set the BCS field to a new value.
  823. #define BW_I2S_TCR2_BCS(x, v) (BITBAND_ACCESS32(HW_I2S_TCR2_ADDR(x), BP_I2S_TCR2_BCS) = (v))
  824. #endif
  825. //@}
  826. /*!
  827. * @name Register I2S_TCR2, field SYNC[31:30] (RW)
  828. *
  829. * Configures between asynchronous and synchronous modes of operation. When
  830. * configured for a synchronous mode of operation, the receiver or other SAI
  831. * peripheral must be configured for asynchronous operation.
  832. *
  833. * Values:
  834. * - 00 - Asynchronous mode.
  835. * - 01 - Synchronous with receiver.
  836. * - 10 - Synchronous with another SAI transmitter.
  837. * - 11 - Synchronous with another SAI receiver.
  838. */
  839. //@{
  840. #define BP_I2S_TCR2_SYNC (30U) //!< Bit position for I2S_TCR2_SYNC.
  841. #define BM_I2S_TCR2_SYNC (0xC0000000U) //!< Bit mask for I2S_TCR2_SYNC.
  842. #define BS_I2S_TCR2_SYNC (2U) //!< Bit field size in bits for I2S_TCR2_SYNC.
  843. #ifndef __LANGUAGE_ASM__
  844. //! @brief Read current value of the I2S_TCR2_SYNC field.
  845. #define BR_I2S_TCR2_SYNC(x) (HW_I2S_TCR2(x).B.SYNC)
  846. #endif
  847. //! @brief Format value for bitfield I2S_TCR2_SYNC.
  848. #define BF_I2S_TCR2_SYNC(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR2_SYNC), uint32_t) & BM_I2S_TCR2_SYNC)
  849. #ifndef __LANGUAGE_ASM__
  850. //! @brief Set the SYNC field to a new value.
  851. #define BW_I2S_TCR2_SYNC(x, v) (HW_I2S_TCR2_WR(x, (HW_I2S_TCR2_RD(x) & ~BM_I2S_TCR2_SYNC) | BF_I2S_TCR2_SYNC(v)))
  852. #endif
  853. //@}
  854. //-------------------------------------------------------------------------------------------
  855. // HW_I2S_TCR3 - SAI Transmit Configuration 3 Register
  856. //-------------------------------------------------------------------------------------------
  857. #ifndef __LANGUAGE_ASM__
  858. /*!
  859. * @brief HW_I2S_TCR3 - SAI Transmit Configuration 3 Register (RW)
  860. *
  861. * Reset value: 0x00000000U
  862. *
  863. * This register must not be altered when TCSR[TE] is set.
  864. */
  865. typedef union _hw_i2s_tcr3
  866. {
  867. uint32_t U;
  868. struct _hw_i2s_tcr3_bitfields
  869. {
  870. uint32_t WDFL : 5; //!< [4:0] Word Flag Configuration
  871. uint32_t RESERVED0 : 11; //!< [15:5]
  872. uint32_t TCE : 2; //!< [17:16] Transmit Channel Enable
  873. uint32_t RESERVED1 : 14; //!< [31:18]
  874. } B;
  875. } hw_i2s_tcr3_t;
  876. #endif
  877. /*!
  878. * @name Constants and macros for entire I2S_TCR3 register
  879. */
  880. //@{
  881. #define HW_I2S_TCR3_ADDR(x) (REGS_I2S_BASE(x) + 0xCU)
  882. #ifndef __LANGUAGE_ASM__
  883. #define HW_I2S_TCR3(x) (*(__IO hw_i2s_tcr3_t *) HW_I2S_TCR3_ADDR(x))
  884. #define HW_I2S_TCR3_RD(x) (HW_I2S_TCR3(x).U)
  885. #define HW_I2S_TCR3_WR(x, v) (HW_I2S_TCR3(x).U = (v))
  886. #define HW_I2S_TCR3_SET(x, v) (HW_I2S_TCR3_WR(x, HW_I2S_TCR3_RD(x) | (v)))
  887. #define HW_I2S_TCR3_CLR(x, v) (HW_I2S_TCR3_WR(x, HW_I2S_TCR3_RD(x) & ~(v)))
  888. #define HW_I2S_TCR3_TOG(x, v) (HW_I2S_TCR3_WR(x, HW_I2S_TCR3_RD(x) ^ (v)))
  889. #endif
  890. //@}
  891. /*
  892. * Constants & macros for individual I2S_TCR3 bitfields
  893. */
  894. /*!
  895. * @name Register I2S_TCR3, field WDFL[4:0] (RW)
  896. *
  897. * Configures which word sets the start of word flag. The value written must be
  898. * one less than the word number. For example, writing 0 configures the first
  899. * word in the frame. When configured to a value greater than TCR4[FRSZ], then the
  900. * start of word flag is never set.
  901. */
  902. //@{
  903. #define BP_I2S_TCR3_WDFL (0U) //!< Bit position for I2S_TCR3_WDFL.
  904. #define BM_I2S_TCR3_WDFL (0x0000001FU) //!< Bit mask for I2S_TCR3_WDFL.
  905. #define BS_I2S_TCR3_WDFL (5U) //!< Bit field size in bits for I2S_TCR3_WDFL.
  906. #ifndef __LANGUAGE_ASM__
  907. //! @brief Read current value of the I2S_TCR3_WDFL field.
  908. #define BR_I2S_TCR3_WDFL(x) (HW_I2S_TCR3(x).B.WDFL)
  909. #endif
  910. //! @brief Format value for bitfield I2S_TCR3_WDFL.
  911. #define BF_I2S_TCR3_WDFL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR3_WDFL), uint32_t) & BM_I2S_TCR3_WDFL)
  912. #ifndef __LANGUAGE_ASM__
  913. //! @brief Set the WDFL field to a new value.
  914. #define BW_I2S_TCR3_WDFL(x, v) (HW_I2S_TCR3_WR(x, (HW_I2S_TCR3_RD(x) & ~BM_I2S_TCR3_WDFL) | BF_I2S_TCR3_WDFL(v)))
  915. #endif
  916. //@}
  917. /*!
  918. * @name Register I2S_TCR3, field TCE[17:16] (RW)
  919. *
  920. * Enables the corresponding data channel for transmit operation. A channel must
  921. * be enabled before its FIFO is accessed.
  922. *
  923. * Values:
  924. * - 0 - Transmit data channel N is disabled.
  925. * - 1 - Transmit data channel N is enabled.
  926. */
  927. //@{
  928. #define BP_I2S_TCR3_TCE (16U) //!< Bit position for I2S_TCR3_TCE.
  929. #define BM_I2S_TCR3_TCE (0x00030000U) //!< Bit mask for I2S_TCR3_TCE.
  930. #define BS_I2S_TCR3_TCE (2U) //!< Bit field size in bits for I2S_TCR3_TCE.
  931. #ifndef __LANGUAGE_ASM__
  932. //! @brief Read current value of the I2S_TCR3_TCE field.
  933. #define BR_I2S_TCR3_TCE(x) (HW_I2S_TCR3(x).B.TCE)
  934. #endif
  935. //! @brief Format value for bitfield I2S_TCR3_TCE.
  936. #define BF_I2S_TCR3_TCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR3_TCE), uint32_t) & BM_I2S_TCR3_TCE)
  937. #ifndef __LANGUAGE_ASM__
  938. //! @brief Set the TCE field to a new value.
  939. #define BW_I2S_TCR3_TCE(x, v) (HW_I2S_TCR3_WR(x, (HW_I2S_TCR3_RD(x) & ~BM_I2S_TCR3_TCE) | BF_I2S_TCR3_TCE(v)))
  940. #endif
  941. //@}
  942. //-------------------------------------------------------------------------------------------
  943. // HW_I2S_TCR4 - SAI Transmit Configuration 4 Register
  944. //-------------------------------------------------------------------------------------------
  945. #ifndef __LANGUAGE_ASM__
  946. /*!
  947. * @brief HW_I2S_TCR4 - SAI Transmit Configuration 4 Register (RW)
  948. *
  949. * Reset value: 0x00000000U
  950. *
  951. * This register must not be altered when TCSR[TE] is set.
  952. */
  953. typedef union _hw_i2s_tcr4
  954. {
  955. uint32_t U;
  956. struct _hw_i2s_tcr4_bitfields
  957. {
  958. uint32_t FSD : 1; //!< [0] Frame Sync Direction
  959. uint32_t FSP : 1; //!< [1] Frame Sync Polarity
  960. uint32_t RESERVED0 : 1; //!< [2]
  961. uint32_t FSE : 1; //!< [3] Frame Sync Early
  962. uint32_t MF : 1; //!< [4] MSB First
  963. uint32_t RESERVED1 : 3; //!< [7:5]
  964. uint32_t SYWD : 5; //!< [12:8] Sync Width
  965. uint32_t RESERVED2 : 3; //!< [15:13]
  966. uint32_t FRSZ : 5; //!< [20:16] Frame size
  967. uint32_t RESERVED3 : 11; //!< [31:21]
  968. } B;
  969. } hw_i2s_tcr4_t;
  970. #endif
  971. /*!
  972. * @name Constants and macros for entire I2S_TCR4 register
  973. */
  974. //@{
  975. #define HW_I2S_TCR4_ADDR(x) (REGS_I2S_BASE(x) + 0x10U)
  976. #ifndef __LANGUAGE_ASM__
  977. #define HW_I2S_TCR4(x) (*(__IO hw_i2s_tcr4_t *) HW_I2S_TCR4_ADDR(x))
  978. #define HW_I2S_TCR4_RD(x) (HW_I2S_TCR4(x).U)
  979. #define HW_I2S_TCR4_WR(x, v) (HW_I2S_TCR4(x).U = (v))
  980. #define HW_I2S_TCR4_SET(x, v) (HW_I2S_TCR4_WR(x, HW_I2S_TCR4_RD(x) | (v)))
  981. #define HW_I2S_TCR4_CLR(x, v) (HW_I2S_TCR4_WR(x, HW_I2S_TCR4_RD(x) & ~(v)))
  982. #define HW_I2S_TCR4_TOG(x, v) (HW_I2S_TCR4_WR(x, HW_I2S_TCR4_RD(x) ^ (v)))
  983. #endif
  984. //@}
  985. /*
  986. * Constants & macros for individual I2S_TCR4 bitfields
  987. */
  988. /*!
  989. * @name Register I2S_TCR4, field FSD[0] (RW)
  990. *
  991. * Configures the direction of the frame sync.
  992. *
  993. * Values:
  994. * - 0 - Frame sync is generated externally in Slave mode.
  995. * - 1 - Frame sync is generated internally in Master mode.
  996. */
  997. //@{
  998. #define BP_I2S_TCR4_FSD (0U) //!< Bit position for I2S_TCR4_FSD.
  999. #define BM_I2S_TCR4_FSD (0x00000001U) //!< Bit mask for I2S_TCR4_FSD.
  1000. #define BS_I2S_TCR4_FSD (1U) //!< Bit field size in bits for I2S_TCR4_FSD.
  1001. #ifndef __LANGUAGE_ASM__
  1002. //! @brief Read current value of the I2S_TCR4_FSD field.
  1003. #define BR_I2S_TCR4_FSD(x) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSD))
  1004. #endif
  1005. //! @brief Format value for bitfield I2S_TCR4_FSD.
  1006. #define BF_I2S_TCR4_FSD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_FSD), uint32_t) & BM_I2S_TCR4_FSD)
  1007. #ifndef __LANGUAGE_ASM__
  1008. //! @brief Set the FSD field to a new value.
  1009. #define BW_I2S_TCR4_FSD(x, v) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSD) = (v))
  1010. #endif
  1011. //@}
  1012. /*!
  1013. * @name Register I2S_TCR4, field FSP[1] (RW)
  1014. *
  1015. * Configures the polarity of the frame sync.
  1016. *
  1017. * Values:
  1018. * - 0 - Frame sync is active high.
  1019. * - 1 - Frame sync is active low.
  1020. */
  1021. //@{
  1022. #define BP_I2S_TCR4_FSP (1U) //!< Bit position for I2S_TCR4_FSP.
  1023. #define BM_I2S_TCR4_FSP (0x00000002U) //!< Bit mask for I2S_TCR4_FSP.
  1024. #define BS_I2S_TCR4_FSP (1U) //!< Bit field size in bits for I2S_TCR4_FSP.
  1025. #ifndef __LANGUAGE_ASM__
  1026. //! @brief Read current value of the I2S_TCR4_FSP field.
  1027. #define BR_I2S_TCR4_FSP(x) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSP))
  1028. #endif
  1029. //! @brief Format value for bitfield I2S_TCR4_FSP.
  1030. #define BF_I2S_TCR4_FSP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_FSP), uint32_t) & BM_I2S_TCR4_FSP)
  1031. #ifndef __LANGUAGE_ASM__
  1032. //! @brief Set the FSP field to a new value.
  1033. #define BW_I2S_TCR4_FSP(x, v) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSP) = (v))
  1034. #endif
  1035. //@}
  1036. /*!
  1037. * @name Register I2S_TCR4, field FSE[3] (RW)
  1038. *
  1039. * Values:
  1040. * - 0 - Frame sync asserts with the first bit of the frame.
  1041. * - 1 - Frame sync asserts one bit before the first bit of the frame.
  1042. */
  1043. //@{
  1044. #define BP_I2S_TCR4_FSE (3U) //!< Bit position for I2S_TCR4_FSE.
  1045. #define BM_I2S_TCR4_FSE (0x00000008U) //!< Bit mask for I2S_TCR4_FSE.
  1046. #define BS_I2S_TCR4_FSE (1U) //!< Bit field size in bits for I2S_TCR4_FSE.
  1047. #ifndef __LANGUAGE_ASM__
  1048. //! @brief Read current value of the I2S_TCR4_FSE field.
  1049. #define BR_I2S_TCR4_FSE(x) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSE))
  1050. #endif
  1051. //! @brief Format value for bitfield I2S_TCR4_FSE.
  1052. #define BF_I2S_TCR4_FSE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_FSE), uint32_t) & BM_I2S_TCR4_FSE)
  1053. #ifndef __LANGUAGE_ASM__
  1054. //! @brief Set the FSE field to a new value.
  1055. #define BW_I2S_TCR4_FSE(x, v) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_FSE) = (v))
  1056. #endif
  1057. //@}
  1058. /*!
  1059. * @name Register I2S_TCR4, field MF[4] (RW)
  1060. *
  1061. * Configures whether the LSB or the MSB is transmitted first.
  1062. *
  1063. * Values:
  1064. * - 0 - LSB is transmitted first.
  1065. * - 1 - MSB is transmitted first.
  1066. */
  1067. //@{
  1068. #define BP_I2S_TCR4_MF (4U) //!< Bit position for I2S_TCR4_MF.
  1069. #define BM_I2S_TCR4_MF (0x00000010U) //!< Bit mask for I2S_TCR4_MF.
  1070. #define BS_I2S_TCR4_MF (1U) //!< Bit field size in bits for I2S_TCR4_MF.
  1071. #ifndef __LANGUAGE_ASM__
  1072. //! @brief Read current value of the I2S_TCR4_MF field.
  1073. #define BR_I2S_TCR4_MF(x) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_MF))
  1074. #endif
  1075. //! @brief Format value for bitfield I2S_TCR4_MF.
  1076. #define BF_I2S_TCR4_MF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_MF), uint32_t) & BM_I2S_TCR4_MF)
  1077. #ifndef __LANGUAGE_ASM__
  1078. //! @brief Set the MF field to a new value.
  1079. #define BW_I2S_TCR4_MF(x, v) (BITBAND_ACCESS32(HW_I2S_TCR4_ADDR(x), BP_I2S_TCR4_MF) = (v))
  1080. #endif
  1081. //@}
  1082. /*!
  1083. * @name Register I2S_TCR4, field SYWD[12:8] (RW)
  1084. *
  1085. * Configures the length of the frame sync in number of bit clocks. The value
  1086. * written must be one less than the number of bit clocks. For example, write 0 for
  1087. * the frame sync to assert for one bit clock only. The sync width cannot be
  1088. * configured longer than the first word of the frame.
  1089. */
  1090. //@{
  1091. #define BP_I2S_TCR4_SYWD (8U) //!< Bit position for I2S_TCR4_SYWD.
  1092. #define BM_I2S_TCR4_SYWD (0x00001F00U) //!< Bit mask for I2S_TCR4_SYWD.
  1093. #define BS_I2S_TCR4_SYWD (5U) //!< Bit field size in bits for I2S_TCR4_SYWD.
  1094. #ifndef __LANGUAGE_ASM__
  1095. //! @brief Read current value of the I2S_TCR4_SYWD field.
  1096. #define BR_I2S_TCR4_SYWD(x) (HW_I2S_TCR4(x).B.SYWD)
  1097. #endif
  1098. //! @brief Format value for bitfield I2S_TCR4_SYWD.
  1099. #define BF_I2S_TCR4_SYWD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_SYWD), uint32_t) & BM_I2S_TCR4_SYWD)
  1100. #ifndef __LANGUAGE_ASM__
  1101. //! @brief Set the SYWD field to a new value.
  1102. #define BW_I2S_TCR4_SYWD(x, v) (HW_I2S_TCR4_WR(x, (HW_I2S_TCR4_RD(x) & ~BM_I2S_TCR4_SYWD) | BF_I2S_TCR4_SYWD(v)))
  1103. #endif
  1104. //@}
  1105. /*!
  1106. * @name Register I2S_TCR4, field FRSZ[20:16] (RW)
  1107. *
  1108. * Configures the number of words in each frame. The value written must be one
  1109. * less than the number of words in the frame. For example, write 0 for one word
  1110. * per frame. The maximum supported frame size is 32 words.
  1111. */
  1112. //@{
  1113. #define BP_I2S_TCR4_FRSZ (16U) //!< Bit position for I2S_TCR4_FRSZ.
  1114. #define BM_I2S_TCR4_FRSZ (0x001F0000U) //!< Bit mask for I2S_TCR4_FRSZ.
  1115. #define BS_I2S_TCR4_FRSZ (5U) //!< Bit field size in bits for I2S_TCR4_FRSZ.
  1116. #ifndef __LANGUAGE_ASM__
  1117. //! @brief Read current value of the I2S_TCR4_FRSZ field.
  1118. #define BR_I2S_TCR4_FRSZ(x) (HW_I2S_TCR4(x).B.FRSZ)
  1119. #endif
  1120. //! @brief Format value for bitfield I2S_TCR4_FRSZ.
  1121. #define BF_I2S_TCR4_FRSZ(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR4_FRSZ), uint32_t) & BM_I2S_TCR4_FRSZ)
  1122. #ifndef __LANGUAGE_ASM__
  1123. //! @brief Set the FRSZ field to a new value.
  1124. #define BW_I2S_TCR4_FRSZ(x, v) (HW_I2S_TCR4_WR(x, (HW_I2S_TCR4_RD(x) & ~BM_I2S_TCR4_FRSZ) | BF_I2S_TCR4_FRSZ(v)))
  1125. #endif
  1126. //@}
  1127. //-------------------------------------------------------------------------------------------
  1128. // HW_I2S_TCR5 - SAI Transmit Configuration 5 Register
  1129. //-------------------------------------------------------------------------------------------
  1130. #ifndef __LANGUAGE_ASM__
  1131. /*!
  1132. * @brief HW_I2S_TCR5 - SAI Transmit Configuration 5 Register (RW)
  1133. *
  1134. * Reset value: 0x00000000U
  1135. *
  1136. * This register must not be altered when TCSR[TE] is set.
  1137. */
  1138. typedef union _hw_i2s_tcr5
  1139. {
  1140. uint32_t U;
  1141. struct _hw_i2s_tcr5_bitfields
  1142. {
  1143. uint32_t RESERVED0 : 8; //!< [7:0]
  1144. uint32_t FBT : 5; //!< [12:8] First Bit Shifted
  1145. uint32_t RESERVED1 : 3; //!< [15:13]
  1146. uint32_t W0W : 5; //!< [20:16] Word 0 Width
  1147. uint32_t RESERVED2 : 3; //!< [23:21]
  1148. uint32_t WNW : 5; //!< [28:24] Word N Width
  1149. uint32_t RESERVED3 : 3; //!< [31:29]
  1150. } B;
  1151. } hw_i2s_tcr5_t;
  1152. #endif
  1153. /*!
  1154. * @name Constants and macros for entire I2S_TCR5 register
  1155. */
  1156. //@{
  1157. #define HW_I2S_TCR5_ADDR(x) (REGS_I2S_BASE(x) + 0x14U)
  1158. #ifndef __LANGUAGE_ASM__
  1159. #define HW_I2S_TCR5(x) (*(__IO hw_i2s_tcr5_t *) HW_I2S_TCR5_ADDR(x))
  1160. #define HW_I2S_TCR5_RD(x) (HW_I2S_TCR5(x).U)
  1161. #define HW_I2S_TCR5_WR(x, v) (HW_I2S_TCR5(x).U = (v))
  1162. #define HW_I2S_TCR5_SET(x, v) (HW_I2S_TCR5_WR(x, HW_I2S_TCR5_RD(x) | (v)))
  1163. #define HW_I2S_TCR5_CLR(x, v) (HW_I2S_TCR5_WR(x, HW_I2S_TCR5_RD(x) & ~(v)))
  1164. #define HW_I2S_TCR5_TOG(x, v) (HW_I2S_TCR5_WR(x, HW_I2S_TCR5_RD(x) ^ (v)))
  1165. #endif
  1166. //@}
  1167. /*
  1168. * Constants & macros for individual I2S_TCR5 bitfields
  1169. */
  1170. /*!
  1171. * @name Register I2S_TCR5, field FBT[12:8] (RW)
  1172. *
  1173. * Configures the bit index for the first bit transmitted for each word in the
  1174. * frame. If configured for MSB First, the index of the next bit transmitted is
  1175. * one less than the current bit transmitted. If configured for LSB First, the
  1176. * index of the next bit transmitted is one more than the current bit transmitted.
  1177. * The value written must be greater than or equal to the word width when
  1178. * configured for MSB First. The value written must be less than or equal to 31-word width
  1179. * when configured for LSB First.
  1180. */
  1181. //@{
  1182. #define BP_I2S_TCR5_FBT (8U) //!< Bit position for I2S_TCR5_FBT.
  1183. #define BM_I2S_TCR5_FBT (0x00001F00U) //!< Bit mask for I2S_TCR5_FBT.
  1184. #define BS_I2S_TCR5_FBT (5U) //!< Bit field size in bits for I2S_TCR5_FBT.
  1185. #ifndef __LANGUAGE_ASM__
  1186. //! @brief Read current value of the I2S_TCR5_FBT field.
  1187. #define BR_I2S_TCR5_FBT(x) (HW_I2S_TCR5(x).B.FBT)
  1188. #endif
  1189. //! @brief Format value for bitfield I2S_TCR5_FBT.
  1190. #define BF_I2S_TCR5_FBT(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR5_FBT), uint32_t) & BM_I2S_TCR5_FBT)
  1191. #ifndef __LANGUAGE_ASM__
  1192. //! @brief Set the FBT field to a new value.
  1193. #define BW_I2S_TCR5_FBT(x, v) (HW_I2S_TCR5_WR(x, (HW_I2S_TCR5_RD(x) & ~BM_I2S_TCR5_FBT) | BF_I2S_TCR5_FBT(v)))
  1194. #endif
  1195. //@}
  1196. /*!
  1197. * @name Register I2S_TCR5, field W0W[20:16] (RW)
  1198. *
  1199. * Configures the number of bits in the first word in each frame. The value
  1200. * written must be one less than the number of bits in the first word. Word width of
  1201. * less than 8 bits is not supported if there is only one word per frame.
  1202. */
  1203. //@{
  1204. #define BP_I2S_TCR5_W0W (16U) //!< Bit position for I2S_TCR5_W0W.
  1205. #define BM_I2S_TCR5_W0W (0x001F0000U) //!< Bit mask for I2S_TCR5_W0W.
  1206. #define BS_I2S_TCR5_W0W (5U) //!< Bit field size in bits for I2S_TCR5_W0W.
  1207. #ifndef __LANGUAGE_ASM__
  1208. //! @brief Read current value of the I2S_TCR5_W0W field.
  1209. #define BR_I2S_TCR5_W0W(x) (HW_I2S_TCR5(x).B.W0W)
  1210. #endif
  1211. //! @brief Format value for bitfield I2S_TCR5_W0W.
  1212. #define BF_I2S_TCR5_W0W(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR5_W0W), uint32_t) & BM_I2S_TCR5_W0W)
  1213. #ifndef __LANGUAGE_ASM__
  1214. //! @brief Set the W0W field to a new value.
  1215. #define BW_I2S_TCR5_W0W(x, v) (HW_I2S_TCR5_WR(x, (HW_I2S_TCR5_RD(x) & ~BM_I2S_TCR5_W0W) | BF_I2S_TCR5_W0W(v)))
  1216. #endif
  1217. //@}
  1218. /*!
  1219. * @name Register I2S_TCR5, field WNW[28:24] (RW)
  1220. *
  1221. * Configures the number of bits in each word, for each word except the first in
  1222. * the frame. The value written must be one less than the number of bits per
  1223. * word. Word width of less than 8 bits is not supported.
  1224. */
  1225. //@{
  1226. #define BP_I2S_TCR5_WNW (24U) //!< Bit position for I2S_TCR5_WNW.
  1227. #define BM_I2S_TCR5_WNW (0x1F000000U) //!< Bit mask for I2S_TCR5_WNW.
  1228. #define BS_I2S_TCR5_WNW (5U) //!< Bit field size in bits for I2S_TCR5_WNW.
  1229. #ifndef __LANGUAGE_ASM__
  1230. //! @brief Read current value of the I2S_TCR5_WNW field.
  1231. #define BR_I2S_TCR5_WNW(x) (HW_I2S_TCR5(x).B.WNW)
  1232. #endif
  1233. //! @brief Format value for bitfield I2S_TCR5_WNW.
  1234. #define BF_I2S_TCR5_WNW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TCR5_WNW), uint32_t) & BM_I2S_TCR5_WNW)
  1235. #ifndef __LANGUAGE_ASM__
  1236. //! @brief Set the WNW field to a new value.
  1237. #define BW_I2S_TCR5_WNW(x, v) (HW_I2S_TCR5_WR(x, (HW_I2S_TCR5_RD(x) & ~BM_I2S_TCR5_WNW) | BF_I2S_TCR5_WNW(v)))
  1238. #endif
  1239. //@}
  1240. //-------------------------------------------------------------------------------------------
  1241. // HW_I2S_TDRn - SAI Transmit Data Register
  1242. //-------------------------------------------------------------------------------------------
  1243. #ifndef __LANGUAGE_ASM__
  1244. /*!
  1245. * @brief HW_I2S_TDRn - SAI Transmit Data Register (WORZ)
  1246. *
  1247. * Reset value: 0x00000000U
  1248. */
  1249. typedef union _hw_i2s_tdrn
  1250. {
  1251. uint32_t U;
  1252. struct _hw_i2s_tdrn_bitfields
  1253. {
  1254. uint32_t TDR : 32; //!< [31:0] Transmit Data Register
  1255. } B;
  1256. } hw_i2s_tdrn_t;
  1257. #endif
  1258. /*!
  1259. * @name Constants and macros for entire I2S_TDRn register
  1260. */
  1261. //@{
  1262. #define HW_I2S_TDRn_COUNT (2U)
  1263. #define HW_I2S_TDRn_ADDR(x, n) (REGS_I2S_BASE(x) + 0x20U + (0x4U * n))
  1264. #ifndef __LANGUAGE_ASM__
  1265. #define HW_I2S_TDRn(x, n) (*(__O hw_i2s_tdrn_t *) HW_I2S_TDRn_ADDR(x, n))
  1266. #define HW_I2S_TDRn_RD(x, n) (HW_I2S_TDRn(x, n).U)
  1267. #define HW_I2S_TDRn_WR(x, n, v) (HW_I2S_TDRn(x, n).U = (v))
  1268. #endif
  1269. //@}
  1270. /*
  1271. * Constants & macros for individual I2S_TDRn bitfields
  1272. */
  1273. /*!
  1274. * @name Register I2S_TDRn, field TDR[31:0] (WORZ)
  1275. *
  1276. * The corresponding TCR3[TCE] bit must be set before accessing the channel's
  1277. * transmit data register. Writes to this register when the transmit FIFO is not
  1278. * full will push the data written into the transmit data FIFO. Writes to this
  1279. * register when the transmit FIFO is full are ignored.
  1280. */
  1281. //@{
  1282. #define BP_I2S_TDRn_TDR (0U) //!< Bit position for I2S_TDRn_TDR.
  1283. #define BM_I2S_TDRn_TDR (0xFFFFFFFFU) //!< Bit mask for I2S_TDRn_TDR.
  1284. #define BS_I2S_TDRn_TDR (32U) //!< Bit field size in bits for I2S_TDRn_TDR.
  1285. //! @brief Format value for bitfield I2S_TDRn_TDR.
  1286. #define BF_I2S_TDRn_TDR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TDRn_TDR), uint32_t) & BM_I2S_TDRn_TDR)
  1287. #ifndef __LANGUAGE_ASM__
  1288. //! @brief Set the TDR field to a new value.
  1289. #define BW_I2S_TDRn_TDR(x, n, v) (HW_I2S_TDRn_WR(x, n, v))
  1290. #endif
  1291. //@}
  1292. //-------------------------------------------------------------------------------------------
  1293. // HW_I2S_TFRn - SAI Transmit FIFO Register
  1294. //-------------------------------------------------------------------------------------------
  1295. #ifndef __LANGUAGE_ASM__
  1296. /*!
  1297. * @brief HW_I2S_TFRn - SAI Transmit FIFO Register (RO)
  1298. *
  1299. * Reset value: 0x00000000U
  1300. *
  1301. * The MSB of the read and write pointers is used to distinguish between FIFO
  1302. * full and empty conditions. If the read and write pointers are identical, then
  1303. * the FIFO is empty. If the read and write pointers are identical except for the
  1304. * MSB, then the FIFO is full.
  1305. */
  1306. typedef union _hw_i2s_tfrn
  1307. {
  1308. uint32_t U;
  1309. struct _hw_i2s_tfrn_bitfields
  1310. {
  1311. uint32_t RFP : 4; //!< [3:0] Read FIFO Pointer
  1312. uint32_t RESERVED0 : 12; //!< [15:4]
  1313. uint32_t WFP : 4; //!< [19:16] Write FIFO Pointer
  1314. uint32_t RESERVED1 : 12; //!< [31:20]
  1315. } B;
  1316. } hw_i2s_tfrn_t;
  1317. #endif
  1318. /*!
  1319. * @name Constants and macros for entire I2S_TFRn register
  1320. */
  1321. //@{
  1322. #define HW_I2S_TFRn_COUNT (2U)
  1323. #define HW_I2S_TFRn_ADDR(x, n) (REGS_I2S_BASE(x) + 0x40U + (0x4U * n))
  1324. #ifndef __LANGUAGE_ASM__
  1325. #define HW_I2S_TFRn(x, n) (*(__I hw_i2s_tfrn_t *) HW_I2S_TFRn_ADDR(x, n))
  1326. #define HW_I2S_TFRn_RD(x, n) (HW_I2S_TFRn(x, n).U)
  1327. #endif
  1328. //@}
  1329. /*
  1330. * Constants & macros for individual I2S_TFRn bitfields
  1331. */
  1332. /*!
  1333. * @name Register I2S_TFRn, field RFP[3:0] (RO)
  1334. *
  1335. * FIFO read pointer for transmit data channel.
  1336. */
  1337. //@{
  1338. #define BP_I2S_TFRn_RFP (0U) //!< Bit position for I2S_TFRn_RFP.
  1339. #define BM_I2S_TFRn_RFP (0x0000000FU) //!< Bit mask for I2S_TFRn_RFP.
  1340. #define BS_I2S_TFRn_RFP (4U) //!< Bit field size in bits for I2S_TFRn_RFP.
  1341. #ifndef __LANGUAGE_ASM__
  1342. //! @brief Read current value of the I2S_TFRn_RFP field.
  1343. #define BR_I2S_TFRn_RFP(x, n) (HW_I2S_TFRn(x, n).B.RFP)
  1344. #endif
  1345. //@}
  1346. /*!
  1347. * @name Register I2S_TFRn, field WFP[19:16] (RO)
  1348. *
  1349. * FIFO write pointer for transmit data channel.
  1350. */
  1351. //@{
  1352. #define BP_I2S_TFRn_WFP (16U) //!< Bit position for I2S_TFRn_WFP.
  1353. #define BM_I2S_TFRn_WFP (0x000F0000U) //!< Bit mask for I2S_TFRn_WFP.
  1354. #define BS_I2S_TFRn_WFP (4U) //!< Bit field size in bits for I2S_TFRn_WFP.
  1355. #ifndef __LANGUAGE_ASM__
  1356. //! @brief Read current value of the I2S_TFRn_WFP field.
  1357. #define BR_I2S_TFRn_WFP(x, n) (HW_I2S_TFRn(x, n).B.WFP)
  1358. #endif
  1359. //@}
  1360. //-------------------------------------------------------------------------------------------
  1361. // HW_I2S_TMR - SAI Transmit Mask Register
  1362. //-------------------------------------------------------------------------------------------
  1363. #ifndef __LANGUAGE_ASM__
  1364. /*!
  1365. * @brief HW_I2S_TMR - SAI Transmit Mask Register (RW)
  1366. *
  1367. * Reset value: 0x00000000U
  1368. *
  1369. * This register is double-buffered and updates: When TCSR[TE] is first set At
  1370. * the end of each frame. This allows the masked words in each frame to change
  1371. * from frame to frame.
  1372. */
  1373. typedef union _hw_i2s_tmr
  1374. {
  1375. uint32_t U;
  1376. struct _hw_i2s_tmr_bitfields
  1377. {
  1378. uint32_t TWM : 32; //!< [31:0] Transmit Word Mask
  1379. } B;
  1380. } hw_i2s_tmr_t;
  1381. #endif
  1382. /*!
  1383. * @name Constants and macros for entire I2S_TMR register
  1384. */
  1385. //@{
  1386. #define HW_I2S_TMR_ADDR(x) (REGS_I2S_BASE(x) + 0x60U)
  1387. #ifndef __LANGUAGE_ASM__
  1388. #define HW_I2S_TMR(x) (*(__IO hw_i2s_tmr_t *) HW_I2S_TMR_ADDR(x))
  1389. #define HW_I2S_TMR_RD(x) (HW_I2S_TMR(x).U)
  1390. #define HW_I2S_TMR_WR(x, v) (HW_I2S_TMR(x).U = (v))
  1391. #define HW_I2S_TMR_SET(x, v) (HW_I2S_TMR_WR(x, HW_I2S_TMR_RD(x) | (v)))
  1392. #define HW_I2S_TMR_CLR(x, v) (HW_I2S_TMR_WR(x, HW_I2S_TMR_RD(x) & ~(v)))
  1393. #define HW_I2S_TMR_TOG(x, v) (HW_I2S_TMR_WR(x, HW_I2S_TMR_RD(x) ^ (v)))
  1394. #endif
  1395. //@}
  1396. /*
  1397. * Constants & macros for individual I2S_TMR bitfields
  1398. */
  1399. /*!
  1400. * @name Register I2S_TMR, field TWM[31:0] (RW)
  1401. *
  1402. * Configures whether the transmit word is masked (transmit data pin tristated
  1403. * and transmit data not read from FIFO) for the corresponding word in the frame.
  1404. *
  1405. * Values:
  1406. * - 0 - Word N is enabled.
  1407. * - 1 - Word N is masked. The transmit data pins are tri-stated when masked.
  1408. */
  1409. //@{
  1410. #define BP_I2S_TMR_TWM (0U) //!< Bit position for I2S_TMR_TWM.
  1411. #define BM_I2S_TMR_TWM (0xFFFFFFFFU) //!< Bit mask for I2S_TMR_TWM.
  1412. #define BS_I2S_TMR_TWM (32U) //!< Bit field size in bits for I2S_TMR_TWM.
  1413. #ifndef __LANGUAGE_ASM__
  1414. //! @brief Read current value of the I2S_TMR_TWM field.
  1415. #define BR_I2S_TMR_TWM(x) (HW_I2S_TMR(x).U)
  1416. #endif
  1417. //! @brief Format value for bitfield I2S_TMR_TWM.
  1418. #define BF_I2S_TMR_TWM(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_TMR_TWM), uint32_t) & BM_I2S_TMR_TWM)
  1419. #ifndef __LANGUAGE_ASM__
  1420. //! @brief Set the TWM field to a new value.
  1421. #define BW_I2S_TMR_TWM(x, v) (HW_I2S_TMR_WR(x, v))
  1422. #endif
  1423. //@}
  1424. //-------------------------------------------------------------------------------------------
  1425. // HW_I2S_RCSR - SAI Receive Control Register
  1426. //-------------------------------------------------------------------------------------------
  1427. #ifndef __LANGUAGE_ASM__
  1428. /*!
  1429. * @brief HW_I2S_RCSR - SAI Receive Control Register (RW)
  1430. *
  1431. * Reset value: 0x00000000U
  1432. */
  1433. typedef union _hw_i2s_rcsr
  1434. {
  1435. uint32_t U;
  1436. struct _hw_i2s_rcsr_bitfields
  1437. {
  1438. uint32_t FRDE : 1; //!< [0] FIFO Request DMA Enable
  1439. uint32_t FWDE : 1; //!< [1] FIFO Warning DMA Enable
  1440. uint32_t RESERVED0 : 6; //!< [7:2]
  1441. uint32_t FRIE : 1; //!< [8] FIFO Request Interrupt Enable
  1442. uint32_t FWIE : 1; //!< [9] FIFO Warning Interrupt Enable
  1443. uint32_t FEIE : 1; //!< [10] FIFO Error Interrupt Enable
  1444. uint32_t SEIE : 1; //!< [11] Sync Error Interrupt Enable
  1445. uint32_t WSIE : 1; //!< [12] Word Start Interrupt Enable
  1446. uint32_t RESERVED1 : 3; //!< [15:13]
  1447. uint32_t FRF : 1; //!< [16] FIFO Request Flag
  1448. uint32_t FWF : 1; //!< [17] FIFO Warning Flag
  1449. uint32_t FEF : 1; //!< [18] FIFO Error Flag
  1450. uint32_t SEF : 1; //!< [19] Sync Error Flag
  1451. uint32_t WSF : 1; //!< [20] Word Start Flag
  1452. uint32_t RESERVED2 : 3; //!< [23:21]
  1453. uint32_t SR : 1; //!< [24] Software Reset
  1454. uint32_t FR : 1; //!< [25] FIFO Reset
  1455. uint32_t RESERVED3 : 2; //!< [27:26]
  1456. uint32_t BCE : 1; //!< [28] Bit Clock Enable
  1457. uint32_t DBGE : 1; //!< [29] Debug Enable
  1458. uint32_t STOPE : 1; //!< [30] Stop Enable
  1459. uint32_t RE : 1; //!< [31] Receiver Enable
  1460. } B;
  1461. } hw_i2s_rcsr_t;
  1462. #endif
  1463. /*!
  1464. * @name Constants and macros for entire I2S_RCSR register
  1465. */
  1466. //@{
  1467. #define HW_I2S_RCSR_ADDR(x) (REGS_I2S_BASE(x) + 0x80U)
  1468. #ifndef __LANGUAGE_ASM__
  1469. #define HW_I2S_RCSR(x) (*(__IO hw_i2s_rcsr_t *) HW_I2S_RCSR_ADDR(x))
  1470. #define HW_I2S_RCSR_RD(x) (HW_I2S_RCSR(x).U)
  1471. #define HW_I2S_RCSR_WR(x, v) (HW_I2S_RCSR(x).U = (v))
  1472. #define HW_I2S_RCSR_SET(x, v) (HW_I2S_RCSR_WR(x, HW_I2S_RCSR_RD(x) | (v)))
  1473. #define HW_I2S_RCSR_CLR(x, v) (HW_I2S_RCSR_WR(x, HW_I2S_RCSR_RD(x) & ~(v)))
  1474. #define HW_I2S_RCSR_TOG(x, v) (HW_I2S_RCSR_WR(x, HW_I2S_RCSR_RD(x) ^ (v)))
  1475. #endif
  1476. //@}
  1477. /*
  1478. * Constants & macros for individual I2S_RCSR bitfields
  1479. */
  1480. /*!
  1481. * @name Register I2S_RCSR, field FRDE[0] (RW)
  1482. *
  1483. * Enables/disables DMA requests.
  1484. *
  1485. * Values:
  1486. * - 0 - Disables the DMA request.
  1487. * - 1 - Enables the DMA request.
  1488. */
  1489. //@{
  1490. #define BP_I2S_RCSR_FRDE (0U) //!< Bit position for I2S_RCSR_FRDE.
  1491. #define BM_I2S_RCSR_FRDE (0x00000001U) //!< Bit mask for I2S_RCSR_FRDE.
  1492. #define BS_I2S_RCSR_FRDE (1U) //!< Bit field size in bits for I2S_RCSR_FRDE.
  1493. #ifndef __LANGUAGE_ASM__
  1494. //! @brief Read current value of the I2S_RCSR_FRDE field.
  1495. #define BR_I2S_RCSR_FRDE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FRDE))
  1496. #endif
  1497. //! @brief Format value for bitfield I2S_RCSR_FRDE.
  1498. #define BF_I2S_RCSR_FRDE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FRDE), uint32_t) & BM_I2S_RCSR_FRDE)
  1499. #ifndef __LANGUAGE_ASM__
  1500. //! @brief Set the FRDE field to a new value.
  1501. #define BW_I2S_RCSR_FRDE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FRDE) = (v))
  1502. #endif
  1503. //@}
  1504. /*!
  1505. * @name Register I2S_RCSR, field FWDE[1] (RW)
  1506. *
  1507. * Enables/disables DMA requests.
  1508. *
  1509. * Values:
  1510. * - 0 - Disables the DMA request.
  1511. * - 1 - Enables the DMA request.
  1512. */
  1513. //@{
  1514. #define BP_I2S_RCSR_FWDE (1U) //!< Bit position for I2S_RCSR_FWDE.
  1515. #define BM_I2S_RCSR_FWDE (0x00000002U) //!< Bit mask for I2S_RCSR_FWDE.
  1516. #define BS_I2S_RCSR_FWDE (1U) //!< Bit field size in bits for I2S_RCSR_FWDE.
  1517. #ifndef __LANGUAGE_ASM__
  1518. //! @brief Read current value of the I2S_RCSR_FWDE field.
  1519. #define BR_I2S_RCSR_FWDE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FWDE))
  1520. #endif
  1521. //! @brief Format value for bitfield I2S_RCSR_FWDE.
  1522. #define BF_I2S_RCSR_FWDE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FWDE), uint32_t) & BM_I2S_RCSR_FWDE)
  1523. #ifndef __LANGUAGE_ASM__
  1524. //! @brief Set the FWDE field to a new value.
  1525. #define BW_I2S_RCSR_FWDE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FWDE) = (v))
  1526. #endif
  1527. //@}
  1528. /*!
  1529. * @name Register I2S_RCSR, field FRIE[8] (RW)
  1530. *
  1531. * Enables/disables FIFO request interrupts.
  1532. *
  1533. * Values:
  1534. * - 0 - Disables the interrupt.
  1535. * - 1 - Enables the interrupt.
  1536. */
  1537. //@{
  1538. #define BP_I2S_RCSR_FRIE (8U) //!< Bit position for I2S_RCSR_FRIE.
  1539. #define BM_I2S_RCSR_FRIE (0x00000100U) //!< Bit mask for I2S_RCSR_FRIE.
  1540. #define BS_I2S_RCSR_FRIE (1U) //!< Bit field size in bits for I2S_RCSR_FRIE.
  1541. #ifndef __LANGUAGE_ASM__
  1542. //! @brief Read current value of the I2S_RCSR_FRIE field.
  1543. #define BR_I2S_RCSR_FRIE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FRIE))
  1544. #endif
  1545. //! @brief Format value for bitfield I2S_RCSR_FRIE.
  1546. #define BF_I2S_RCSR_FRIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FRIE), uint32_t) & BM_I2S_RCSR_FRIE)
  1547. #ifndef __LANGUAGE_ASM__
  1548. //! @brief Set the FRIE field to a new value.
  1549. #define BW_I2S_RCSR_FRIE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FRIE) = (v))
  1550. #endif
  1551. //@}
  1552. /*!
  1553. * @name Register I2S_RCSR, field FWIE[9] (RW)
  1554. *
  1555. * Enables/disables FIFO warning interrupts.
  1556. *
  1557. * Values:
  1558. * - 0 - Disables the interrupt.
  1559. * - 1 - Enables the interrupt.
  1560. */
  1561. //@{
  1562. #define BP_I2S_RCSR_FWIE (9U) //!< Bit position for I2S_RCSR_FWIE.
  1563. #define BM_I2S_RCSR_FWIE (0x00000200U) //!< Bit mask for I2S_RCSR_FWIE.
  1564. #define BS_I2S_RCSR_FWIE (1U) //!< Bit field size in bits for I2S_RCSR_FWIE.
  1565. #ifndef __LANGUAGE_ASM__
  1566. //! @brief Read current value of the I2S_RCSR_FWIE field.
  1567. #define BR_I2S_RCSR_FWIE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FWIE))
  1568. #endif
  1569. //! @brief Format value for bitfield I2S_RCSR_FWIE.
  1570. #define BF_I2S_RCSR_FWIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FWIE), uint32_t) & BM_I2S_RCSR_FWIE)
  1571. #ifndef __LANGUAGE_ASM__
  1572. //! @brief Set the FWIE field to a new value.
  1573. #define BW_I2S_RCSR_FWIE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FWIE) = (v))
  1574. #endif
  1575. //@}
  1576. /*!
  1577. * @name Register I2S_RCSR, field FEIE[10] (RW)
  1578. *
  1579. * Enables/disables FIFO error interrupts.
  1580. *
  1581. * Values:
  1582. * - 0 - Disables the interrupt.
  1583. * - 1 - Enables the interrupt.
  1584. */
  1585. //@{
  1586. #define BP_I2S_RCSR_FEIE (10U) //!< Bit position for I2S_RCSR_FEIE.
  1587. #define BM_I2S_RCSR_FEIE (0x00000400U) //!< Bit mask for I2S_RCSR_FEIE.
  1588. #define BS_I2S_RCSR_FEIE (1U) //!< Bit field size in bits for I2S_RCSR_FEIE.
  1589. #ifndef __LANGUAGE_ASM__
  1590. //! @brief Read current value of the I2S_RCSR_FEIE field.
  1591. #define BR_I2S_RCSR_FEIE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FEIE))
  1592. #endif
  1593. //! @brief Format value for bitfield I2S_RCSR_FEIE.
  1594. #define BF_I2S_RCSR_FEIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FEIE), uint32_t) & BM_I2S_RCSR_FEIE)
  1595. #ifndef __LANGUAGE_ASM__
  1596. //! @brief Set the FEIE field to a new value.
  1597. #define BW_I2S_RCSR_FEIE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FEIE) = (v))
  1598. #endif
  1599. //@}
  1600. /*!
  1601. * @name Register I2S_RCSR, field SEIE[11] (RW)
  1602. *
  1603. * Enables/disables sync error interrupts.
  1604. *
  1605. * Values:
  1606. * - 0 - Disables interrupt.
  1607. * - 1 - Enables interrupt.
  1608. */
  1609. //@{
  1610. #define BP_I2S_RCSR_SEIE (11U) //!< Bit position for I2S_RCSR_SEIE.
  1611. #define BM_I2S_RCSR_SEIE (0x00000800U) //!< Bit mask for I2S_RCSR_SEIE.
  1612. #define BS_I2S_RCSR_SEIE (1U) //!< Bit field size in bits for I2S_RCSR_SEIE.
  1613. #ifndef __LANGUAGE_ASM__
  1614. //! @brief Read current value of the I2S_RCSR_SEIE field.
  1615. #define BR_I2S_RCSR_SEIE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SEIE))
  1616. #endif
  1617. //! @brief Format value for bitfield I2S_RCSR_SEIE.
  1618. #define BF_I2S_RCSR_SEIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_SEIE), uint32_t) & BM_I2S_RCSR_SEIE)
  1619. #ifndef __LANGUAGE_ASM__
  1620. //! @brief Set the SEIE field to a new value.
  1621. #define BW_I2S_RCSR_SEIE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SEIE) = (v))
  1622. #endif
  1623. //@}
  1624. /*!
  1625. * @name Register I2S_RCSR, field WSIE[12] (RW)
  1626. *
  1627. * Enables/disables word start interrupts.
  1628. *
  1629. * Values:
  1630. * - 0 - Disables interrupt.
  1631. * - 1 - Enables interrupt.
  1632. */
  1633. //@{
  1634. #define BP_I2S_RCSR_WSIE (12U) //!< Bit position for I2S_RCSR_WSIE.
  1635. #define BM_I2S_RCSR_WSIE (0x00001000U) //!< Bit mask for I2S_RCSR_WSIE.
  1636. #define BS_I2S_RCSR_WSIE (1U) //!< Bit field size in bits for I2S_RCSR_WSIE.
  1637. #ifndef __LANGUAGE_ASM__
  1638. //! @brief Read current value of the I2S_RCSR_WSIE field.
  1639. #define BR_I2S_RCSR_WSIE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_WSIE))
  1640. #endif
  1641. //! @brief Format value for bitfield I2S_RCSR_WSIE.
  1642. #define BF_I2S_RCSR_WSIE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_WSIE), uint32_t) & BM_I2S_RCSR_WSIE)
  1643. #ifndef __LANGUAGE_ASM__
  1644. //! @brief Set the WSIE field to a new value.
  1645. #define BW_I2S_RCSR_WSIE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_WSIE) = (v))
  1646. #endif
  1647. //@}
  1648. /*!
  1649. * @name Register I2S_RCSR, field FRF[16] (RO)
  1650. *
  1651. * Indicates that the number of words in an enabled receive channel FIFO is
  1652. * greater than the receive FIFO watermark.
  1653. *
  1654. * Values:
  1655. * - 0 - Receive FIFO watermark not reached.
  1656. * - 1 - Receive FIFO watermark has been reached.
  1657. */
  1658. //@{
  1659. #define BP_I2S_RCSR_FRF (16U) //!< Bit position for I2S_RCSR_FRF.
  1660. #define BM_I2S_RCSR_FRF (0x00010000U) //!< Bit mask for I2S_RCSR_FRF.
  1661. #define BS_I2S_RCSR_FRF (1U) //!< Bit field size in bits for I2S_RCSR_FRF.
  1662. #ifndef __LANGUAGE_ASM__
  1663. //! @brief Read current value of the I2S_RCSR_FRF field.
  1664. #define BR_I2S_RCSR_FRF(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FRF))
  1665. #endif
  1666. //@}
  1667. /*!
  1668. * @name Register I2S_RCSR, field FWF[17] (RO)
  1669. *
  1670. * Indicates that an enabled receive FIFO is full.
  1671. *
  1672. * Values:
  1673. * - 0 - No enabled receive FIFO is full.
  1674. * - 1 - Enabled receive FIFO is full.
  1675. */
  1676. //@{
  1677. #define BP_I2S_RCSR_FWF (17U) //!< Bit position for I2S_RCSR_FWF.
  1678. #define BM_I2S_RCSR_FWF (0x00020000U) //!< Bit mask for I2S_RCSR_FWF.
  1679. #define BS_I2S_RCSR_FWF (1U) //!< Bit field size in bits for I2S_RCSR_FWF.
  1680. #ifndef __LANGUAGE_ASM__
  1681. //! @brief Read current value of the I2S_RCSR_FWF field.
  1682. #define BR_I2S_RCSR_FWF(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FWF))
  1683. #endif
  1684. //@}
  1685. /*!
  1686. * @name Register I2S_RCSR, field FEF[18] (W1C)
  1687. *
  1688. * Indicates that an enabled receive FIFO has overflowed. Write a logic 1 to
  1689. * this field to clear this flag.
  1690. *
  1691. * Values:
  1692. * - 0 - Receive overflow not detected.
  1693. * - 1 - Receive overflow detected.
  1694. */
  1695. //@{
  1696. #define BP_I2S_RCSR_FEF (18U) //!< Bit position for I2S_RCSR_FEF.
  1697. #define BM_I2S_RCSR_FEF (0x00040000U) //!< Bit mask for I2S_RCSR_FEF.
  1698. #define BS_I2S_RCSR_FEF (1U) //!< Bit field size in bits for I2S_RCSR_FEF.
  1699. #ifndef __LANGUAGE_ASM__
  1700. //! @brief Read current value of the I2S_RCSR_FEF field.
  1701. #define BR_I2S_RCSR_FEF(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FEF))
  1702. #endif
  1703. //! @brief Format value for bitfield I2S_RCSR_FEF.
  1704. #define BF_I2S_RCSR_FEF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FEF), uint32_t) & BM_I2S_RCSR_FEF)
  1705. #ifndef __LANGUAGE_ASM__
  1706. //! @brief Set the FEF field to a new value.
  1707. #define BW_I2S_RCSR_FEF(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FEF) = (v))
  1708. #endif
  1709. //@}
  1710. /*!
  1711. * @name Register I2S_RCSR, field SEF[19] (W1C)
  1712. *
  1713. * Indicates that an error in the externally-generated frame sync has been
  1714. * detected. Write a logic 1 to this field to clear this flag.
  1715. *
  1716. * Values:
  1717. * - 0 - Sync error not detected.
  1718. * - 1 - Frame sync error detected.
  1719. */
  1720. //@{
  1721. #define BP_I2S_RCSR_SEF (19U) //!< Bit position for I2S_RCSR_SEF.
  1722. #define BM_I2S_RCSR_SEF (0x00080000U) //!< Bit mask for I2S_RCSR_SEF.
  1723. #define BS_I2S_RCSR_SEF (1U) //!< Bit field size in bits for I2S_RCSR_SEF.
  1724. #ifndef __LANGUAGE_ASM__
  1725. //! @brief Read current value of the I2S_RCSR_SEF field.
  1726. #define BR_I2S_RCSR_SEF(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SEF))
  1727. #endif
  1728. //! @brief Format value for bitfield I2S_RCSR_SEF.
  1729. #define BF_I2S_RCSR_SEF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_SEF), uint32_t) & BM_I2S_RCSR_SEF)
  1730. #ifndef __LANGUAGE_ASM__
  1731. //! @brief Set the SEF field to a new value.
  1732. #define BW_I2S_RCSR_SEF(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SEF) = (v))
  1733. #endif
  1734. //@}
  1735. /*!
  1736. * @name Register I2S_RCSR, field WSF[20] (W1C)
  1737. *
  1738. * Indicates that the start of the configured word has been detected. Write a
  1739. * logic 1 to this field to clear this flag.
  1740. *
  1741. * Values:
  1742. * - 0 - Start of word not detected.
  1743. * - 1 - Start of word detected.
  1744. */
  1745. //@{
  1746. #define BP_I2S_RCSR_WSF (20U) //!< Bit position for I2S_RCSR_WSF.
  1747. #define BM_I2S_RCSR_WSF (0x00100000U) //!< Bit mask for I2S_RCSR_WSF.
  1748. #define BS_I2S_RCSR_WSF (1U) //!< Bit field size in bits for I2S_RCSR_WSF.
  1749. #ifndef __LANGUAGE_ASM__
  1750. //! @brief Read current value of the I2S_RCSR_WSF field.
  1751. #define BR_I2S_RCSR_WSF(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_WSF))
  1752. #endif
  1753. //! @brief Format value for bitfield I2S_RCSR_WSF.
  1754. #define BF_I2S_RCSR_WSF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_WSF), uint32_t) & BM_I2S_RCSR_WSF)
  1755. #ifndef __LANGUAGE_ASM__
  1756. //! @brief Set the WSF field to a new value.
  1757. #define BW_I2S_RCSR_WSF(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_WSF) = (v))
  1758. #endif
  1759. //@}
  1760. /*!
  1761. * @name Register I2S_RCSR, field SR[24] (RW)
  1762. *
  1763. * Resets the internal receiver logic including the FIFO pointers.
  1764. * Software-visible registers are not affected, except for the status registers.
  1765. *
  1766. * Values:
  1767. * - 0 - No effect.
  1768. * - 1 - Software reset.
  1769. */
  1770. //@{
  1771. #define BP_I2S_RCSR_SR (24U) //!< Bit position for I2S_RCSR_SR.
  1772. #define BM_I2S_RCSR_SR (0x01000000U) //!< Bit mask for I2S_RCSR_SR.
  1773. #define BS_I2S_RCSR_SR (1U) //!< Bit field size in bits for I2S_RCSR_SR.
  1774. #ifndef __LANGUAGE_ASM__
  1775. //! @brief Read current value of the I2S_RCSR_SR field.
  1776. #define BR_I2S_RCSR_SR(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SR))
  1777. #endif
  1778. //! @brief Format value for bitfield I2S_RCSR_SR.
  1779. #define BF_I2S_RCSR_SR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_SR), uint32_t) & BM_I2S_RCSR_SR)
  1780. #ifndef __LANGUAGE_ASM__
  1781. //! @brief Set the SR field to a new value.
  1782. #define BW_I2S_RCSR_SR(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_SR) = (v))
  1783. #endif
  1784. //@}
  1785. /*!
  1786. * @name Register I2S_RCSR, field FR[25] (WORZ)
  1787. *
  1788. * Resets the FIFO pointers. Reading this field will always return zero. FIFO
  1789. * pointers should only be reset when the receiver is disabled or the FIFO error
  1790. * flag is set.
  1791. *
  1792. * Values:
  1793. * - 0 - No effect.
  1794. * - 1 - FIFO reset.
  1795. */
  1796. //@{
  1797. #define BP_I2S_RCSR_FR (25U) //!< Bit position for I2S_RCSR_FR.
  1798. #define BM_I2S_RCSR_FR (0x02000000U) //!< Bit mask for I2S_RCSR_FR.
  1799. #define BS_I2S_RCSR_FR (1U) //!< Bit field size in bits for I2S_RCSR_FR.
  1800. //! @brief Format value for bitfield I2S_RCSR_FR.
  1801. #define BF_I2S_RCSR_FR(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_FR), uint32_t) & BM_I2S_RCSR_FR)
  1802. #ifndef __LANGUAGE_ASM__
  1803. //! @brief Set the FR field to a new value.
  1804. #define BW_I2S_RCSR_FR(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_FR) = (v))
  1805. #endif
  1806. //@}
  1807. /*!
  1808. * @name Register I2S_RCSR, field BCE[28] (RW)
  1809. *
  1810. * Enables the receive bit clock, separately from RE. This field is
  1811. * automatically set whenever RE is set. When software clears this field, the receive bit
  1812. * clock remains enabled, and this field remains set, until the end of the current
  1813. * frame.
  1814. *
  1815. * Values:
  1816. * - 0 - Receive bit clock is disabled.
  1817. * - 1 - Receive bit clock is enabled.
  1818. */
  1819. //@{
  1820. #define BP_I2S_RCSR_BCE (28U) //!< Bit position for I2S_RCSR_BCE.
  1821. #define BM_I2S_RCSR_BCE (0x10000000U) //!< Bit mask for I2S_RCSR_BCE.
  1822. #define BS_I2S_RCSR_BCE (1U) //!< Bit field size in bits for I2S_RCSR_BCE.
  1823. #ifndef __LANGUAGE_ASM__
  1824. //! @brief Read current value of the I2S_RCSR_BCE field.
  1825. #define BR_I2S_RCSR_BCE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_BCE))
  1826. #endif
  1827. //! @brief Format value for bitfield I2S_RCSR_BCE.
  1828. #define BF_I2S_RCSR_BCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_BCE), uint32_t) & BM_I2S_RCSR_BCE)
  1829. #ifndef __LANGUAGE_ASM__
  1830. //! @brief Set the BCE field to a new value.
  1831. #define BW_I2S_RCSR_BCE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_BCE) = (v))
  1832. #endif
  1833. //@}
  1834. /*!
  1835. * @name Register I2S_RCSR, field DBGE[29] (RW)
  1836. *
  1837. * Enables/disables receiver operation in Debug mode. The receive bit clock is
  1838. * not affected by Debug mode.
  1839. *
  1840. * Values:
  1841. * - 0 - Receiver is disabled in Debug mode, after completing the current frame.
  1842. * - 1 - Receiver is enabled in Debug mode.
  1843. */
  1844. //@{
  1845. #define BP_I2S_RCSR_DBGE (29U) //!< Bit position for I2S_RCSR_DBGE.
  1846. #define BM_I2S_RCSR_DBGE (0x20000000U) //!< Bit mask for I2S_RCSR_DBGE.
  1847. #define BS_I2S_RCSR_DBGE (1U) //!< Bit field size in bits for I2S_RCSR_DBGE.
  1848. #ifndef __LANGUAGE_ASM__
  1849. //! @brief Read current value of the I2S_RCSR_DBGE field.
  1850. #define BR_I2S_RCSR_DBGE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_DBGE))
  1851. #endif
  1852. //! @brief Format value for bitfield I2S_RCSR_DBGE.
  1853. #define BF_I2S_RCSR_DBGE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_DBGE), uint32_t) & BM_I2S_RCSR_DBGE)
  1854. #ifndef __LANGUAGE_ASM__
  1855. //! @brief Set the DBGE field to a new value.
  1856. #define BW_I2S_RCSR_DBGE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_DBGE) = (v))
  1857. #endif
  1858. //@}
  1859. /*!
  1860. * @name Register I2S_RCSR, field STOPE[30] (RW)
  1861. *
  1862. * Configures receiver operation in Stop mode. This bit is ignored and the
  1863. * receiver is disabled in all low-leakage stop modes.
  1864. *
  1865. * Values:
  1866. * - 0 - Receiver disabled in Stop mode.
  1867. * - 1 - Receiver enabled in Stop mode.
  1868. */
  1869. //@{
  1870. #define BP_I2S_RCSR_STOPE (30U) //!< Bit position for I2S_RCSR_STOPE.
  1871. #define BM_I2S_RCSR_STOPE (0x40000000U) //!< Bit mask for I2S_RCSR_STOPE.
  1872. #define BS_I2S_RCSR_STOPE (1U) //!< Bit field size in bits for I2S_RCSR_STOPE.
  1873. #ifndef __LANGUAGE_ASM__
  1874. //! @brief Read current value of the I2S_RCSR_STOPE field.
  1875. #define BR_I2S_RCSR_STOPE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_STOPE))
  1876. #endif
  1877. //! @brief Format value for bitfield I2S_RCSR_STOPE.
  1878. #define BF_I2S_RCSR_STOPE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_STOPE), uint32_t) & BM_I2S_RCSR_STOPE)
  1879. #ifndef __LANGUAGE_ASM__
  1880. //! @brief Set the STOPE field to a new value.
  1881. #define BW_I2S_RCSR_STOPE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_STOPE) = (v))
  1882. #endif
  1883. //@}
  1884. /*!
  1885. * @name Register I2S_RCSR, field RE[31] (RW)
  1886. *
  1887. * Enables/disables the receiver. When software clears this field, the receiver
  1888. * remains enabled, and this bit remains set, until the end of the current frame.
  1889. *
  1890. * Values:
  1891. * - 0 - Receiver is disabled.
  1892. * - 1 - Receiver is enabled, or receiver has been disabled and has not yet
  1893. * reached end of frame.
  1894. */
  1895. //@{
  1896. #define BP_I2S_RCSR_RE (31U) //!< Bit position for I2S_RCSR_RE.
  1897. #define BM_I2S_RCSR_RE (0x80000000U) //!< Bit mask for I2S_RCSR_RE.
  1898. #define BS_I2S_RCSR_RE (1U) //!< Bit field size in bits for I2S_RCSR_RE.
  1899. #ifndef __LANGUAGE_ASM__
  1900. //! @brief Read current value of the I2S_RCSR_RE field.
  1901. #define BR_I2S_RCSR_RE(x) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_RE))
  1902. #endif
  1903. //! @brief Format value for bitfield I2S_RCSR_RE.
  1904. #define BF_I2S_RCSR_RE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCSR_RE), uint32_t) & BM_I2S_RCSR_RE)
  1905. #ifndef __LANGUAGE_ASM__
  1906. //! @brief Set the RE field to a new value.
  1907. #define BW_I2S_RCSR_RE(x, v) (BITBAND_ACCESS32(HW_I2S_RCSR_ADDR(x), BP_I2S_RCSR_RE) = (v))
  1908. #endif
  1909. //@}
  1910. //-------------------------------------------------------------------------------------------
  1911. // HW_I2S_RCR1 - SAI Receive Configuration 1 Register
  1912. //-------------------------------------------------------------------------------------------
  1913. #ifndef __LANGUAGE_ASM__
  1914. /*!
  1915. * @brief HW_I2S_RCR1 - SAI Receive Configuration 1 Register (RW)
  1916. *
  1917. * Reset value: 0x00000000U
  1918. */
  1919. typedef union _hw_i2s_rcr1
  1920. {
  1921. uint32_t U;
  1922. struct _hw_i2s_rcr1_bitfields
  1923. {
  1924. uint32_t RFW : 3; //!< [2:0] Receive FIFO Watermark
  1925. uint32_t RESERVED0 : 29; //!< [31:3]
  1926. } B;
  1927. } hw_i2s_rcr1_t;
  1928. #endif
  1929. /*!
  1930. * @name Constants and macros for entire I2S_RCR1 register
  1931. */
  1932. //@{
  1933. #define HW_I2S_RCR1_ADDR(x) (REGS_I2S_BASE(x) + 0x84U)
  1934. #ifndef __LANGUAGE_ASM__
  1935. #define HW_I2S_RCR1(x) (*(__IO hw_i2s_rcr1_t *) HW_I2S_RCR1_ADDR(x))
  1936. #define HW_I2S_RCR1_RD(x) (HW_I2S_RCR1(x).U)
  1937. #define HW_I2S_RCR1_WR(x, v) (HW_I2S_RCR1(x).U = (v))
  1938. #define HW_I2S_RCR1_SET(x, v) (HW_I2S_RCR1_WR(x, HW_I2S_RCR1_RD(x) | (v)))
  1939. #define HW_I2S_RCR1_CLR(x, v) (HW_I2S_RCR1_WR(x, HW_I2S_RCR1_RD(x) & ~(v)))
  1940. #define HW_I2S_RCR1_TOG(x, v) (HW_I2S_RCR1_WR(x, HW_I2S_RCR1_RD(x) ^ (v)))
  1941. #endif
  1942. //@}
  1943. /*
  1944. * Constants & macros for individual I2S_RCR1 bitfields
  1945. */
  1946. /*!
  1947. * @name Register I2S_RCR1, field RFW[2:0] (RW)
  1948. *
  1949. * Configures the watermark level for all enabled receiver channels.
  1950. */
  1951. //@{
  1952. #define BP_I2S_RCR1_RFW (0U) //!< Bit position for I2S_RCR1_RFW.
  1953. #define BM_I2S_RCR1_RFW (0x00000007U) //!< Bit mask for I2S_RCR1_RFW.
  1954. #define BS_I2S_RCR1_RFW (3U) //!< Bit field size in bits for I2S_RCR1_RFW.
  1955. #ifndef __LANGUAGE_ASM__
  1956. //! @brief Read current value of the I2S_RCR1_RFW field.
  1957. #define BR_I2S_RCR1_RFW(x) (HW_I2S_RCR1(x).B.RFW)
  1958. #endif
  1959. //! @brief Format value for bitfield I2S_RCR1_RFW.
  1960. #define BF_I2S_RCR1_RFW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR1_RFW), uint32_t) & BM_I2S_RCR1_RFW)
  1961. #ifndef __LANGUAGE_ASM__
  1962. //! @brief Set the RFW field to a new value.
  1963. #define BW_I2S_RCR1_RFW(x, v) (HW_I2S_RCR1_WR(x, (HW_I2S_RCR1_RD(x) & ~BM_I2S_RCR1_RFW) | BF_I2S_RCR1_RFW(v)))
  1964. #endif
  1965. //@}
  1966. //-------------------------------------------------------------------------------------------
  1967. // HW_I2S_RCR2 - SAI Receive Configuration 2 Register
  1968. //-------------------------------------------------------------------------------------------
  1969. #ifndef __LANGUAGE_ASM__
  1970. /*!
  1971. * @brief HW_I2S_RCR2 - SAI Receive Configuration 2 Register (RW)
  1972. *
  1973. * Reset value: 0x00000000U
  1974. *
  1975. * This register must not be altered when RCSR[RE] is set.
  1976. */
  1977. typedef union _hw_i2s_rcr2
  1978. {
  1979. uint32_t U;
  1980. struct _hw_i2s_rcr2_bitfields
  1981. {
  1982. uint32_t DIV : 8; //!< [7:0] Bit Clock Divide
  1983. uint32_t RESERVED0 : 16; //!< [23:8]
  1984. uint32_t BCD : 1; //!< [24] Bit Clock Direction
  1985. uint32_t BCP : 1; //!< [25] Bit Clock Polarity
  1986. uint32_t MSEL : 2; //!< [27:26] MCLK Select
  1987. uint32_t BCI : 1; //!< [28] Bit Clock Input
  1988. uint32_t BCS : 1; //!< [29] Bit Clock Swap
  1989. uint32_t SYNC : 2; //!< [31:30] Synchronous Mode
  1990. } B;
  1991. } hw_i2s_rcr2_t;
  1992. #endif
  1993. /*!
  1994. * @name Constants and macros for entire I2S_RCR2 register
  1995. */
  1996. //@{
  1997. #define HW_I2S_RCR2_ADDR(x) (REGS_I2S_BASE(x) + 0x88U)
  1998. #ifndef __LANGUAGE_ASM__
  1999. #define HW_I2S_RCR2(x) (*(__IO hw_i2s_rcr2_t *) HW_I2S_RCR2_ADDR(x))
  2000. #define HW_I2S_RCR2_RD(x) (HW_I2S_RCR2(x).U)
  2001. #define HW_I2S_RCR2_WR(x, v) (HW_I2S_RCR2(x).U = (v))
  2002. #define HW_I2S_RCR2_SET(x, v) (HW_I2S_RCR2_WR(x, HW_I2S_RCR2_RD(x) | (v)))
  2003. #define HW_I2S_RCR2_CLR(x, v) (HW_I2S_RCR2_WR(x, HW_I2S_RCR2_RD(x) & ~(v)))
  2004. #define HW_I2S_RCR2_TOG(x, v) (HW_I2S_RCR2_WR(x, HW_I2S_RCR2_RD(x) ^ (v)))
  2005. #endif
  2006. //@}
  2007. /*
  2008. * Constants & macros for individual I2S_RCR2 bitfields
  2009. */
  2010. /*!
  2011. * @name Register I2S_RCR2, field DIV[7:0] (RW)
  2012. *
  2013. * Divides down the audio master clock to generate the bit clock when configured
  2014. * for an internal bit clock. The division value is (DIV + 1) * 2.
  2015. */
  2016. //@{
  2017. #define BP_I2S_RCR2_DIV (0U) //!< Bit position for I2S_RCR2_DIV.
  2018. #define BM_I2S_RCR2_DIV (0x000000FFU) //!< Bit mask for I2S_RCR2_DIV.
  2019. #define BS_I2S_RCR2_DIV (8U) //!< Bit field size in bits for I2S_RCR2_DIV.
  2020. #ifndef __LANGUAGE_ASM__
  2021. //! @brief Read current value of the I2S_RCR2_DIV field.
  2022. #define BR_I2S_RCR2_DIV(x) (HW_I2S_RCR2(x).B.DIV)
  2023. #endif
  2024. //! @brief Format value for bitfield I2S_RCR2_DIV.
  2025. #define BF_I2S_RCR2_DIV(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_DIV), uint32_t) & BM_I2S_RCR2_DIV)
  2026. #ifndef __LANGUAGE_ASM__
  2027. //! @brief Set the DIV field to a new value.
  2028. #define BW_I2S_RCR2_DIV(x, v) (HW_I2S_RCR2_WR(x, (HW_I2S_RCR2_RD(x) & ~BM_I2S_RCR2_DIV) | BF_I2S_RCR2_DIV(v)))
  2029. #endif
  2030. //@}
  2031. /*!
  2032. * @name Register I2S_RCR2, field BCD[24] (RW)
  2033. *
  2034. * Configures the direction of the bit clock.
  2035. *
  2036. * Values:
  2037. * - 0 - Bit clock is generated externally in Slave mode.
  2038. * - 1 - Bit clock is generated internally in Master mode.
  2039. */
  2040. //@{
  2041. #define BP_I2S_RCR2_BCD (24U) //!< Bit position for I2S_RCR2_BCD.
  2042. #define BM_I2S_RCR2_BCD (0x01000000U) //!< Bit mask for I2S_RCR2_BCD.
  2043. #define BS_I2S_RCR2_BCD (1U) //!< Bit field size in bits for I2S_RCR2_BCD.
  2044. #ifndef __LANGUAGE_ASM__
  2045. //! @brief Read current value of the I2S_RCR2_BCD field.
  2046. #define BR_I2S_RCR2_BCD(x) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCD))
  2047. #endif
  2048. //! @brief Format value for bitfield I2S_RCR2_BCD.
  2049. #define BF_I2S_RCR2_BCD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_BCD), uint32_t) & BM_I2S_RCR2_BCD)
  2050. #ifndef __LANGUAGE_ASM__
  2051. //! @brief Set the BCD field to a new value.
  2052. #define BW_I2S_RCR2_BCD(x, v) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCD) = (v))
  2053. #endif
  2054. //@}
  2055. /*!
  2056. * @name Register I2S_RCR2, field BCP[25] (RW)
  2057. *
  2058. * Configures the polarity of the bit clock.
  2059. *
  2060. * Values:
  2061. * - 0 - Bit Clock is active high with drive outputs on rising edge and sample
  2062. * inputs on falling edge.
  2063. * - 1 - Bit Clock is active low with drive outputs on falling edge and sample
  2064. * inputs on rising edge.
  2065. */
  2066. //@{
  2067. #define BP_I2S_RCR2_BCP (25U) //!< Bit position for I2S_RCR2_BCP.
  2068. #define BM_I2S_RCR2_BCP (0x02000000U) //!< Bit mask for I2S_RCR2_BCP.
  2069. #define BS_I2S_RCR2_BCP (1U) //!< Bit field size in bits for I2S_RCR2_BCP.
  2070. #ifndef __LANGUAGE_ASM__
  2071. //! @brief Read current value of the I2S_RCR2_BCP field.
  2072. #define BR_I2S_RCR2_BCP(x) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCP))
  2073. #endif
  2074. //! @brief Format value for bitfield I2S_RCR2_BCP.
  2075. #define BF_I2S_RCR2_BCP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_BCP), uint32_t) & BM_I2S_RCR2_BCP)
  2076. #ifndef __LANGUAGE_ASM__
  2077. //! @brief Set the BCP field to a new value.
  2078. #define BW_I2S_RCR2_BCP(x, v) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCP) = (v))
  2079. #endif
  2080. //@}
  2081. /*!
  2082. * @name Register I2S_RCR2, field MSEL[27:26] (RW)
  2083. *
  2084. * Selects the audio Master Clock option used to generate an internally
  2085. * generated bit clock. This field has no effect when configured for an externally
  2086. * generated bit clock. Depending on the device, some Master Clock options might not be
  2087. * available. See the chip configuration details for the availability and
  2088. * chip-specific meaning of each option.
  2089. *
  2090. * Values:
  2091. * - 00 - Bus Clock selected.
  2092. * - 01 - Master Clock (MCLK) 1 option selected.
  2093. * - 10 - Master Clock (MCLK) 2 option selected.
  2094. * - 11 - Master Clock (MCLK) 3 option selected.
  2095. */
  2096. //@{
  2097. #define BP_I2S_RCR2_MSEL (26U) //!< Bit position for I2S_RCR2_MSEL.
  2098. #define BM_I2S_RCR2_MSEL (0x0C000000U) //!< Bit mask for I2S_RCR2_MSEL.
  2099. #define BS_I2S_RCR2_MSEL (2U) //!< Bit field size in bits for I2S_RCR2_MSEL.
  2100. #ifndef __LANGUAGE_ASM__
  2101. //! @brief Read current value of the I2S_RCR2_MSEL field.
  2102. #define BR_I2S_RCR2_MSEL(x) (HW_I2S_RCR2(x).B.MSEL)
  2103. #endif
  2104. //! @brief Format value for bitfield I2S_RCR2_MSEL.
  2105. #define BF_I2S_RCR2_MSEL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_MSEL), uint32_t) & BM_I2S_RCR2_MSEL)
  2106. #ifndef __LANGUAGE_ASM__
  2107. //! @brief Set the MSEL field to a new value.
  2108. #define BW_I2S_RCR2_MSEL(x, v) (HW_I2S_RCR2_WR(x, (HW_I2S_RCR2_RD(x) & ~BM_I2S_RCR2_MSEL) | BF_I2S_RCR2_MSEL(v)))
  2109. #endif
  2110. //@}
  2111. /*!
  2112. * @name Register I2S_RCR2, field BCI[28] (RW)
  2113. *
  2114. * When this field is set and using an internally generated bit clock in either
  2115. * synchronous or asynchronous mode, the bit clock actually used by the receiver
  2116. * is delayed by the pad output delay (the receiver is clocked by the pad input
  2117. * as if the clock was externally generated). This has the effect of decreasing
  2118. * the data input setup time, but increasing the data output valid time. The slave
  2119. * mode timing from the datasheet should be used for the receiver when this bit
  2120. * is set. In synchronous mode, this bit allows the receiver to use the slave mode
  2121. * timing from the datasheet, while the transmitter uses the master mode timing.
  2122. * This field has no effect when configured for an externally generated bit
  2123. * clock or when synchronous to another SAI peripheral .
  2124. *
  2125. * Values:
  2126. * - 0 - No effect.
  2127. * - 1 - Internal logic is clocked as if bit clock was externally generated.
  2128. */
  2129. //@{
  2130. #define BP_I2S_RCR2_BCI (28U) //!< Bit position for I2S_RCR2_BCI.
  2131. #define BM_I2S_RCR2_BCI (0x10000000U) //!< Bit mask for I2S_RCR2_BCI.
  2132. #define BS_I2S_RCR2_BCI (1U) //!< Bit field size in bits for I2S_RCR2_BCI.
  2133. #ifndef __LANGUAGE_ASM__
  2134. //! @brief Read current value of the I2S_RCR2_BCI field.
  2135. #define BR_I2S_RCR2_BCI(x) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCI))
  2136. #endif
  2137. //! @brief Format value for bitfield I2S_RCR2_BCI.
  2138. #define BF_I2S_RCR2_BCI(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_BCI), uint32_t) & BM_I2S_RCR2_BCI)
  2139. #ifndef __LANGUAGE_ASM__
  2140. //! @brief Set the BCI field to a new value.
  2141. #define BW_I2S_RCR2_BCI(x, v) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCI) = (v))
  2142. #endif
  2143. //@}
  2144. /*!
  2145. * @name Register I2S_RCR2, field BCS[29] (RW)
  2146. *
  2147. * This field swaps the bit clock used by the receiver. When the receiver is
  2148. * configured in asynchronous mode and this bit is set, the receiver is clocked by
  2149. * the transmitter bit clock (SAI_TX_BCLK). This allows the transmitter and
  2150. * receiver to share the same bit clock, but the receiver continues to use the receiver
  2151. * frame sync (SAI_RX_SYNC). When the receiver is configured in synchronous
  2152. * mode, the transmitter BCS field and receiver BCS field must be set to the same
  2153. * value. When both are set, the transmitter and receiver are both clocked by the
  2154. * receiver bit clock (SAI_RX_BCLK) but use the transmitter frame sync
  2155. * (SAI_TX_SYNC). This field has no effect when synchronous to another SAI peripheral.
  2156. *
  2157. * Values:
  2158. * - 0 - Use the normal bit clock source.
  2159. * - 1 - Swap the bit clock source.
  2160. */
  2161. //@{
  2162. #define BP_I2S_RCR2_BCS (29U) //!< Bit position for I2S_RCR2_BCS.
  2163. #define BM_I2S_RCR2_BCS (0x20000000U) //!< Bit mask for I2S_RCR2_BCS.
  2164. #define BS_I2S_RCR2_BCS (1U) //!< Bit field size in bits for I2S_RCR2_BCS.
  2165. #ifndef __LANGUAGE_ASM__
  2166. //! @brief Read current value of the I2S_RCR2_BCS field.
  2167. #define BR_I2S_RCR2_BCS(x) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCS))
  2168. #endif
  2169. //! @brief Format value for bitfield I2S_RCR2_BCS.
  2170. #define BF_I2S_RCR2_BCS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_BCS), uint32_t) & BM_I2S_RCR2_BCS)
  2171. #ifndef __LANGUAGE_ASM__
  2172. //! @brief Set the BCS field to a new value.
  2173. #define BW_I2S_RCR2_BCS(x, v) (BITBAND_ACCESS32(HW_I2S_RCR2_ADDR(x), BP_I2S_RCR2_BCS) = (v))
  2174. #endif
  2175. //@}
  2176. /*!
  2177. * @name Register I2S_RCR2, field SYNC[31:30] (RW)
  2178. *
  2179. * Configures between asynchronous and synchronous modes of operation. When
  2180. * configured for a synchronous mode of operation, the transmitter or other SAI
  2181. * peripheral must be configured for asynchronous operation.
  2182. *
  2183. * Values:
  2184. * - 00 - Asynchronous mode.
  2185. * - 01 - Synchronous with transmitter.
  2186. * - 10 - Synchronous with another SAI receiver.
  2187. * - 11 - Synchronous with another SAI transmitter.
  2188. */
  2189. //@{
  2190. #define BP_I2S_RCR2_SYNC (30U) //!< Bit position for I2S_RCR2_SYNC.
  2191. #define BM_I2S_RCR2_SYNC (0xC0000000U) //!< Bit mask for I2S_RCR2_SYNC.
  2192. #define BS_I2S_RCR2_SYNC (2U) //!< Bit field size in bits for I2S_RCR2_SYNC.
  2193. #ifndef __LANGUAGE_ASM__
  2194. //! @brief Read current value of the I2S_RCR2_SYNC field.
  2195. #define BR_I2S_RCR2_SYNC(x) (HW_I2S_RCR2(x).B.SYNC)
  2196. #endif
  2197. //! @brief Format value for bitfield I2S_RCR2_SYNC.
  2198. #define BF_I2S_RCR2_SYNC(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR2_SYNC), uint32_t) & BM_I2S_RCR2_SYNC)
  2199. #ifndef __LANGUAGE_ASM__
  2200. //! @brief Set the SYNC field to a new value.
  2201. #define BW_I2S_RCR2_SYNC(x, v) (HW_I2S_RCR2_WR(x, (HW_I2S_RCR2_RD(x) & ~BM_I2S_RCR2_SYNC) | BF_I2S_RCR2_SYNC(v)))
  2202. #endif
  2203. //@}
  2204. //-------------------------------------------------------------------------------------------
  2205. // HW_I2S_RCR3 - SAI Receive Configuration 3 Register
  2206. //-------------------------------------------------------------------------------------------
  2207. #ifndef __LANGUAGE_ASM__
  2208. /*!
  2209. * @brief HW_I2S_RCR3 - SAI Receive Configuration 3 Register (RW)
  2210. *
  2211. * Reset value: 0x00000000U
  2212. *
  2213. * This register must not be altered when RCSR[RE] is set.
  2214. */
  2215. typedef union _hw_i2s_rcr3
  2216. {
  2217. uint32_t U;
  2218. struct _hw_i2s_rcr3_bitfields
  2219. {
  2220. uint32_t WDFL : 5; //!< [4:0] Word Flag Configuration
  2221. uint32_t RESERVED0 : 11; //!< [15:5]
  2222. uint32_t RCE : 2; //!< [17:16] Receive Channel Enable
  2223. uint32_t RESERVED1 : 14; //!< [31:18]
  2224. } B;
  2225. } hw_i2s_rcr3_t;
  2226. #endif
  2227. /*!
  2228. * @name Constants and macros for entire I2S_RCR3 register
  2229. */
  2230. //@{
  2231. #define HW_I2S_RCR3_ADDR(x) (REGS_I2S_BASE(x) + 0x8CU)
  2232. #ifndef __LANGUAGE_ASM__
  2233. #define HW_I2S_RCR3(x) (*(__IO hw_i2s_rcr3_t *) HW_I2S_RCR3_ADDR(x))
  2234. #define HW_I2S_RCR3_RD(x) (HW_I2S_RCR3(x).U)
  2235. #define HW_I2S_RCR3_WR(x, v) (HW_I2S_RCR3(x).U = (v))
  2236. #define HW_I2S_RCR3_SET(x, v) (HW_I2S_RCR3_WR(x, HW_I2S_RCR3_RD(x) | (v)))
  2237. #define HW_I2S_RCR3_CLR(x, v) (HW_I2S_RCR3_WR(x, HW_I2S_RCR3_RD(x) & ~(v)))
  2238. #define HW_I2S_RCR3_TOG(x, v) (HW_I2S_RCR3_WR(x, HW_I2S_RCR3_RD(x) ^ (v)))
  2239. #endif
  2240. //@}
  2241. /*
  2242. * Constants & macros for individual I2S_RCR3 bitfields
  2243. */
  2244. /*!
  2245. * @name Register I2S_RCR3, field WDFL[4:0] (RW)
  2246. *
  2247. * Configures which word the start of word flag is set. The value written should
  2248. * be one less than the word number (for example, write zero to configure for
  2249. * the first word in the frame). When configured to a value greater than the Frame
  2250. * Size field, then the start of word flag is never set.
  2251. */
  2252. //@{
  2253. #define BP_I2S_RCR3_WDFL (0U) //!< Bit position for I2S_RCR3_WDFL.
  2254. #define BM_I2S_RCR3_WDFL (0x0000001FU) //!< Bit mask for I2S_RCR3_WDFL.
  2255. #define BS_I2S_RCR3_WDFL (5U) //!< Bit field size in bits for I2S_RCR3_WDFL.
  2256. #ifndef __LANGUAGE_ASM__
  2257. //! @brief Read current value of the I2S_RCR3_WDFL field.
  2258. #define BR_I2S_RCR3_WDFL(x) (HW_I2S_RCR3(x).B.WDFL)
  2259. #endif
  2260. //! @brief Format value for bitfield I2S_RCR3_WDFL.
  2261. #define BF_I2S_RCR3_WDFL(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR3_WDFL), uint32_t) & BM_I2S_RCR3_WDFL)
  2262. #ifndef __LANGUAGE_ASM__
  2263. //! @brief Set the WDFL field to a new value.
  2264. #define BW_I2S_RCR3_WDFL(x, v) (HW_I2S_RCR3_WR(x, (HW_I2S_RCR3_RD(x) & ~BM_I2S_RCR3_WDFL) | BF_I2S_RCR3_WDFL(v)))
  2265. #endif
  2266. //@}
  2267. /*!
  2268. * @name Register I2S_RCR3, field RCE[17:16] (RW)
  2269. *
  2270. * Enables the corresponding data channel for receive operation. A channel must
  2271. * be enabled before its FIFO is accessed.
  2272. *
  2273. * Values:
  2274. * - 0 - Receive data channel N is disabled.
  2275. * - 1 - Receive data channel N is enabled.
  2276. */
  2277. //@{
  2278. #define BP_I2S_RCR3_RCE (16U) //!< Bit position for I2S_RCR3_RCE.
  2279. #define BM_I2S_RCR3_RCE (0x00030000U) //!< Bit mask for I2S_RCR3_RCE.
  2280. #define BS_I2S_RCR3_RCE (2U) //!< Bit field size in bits for I2S_RCR3_RCE.
  2281. #ifndef __LANGUAGE_ASM__
  2282. //! @brief Read current value of the I2S_RCR3_RCE field.
  2283. #define BR_I2S_RCR3_RCE(x) (HW_I2S_RCR3(x).B.RCE)
  2284. #endif
  2285. //! @brief Format value for bitfield I2S_RCR3_RCE.
  2286. #define BF_I2S_RCR3_RCE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR3_RCE), uint32_t) & BM_I2S_RCR3_RCE)
  2287. #ifndef __LANGUAGE_ASM__
  2288. //! @brief Set the RCE field to a new value.
  2289. #define BW_I2S_RCR3_RCE(x, v) (HW_I2S_RCR3_WR(x, (HW_I2S_RCR3_RD(x) & ~BM_I2S_RCR3_RCE) | BF_I2S_RCR3_RCE(v)))
  2290. #endif
  2291. //@}
  2292. //-------------------------------------------------------------------------------------------
  2293. // HW_I2S_RCR4 - SAI Receive Configuration 4 Register
  2294. //-------------------------------------------------------------------------------------------
  2295. #ifndef __LANGUAGE_ASM__
  2296. /*!
  2297. * @brief HW_I2S_RCR4 - SAI Receive Configuration 4 Register (RW)
  2298. *
  2299. * Reset value: 0x00000000U
  2300. *
  2301. * This register must not be altered when RCSR[RE] is set.
  2302. */
  2303. typedef union _hw_i2s_rcr4
  2304. {
  2305. uint32_t U;
  2306. struct _hw_i2s_rcr4_bitfields
  2307. {
  2308. uint32_t FSD : 1; //!< [0] Frame Sync Direction
  2309. uint32_t FSP : 1; //!< [1] Frame Sync Polarity
  2310. uint32_t RESERVED0 : 1; //!< [2]
  2311. uint32_t FSE : 1; //!< [3] Frame Sync Early
  2312. uint32_t MF : 1; //!< [4] MSB First
  2313. uint32_t RESERVED1 : 3; //!< [7:5]
  2314. uint32_t SYWD : 5; //!< [12:8] Sync Width
  2315. uint32_t RESERVED2 : 3; //!< [15:13]
  2316. uint32_t FRSZ : 5; //!< [20:16] Frame Size
  2317. uint32_t RESERVED3 : 11; //!< [31:21]
  2318. } B;
  2319. } hw_i2s_rcr4_t;
  2320. #endif
  2321. /*!
  2322. * @name Constants and macros for entire I2S_RCR4 register
  2323. */
  2324. //@{
  2325. #define HW_I2S_RCR4_ADDR(x) (REGS_I2S_BASE(x) + 0x90U)
  2326. #ifndef __LANGUAGE_ASM__
  2327. #define HW_I2S_RCR4(x) (*(__IO hw_i2s_rcr4_t *) HW_I2S_RCR4_ADDR(x))
  2328. #define HW_I2S_RCR4_RD(x) (HW_I2S_RCR4(x).U)
  2329. #define HW_I2S_RCR4_WR(x, v) (HW_I2S_RCR4(x).U = (v))
  2330. #define HW_I2S_RCR4_SET(x, v) (HW_I2S_RCR4_WR(x, HW_I2S_RCR4_RD(x) | (v)))
  2331. #define HW_I2S_RCR4_CLR(x, v) (HW_I2S_RCR4_WR(x, HW_I2S_RCR4_RD(x) & ~(v)))
  2332. #define HW_I2S_RCR4_TOG(x, v) (HW_I2S_RCR4_WR(x, HW_I2S_RCR4_RD(x) ^ (v)))
  2333. #endif
  2334. //@}
  2335. /*
  2336. * Constants & macros for individual I2S_RCR4 bitfields
  2337. */
  2338. /*!
  2339. * @name Register I2S_RCR4, field FSD[0] (RW)
  2340. *
  2341. * Configures the direction of the frame sync.
  2342. *
  2343. * Values:
  2344. * - 0 - Frame Sync is generated externally in Slave mode.
  2345. * - 1 - Frame Sync is generated internally in Master mode.
  2346. */
  2347. //@{
  2348. #define BP_I2S_RCR4_FSD (0U) //!< Bit position for I2S_RCR4_FSD.
  2349. #define BM_I2S_RCR4_FSD (0x00000001U) //!< Bit mask for I2S_RCR4_FSD.
  2350. #define BS_I2S_RCR4_FSD (1U) //!< Bit field size in bits for I2S_RCR4_FSD.
  2351. #ifndef __LANGUAGE_ASM__
  2352. //! @brief Read current value of the I2S_RCR4_FSD field.
  2353. #define BR_I2S_RCR4_FSD(x) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSD))
  2354. #endif
  2355. //! @brief Format value for bitfield I2S_RCR4_FSD.
  2356. #define BF_I2S_RCR4_FSD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_FSD), uint32_t) & BM_I2S_RCR4_FSD)
  2357. #ifndef __LANGUAGE_ASM__
  2358. //! @brief Set the FSD field to a new value.
  2359. #define BW_I2S_RCR4_FSD(x, v) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSD) = (v))
  2360. #endif
  2361. //@}
  2362. /*!
  2363. * @name Register I2S_RCR4, field FSP[1] (RW)
  2364. *
  2365. * Configures the polarity of the frame sync.
  2366. *
  2367. * Values:
  2368. * - 0 - Frame sync is active high.
  2369. * - 1 - Frame sync is active low.
  2370. */
  2371. //@{
  2372. #define BP_I2S_RCR4_FSP (1U) //!< Bit position for I2S_RCR4_FSP.
  2373. #define BM_I2S_RCR4_FSP (0x00000002U) //!< Bit mask for I2S_RCR4_FSP.
  2374. #define BS_I2S_RCR4_FSP (1U) //!< Bit field size in bits for I2S_RCR4_FSP.
  2375. #ifndef __LANGUAGE_ASM__
  2376. //! @brief Read current value of the I2S_RCR4_FSP field.
  2377. #define BR_I2S_RCR4_FSP(x) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSP))
  2378. #endif
  2379. //! @brief Format value for bitfield I2S_RCR4_FSP.
  2380. #define BF_I2S_RCR4_FSP(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_FSP), uint32_t) & BM_I2S_RCR4_FSP)
  2381. #ifndef __LANGUAGE_ASM__
  2382. //! @brief Set the FSP field to a new value.
  2383. #define BW_I2S_RCR4_FSP(x, v) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSP) = (v))
  2384. #endif
  2385. //@}
  2386. /*!
  2387. * @name Register I2S_RCR4, field FSE[3] (RW)
  2388. *
  2389. * Values:
  2390. * - 0 - Frame sync asserts with the first bit of the frame.
  2391. * - 1 - Frame sync asserts one bit before the first bit of the frame.
  2392. */
  2393. //@{
  2394. #define BP_I2S_RCR4_FSE (3U) //!< Bit position for I2S_RCR4_FSE.
  2395. #define BM_I2S_RCR4_FSE (0x00000008U) //!< Bit mask for I2S_RCR4_FSE.
  2396. #define BS_I2S_RCR4_FSE (1U) //!< Bit field size in bits for I2S_RCR4_FSE.
  2397. #ifndef __LANGUAGE_ASM__
  2398. //! @brief Read current value of the I2S_RCR4_FSE field.
  2399. #define BR_I2S_RCR4_FSE(x) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSE))
  2400. #endif
  2401. //! @brief Format value for bitfield I2S_RCR4_FSE.
  2402. #define BF_I2S_RCR4_FSE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_FSE), uint32_t) & BM_I2S_RCR4_FSE)
  2403. #ifndef __LANGUAGE_ASM__
  2404. //! @brief Set the FSE field to a new value.
  2405. #define BW_I2S_RCR4_FSE(x, v) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_FSE) = (v))
  2406. #endif
  2407. //@}
  2408. /*!
  2409. * @name Register I2S_RCR4, field MF[4] (RW)
  2410. *
  2411. * Configures whether the LSB or the MSB is received first.
  2412. *
  2413. * Values:
  2414. * - 0 - LSB is received first.
  2415. * - 1 - MSB is received first.
  2416. */
  2417. //@{
  2418. #define BP_I2S_RCR4_MF (4U) //!< Bit position for I2S_RCR4_MF.
  2419. #define BM_I2S_RCR4_MF (0x00000010U) //!< Bit mask for I2S_RCR4_MF.
  2420. #define BS_I2S_RCR4_MF (1U) //!< Bit field size in bits for I2S_RCR4_MF.
  2421. #ifndef __LANGUAGE_ASM__
  2422. //! @brief Read current value of the I2S_RCR4_MF field.
  2423. #define BR_I2S_RCR4_MF(x) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_MF))
  2424. #endif
  2425. //! @brief Format value for bitfield I2S_RCR4_MF.
  2426. #define BF_I2S_RCR4_MF(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_MF), uint32_t) & BM_I2S_RCR4_MF)
  2427. #ifndef __LANGUAGE_ASM__
  2428. //! @brief Set the MF field to a new value.
  2429. #define BW_I2S_RCR4_MF(x, v) (BITBAND_ACCESS32(HW_I2S_RCR4_ADDR(x), BP_I2S_RCR4_MF) = (v))
  2430. #endif
  2431. //@}
  2432. /*!
  2433. * @name Register I2S_RCR4, field SYWD[12:8] (RW)
  2434. *
  2435. * Configures the length of the frame sync in number of bit clocks. The value
  2436. * written must be one less than the number of bit clocks. For example, write 0 for
  2437. * the frame sync to assert for one bit clock only. The sync width cannot be
  2438. * configured longer than the first word of the frame.
  2439. */
  2440. //@{
  2441. #define BP_I2S_RCR4_SYWD (8U) //!< Bit position for I2S_RCR4_SYWD.
  2442. #define BM_I2S_RCR4_SYWD (0x00001F00U) //!< Bit mask for I2S_RCR4_SYWD.
  2443. #define BS_I2S_RCR4_SYWD (5U) //!< Bit field size in bits for I2S_RCR4_SYWD.
  2444. #ifndef __LANGUAGE_ASM__
  2445. //! @brief Read current value of the I2S_RCR4_SYWD field.
  2446. #define BR_I2S_RCR4_SYWD(x) (HW_I2S_RCR4(x).B.SYWD)
  2447. #endif
  2448. //! @brief Format value for bitfield I2S_RCR4_SYWD.
  2449. #define BF_I2S_RCR4_SYWD(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_SYWD), uint32_t) & BM_I2S_RCR4_SYWD)
  2450. #ifndef __LANGUAGE_ASM__
  2451. //! @brief Set the SYWD field to a new value.
  2452. #define BW_I2S_RCR4_SYWD(x, v) (HW_I2S_RCR4_WR(x, (HW_I2S_RCR4_RD(x) & ~BM_I2S_RCR4_SYWD) | BF_I2S_RCR4_SYWD(v)))
  2453. #endif
  2454. //@}
  2455. /*!
  2456. * @name Register I2S_RCR4, field FRSZ[20:16] (RW)
  2457. *
  2458. * Configures the number of words in each frame. The value written must be one
  2459. * less than the number of words in the frame. For example, write 0 for one word
  2460. * per frame. The maximum supported frame size is 32 words.
  2461. */
  2462. //@{
  2463. #define BP_I2S_RCR4_FRSZ (16U) //!< Bit position for I2S_RCR4_FRSZ.
  2464. #define BM_I2S_RCR4_FRSZ (0x001F0000U) //!< Bit mask for I2S_RCR4_FRSZ.
  2465. #define BS_I2S_RCR4_FRSZ (5U) //!< Bit field size in bits for I2S_RCR4_FRSZ.
  2466. #ifndef __LANGUAGE_ASM__
  2467. //! @brief Read current value of the I2S_RCR4_FRSZ field.
  2468. #define BR_I2S_RCR4_FRSZ(x) (HW_I2S_RCR4(x).B.FRSZ)
  2469. #endif
  2470. //! @brief Format value for bitfield I2S_RCR4_FRSZ.
  2471. #define BF_I2S_RCR4_FRSZ(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR4_FRSZ), uint32_t) & BM_I2S_RCR4_FRSZ)
  2472. #ifndef __LANGUAGE_ASM__
  2473. //! @brief Set the FRSZ field to a new value.
  2474. #define BW_I2S_RCR4_FRSZ(x, v) (HW_I2S_RCR4_WR(x, (HW_I2S_RCR4_RD(x) & ~BM_I2S_RCR4_FRSZ) | BF_I2S_RCR4_FRSZ(v)))
  2475. #endif
  2476. //@}
  2477. //-------------------------------------------------------------------------------------------
  2478. // HW_I2S_RCR5 - SAI Receive Configuration 5 Register
  2479. //-------------------------------------------------------------------------------------------
  2480. #ifndef __LANGUAGE_ASM__
  2481. /*!
  2482. * @brief HW_I2S_RCR5 - SAI Receive Configuration 5 Register (RW)
  2483. *
  2484. * Reset value: 0x00000000U
  2485. *
  2486. * This register must not be altered when RCSR[RE] is set.
  2487. */
  2488. typedef union _hw_i2s_rcr5
  2489. {
  2490. uint32_t U;
  2491. struct _hw_i2s_rcr5_bitfields
  2492. {
  2493. uint32_t RESERVED0 : 8; //!< [7:0]
  2494. uint32_t FBT : 5; //!< [12:8] First Bit Shifted
  2495. uint32_t RESERVED1 : 3; //!< [15:13]
  2496. uint32_t W0W : 5; //!< [20:16] Word 0 Width
  2497. uint32_t RESERVED2 : 3; //!< [23:21]
  2498. uint32_t WNW : 5; //!< [28:24] Word N Width
  2499. uint32_t RESERVED3 : 3; //!< [31:29]
  2500. } B;
  2501. } hw_i2s_rcr5_t;
  2502. #endif
  2503. /*!
  2504. * @name Constants and macros for entire I2S_RCR5 register
  2505. */
  2506. //@{
  2507. #define HW_I2S_RCR5_ADDR(x) (REGS_I2S_BASE(x) + 0x94U)
  2508. #ifndef __LANGUAGE_ASM__
  2509. #define HW_I2S_RCR5(x) (*(__IO hw_i2s_rcr5_t *) HW_I2S_RCR5_ADDR(x))
  2510. #define HW_I2S_RCR5_RD(x) (HW_I2S_RCR5(x).U)
  2511. #define HW_I2S_RCR5_WR(x, v) (HW_I2S_RCR5(x).U = (v))
  2512. #define HW_I2S_RCR5_SET(x, v) (HW_I2S_RCR5_WR(x, HW_I2S_RCR5_RD(x) | (v)))
  2513. #define HW_I2S_RCR5_CLR(x, v) (HW_I2S_RCR5_WR(x, HW_I2S_RCR5_RD(x) & ~(v)))
  2514. #define HW_I2S_RCR5_TOG(x, v) (HW_I2S_RCR5_WR(x, HW_I2S_RCR5_RD(x) ^ (v)))
  2515. #endif
  2516. //@}
  2517. /*
  2518. * Constants & macros for individual I2S_RCR5 bitfields
  2519. */
  2520. /*!
  2521. * @name Register I2S_RCR5, field FBT[12:8] (RW)
  2522. *
  2523. * Configures the bit index for the first bit received for each word in the
  2524. * frame. If configured for MSB First, the index of the next bit received is one less
  2525. * than the current bit received. If configured for LSB First, the index of the
  2526. * next bit received is one more than the current bit received. The value written
  2527. * must be greater than or equal to the word width when configured for MSB
  2528. * First. The value written must be less than or equal to 31-word width when
  2529. * configured for LSB First.
  2530. */
  2531. //@{
  2532. #define BP_I2S_RCR5_FBT (8U) //!< Bit position for I2S_RCR5_FBT.
  2533. #define BM_I2S_RCR5_FBT (0x00001F00U) //!< Bit mask for I2S_RCR5_FBT.
  2534. #define BS_I2S_RCR5_FBT (5U) //!< Bit field size in bits for I2S_RCR5_FBT.
  2535. #ifndef __LANGUAGE_ASM__
  2536. //! @brief Read current value of the I2S_RCR5_FBT field.
  2537. #define BR_I2S_RCR5_FBT(x) (HW_I2S_RCR5(x).B.FBT)
  2538. #endif
  2539. //! @brief Format value for bitfield I2S_RCR5_FBT.
  2540. #define BF_I2S_RCR5_FBT(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR5_FBT), uint32_t) & BM_I2S_RCR5_FBT)
  2541. #ifndef __LANGUAGE_ASM__
  2542. //! @brief Set the FBT field to a new value.
  2543. #define BW_I2S_RCR5_FBT(x, v) (HW_I2S_RCR5_WR(x, (HW_I2S_RCR5_RD(x) & ~BM_I2S_RCR5_FBT) | BF_I2S_RCR5_FBT(v)))
  2544. #endif
  2545. //@}
  2546. /*!
  2547. * @name Register I2S_RCR5, field W0W[20:16] (RW)
  2548. *
  2549. * Configures the number of bits in the first word in each frame. The value
  2550. * written must be one less than the number of bits in the first word. Word width of
  2551. * less than 8 bits is not supported if there is only one word per frame.
  2552. */
  2553. //@{
  2554. #define BP_I2S_RCR5_W0W (16U) //!< Bit position for I2S_RCR5_W0W.
  2555. #define BM_I2S_RCR5_W0W (0x001F0000U) //!< Bit mask for I2S_RCR5_W0W.
  2556. #define BS_I2S_RCR5_W0W (5U) //!< Bit field size in bits for I2S_RCR5_W0W.
  2557. #ifndef __LANGUAGE_ASM__
  2558. //! @brief Read current value of the I2S_RCR5_W0W field.
  2559. #define BR_I2S_RCR5_W0W(x) (HW_I2S_RCR5(x).B.W0W)
  2560. #endif
  2561. //! @brief Format value for bitfield I2S_RCR5_W0W.
  2562. #define BF_I2S_RCR5_W0W(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR5_W0W), uint32_t) & BM_I2S_RCR5_W0W)
  2563. #ifndef __LANGUAGE_ASM__
  2564. //! @brief Set the W0W field to a new value.
  2565. #define BW_I2S_RCR5_W0W(x, v) (HW_I2S_RCR5_WR(x, (HW_I2S_RCR5_RD(x) & ~BM_I2S_RCR5_W0W) | BF_I2S_RCR5_W0W(v)))
  2566. #endif
  2567. //@}
  2568. /*!
  2569. * @name Register I2S_RCR5, field WNW[28:24] (RW)
  2570. *
  2571. * Configures the number of bits in each word, for each word except the first in
  2572. * the frame. The value written must be one less than the number of bits per
  2573. * word. Word width of less than 8 bits is not supported.
  2574. */
  2575. //@{
  2576. #define BP_I2S_RCR5_WNW (24U) //!< Bit position for I2S_RCR5_WNW.
  2577. #define BM_I2S_RCR5_WNW (0x1F000000U) //!< Bit mask for I2S_RCR5_WNW.
  2578. #define BS_I2S_RCR5_WNW (5U) //!< Bit field size in bits for I2S_RCR5_WNW.
  2579. #ifndef __LANGUAGE_ASM__
  2580. //! @brief Read current value of the I2S_RCR5_WNW field.
  2581. #define BR_I2S_RCR5_WNW(x) (HW_I2S_RCR5(x).B.WNW)
  2582. #endif
  2583. //! @brief Format value for bitfield I2S_RCR5_WNW.
  2584. #define BF_I2S_RCR5_WNW(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RCR5_WNW), uint32_t) & BM_I2S_RCR5_WNW)
  2585. #ifndef __LANGUAGE_ASM__
  2586. //! @brief Set the WNW field to a new value.
  2587. #define BW_I2S_RCR5_WNW(x, v) (HW_I2S_RCR5_WR(x, (HW_I2S_RCR5_RD(x) & ~BM_I2S_RCR5_WNW) | BF_I2S_RCR5_WNW(v)))
  2588. #endif
  2589. //@}
  2590. //-------------------------------------------------------------------------------------------
  2591. // HW_I2S_RDRn - SAI Receive Data Register
  2592. //-------------------------------------------------------------------------------------------
  2593. #ifndef __LANGUAGE_ASM__
  2594. /*!
  2595. * @brief HW_I2S_RDRn - SAI Receive Data Register (RO)
  2596. *
  2597. * Reset value: 0x00000000U
  2598. *
  2599. * Reading this register introduces one additional peripheral clock wait state
  2600. * on each read.
  2601. */
  2602. typedef union _hw_i2s_rdrn
  2603. {
  2604. uint32_t U;
  2605. struct _hw_i2s_rdrn_bitfields
  2606. {
  2607. uint32_t RDR : 32; //!< [31:0] Receive Data Register
  2608. } B;
  2609. } hw_i2s_rdrn_t;
  2610. #endif
  2611. /*!
  2612. * @name Constants and macros for entire I2S_RDRn register
  2613. */
  2614. //@{
  2615. #define HW_I2S_RDRn_COUNT (2U)
  2616. #define HW_I2S_RDRn_ADDR(x, n) (REGS_I2S_BASE(x) + 0xA0U + (0x4U * n))
  2617. #ifndef __LANGUAGE_ASM__
  2618. #define HW_I2S_RDRn(x, n) (*(__I hw_i2s_rdrn_t *) HW_I2S_RDRn_ADDR(x, n))
  2619. #define HW_I2S_RDRn_RD(x, n) (HW_I2S_RDRn(x, n).U)
  2620. #endif
  2621. //@}
  2622. /*
  2623. * Constants & macros for individual I2S_RDRn bitfields
  2624. */
  2625. /*!
  2626. * @name Register I2S_RDRn, field RDR[31:0] (RO)
  2627. *
  2628. * The corresponding RCR3[RCE] bit must be set before accessing the channel's
  2629. * receive data register. Reads from this register when the receive FIFO is not
  2630. * empty will return the data from the top of the receive FIFO. Reads from this
  2631. * register when the receive FIFO is empty are ignored.
  2632. */
  2633. //@{
  2634. #define BP_I2S_RDRn_RDR (0U) //!< Bit position for I2S_RDRn_RDR.
  2635. #define BM_I2S_RDRn_RDR (0xFFFFFFFFU) //!< Bit mask for I2S_RDRn_RDR.
  2636. #define BS_I2S_RDRn_RDR (32U) //!< Bit field size in bits for I2S_RDRn_RDR.
  2637. #ifndef __LANGUAGE_ASM__
  2638. //! @brief Read current value of the I2S_RDRn_RDR field.
  2639. #define BR_I2S_RDRn_RDR(x, n) (HW_I2S_RDRn(x, n).U)
  2640. #endif
  2641. //@}
  2642. //-------------------------------------------------------------------------------------------
  2643. // HW_I2S_RFRn - SAI Receive FIFO Register
  2644. //-------------------------------------------------------------------------------------------
  2645. #ifndef __LANGUAGE_ASM__
  2646. /*!
  2647. * @brief HW_I2S_RFRn - SAI Receive FIFO Register (RO)
  2648. *
  2649. * Reset value: 0x00000000U
  2650. *
  2651. * The MSB of the read and write pointers is used to distinguish between FIFO
  2652. * full and empty conditions. If the read and write pointers are identical, then
  2653. * the FIFO is empty. If the read and write pointers are identical except for the
  2654. * MSB, then the FIFO is full.
  2655. */
  2656. typedef union _hw_i2s_rfrn
  2657. {
  2658. uint32_t U;
  2659. struct _hw_i2s_rfrn_bitfields
  2660. {
  2661. uint32_t RFP : 4; //!< [3:0] Read FIFO Pointer
  2662. uint32_t RESERVED0 : 12; //!< [15:4]
  2663. uint32_t WFP : 4; //!< [19:16] Write FIFO Pointer
  2664. uint32_t RESERVED1 : 12; //!< [31:20]
  2665. } B;
  2666. } hw_i2s_rfrn_t;
  2667. #endif
  2668. /*!
  2669. * @name Constants and macros for entire I2S_RFRn register
  2670. */
  2671. //@{
  2672. #define HW_I2S_RFRn_COUNT (2U)
  2673. #define HW_I2S_RFRn_ADDR(x, n) (REGS_I2S_BASE(x) + 0xC0U + (0x4U * n))
  2674. #ifndef __LANGUAGE_ASM__
  2675. #define HW_I2S_RFRn(x, n) (*(__I hw_i2s_rfrn_t *) HW_I2S_RFRn_ADDR(x, n))
  2676. #define HW_I2S_RFRn_RD(x, n) (HW_I2S_RFRn(x, n).U)
  2677. #endif
  2678. //@}
  2679. /*
  2680. * Constants & macros for individual I2S_RFRn bitfields
  2681. */
  2682. /*!
  2683. * @name Register I2S_RFRn, field RFP[3:0] (RO)
  2684. *
  2685. * FIFO read pointer for receive data channel.
  2686. */
  2687. //@{
  2688. #define BP_I2S_RFRn_RFP (0U) //!< Bit position for I2S_RFRn_RFP.
  2689. #define BM_I2S_RFRn_RFP (0x0000000FU) //!< Bit mask for I2S_RFRn_RFP.
  2690. #define BS_I2S_RFRn_RFP (4U) //!< Bit field size in bits for I2S_RFRn_RFP.
  2691. #ifndef __LANGUAGE_ASM__
  2692. //! @brief Read current value of the I2S_RFRn_RFP field.
  2693. #define BR_I2S_RFRn_RFP(x, n) (HW_I2S_RFRn(x, n).B.RFP)
  2694. #endif
  2695. //@}
  2696. /*!
  2697. * @name Register I2S_RFRn, field WFP[19:16] (RO)
  2698. *
  2699. * FIFO write pointer for receive data channel.
  2700. */
  2701. //@{
  2702. #define BP_I2S_RFRn_WFP (16U) //!< Bit position for I2S_RFRn_WFP.
  2703. #define BM_I2S_RFRn_WFP (0x000F0000U) //!< Bit mask for I2S_RFRn_WFP.
  2704. #define BS_I2S_RFRn_WFP (4U) //!< Bit field size in bits for I2S_RFRn_WFP.
  2705. #ifndef __LANGUAGE_ASM__
  2706. //! @brief Read current value of the I2S_RFRn_WFP field.
  2707. #define BR_I2S_RFRn_WFP(x, n) (HW_I2S_RFRn(x, n).B.WFP)
  2708. #endif
  2709. //@}
  2710. //-------------------------------------------------------------------------------------------
  2711. // HW_I2S_RMR - SAI Receive Mask Register
  2712. //-------------------------------------------------------------------------------------------
  2713. #ifndef __LANGUAGE_ASM__
  2714. /*!
  2715. * @brief HW_I2S_RMR - SAI Receive Mask Register (RW)
  2716. *
  2717. * Reset value: 0x00000000U
  2718. *
  2719. * This register is double-buffered and updates: When RCSR[RE] is first set At
  2720. * the end of each frame This allows the masked words in each frame to change from
  2721. * frame to frame.
  2722. */
  2723. typedef union _hw_i2s_rmr
  2724. {
  2725. uint32_t U;
  2726. struct _hw_i2s_rmr_bitfields
  2727. {
  2728. uint32_t RWM : 32; //!< [31:0] Receive Word Mask
  2729. } B;
  2730. } hw_i2s_rmr_t;
  2731. #endif
  2732. /*!
  2733. * @name Constants and macros for entire I2S_RMR register
  2734. */
  2735. //@{
  2736. #define HW_I2S_RMR_ADDR(x) (REGS_I2S_BASE(x) + 0xE0U)
  2737. #ifndef __LANGUAGE_ASM__
  2738. #define HW_I2S_RMR(x) (*(__IO hw_i2s_rmr_t *) HW_I2S_RMR_ADDR(x))
  2739. #define HW_I2S_RMR_RD(x) (HW_I2S_RMR(x).U)
  2740. #define HW_I2S_RMR_WR(x, v) (HW_I2S_RMR(x).U = (v))
  2741. #define HW_I2S_RMR_SET(x, v) (HW_I2S_RMR_WR(x, HW_I2S_RMR_RD(x) | (v)))
  2742. #define HW_I2S_RMR_CLR(x, v) (HW_I2S_RMR_WR(x, HW_I2S_RMR_RD(x) & ~(v)))
  2743. #define HW_I2S_RMR_TOG(x, v) (HW_I2S_RMR_WR(x, HW_I2S_RMR_RD(x) ^ (v)))
  2744. #endif
  2745. //@}
  2746. /*
  2747. * Constants & macros for individual I2S_RMR bitfields
  2748. */
  2749. /*!
  2750. * @name Register I2S_RMR, field RWM[31:0] (RW)
  2751. *
  2752. * Configures whether the receive word is masked (received data ignored and not
  2753. * written to receive FIFO) for the corresponding word in the frame.
  2754. *
  2755. * Values:
  2756. * - 0 - Word N is enabled.
  2757. * - 1 - Word N is masked.
  2758. */
  2759. //@{
  2760. #define BP_I2S_RMR_RWM (0U) //!< Bit position for I2S_RMR_RWM.
  2761. #define BM_I2S_RMR_RWM (0xFFFFFFFFU) //!< Bit mask for I2S_RMR_RWM.
  2762. #define BS_I2S_RMR_RWM (32U) //!< Bit field size in bits for I2S_RMR_RWM.
  2763. #ifndef __LANGUAGE_ASM__
  2764. //! @brief Read current value of the I2S_RMR_RWM field.
  2765. #define BR_I2S_RMR_RWM(x) (HW_I2S_RMR(x).U)
  2766. #endif
  2767. //! @brief Format value for bitfield I2S_RMR_RWM.
  2768. #define BF_I2S_RMR_RWM(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_RMR_RWM), uint32_t) & BM_I2S_RMR_RWM)
  2769. #ifndef __LANGUAGE_ASM__
  2770. //! @brief Set the RWM field to a new value.
  2771. #define BW_I2S_RMR_RWM(x, v) (HW_I2S_RMR_WR(x, v))
  2772. #endif
  2773. //@}
  2774. //-------------------------------------------------------------------------------------------
  2775. // HW_I2S_MCR - SAI MCLK Control Register
  2776. //-------------------------------------------------------------------------------------------
  2777. #ifndef __LANGUAGE_ASM__
  2778. /*!
  2779. * @brief HW_I2S_MCR - SAI MCLK Control Register (RW)
  2780. *
  2781. * Reset value: 0x00000000U
  2782. *
  2783. * The MCLK Control Register (MCR) controls the clock source and direction of
  2784. * the audio master clock.
  2785. */
  2786. typedef union _hw_i2s_mcr
  2787. {
  2788. uint32_t U;
  2789. struct _hw_i2s_mcr_bitfields
  2790. {
  2791. uint32_t RESERVED0 : 24; //!< [23:0]
  2792. uint32_t MICS : 2; //!< [25:24] MCLK Input Clock Select
  2793. uint32_t RESERVED1 : 4; //!< [29:26]
  2794. uint32_t MOE : 1; //!< [30] MCLK Output Enable
  2795. uint32_t DUF : 1; //!< [31] Divider Update Flag
  2796. } B;
  2797. } hw_i2s_mcr_t;
  2798. #endif
  2799. /*!
  2800. * @name Constants and macros for entire I2S_MCR register
  2801. */
  2802. //@{
  2803. #define HW_I2S_MCR_ADDR(x) (REGS_I2S_BASE(x) + 0x100U)
  2804. #ifndef __LANGUAGE_ASM__
  2805. #define HW_I2S_MCR(x) (*(__IO hw_i2s_mcr_t *) HW_I2S_MCR_ADDR(x))
  2806. #define HW_I2S_MCR_RD(x) (HW_I2S_MCR(x).U)
  2807. #define HW_I2S_MCR_WR(x, v) (HW_I2S_MCR(x).U = (v))
  2808. #define HW_I2S_MCR_SET(x, v) (HW_I2S_MCR_WR(x, HW_I2S_MCR_RD(x) | (v)))
  2809. #define HW_I2S_MCR_CLR(x, v) (HW_I2S_MCR_WR(x, HW_I2S_MCR_RD(x) & ~(v)))
  2810. #define HW_I2S_MCR_TOG(x, v) (HW_I2S_MCR_WR(x, HW_I2S_MCR_RD(x) ^ (v)))
  2811. #endif
  2812. //@}
  2813. /*
  2814. * Constants & macros for individual I2S_MCR bitfields
  2815. */
  2816. /*!
  2817. * @name Register I2S_MCR, field MICS[25:24] (RW)
  2818. *
  2819. * Selects the clock input to the MCLK divider. This field cannot be changed
  2820. * while the MCLK divider is enabled. See the chip configuration details for
  2821. * information about the connections to these inputs.
  2822. *
  2823. * Values:
  2824. * - 00 - MCLK divider input clock 0 selected.
  2825. * - 01 - MCLK divider input clock 1 selected.
  2826. * - 10 - MCLK divider input clock 2 selected.
  2827. * - 11 - MCLK divider input clock 3 selected.
  2828. */
  2829. //@{
  2830. #define BP_I2S_MCR_MICS (24U) //!< Bit position for I2S_MCR_MICS.
  2831. #define BM_I2S_MCR_MICS (0x03000000U) //!< Bit mask for I2S_MCR_MICS.
  2832. #define BS_I2S_MCR_MICS (2U) //!< Bit field size in bits for I2S_MCR_MICS.
  2833. #ifndef __LANGUAGE_ASM__
  2834. //! @brief Read current value of the I2S_MCR_MICS field.
  2835. #define BR_I2S_MCR_MICS(x) (HW_I2S_MCR(x).B.MICS)
  2836. #endif
  2837. //! @brief Format value for bitfield I2S_MCR_MICS.
  2838. #define BF_I2S_MCR_MICS(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_MCR_MICS), uint32_t) & BM_I2S_MCR_MICS)
  2839. #ifndef __LANGUAGE_ASM__
  2840. //! @brief Set the MICS field to a new value.
  2841. #define BW_I2S_MCR_MICS(x, v) (HW_I2S_MCR_WR(x, (HW_I2S_MCR_RD(x) & ~BM_I2S_MCR_MICS) | BF_I2S_MCR_MICS(v)))
  2842. #endif
  2843. //@}
  2844. /*!
  2845. * @name Register I2S_MCR, field MOE[30] (RW)
  2846. *
  2847. * Enables the MCLK divider and configures the MCLK signal pin as an output.
  2848. * When software clears this field, it remains set until the MCLK divider is fully
  2849. * disabled.
  2850. *
  2851. * Values:
  2852. * - 0 - MCLK signal pin is configured as an input that bypasses the MCLK
  2853. * divider.
  2854. * - 1 - MCLK signal pin is configured as an output from the MCLK divider and
  2855. * the MCLK divider is enabled.
  2856. */
  2857. //@{
  2858. #define BP_I2S_MCR_MOE (30U) //!< Bit position for I2S_MCR_MOE.
  2859. #define BM_I2S_MCR_MOE (0x40000000U) //!< Bit mask for I2S_MCR_MOE.
  2860. #define BS_I2S_MCR_MOE (1U) //!< Bit field size in bits for I2S_MCR_MOE.
  2861. #ifndef __LANGUAGE_ASM__
  2862. //! @brief Read current value of the I2S_MCR_MOE field.
  2863. #define BR_I2S_MCR_MOE(x) (BITBAND_ACCESS32(HW_I2S_MCR_ADDR(x), BP_I2S_MCR_MOE))
  2864. #endif
  2865. //! @brief Format value for bitfield I2S_MCR_MOE.
  2866. #define BF_I2S_MCR_MOE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_MCR_MOE), uint32_t) & BM_I2S_MCR_MOE)
  2867. #ifndef __LANGUAGE_ASM__
  2868. //! @brief Set the MOE field to a new value.
  2869. #define BW_I2S_MCR_MOE(x, v) (BITBAND_ACCESS32(HW_I2S_MCR_ADDR(x), BP_I2S_MCR_MOE) = (v))
  2870. #endif
  2871. //@}
  2872. /*!
  2873. * @name Register I2S_MCR, field DUF[31] (RO)
  2874. *
  2875. * Provides the status of on-the-fly updates to the MCLK divider ratio.
  2876. *
  2877. * Values:
  2878. * - 0 - MCLK divider ratio is not being updated currently.
  2879. * - 1 - MCLK divider ratio is updating on-the-fly. Further updates to the MCLK
  2880. * divider ratio are blocked while this flag remains set.
  2881. */
  2882. //@{
  2883. #define BP_I2S_MCR_DUF (31U) //!< Bit position for I2S_MCR_DUF.
  2884. #define BM_I2S_MCR_DUF (0x80000000U) //!< Bit mask for I2S_MCR_DUF.
  2885. #define BS_I2S_MCR_DUF (1U) //!< Bit field size in bits for I2S_MCR_DUF.
  2886. #ifndef __LANGUAGE_ASM__
  2887. //! @brief Read current value of the I2S_MCR_DUF field.
  2888. #define BR_I2S_MCR_DUF(x) (BITBAND_ACCESS32(HW_I2S_MCR_ADDR(x), BP_I2S_MCR_DUF))
  2889. #endif
  2890. //@}
  2891. //-------------------------------------------------------------------------------------------
  2892. // HW_I2S_MDR - SAI MCLK Divide Register
  2893. //-------------------------------------------------------------------------------------------
  2894. #ifndef __LANGUAGE_ASM__
  2895. /*!
  2896. * @brief HW_I2S_MDR - SAI MCLK Divide Register (RW)
  2897. *
  2898. * Reset value: 0x00000000U
  2899. *
  2900. * The MCLK Divide Register (MDR) configures the MCLK divide ratio. Although the
  2901. * MDR can be changed when the MCLK divider clock is enabled, additional writes
  2902. * to the MDR are blocked while MCR[DUF] is set. Writes to the MDR when the MCLK
  2903. * divided clock is disabled do not set MCR[DUF].
  2904. */
  2905. typedef union _hw_i2s_mdr
  2906. {
  2907. uint32_t U;
  2908. struct _hw_i2s_mdr_bitfields
  2909. {
  2910. uint32_t DIVIDE : 12; //!< [11:0] MCLK Divide
  2911. uint32_t FRACT : 8; //!< [19:12] MCLK Fraction
  2912. uint32_t RESERVED0 : 12; //!< [31:20]
  2913. } B;
  2914. } hw_i2s_mdr_t;
  2915. #endif
  2916. /*!
  2917. * @name Constants and macros for entire I2S_MDR register
  2918. */
  2919. //@{
  2920. #define HW_I2S_MDR_ADDR(x) (REGS_I2S_BASE(x) + 0x104U)
  2921. #ifndef __LANGUAGE_ASM__
  2922. #define HW_I2S_MDR(x) (*(__IO hw_i2s_mdr_t *) HW_I2S_MDR_ADDR(x))
  2923. #define HW_I2S_MDR_RD(x) (HW_I2S_MDR(x).U)
  2924. #define HW_I2S_MDR_WR(x, v) (HW_I2S_MDR(x).U = (v))
  2925. #define HW_I2S_MDR_SET(x, v) (HW_I2S_MDR_WR(x, HW_I2S_MDR_RD(x) | (v)))
  2926. #define HW_I2S_MDR_CLR(x, v) (HW_I2S_MDR_WR(x, HW_I2S_MDR_RD(x) & ~(v)))
  2927. #define HW_I2S_MDR_TOG(x, v) (HW_I2S_MDR_WR(x, HW_I2S_MDR_RD(x) ^ (v)))
  2928. #endif
  2929. //@}
  2930. /*
  2931. * Constants & macros for individual I2S_MDR bitfields
  2932. */
  2933. /*!
  2934. * @name Register I2S_MDR, field DIVIDE[11:0] (RW)
  2935. *
  2936. * Sets the MCLK divide ratio such that: MCLK output = MCLK input * ( (FRACT +
  2937. * 1) / (DIVIDE + 1) ). FRACT must be set equal or less than the value in the
  2938. * DIVIDE field.
  2939. */
  2940. //@{
  2941. #define BP_I2S_MDR_DIVIDE (0U) //!< Bit position for I2S_MDR_DIVIDE.
  2942. #define BM_I2S_MDR_DIVIDE (0x00000FFFU) //!< Bit mask for I2S_MDR_DIVIDE.
  2943. #define BS_I2S_MDR_DIVIDE (12U) //!< Bit field size in bits for I2S_MDR_DIVIDE.
  2944. #ifndef __LANGUAGE_ASM__
  2945. //! @brief Read current value of the I2S_MDR_DIVIDE field.
  2946. #define BR_I2S_MDR_DIVIDE(x) (HW_I2S_MDR(x).B.DIVIDE)
  2947. #endif
  2948. //! @brief Format value for bitfield I2S_MDR_DIVIDE.
  2949. #define BF_I2S_MDR_DIVIDE(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_MDR_DIVIDE), uint32_t) & BM_I2S_MDR_DIVIDE)
  2950. #ifndef __LANGUAGE_ASM__
  2951. //! @brief Set the DIVIDE field to a new value.
  2952. #define BW_I2S_MDR_DIVIDE(x, v) (HW_I2S_MDR_WR(x, (HW_I2S_MDR_RD(x) & ~BM_I2S_MDR_DIVIDE) | BF_I2S_MDR_DIVIDE(v)))
  2953. #endif
  2954. //@}
  2955. /*!
  2956. * @name Register I2S_MDR, field FRACT[19:12] (RW)
  2957. *
  2958. * Sets the MCLK divide ratio such that: MCLK output = MCLK input * ( (FRACT +
  2959. * 1) / (DIVIDE + 1) ). FRACT must be set equal or less than the value in the
  2960. * DIVIDE field.
  2961. */
  2962. //@{
  2963. #define BP_I2S_MDR_FRACT (12U) //!< Bit position for I2S_MDR_FRACT.
  2964. #define BM_I2S_MDR_FRACT (0x000FF000U) //!< Bit mask for I2S_MDR_FRACT.
  2965. #define BS_I2S_MDR_FRACT (8U) //!< Bit field size in bits for I2S_MDR_FRACT.
  2966. #ifndef __LANGUAGE_ASM__
  2967. //! @brief Read current value of the I2S_MDR_FRACT field.
  2968. #define BR_I2S_MDR_FRACT(x) (HW_I2S_MDR(x).B.FRACT)
  2969. #endif
  2970. //! @brief Format value for bitfield I2S_MDR_FRACT.
  2971. #define BF_I2S_MDR_FRACT(v) (__REG_VALUE_TYPE((__REG_VALUE_TYPE((v), uint32_t) << BP_I2S_MDR_FRACT), uint32_t) & BM_I2S_MDR_FRACT)
  2972. #ifndef __LANGUAGE_ASM__
  2973. //! @brief Set the FRACT field to a new value.
  2974. #define BW_I2S_MDR_FRACT(x, v) (HW_I2S_MDR_WR(x, (HW_I2S_MDR_RD(x) & ~BM_I2S_MDR_FRACT) | BF_I2S_MDR_FRACT(v)))
  2975. #endif
  2976. //@}
  2977. //-------------------------------------------------------------------------------------------
  2978. // hw_i2s_t - module struct
  2979. //-------------------------------------------------------------------------------------------
  2980. /*!
  2981. * @brief All I2S module registers.
  2982. */
  2983. #ifndef __LANGUAGE_ASM__
  2984. #pragma pack(1)
  2985. typedef struct _hw_i2s
  2986. {
  2987. __IO hw_i2s_tcsr_t TCSR; //!< [0x0] SAI Transmit Control Register
  2988. __IO hw_i2s_tcr1_t TCR1; //!< [0x4] SAI Transmit Configuration 1 Register
  2989. __IO hw_i2s_tcr2_t TCR2; //!< [0x8] SAI Transmit Configuration 2 Register
  2990. __IO hw_i2s_tcr3_t TCR3; //!< [0xC] SAI Transmit Configuration 3 Register
  2991. __IO hw_i2s_tcr4_t TCR4; //!< [0x10] SAI Transmit Configuration 4 Register
  2992. __IO hw_i2s_tcr5_t TCR5; //!< [0x14] SAI Transmit Configuration 5 Register
  2993. uint8_t _reserved0[8];
  2994. __O hw_i2s_tdrn_t TDRn[2]; //!< [0x20] SAI Transmit Data Register
  2995. uint8_t _reserved1[24];
  2996. __I hw_i2s_tfrn_t TFRn[2]; //!< [0x40] SAI Transmit FIFO Register
  2997. uint8_t _reserved2[24];
  2998. __IO hw_i2s_tmr_t TMR; //!< [0x60] SAI Transmit Mask Register
  2999. uint8_t _reserved3[28];
  3000. __IO hw_i2s_rcsr_t RCSR; //!< [0x80] SAI Receive Control Register
  3001. __IO hw_i2s_rcr1_t RCR1; //!< [0x84] SAI Receive Configuration 1 Register
  3002. __IO hw_i2s_rcr2_t RCR2; //!< [0x88] SAI Receive Configuration 2 Register
  3003. __IO hw_i2s_rcr3_t RCR3; //!< [0x8C] SAI Receive Configuration 3 Register
  3004. __IO hw_i2s_rcr4_t RCR4; //!< [0x90] SAI Receive Configuration 4 Register
  3005. __IO hw_i2s_rcr5_t RCR5; //!< [0x94] SAI Receive Configuration 5 Register
  3006. uint8_t _reserved4[8];
  3007. __I hw_i2s_rdrn_t RDRn[2]; //!< [0xA0] SAI Receive Data Register
  3008. uint8_t _reserved5[24];
  3009. __I hw_i2s_rfrn_t RFRn[2]; //!< [0xC0] SAI Receive FIFO Register
  3010. uint8_t _reserved6[24];
  3011. __IO hw_i2s_rmr_t RMR; //!< [0xE0] SAI Receive Mask Register
  3012. uint8_t _reserved7[28];
  3013. __IO hw_i2s_mcr_t MCR; //!< [0x100] SAI MCLK Control Register
  3014. __IO hw_i2s_mdr_t MDR; //!< [0x104] SAI MCLK Divide Register
  3015. } hw_i2s_t;
  3016. #pragma pack()
  3017. //! @brief Macro to access all I2S registers.
  3018. //! @param x I2S instance number.
  3019. //! @return Reference (not a pointer) to the registers struct. To get a pointer to the struct,
  3020. //! use the '&' operator, like <code>&HW_I2S(0)</code>.
  3021. #define HW_I2S(x) (*(hw_i2s_t *) REGS_I2S_BASE(x))
  3022. #endif
  3023. #endif // __HW_I2S_REGISTERS_H__
  3024. // v22/130726/0.9
  3025. // EOF