2 * @brief I2S Registers and control functions
\r
5 * Copyright(C) NXP Semiconductors, 2012
\r
6 * All rights reserved.
\r
9 * Software that is described herein is for illustrative purposes only
\r
10 * which provides customers with programming information regarding the
\r
11 * LPC products. This software is supplied "AS IS" without any warranties of
\r
12 * any kind, and NXP Semiconductors and its licensor disclaim any and
\r
13 * all warranties, express or implied, including all implied warranties of
\r
14 * merchantability, fitness for a particular purpose and non-infringement of
\r
15 * intellectual property rights. NXP Semiconductors assumes no responsibility
\r
16 * or liability for the use of the software, conveys no license or rights under any
\r
17 * patent, copyright, mask work right, or any other intellectual property rights in
\r
18 * or to any products. NXP Semiconductors reserves the right to make changes
\r
19 * in the software without notification. NXP Semiconductors also makes no
\r
20 * representation or warranty that such application will be suitable for the
\r
21 * specified use without further testing or modification.
\r
24 * Permission to use, copy, modify, and distribute this software and its
\r
25 * documentation is hereby granted, under NXP Semiconductors' and its
\r
26 * licensor's relevant copyrights in the software, without fee, provided that it
\r
27 * is used in conjunction with NXP Semiconductors microcontrollers. This
\r
28 * copyright, permission, and disclaimer notice must appear in all copies of
\r
32 #ifndef __I2S_001_H_
\r
33 #define __I2S_001_H_
\r
35 #include "sys_config.h"
\r
42 /** @defgroup IP_I2S_001 IP: I2S register block and driver
\r
43 * @ingroup IP_Drivers
\r
48 * @brief I2S register block structure
\r
50 typedef struct { /*!< I2S Structure */
\r
51 __IO uint32_t DAO; /*!< I2S Digital Audio Output Register. Contains control bits for the I2S transmit channel */
\r
52 __IO uint32_t DAI; /*!< I2S Digital Audio Input Register. Contains control bits for the I2S receive channel */
\r
53 __O uint32_t TXFIFO; /*!< I2S Transmit FIFO. Access register for the 8 x 32-bit transmitter FIFO */
\r
54 __I uint32_t RXFIFO; /*!< I2S Receive FIFO. Access register for the 8 x 32-bit receiver FIFO */
\r
55 __I uint32_t STATE; /*!< I2S Status Feedback Register. Contains status information about the I2S interface */
\r
56 __IO uint32_t DMA1; /*!< I2S DMA Configuration Register 1. Contains control information for DMA request 1 */
\r
57 __IO uint32_t DMA2; /*!< I2S DMA Configuration Register 2. Contains control information for DMA request 2 */
\r
58 __IO uint32_t IRQ; /*!< I2S Interrupt Request Control Register. Contains bits that control how the I2S interrupt request is generated */
\r
59 __IO uint32_t TXRATE; /*!< I2S Transmit MCLK divider. This register determines the I2S TX MCLK rate by specifying the value to divide PCLK by in order to produce MCLK */
\r
60 __IO uint32_t RXRATE; /*!< I2S Receive MCLK divider. This register determines the I2S RX MCLK rate by specifying the value to divide PCLK by in order to produce MCLK */
\r
61 __IO uint32_t TXBITRATE; /*!< I2S Transmit bit rate divider. This register determines the I2S transmit bit rate by specifying the value to divide TX_MCLK by in order to produce the transmit bit clock */
\r
62 __IO uint32_t RXBITRATE; /*!< I2S Receive bit rate divider. This register determines the I2S receive bit rate by specifying the value to divide RX_MCLK by in order to produce the receive bit clock */
\r
63 __IO uint32_t TXMODE; /*!< I2S Transmit mode control */
\r
64 __IO uint32_t RXMODE; /*!< I2S Receive mode control */
\r
68 * @brief I2S configuration parameter defines
\r
70 /** I2S Wordwidth bit */
\r
71 #define I2S_WORDWIDTH_8 (0UL << 0) /*!< 8 bit Word */
\r
72 #define I2S_WORDWIDTH_16 (1UL << 0) /*!< 16 bit word */
\r
73 #define I2S_WORDWIDTH_32 (3UL << 0) /*!< 32 bit word */
\r
75 /** I2S Channel bit */
\r
76 #define I2S_STEREO (0UL << 2) /*!< Stereo audio */
\r
77 #define I2S_MONO (1UL << 2) /*!< Mono audio */
\r
79 /** I2S Master/Slave mode bit */
\r
80 #define I2S_MASTER_MODE (0UL << 5) /*!< I2S in master mode */
\r
81 #define I2S_SLAVE_MODE (1UL << 5) /*!< I2S in slave mode */
\r
84 #define I2S_STOP_ENABLE (0UL << 3) /*!< I2S stop enable mask */
\r
85 #define I2S_STOP_DISABLE (1UL << 3) /*!< I2S stop disable mask */
\r
87 /** I2S Reset bit */
\r
88 #define I2S_RESET_ENABLE (1UL << 4) /*!< I2S reset enable mask */
\r
89 #define I2S_RESET_DISABLE (0UL << 4) /*!< I2S reset disable mask */
\r
92 #define I2S_MUTE_ENABLE (1UL << 15) /*!< I2S mute enable mask */
\r
93 #define I2S_MUTE_DISABLE (0UL << 15) /*!< I2S mute disbale mask */
\r
96 * @brief Macro defines for DAO-Digital Audio Output register
\r
98 /** I2S wordwide - the number of bytes in data*/
\r
99 #define I2S_DAO_WORDWIDTH_8 ((uint32_t) (0)) /*!< DAO 8 bit */
\r
100 #define I2S_DAO_WORDWIDTH_16 ((uint32_t) (1)) /*!< DAO 16 bit */
\r
101 #define I2S_DAO_WORDWIDTH_32 ((uint32_t) (3)) /*!< DAO 32 bit */
\r
102 #define I2S_DAO_WORDWIDTH_MASK ((uint32_t) (3))
\r
104 /** I2S control mono or stereo format */
\r
105 #define I2S_DAO_MONO ((uint32_t) (1 << 2)) /*!< DAO mono audio mask */
\r
107 /** I2S control stop mode */
\r
108 #define I2S_DAO_STOP ((uint32_t) (1 << 3)) /*!< DAO stop mask */
\r
110 /** I2S control reset mode */
\r
111 #define I2S_DAO_RESET ((uint32_t) (1 << 4)) /*!< DAO reset mask */
\r
113 /** I2S control master/slave mode */
\r
114 #define I2S_DAO_SLAVE ((uint32_t) (1 << 5)) /*!< DAO slave mode mask */
\r
116 /** I2S word select half period minus one */
\r
117 #define I2S_DAO_WS_HALFPERIOD(n) ((uint32_t) ((n & 0x1FF) << 6)) /*!< DAO Word select set macro */
\r
118 #define I2S_DAO_WS_HALFPERIOD_MASK ((uint32_t) ((0x1FF) << 6)) /*!< DAO Word select mask */
\r
120 /** I2S control mute mode */
\r
121 #define I2S_DAO_MUTE ((uint32_t) (1 << 15)) /*!< DAO mute mask */
\r
124 * @brief Macro defines for DAI-Digital Audio Input register
\r
126 /** I2S wordwide - the number of bytes in data*/
\r
127 #define I2S_DAI_WORDWIDTH_8 ((uint32_t) (0)) /*!< DAI 8 bit */
\r
128 #define I2S_DAI_WORDWIDTH_16 ((uint32_t) (1)) /*!< DAI 16 bit */
\r
129 #define I2S_DAI_WORDWIDTH_32 ((uint32_t) (3)) /*!< DAI 32 bit */
\r
130 #define I2S_DAI_WORDWIDTH_MASK ((uint32_t) (3)) /*!< DAI word wide mask */
\r
132 /** I2S control mono or stereo format */
\r
133 #define I2S_DAI_MONO ((uint32_t) (1 << 2)) /*!< DAI mono mode mask */
\r
135 /** I2S control stop mode */
\r
136 #define I2S_DAI_STOP ((uint32_t) (1 << 3)) /*!< DAI stop bit mask */
\r
138 /** I2S control reset mode */
\r
139 #define I2S_DAI_RESET ((uint32_t) (1 << 4)) /*!< DAI reset bit mask */
\r
141 /** I2S control master/slave mode */
\r
142 #define I2S_DAI_SLAVE ((uint32_t) (1 << 5)) /*!< DAI slave mode mask */
\r
144 /** I2S word select half period minus one (9 bits)*/
\r
145 #define I2S_DAI_WS_HALFPERIOD(n) ((uint32_t) ((n & 0x1FF) << 6)) /*!< DAI Word select set macro */
\r
146 #define I2S_DAI_WS_HALFPERIOD_MASK ((uint32_t) ((0x1FF) << 6)) /*!< DAI Word select mask */
\r
149 * @brief Macro defines for STAT register (Status Feedback register)
\r
151 #define I2S_STATE_IRQ ((uint32_t) (1))/*!< I2S Status Receive or Transmit Interrupt */
\r
152 #define I2S_STATE_DMA1 ((uint32_t) (1 << 1)) /*!< I2S Status Receive or Transmit DMA1 */
\r
153 #define I2S_STATE_DMA2 ((uint32_t) (1 << 2)) /*!< I2S Status Receive or Transmit DMA2 */
\r
154 #define I2S_STATE_RX_LEVEL(n) ((uint32_t) ((n & 1F) << 8))/*!< I2S Status Current level of the Receive FIFO (5 bits)*/
\r
155 #define I2S_STATE_TX_LEVEL(n) ((uint32_t) ((n & 1F) << 16)) /*!< I2S Status Current level of the Transmit FIFO (5 bits)*/
\r
158 * @brief Macro defines for DMA1 register (DMA1 Configuration register)
\r
160 #define I2S_DMA1_RX_ENABLE ((uint32_t) (1))/*!< I2S control DMA1 for I2S receive */
\r
161 #define I2S_DMA1_TX_ENABLE ((uint32_t) (1 << 1)) /*!< I2S control DMA1 for I2S transmit */
\r
162 #define I2S_DMA1_RX_DEPTH(n) ((uint32_t) ((n & 0x1F) << 8)) /*!< I2S set FIFO level that trigger a receive DMA request on DMA1 */
\r
163 #define I2S_DMA1_TX_DEPTH(n) ((uint32_t) ((n & 0x1F) << 16)) /*!< I2S set FIFO level that trigger a transmit DMA request on DMA1 */
\r
166 * @brief Macro defines for DMA2 register (DMA2 Configuration register)
\r
168 #define I2S_DMA2_RX_ENABLE ((uint32_t) (1))/*!< I2S control DMA2 for I2S receive */
\r
169 #define I2S_DMA2_TX_ENABLE ((uint32_t) (1 << 1)) /*!< I2S control DMA1 for I2S transmit */
\r
170 #define I2S_DMA2_RX_DEPTH(n) ((uint32_t) ((n & 0x1F) << 8)) /*!< I2S set FIFO level that trigger a receive DMA request on DMA1 */
\r
171 #define I2S_DMA2_TX_DEPTH(n) ((uint32_t) ((n & 0x1F) << 16)) /*!< I2S set FIFO level that trigger a transmit DMA request on DMA1 */
\r
174 * @brief Macro defines for IRQ register (Interrupt Request Control register)
\r
177 #define I2S_IRQ_RX_ENABLE ((uint32_t) (1))/*!< I2S control I2S receive interrupt */
\r
178 #define I2S_IRQ_TX_ENABLE ((uint32_t) (1 << 1)) /*!< I2S control I2S transmit interrupt */
\r
179 #define I2S_IRQ_RX_DEPTH(n) ((uint32_t) ((n & 0x0F) << 8)) /*!< I2S set the FIFO level on which to create an irq request */
\r
180 #define I2S_IRQ_RX_DEPTH_MASK ((uint32_t) ((0x0F) << 8))
\r
181 #define I2S_IRQ_TX_DEPTH(n) ((uint32_t) ((n & 0x0F) << 16)) /*!< I2S set the FIFO level on which to create an irq request */
\r
182 #define I2S_IRQ_TX_DEPTH_MASK ((uint32_t) ((0x0F) << 16))
\r
185 * @brief Macro defines for TXRATE/RXRATE register (Transmit/Receive Clock Rate register)
\r
187 #define I2S_TXRATE_Y_DIVIDER(n) ((uint32_t) (n & 0xFF)) /*!< I2S Transmit MCLK rate denominator */
\r
188 #define I2S_TXRATE_X_DIVIDER(n) ((uint32_t) ((n & 0xFF) << 8)) /*!< I2S Transmit MCLK rate denominator */
\r
189 #define I2S_RXRATE_Y_DIVIDER(n) ((uint32_t) (n & 0xFF)) /*!< I2S Receive MCLK rate denominator */
\r
190 #define I2S_RXRATE_X_DIVIDER(n) ((uint32_t) ((n & 0xFF) << 8)) /*!< I2S Receive MCLK rate denominator */
\r
193 * @brief Macro defines for TXBITRATE & RXBITRATE register (Transmit/Receive Bit Rate register)
\r
195 #define I2S_TXBITRATE(n) ((uint32_t) (n & 0x3F))
\r
196 #define I2S_RXBITRATE(n) ((uint32_t) (n & 0x3F))
\r
199 * @brief Macro defines for TXMODE/RXMODE register (Transmit/Receive Mode Control register)
\r
201 #define I2S_TXMODE_CLKSEL(n) ((uint32_t) (n & 0x03)) /*!< I2S Transmit select clock source (2 bits)*/
\r
202 #define I2S_TXMODE_4PIN_ENABLE ((uint32_t) (1 << 2)) /*!< I2S Transmit control 4-pin mode */
\r
203 #define I2S_TXMODE_MCENA ((uint32_t) (1 << 3)) /*!< I2S Transmit control the TX_MCLK output */
\r
204 #define I2S_RXMODE_CLKSEL(n) ((uint32_t) (n & 0x03)) /*!< I2S Receive select clock source */
\r
205 #define I2S_RXMODE_4PIN_ENABLE ((uint32_t) (1 << 2)) /*!< I2S Receive control 4-pin mode */
\r
206 #define I2S_RXMODE_MCENA ((uint32_t) (1 << 3)) /*!< I2S Receive control the TX_MCLK output */
\r
209 * @brief I2S transmit/receive mode for configuration
\r
211 typedef enum IP_I2S_TRxMode {
\r
212 I2S_TX_MODE, /*!< Transmit mode */
\r
213 I2S_RX_MODE, /*!< Receive mode */
\r
214 } IP_I2S_TRxMode_T;
\r
217 * @brief I2S DMA request channel define
\r
219 typedef enum IP_I2S_DMARequestNumber {
\r
220 IP_I2S_DMA_REQUEST_NUMBER_1, /*!< DMA request channel 1 */
\r
221 IP_I2S_DMA_REQUEST_NUMBER_2, /*!< DMA request channel 2 */
\r
222 } IP_I2S_DMARequestNumber_T;
\r
224 /**********************************************************************************
\r
225 * I2S Init/DeInit functions
\r
226 *********************************************************************************/
\r
229 * @brief Initialize for I2S
\r
230 * @param pI2S : The base of I2S peripheral on the chip
\r
233 void IP_I2S_Init(IP_I2S_001_T *pI2S);
\r
236 * @brief Shutdown I2S
\r
237 * @param pI2S : The base of I2S peripheral on the chip
\r
239 * @note Reset all relative registers (DMA, transmit/receive control, interrupt) to default value
\r
241 void IP_I2S_DeInit(IP_I2S_001_T *pI2S);
\r
243 /**********************************************************************************
\r
244 * I2S configuration functions
\r
245 *********************************************************************************/
\r
248 * @brief Set the data width for the specified mode
\r
249 * @param pI2S : The base of I2S peripheral on the chip
\r
250 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
251 * @param wordwidth : Data width, should be :
\r
252 * - I2S_WORDWIDTH_8
\r
253 * - I2S_WORDWIDTH_16
\r
254 * - I2S_WORDWIDTH_32
\r
257 void IP_I2S_SetWordWidth(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t wordwidth);
\r
260 * @brief Set I2S data format to mono or stereo
\r
261 * @param pI2S : The base of I2S peripheral on the chip
\r
262 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
263 * @param mono : Data channel, should be
\r
268 void IP_I2S_SetMono(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t mono);
\r
271 * @brief Set I2S interface in master/slave mode
\r
272 * @param pI2S : The base of I2S peripheral on the chip
\r
273 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
274 * @param mode : Interface mode, should be
\r
275 * - I2S_MASTER_MODE
\r
279 void IP_I2S_SetMasterSlaveMode(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t mode);
\r
282 * @brief Set the clock frequency for I2S interface
\r
283 * @param pI2S : The base of I2S peripheral on the chip
\r
284 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
285 * @param mclk_divider : Clock divider. This value plus one is used to divide MCLK to produce the clock frequency for I2S interface
\r
287 * @note The value depends on the audio sample rate desired and the data size and format(stereo/mono) used.
\r
288 * For example, a 48 kHz sample rate for 16-bit stereo data requires a bit rate of 48 000 x 16 x 2 = 1.536 MHz. So the mclk_divider should be MCLK/1.536 MHz
\r
290 void IP_I2S_SetBitRate(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t mclk_divider);
\r
293 * @brief Set the MCLK rate by using a fractional rate generator, dividing down the frequency of PCLK
\r
294 * @param pI2S : The base of I2S peripheral on the chip
\r
295 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
296 * @param x_divider : I2S transmit MCLK rate numerator
\r
297 * @param y_devider : I2S transmit MCLK rate denominator
\r
299 * @note Values of the numerator (X) and the denominator (Y) must be chosen to
\r
300 * produce a frequency twice that desired for the transmitter MCLK, which
\r
301 * must be an integer multiple of the transmitter bit clock rate.
\r
302 * The equation for the fractional rate generator is:
\r
303 * MCLK = PCLK * (X/Y) /2
\r
304 * Note: If the value of X or Y is 0, then no clock is generated. Also, the value of Y must be
\r
305 * greater than or equal to X.
\r
307 void IP_I2S_SetXYDivider(IP_I2S_001_T *pI2S, uint8_t TRMode, uint8_t x_divider, uint8_t y_devider);
\r
310 * @brief Set word select (WS) half period
\r
311 * @param pI2S : The base of I2S peripheral on the chip
\r
312 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
313 * @param ws_halfperiod : I2S word select half period minus one
\r
315 * @note The Word Select period is configured separately for I2S input and I2S output.
\r
316 * For example: if the WS is 64clk period -> ws_halfperiod = 31
\r
318 void IP_I2S_SetWS_Halfperiod(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t ws_halfperiod);
\r
321 * @brief Set the I2S operating modes
\r
322 * @param pI2S : The base of I2S peripheral on the chip
\r
323 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
324 * @param clksel : Clock source selection for the receive bit clock divider
\r
325 * @param fpin : Receive 4-pin mode selection
\r
326 * @param mcena : Enable for the RX_MCLK output
\r
328 * @note In addition to master and slave modes, which are independently configurable for
\r
329 * the transmitter and the receiver, several different clock sources are possible,
\r
330 * including variations that share the clock and/or WS between the transmitter and
\r
331 * receiver. It also allows using I2S with fewer pins, typically four.
\r
333 void IP_I2S_ModeConfig(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t clksel, uint32_t fpin, uint32_t mcena);
\r
336 * @brief Get the current level of the Transmit/Receive FIFO
\r
337 * @param pI2S : The base of I2S peripheral on the chip
\r
338 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
339 * @return Current level of the Transmit/Receive FIFO
\r
341 uint8_t IP_I2S_GetLevel(IP_I2S_001_T *pI2S, uint8_t TRMode);
\r
343 /**********************************************************************************
\r
344 * I2S operate functions
\r
345 *********************************************************************************/
\r
348 * @brief Send a 32-bit data to TXFIFO for transmition
\r
349 * @param pI2S : The base of I2S peripheral on the chip
\r
350 * @param data : Data to be transmited
\r
352 * @note The function writes to TXFIFO without checking any condition.
\r
354 void IP_I2S_Send(IP_I2S_001_T *pI2S, uint32_t data);
\r
357 * @brief Get received data from RXFIFO
\r
358 * @param pI2S : The base of I2S peripheral on the chip
\r
359 * @return Data received in RXFIFO
\r
360 * @note The function reads from RXFIFO without checking any condition.
\r
362 uint32_t IP_I2S_Receive(IP_I2S_001_T *pI2S);
\r
365 * @brief Start the I2S
\r
366 * @param pI2S : The base of I2S peripheral on the chip
\r
367 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
370 void IP_I2S_Start(IP_I2S_001_T *pI2S, uint8_t TRMode);
\r
373 * @brief Disables accesses on FIFOs, places the transmit channel in mute mode
\r
374 * @param pI2S : The base of I2S peripheral on the chip
\r
375 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
378 void IP_I2S_Pause(IP_I2S_001_T *pI2S, uint8_t TRMode);
\r
381 * @brief Transmit channel sends only zeroes
\r
382 * @param pI2S : The base of I2S peripheral on the chip
\r
384 * @note The data output from I2S transmit channel is always zeroes
\r
386 STATIC INLINE void IP_I2S_EnableMute(IP_I2S_001_T *pI2S)
\r
388 pI2S->DAO |= I2S_DAO_MUTE;
\r
392 * @brief Un-Mute the I2S channel
\r
395 STATIC INLINE void IP_I2S_DisableMute(IP_I2S_001_T *pI2S)
\r
397 pI2S->DAO &= ~I2S_DAO_MUTE;
\r
401 * @brief Stop I2S asynchronously
\r
402 * @param pI2S : The base of I2S peripheral on the chip
\r
403 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
405 * @note Pause, resets the transmit channel and FIFO asynchronously
\r
407 void IP_I2S_Stop(IP_I2S_001_T *pI2S, uint8_t TRMode);
\r
409 /**********************************************************************************
\r
410 * I2S DMA functions
\r
411 *********************************************************************************/
\r
414 * @brief Set the FIFO level on which to create an DMA request
\r
415 * @param pI2S : The base of I2S peripheral on the chip
\r
416 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
417 * @param DMANum : I2S DMA request number, should be
\r
418 * - IP_I2S_DMA_REQUEST_NUMBER_1
\r
419 * - IP_I2S_DMA_REQUEST_NUMBER_2
\r
420 * @param depth : FIFO level on which to create an DMA request
\r
422 * @note DMA request is generated when rx_depth_dma <= rx_level or tx_depth_dma >= tx_level
\r
424 void IP_I2S_SetFIFODepthDMA(IP_I2S_001_T *pI2S, uint8_t TRMode, IP_I2S_DMARequestNumber_T DMANum, uint32_t depth);
\r
427 * @brief Enable/Disable DMA for the I2S
\r
428 * @param pI2S : The base of I2S peripheral on the chip
\r
429 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
430 * @param DMANum : I2S DMA request number, should be
\r
431 * - IP_I2S_DMA_REQUEST_NUMBER_1
\r
432 * - IP_I2S_DMA_REQUEST_NUMBER_2
\r
433 * @param NewState : ENABLE or DISABLE DMA
\r
436 void IP_I2S_DMACmd(IP_I2S_001_T *pI2S, IP_I2S_DMARequestNumber_T DMANum, uint8_t TRMode, FunctionalState NewState);
\r
438 /**********************************************************************************
\r
439 * I2S IRQ functions
\r
440 *********************************************************************************/
\r
443 * @brief Enable/Disable interrupt for the I2S
\r
444 * @param pI2S : The base of I2S peripheral on the chip
\r
445 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
446 * @param NewState : ENABLE or DISABLE Interrupt
\r
448 * @note Interrupt request is generated when rx_depth_irq <= rx_level or tx_depth_irq >= tx_level
\r
450 void IP_I2S_InterruptCmd(IP_I2S_001_T *pI2S, uint8_t TRMode, FunctionalState NewState);
\r
453 * @brief Set the FIFO level on which to create an irq request
\r
454 * @param pI2S : The base of I2S peripheral on the chip
\r
455 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
456 * @param depth : FIFO level on which to create an irq request
\r
459 void IP_I2S_SetFIFODepthIRQ(IP_I2S_001_T *pI2S, uint8_t TRMode, uint32_t depth);
\r
462 * @brief Get the status of I2S interrupt
\r
463 * @param pI2S : The base of I2S peripheral on the chip
\r
464 * @param TRMode : Transmit/Receive mode, should be I2S_RX_MODE or I2S_TX_MODE
\r
465 * @return I2S interrupt status, SET or RESET
\r
467 Status IP_I2S_GetIntStatus(IP_I2S_001_T *pI2S, uint8_t TRMode);
\r
477 #endif /* __I2S_001_H_ */
\r