CC35xxDriverLibrary
i2s.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Filename: i2s.h
3  *
4  * Description: Prototypes and defines for the I2S API.
5  *
6  * Copyright (c) 2025 Texas Instruments Incorporated
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1) Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * 2) Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3) Neither the name of the copyright holder nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
26  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *
34  ******************************************************************************/
35 
36 #ifndef __I2S_H__
37 #define __I2S_H__
38 
39 //****************************************************************************
40 //
45 //
46 //****************************************************************************
47 
48 //*****************************************************************************
49 //
50 // If building with a C++ compiler, make all of the definitions in this header
51 // have a C binding.
52 //
53 //*****************************************************************************
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #include <stdbool.h>
59 #include <stdint.h>
60 #include "../inc/hw_types.h"
61 #include "../inc/hw_ints.h"
62 #include "../inc/hw_memmap.h"
63 #include "../inc/hw_i2s.h"
64 #include "debug.h"
65 #include "interrupt.h"
66 
67 //*****************************************************************************
68 //
69 // Defines for selecting I2S module clock source
70 //
71 //*****************************************************************************
72 #define I2S_CLK_SRC_SOC_CLK I2S_CLKCFG_CLKSEL_SEL_1
73 #define I2S_CLK_SRC_SOC_PLL_CLK I2S_CLKCFG_CLKSEL_SEL_2
74 #define I2S_CLK_SRC_HFXT_CLK I2S_CLKCFG_CLKSEL_SEL_3
75 
76 //*****************************************************************************
77 //
78 // Defines for selecting data pin usage.
79 //
80 //*****************************************************************************
81 #define I2S_SD0_DIS I2S_AIFDIRCFG_AD0_DIS
82 #define I2S_SD0_IN I2S_AIFDIRCFG_AD0_IN
83 #define I2S_SD0_OUT I2S_AIFDIRCFG_AD0_OUT
84 #define I2S_SD1_DIS I2S_AIFDIRCFG_AD1_DIS
85 #define I2S_SD1_IN I2S_AIFDIRCFG_AD1_IN
86 #define I2S_SD1_OUT I2S_AIFDIRCFG_AD1_OUT
87 
88 //*****************************************************************************
89 //
90 // Defines for activating an audio channel.
91 //
92 //*****************************************************************************
93 #define I2S_CHAN0_MASK 0x00000001
94 #define I2S_CHAN1_MASK 0x00000002
95 #define I2S_CHAN2_MASK 0x00000004
96 #define I2S_CHAN3_MASK 0x00000008
97 #define I2S_CHAN4_MASK 0x00000010
98 #define I2S_CHAN5_MASK 0x00000020
99 #define I2S_CHAN6_MASK 0x00000040
100 #define I2S_CHAN7_MASK 0x00000080
101 
102 //*****************************************************************************
103 //
104 // Defines for the audio format configuration
105 //
106 //*****************************************************************************
107 #define I2S_MEM_LENGTH_16 I2S_AIFFMTCFG_LEN32__16BIT
108 #define I2S_MEM_LENGTH_32 I2S_AIFFMTCFG_LEN32__32BIT
109 #define I2S_POS_EDGE I2S_AIFFMTCFG_SMPLEDGE_POS
110 #define I2S_NEG_EDGE I2S_AIFFMTCFG_SMPLEDGE_NEG
111 
112 //*****************************************************************************
113 //
114 // Defines for the sample stamp counters
115 //
116 //*****************************************************************************
117 #define I2S_STMP_SATURATION 0x0000FFFF
118 
119 //*****************************************************************************
120 //
121 // Defines for the interrupt
122 //
123 //*****************************************************************************
124 #define I2S_INT_XCNT_CAPTURE I2S_IRQFLAGS_XCNTCPT
125 #define I2S_INT_DMA_IN I2S_IRQFLAGS_AIFDMAIN
126 #define I2S_INT_DMA_OUT I2S_IRQFLAGS_AIFDMAOUT
127 #define I2S_INT_TIMEOUT I2S_IRQFLAGS_WCLKTOUT
128 #define I2S_INT_BUS_ERR I2S_IRQFLAGS_BUSERR
129 #define I2S_INT_WCLK_ERR I2S_IRQFLAGS_WCLKERR
130 #define I2S_INT_PTR_ERR I2S_IRQFLAGS_PTRERR
131 #define I2S_INT_ALL \
132  (I2S_INT_XCNT_CAPTURE | I2S_INT_DMA_IN | I2S_INT_DMA_OUT | I2S_INT_TIMEOUT | I2S_INT_BUS_ERR | I2S_INT_WCLK_ERR | \
133  I2S_INT_PTR_ERR)
134 
135 //*****************************************************************************
136 //
137 // API Functions and prototypes
138 //
139 //*****************************************************************************
140 
141 #ifdef DRIVERLIB_DEBUG
142 //*****************************************************************************
143 //
154 //
155 //*****************************************************************************
156 static bool I2SBaseValid(uint32_t base)
157 {
158  return (base == I2S_BASE);
159 }
160 #endif
161 
162 //*****************************************************************************
163 //
183 //
184 //*****************************************************************************
185 __STATIC_INLINE void I2SEnableInt(uint32_t base, uint32_t intFlags)
186 {
187  // Check the arguments
188  ASSERT(I2SBaseValid(base));
189 
190  // Enable the specified interrupts
191  HWREG(I2S_BASE + I2S_O_IRQMASK) |= intFlags;
192 }
193 
194 //*****************************************************************************
195 //
215 //
216 //*****************************************************************************
217 __STATIC_INLINE void I2SDisableInt(uint32_t base, uint32_t intFlags)
218 {
219  // Check the arguments
220  ASSERT(I2SBaseValid(base));
221 
222  // Disable the specified interrupts
223  HWREG(I2S_BASE + I2S_O_IRQMASK) &= ~intFlags;
224 }
225 
226 //*****************************************************************************
227 //
247 //
248 //*****************************************************************************
249 __STATIC_INLINE uint32_t I2SIntStatus(uint32_t base, bool masked)
250 {
251  uint32_t status;
252 
253  // Check the arguments
254  ASSERT(I2SBaseValid(base));
255 
256  // Read the raw status
257  status = HWREG(I2S_BASE + I2S_O_IRQFLAGS);
258 
259  // If the masked status is requested, mask the raw status with the interrupt
260  // mask.
261  if (masked)
262  {
263  status &= HWREG(I2S_BASE + I2S_O_IRQMASK);
264  }
265 
266  return status;
267 }
268 
269 //*****************************************************************************
270 //
290 //
291 //*****************************************************************************
292 __STATIC_INLINE void I2SClearInt(uint32_t base, uint32_t intFlags)
293 {
294  // Check the arguments
295  ASSERT(I2SBaseValid(base));
296 
297  // Clear the requested interrupt sources
298  HWREG(I2S_BASE + I2S_O_IRQCLR) = intFlags;
299 }
300 
301 //*****************************************************************************
302 //
317 //
318 //*****************************************************************************
320 {
321  // Check the arguments
322  ASSERT(I2SBaseValid(base));
323 
324  // Set the enable bit
326 }
327 
328 //*****************************************************************************
329 //
338 //
339 //*****************************************************************************
341 {
342  // Check the arguments
343  ASSERT(I2SBaseValid(base));
344 
345  // Clear the enable bit
347 }
348 
349 //*****************************************************************************
350 //
357 //
358 //*****************************************************************************
359 extern uint32_t I2SGetSampleStamp(uint32_t base, uint32_t channel);
360 
361 //*****************************************************************************
362 //
381 //
382 //*****************************************************************************
383 __STATIC_INLINE void I2SStart(uint32_t base, uint16_t dmaLength)
384 {
385  // Check the arguments
386  ASSERT(I2SBaseValid(base));
387  ASSERT(dmaLength <= 256);
388  ASSERT(dmaLength >= 2);
389 
390  // Enable the I2S module, by writting a non-zero value to AIFDMACFG.
391  // AIFDMACFG expects the end frame index to be written, and the end index is
392  // one less than the length.
394 }
395 
396 //*****************************************************************************
397 //
417 //
418 //*****************************************************************************
419 __STATIC_INLINE void I2SStop(uint32_t base)
420 {
421  // Check the arguments
422  ASSERT(I2SBaseValid(base));
423 
424  // Disable the I2S module
425  HWREG(I2S_BASE + I2S_O_AIFDMACFG) = 0x00;
426 }
427 
428 //*****************************************************************************
429 //
461 //
462 //*****************************************************************************
464  uint8_t dataDelay,
465  uint32_t memoryLength,
466  uint32_t samplingEdge,
467  bool dualPhase,
468  uint8_t bitsPerSample)
469 {
470  // Check the arguments
471  ASSERT(I2SBaseValid(base));
472  ASSERT(bitsPerSample <= 24); // Max. I2S_AIFFMTCFG_WORD_LEN
473  ASSERT(bitsPerSample >= 8); // Min. I2S_AIFFMTCFG_WORD_LEN
474 
475  // Setup register AIFFMTCFG Source
476  HWREGH(I2S_BASE + I2S_O_AIFFMTCFG) = (dataDelay << I2S_AIFFMTCFG_DATADELAY_S) | (memoryLength) | (samplingEdge) |
477  (dualPhase << I2S_AIFFMTCFG_DUALPHASE_S) |
478  (bitsPerSample << I2S_AIFFMTCFG_WORDLEN_S);
479 }
480 
481 //****************************************************************************
482 //
520 //
521 //****************************************************************************
523  uint8_t sd0Usage,
524  uint8_t sd0Channels,
525  uint8_t sd1Usage,
526  uint8_t sd1Channels)
527 {
528  // Check the arguments
529  ASSERT(I2SBaseValid(base));
530 
531  // Configure input/output channels
532  HWREGB(I2S_BASE + I2S_O_AIFDIRCFG) = (sd0Usage | sd1Usage);
533 
534  // Configure the valid channel mask
535  HWREGB(I2S_BASE + I2S_O_AIFWMASK0) = sd0Channels;
536  HWREGB(I2S_BASE + I2S_O_AIFWMASK1) = sd1Channels;
537 }
538 
539 //****************************************************************************
540 //
584 //
585 //****************************************************************************
587  bool isController,
588  bool invertWclk,
589  bool dualPhase,
590  uint32_t cclkDiv,
591  uint32_t wclkDiv,
592  uint32_t bclkDiv)
593 {
594  // Check the arguments
595  ASSERT(I2SBaseValid(base));
596  ASSERT(cclkDiv <= 1024);
597  ASSERT(cclkDiv >= 2);
598  ASSERT(wclkDiv <= 1023);
599  ASSERT(wclkDiv >= 1);
600  ASSERT(bclkDiv <= 1024);
601  ASSERT(bclkDiv >= 2);
602 
603  // Setup register WCLK and BCLK Source
605  (invertWclk ? I2S_AIFWCLKSRC_WCLKINV : 0));
606 
607  // Configure internal clocks, if internal clocks are to be used
608  if (isController)
609  {
610 
611  // Make sure to compensate the WCLK division factor if using single
612  // phase format.
613  if (dualPhase == false)
614  {
615  wclkDiv -= 1;
616  }
617 
618  // Write the clock division factors.
619  // A value of 0 is interpreted as 1024 for CCLK and BCLK.
620  HWREG(I2S_BASE + I2S_O_AIFMCLKDIV) = (cclkDiv == 1024 ? 0 : cclkDiv);
621  HWREG(I2S_BASE + I2S_O_AIFWCLKDIV) = wclkDiv;
622  HWREG(I2S_BASE + I2S_O_AIFBCLKDIV) = (bclkDiv == 1024 ? 0 : bclkDiv);
623 
624  // Configure the WCLK format and disable CCLK, WCLK and BCLK
626  : (0 << I2S_AIFCLKCTL_WCLKPHASE_S));
627  }
628 }
629 
630 //*****************************************************************************
631 //
642 //
643 //*****************************************************************************
645 {
646  // Enable CCLK, WCLK and BCLK
648 }
649 
650 //*****************************************************************************
651 //
658 //
659 //*****************************************************************************
661 {
662  // Disable CCLK, WCLK and BCLK
664 }
665 
666 //****************************************************************************
667 //
684 //
685 //****************************************************************************
686 __STATIC_INLINE void I2SSetInPointer(uint32_t base, uint32_t nextPointer)
687 {
688  // Check the arguments
689  ASSERT(I2SBaseValid(base));
690 
691  HWREG(I2S_BASE + I2S_O_AIFINPTNXT) = nextPointer;
692 }
693 
694 //****************************************************************************
695 //
712 //
713 //****************************************************************************
714 __STATIC_INLINE void I2SSetOutPointer(uint32_t base, uint32_t nextPointer)
715 {
716  // Check the arguments
717  ASSERT(I2SBaseValid(base));
718 
719  HWREG(I2S_BASE + I2S_O_AIFOPTNXT) = nextPointer;
720 }
721 
722 //****************************************************************************
723 //
729 //
730 //****************************************************************************
731 __STATIC_INLINE uint32_t I2SGetInPointerNext(uint32_t base)
732 {
733  // Check the arguments
734  ASSERT(I2SBaseValid(base));
735 
736  return (HWREG(I2S_BASE + I2S_O_AIFINPTNXT));
737 }
738 
739 //****************************************************************************
740 //
746 //
747 //****************************************************************************
748 __STATIC_INLINE uint32_t I2SGetOutPointerNext(uint32_t base)
749 {
750  // Check the arguments
751  ASSERT(I2SBaseValid(base));
752 
753  return (HWREG(I2S_BASE + I2S_O_AIFOPTNXT));
754 }
755 
756 //****************************************************************************
757 //
763 //
764 //****************************************************************************
765 __STATIC_INLINE uint32_t I2SGetInPointer(uint32_t base)
766 {
767  // Check the arguments
768  ASSERT(I2SBaseValid(base));
769 
770  return (HWREG(I2S_BASE + I2S_O_AIFINPTR));
771 }
772 
773 //****************************************************************************
774 //
780 //
781 //****************************************************************************
782 __STATIC_INLINE uint32_t I2SGetOutPointer(uint32_t base)
783 {
784  // Check the arguments
785  ASSERT(I2SBaseValid(base));
786 
787  return (HWREG(I2S_BASE + I2S_O_AIFOUTPTR));
788 }
789 
790 //*****************************************************************************
791 //
800 //
801 //*****************************************************************************
802 __STATIC_INLINE void I2SConfigureInSampleStampTrigger(uint32_t base, uint16_t trigValue)
803 {
804  // Check the arguments
805  ASSERT(I2SBaseValid(base));
806 
807  // Setup the sample stamp trigger for input streams
808  HWREGH(I2S_BASE + I2S_O_STMPINTRIG) = trigValue;
809 }
810 
811 //*****************************************************************************
812 //
821 //
822 //*****************************************************************************
823 __STATIC_INLINE void I2SConfigureOutSampleStampTrigger(uint32_t base, uint16_t trigValue)
824 {
825  // Check the arguments
826  ASSERT(I2SBaseValid(base));
827 
828  // Setup the sample stamp trigger for output streams
829  HWREGH(I2S_BASE + I2S_O_STMPOTRIG) = trigValue;
830 }
831 
832 //*****************************************************************************
833 //
844 //
845 //*****************************************************************************
846 __STATIC_INLINE void I2SConfigureWclkCounterPeriod(uint32_t base, uint16_t period)
847 {
848  // Check the arguments
849  ASSERT(I2SBaseValid(base));
850 
851  // Configure the WCLK counter period
852  HWREGH(I2S_BASE + I2S_O_STMPWPER) = period;
853 }
854 
855 //*****************************************************************************
856 //
864 //
865 //*****************************************************************************
866 __STATIC_INLINE void I2SConfigureWclkCounter(uint32_t base, int16_t value)
867 {
868  uint16_t minusValue;
869 
870  // Check the arguments
871  ASSERT(I2SBaseValid(base));
872 
873  if (value >= 0)
874  {
875  HWREGH(I2S_BASE + I2S_O_STMPWADD) = value;
876  }
877  else
878  {
879  minusValue = (uint16_t)(-value);
881  }
882 }
883 
884 //*****************************************************************************
885 //
891 //
892 //*****************************************************************************
894 {
895  // Check the arguments
896  ASSERT(I2SBaseValid(base));
897 
899 }
900 
901 //*****************************************************************************
902 //
908 //
909 //*****************************************************************************
910 __STATIC_INLINE void I2SEnableClk(uint32_t base)
911 {
912  // Check the arguments
913  ASSERT(I2SBaseValid(base));
914 
916 }
917 
918 //*****************************************************************************
919 //
925 //
926 //*****************************************************************************
927 __STATIC_INLINE void I2SDisableClk(uint32_t base)
928 {
929  // Check the arguments
930  ASSERT(I2SBaseValid(base));
931 
933 }
934 
935 //*****************************************************************************
936 //
944 //
945 //*****************************************************************************
946 __STATIC_INLINE void I2SEnableAdfs(uint32_t base)
947 {
948  // Check the arguments
949  ASSERT(I2SBaseValid(base));
950 
952 }
953 
954 //*****************************************************************************
955 //
965 //
966 //*****************************************************************************
967 __STATIC_INLINE void I2SSelectAdfsInputClk(uint32_t base, uint32_t source)
968 {
969  // Check the arguments
970  ASSERT(I2SBaseValid(base));
971 
972  uint32_t temp = HWREG(I2S_BASE + I2S_O_CLKCFG);
973  temp &= ~I2S_CLKCFG_CLKSEL_M;
974  temp |= (source & I2S_CLKCFG_CLKSEL_M);
975  HWREG(I2S_BASE + I2S_O_CLKCFG) = temp;
976 }
977 
978 //*****************************************************************************
979 //
1031 //
1032 //*****************************************************************************
1033 __STATIC_INLINE void I2SConfigureAdfs(uint32_t base, uint32_t tref, uint32_t delta, uint32_t deltaSign, uint32_t div)
1034 {
1035  // Check the arguments
1036  ASSERT(I2SBaseValid(base));
1037 
1042 }
1043 
1044 //*****************************************************************************
1045 //
1051 //
1052 //*****************************************************************************
1053 __STATIC_INLINE void I2SDisableAdfs(uint32_t base)
1054 {
1055  // Check the arguments
1056  ASSERT(I2SBaseValid(base));
1057 
1059 }
1060 
1061 //*****************************************************************************
1062 //
1063 // Mark the end of the C bindings section for C++ compilers.
1064 //
1065 //*****************************************************************************
1066 #ifdef __cplusplus
1067 }
1068 #endif
1069 //****************************************************************************
1070 //
1074 //
1075 //****************************************************************************
1076 
1077 #endif // __I2S_H__
__STATIC_INLINE void I2SStart(uint32_t base, uint16_t dmaLength)
Starts the I2S.
Definition: i2s.h:383
#define I2S_O_AIFWMASK1
Definition: hw_i2s.h:60
#define I2S_STMPCTL_STMPEN_M
Definition: hw_i2s.h:509
__STATIC_INLINE void I2SConfigureOutSampleStampTrigger(uint32_t base, uint16_t trigValue)
Configure the output sample stamp trigger.
Definition: i2s.h:823
#define I2S_AIFFMTCFG_DUALPHASE_S
Definition: hw_i2s.h:292
__STATIC_INLINE void I2SConfigureWclkCounter(uint32_t base, int16_t value)
Confiugre the WCLK counter value.
Definition: i2s.h:866
#define I2S_ADFSCTRL2_DIV_M
Definition: hw_i2s.h:1412
__STATIC_INLINE void I2SDisableAdfs(uint32_t base)
Disables the ADFS (Adaptive Digital Frequency Synthesizer) module.
Definition: i2s.h:1053
__STATIC_INLINE void I2SConfigureClocks(uint32_t base, bool isController, bool invertWclk, bool dualPhase, uint32_t cclkDiv, uint32_t wclkDiv, uint32_t bclkDiv)
Configure the I2S clocks (CCLK, WCLK and BCLK).
Definition: i2s.h:586
#define I2S_O_AIFBCLKDIV
Definition: hw_i2s.h:126
#define HWREG(x)
Definition: hw_types.h:78
#define I2S_O_AIFDMACFG
Definition: hw_i2s.h:48
#define __STATIC_INLINE
Definition: hw_types.h:57
__STATIC_INLINE void I2SEnableControllerClocks(uint32_t base)
Enable the I2S controller clocks (CCLK, WCLK and BCLK).
Definition: i2s.h:644
__STATIC_INLINE void I2SResetWclkCounter(uint32_t base)
Reset the WCLK count.
Definition: i2s.h:893
#define I2S_O_ADFSCTRL2
Definition: hw_i2s.h:141
#define I2S_O_AIFINPTNXT
Definition: hw_i2s.h:63
#define I2S_O_STMPWPER
Definition: hw_i2s.h:87
#define I2S_O_IRQCLR
Definition: hw_i2s.h:120
__STATIC_INLINE void I2SConfigureWclkCounterPeriod(uint32_t base, uint16_t period)
Configure the WCLK counter period.
Definition: i2s.h:846
#define I2S_O_AIFMCLKDIV
Definition: hw_i2s.h:123
uint32_t I2SGetSampleStamp(uint32_t base, uint32_t channel)
Get the current value of a sample stamp counter.
Definition: i2s.c:43
#define I2S_O_STMPINTRIG
Definition: hw_i2s.h:90
#define I2S_AIFWCLKSRC_WBCLKSRC_INT
Definition: hw_i2s.h:169
#define I2S_CLKCFG_ADFSEN_M
Definition: hw_i2s.h:1350
#define I2S_ADFSCTRL2_DELTASIGN_M
Definition: hw_i2s.h:1400
__STATIC_INLINE void I2SSetInPointer(uint32_t base, uint32_t nextPointer)
Set the next input buffer pointer.
Definition: i2s.h:686
__STATIC_INLINE void I2SConfigureFrame(uint32_t base, uint8_t sd0Usage, uint8_t sd0Channels, uint8_t sd1Usage, uint8_t sd1Channels)
Setup the two interfaces SD0 and SD1 (also called AD0 and AD1).
Definition: i2s.h:522
#define I2S_AIFCLKCTL_WBEN
Definition: hw_i2s.h:1269
#define I2S_AIFWCLKSRC_WCLKINV
Definition: hw_i2s.h:183
#define I2S_O_AIFDIRCFG
Definition: hw_i2s.h:51
#define I2S_O_IRQFLAGS
Definition: hw_i2s.h:114
#define I2S_ADFSCTRL2_DELTASIGN_S
Definition: hw_i2s.h:1401
__STATIC_INLINE void I2SDisableControllerClocks(uint32_t base)
Disable the I2S controller clocks (CCLK, WCLK and BCLK).
Definition: i2s.h:660
#define I2S_O_CLKCFG
Definition: hw_i2s.h:135
#define I2S_AIFFMTCFG_WORDLEN_S
Definition: hw_i2s.h:277
#define I2S_O_AIFOUTPTR
Definition: hw_i2s.h:72
__STATIC_INLINE void I2SDisableInt(uint32_t base, uint32_t intFlags)
Disables individual I2S interrupt sources.
Definition: i2s.h:217
#define I2S_O_AIFFMTCFG
Definition: hw_i2s.h:54
__STATIC_INLINE void I2SSetOutPointer(uint32_t base, uint32_t nextPointer)
Set the next output buffer pointer.
Definition: i2s.h:714
#define I2S_CLKCFG_CLKSEL_M
Definition: hw_i2s.h:1334
__STATIC_INLINE void I2SEnableInt(uint32_t base, uint32_t intFlags)
Enables individual I2S interrupt sources.
Definition: i2s.h:185
__STATIC_INLINE void I2SDisableClk(uint32_t base)
Disables the clock source.
Definition: i2s.h:927
__STATIC_INLINE uint32_t I2SGetInPointerNext(uint32_t base)
Get value of the next input pointer.
Definition: i2s.h:731
#define I2S_AIFCLKCTL_MEN
Definition: hw_i2s.h:1293
__STATIC_INLINE uint32_t I2SGetOutPointerNext(uint32_t base)
Get value of the next output pointer.
Definition: i2s.h:748
#define I2S_O_AIFOPTNXT
Definition: hw_i2s.h:69
#define HWREGH(x)
Definition: hw_types.h:84
__STATIC_INLINE void I2SEnableClk(uint32_t base)
Enables the clock source.
Definition: i2s.h:910
#define I2S_ADFSCTRL2_DELTA_M
Definition: hw_i2s.h:1388
__STATIC_INLINE void I2SConfigureAdfs(uint32_t base, uint32_t tref, uint32_t delta, uint32_t deltaSign, uint32_t div)
Configures the Adaptive Digital Frequency Synthesizer (ADFS) module.
Definition: i2s.h:1033
#define I2S_AIFFMTCFG_DATADELAY_S
Definition: hw_i2s.h:346
__STATIC_INLINE uint32_t I2SGetOutPointer(uint32_t base)
Get value of the current output pointer.
Definition: i2s.h:782
__STATIC_INLINE void I2SDisableSampleStamp(uint32_t base)
Disable the Sample Stamp generator.
Definition: i2s.h:340
#define ASSERT(expr)
Definition: debug.h:81
#define I2S_BASE
Definition: hw_memmap.h:97
#define I2S_AIFCLKCTL_WCLKPHASE_S
Definition: hw_i2s.h:1283
#define I2S_O_STMPWADD
Definition: hw_i2s.h:99
#define I2S_AIFDMACFG_ENDFRAMIDX_M
Definition: hw_i2s.h:203
__STATIC_INLINE void I2SSelectAdfsInputClk(uint32_t base, uint32_t source)
Selects the ADFS inpt clock (Fref)
Definition: i2s.h:967
#define I2S_O_STMPCTL
Definition: hw_i2s.h:75
#define I2S_ADFSCTRL1_TREF_M
Definition: hw_i2s.h:1369
#define I2S_O_AIFINPTR
Definition: hw_i2s.h:66
#define I2S_O_IRQMASK
Definition: hw_i2s.h:111
__STATIC_INLINE uint32_t I2SGetInPointer(uint32_t base)
Get value of the current input pointer.
Definition: i2s.h:765
#define I2S_O_ADFSCTRL1
Definition: hw_i2s.h:138
__STATIC_INLINE void I2SStop(uint32_t base)
Stops the I2S module for operation.
Definition: i2s.h:419
__STATIC_INLINE uint32_t I2SIntStatus(uint32_t base, bool masked)
Gets the current interrupt status.
Definition: i2s.h:249
#define I2S_O_AIFWMASK0
Definition: hw_i2s.h:57
#define I2S_O_AIFWCLKDIV
Definition: hw_i2s.h:129
__STATIC_INLINE void I2SConfigureFormat(uint32_t base, uint8_t dataDelay, uint32_t memoryLength, uint32_t samplingEdge, bool dualPhase, uint8_t bitsPerSample)
Configure the serial format of the I2S module.
Definition: i2s.h:463
#define I2S_O_STMPOTRIG
Definition: hw_i2s.h:93
#define I2S_CLKCFG_EN_M
Definition: hw_i2s.h:1317
__STATIC_INLINE void I2SConfigureInSampleStampTrigger(uint32_t base, uint16_t trigValue)
Configure the input sample stamp trigger.
Definition: i2s.h:802
__STATIC_INLINE void I2SEnableSampleStamp(uint32_t base)
Enable the Sample Stamp generator.
Definition: i2s.h:319
#define I2S_O_AIFCLKCTL
Definition: hw_i2s.h:132
__STATIC_INLINE void I2SClearInt(uint32_t base, uint32_t intFlags)
Clears I2S interrupt sources.
Definition: i2s.h:292
#define I2S_AIFWCLKSRC_WBCLKSRC_EXT
Definition: hw_i2s.h:168
#define HWREGB(x)
Definition: hw_types.h:90
__STATIC_INLINE void I2SEnableAdfs(uint32_t base)
Enables the ADFS (Adaptive Digital Frequency Synthesizer) module.
Definition: i2s.h:946
#define I2S_O_STMPWSET
Definition: hw_i2s.h:96
#define I2S_ADFSCTRL2_DIV_S
Definition: hw_i2s.h:1413
#define I2S_O_AIFWCLKSRC
Definition: hw_i2s.h:45