| LPCOpen Platform v1.03 LPCOpen Platform for NXP LPC Microcontrollers

- Main Page
- Modules
- Data Structures
- Files
- Related Pages

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
LPC18xx/43xx I2S example
Peripheral examples

## Detailed Description

Example description
The I2S example shows how to configure I2S and UDA1380 to receive audio signal and play back with three modes: polling, interrupt, and DMA.

To use the example, connect a serial cable to the board's RS232/UART port and start a terminal program to monitor the port. The terminal program on the host PC should be setup for 115K8N1.
For boards that has no default UART (ex: NGX Xplorer), by default example will start in DMA mode hence no need to slect anything from terminal.
Connect the computer line out to board line-in (using 3.5mm male-to-male cable), plug the headphone/speaker into board line-out. Change modes by selecting the option from the terminal. Play audio on computer and listen from target board!

Special connection requirements
There are no special connection requirements for this example.

Build procedures:
LPC18xx/43xx example quickstart for Keil uVision4
LPC18xx/43xx example quickstart for IAR EWARM
LPC18xx/43xx example quickstart for Code Red Xpresso

Supported boards and board setup:
Hitex 1850 evaluation boards
Hitex 4350 evaluation boards
Keil 1857 evaluation boards
Keil 4357 evaluation boards
NGX 1830 Xplorer boards
NGX 4330 Xplorer boards

Submitting LPCOpen issues:
Community support for LPCOpen

## Data Structures
struct | Ring_Buffer_t

## Macros
#define | BUFFER_FULL 0
#define | BUFFER_EMPTY 1
#define | BUFFER_AVAILABLE 2

## Functions
int | Con_GetInput (void)
static void | mute_toggle ()
static uint8_t | ring_buff_get_status (Ring_Buffer_t *ring_buff)
static void | App_Interrupt_Test (void)
static void | App_Polling_Test (void)
static void | App_DMA_Test (void)
void | DMA_IRQHandler (void)
| DMA interrupt handler sub-routine.
void | I2S0_IRQHandler (void)
| I2S0 interrupt handler sub-routine.
int | main (void)
| Main routine for I2S example.

## Variables
static char | WelcomeMenu []
static Ring_Buffer_t | ring_buffer
static uint8_t | send_flag
static uint8_t | channelTC
static uint8_t | dmaChannelNum_I2S_Tx
static uint8_t | dmaChannelNum_I2S_Rx
static uint8_t | dma_send_receive
uint8_t | mute_status = 0

## Macro Definition Documentation

#define BUFFER_AVAILABLE 2

Definition at line 77 of file i2s.c.

#define BUFFER_EMPTY 1

Definition at line 76 of file i2s.c.

#define BUFFER_FULL 0

Definition at line 75 of file i2s.c.

## Function Documentation

static void App_DMA_Test | ( | void |  | ) |
| static

Definition at line 208 of file i2s.c.

static void App_Interrupt_Test | ( | void |  | ) |
| static

Definition at line 145 of file i2s.c.

static void App_Polling_Test | ( | void |  | ) |
| static

Definition at line 174 of file i2s.c.

int Con_GetInput | ( | void |  | ) |

Definition at line 110 of file i2s.c.

void DMA_IRQHandler | ( | void |  | ) |

DMA interrupt handler sub-routine.

Returns
  Nothing

Definition at line 261 of file i2s.c.

void I2S0_IRQHandler | ( | void |  | ) |

I2S0 interrupt handler sub-routine.

Returns
  Nothing

Definition at line 285 of file i2s.c.

int main | ( | void |  | ) |

Main routine for I2S example.

Main program body.

Returns
  Nothing

Definition at line 299 of file i2s.c.

static void mute_toggle | ( |  | ) |
| static

Definition at line 119 of file i2s.c.

static uint8_t ring_buff_get_status | ( | Ring_Buffer_t * | ring_buff | ) |
| static

Definition at line 133 of file i2s.c.

## Variable Documentation

uint8_t channelTC
| static

Definition at line 96 of file i2s.c.

uint8_t dma_send_receive
| static

Definition at line 98 of file i2s.c.

uint8_t dmaChannelNum_I2S_Rx
| static

Definition at line 97 of file i2s.c.

uint8_t dmaChannelNum_I2S_Tx
| static

Definition at line 97 of file i2s.c.

uint8_t mute_status = 0

Definition at line 107 of file i2s.c.

Ring_Buffer_t ring_buffer
| static

Definition at line 93 of file i2s.c.

uint8_t send_flag
| static

Definition at line 95 of file i2s.c.

char WelcomeMenu[]
| static

Initial value:
= "\r\nHello NXP Semiconductors \r\n"
"I2S DEMO : Connect audio headphone out from computer to line-in on tested board to get audio signal\r\n"
"Please press \'1\' to test Polling mode\r\n"
"Please press \'2\' to test Interrupt mode\r\n"
"Please press \'3\' to test DMA mode\r\n"
"Please press \'x\' to exit test mode\r\n"
"Please press \'m\' to DISABLE/ENABLE mute\r\n"

Definition at line 85 of file i2s.c.