LPCOpen Platform for LPC18XX/43XX microcontrollers: LPC4330 NGX Xplorer board support software API functions

| LPCOpen Platform for LPC18XX/43XX microcontrollers 18XX43XX LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers

- Main Page
- Modules
- Data Structures
- Files

Modules | Macros | Functions
LPC4330 NGX Xplorer board support software API functions
NGX 4330 Xplorer boards

## Detailed Description

The board support software API functions provide some simple abstracted functions used across multiple LPCOpen board examples. See BOARD: Common board functions for the functions defined by this board support layer.

## Modules
| BOARD: LPC4330 NGX Xplorer board options

## Macros
#define | BOARD_NGX_XPLORER_4330
#define | USE_RMII
#define | BOARD_ENET_PHY_ADDR 0x01
#define | I2CDEV_UDA1380_ADDR (0x34 >> 1)
#define | UDA1380_I2C_BUS I2C0
#define | LEDS_LED1 0x01
#define | LEDS_LED2 0x02
#define | LEDS_LED3 0x04
#define | LEDS_LED4 0x08
#define | LEDS_NO_LEDS 0x00
#define | BUTTONS_BUTTON1 0x01
#define | JOY_UP 0x01
#define | JOY_DOWN 0x02
#define | JOY_LEFT 0x04
#define | JOY_RIGHT 0x08
#define | JOY_PRESS 0x10
#define | NO_BUTTON_PRESSED 0x00
#define | BUTTONS_BUTTON1_GPIO_PORT_NUM 0
#define | BUTTONS_BUTTON1_GPIO_BIT_NUM 7
#define | LED1_GPIO_PORT_NUM 1
#define | LED1_GPIO_BIT_NUM 11
#define | LED2_GPIO_PORT_NUM 1
#define | LED2_GPIO_BIT_NUM 12
#define | BOARD_NXP_LPCXPRESSO_4337
#define | USE_RMII
#define | BOARD_ENET_PHY_ADDR 0x00
#define | LCD_SSP LPC_SSP1
#define | LCD_CDM_PORT 6
#define | LCD_CMD_PIN 5
#define | LCD_CMD_CFG (SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0)
#define | LCD_CMD_GPIO_PORT 3
#define | LCD_CMD_GPIO_PIN 4
#define | LCD_BIT_RATE 1000000 /* 1 MHz */
#define | I2CDEV_WM8904_ADDR (0x34 >> 1)
#define | WM8904_I2C_BUS I2C1
#define | CODEC_LINE_IN 0 /* Mic */
#define | AUDCFG_SAMPLE_RATE 16000
#define | LEDS_LED1 0x01
#define | LEDS_LED2 0x02
#define | LEDS_LED3 0x04
#define | LEDS_LED4 0x08
#define | LEDS_NO_LEDS 0x00
#define | BUTTONS_BUTTON1 0x01
#define | JOY_UP 0x01
#define | JOY_DOWN 0x02
#define | JOY_LEFT 0x04
#define | JOY_RIGHT 0x08
#define | JOY_PRESS 0x10
#define | NO_BUTTON_PRESSED 0x00
#define | BUTTONS_BUTTON1_GPIO_PORT_NUM 0
#define | BUTTONS_BUTTON1_GPIO_BIT_NUM 7
#define | LED1_GPIO_PORT_NUM 1
#define | LED1_GPIO_BIT_NUM 11
#define | LED2_GPIO_PORT_NUM 1
#define | LED2_GPIO_BIT_NUM 12
#define | USB1_VBUS_PORT_NUM 2
#define | USB1_VBUS_PIN_NUM 5
#define | USB1_VBUS_PIN_CFG (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC4)
#define | USB1_VBUS_GPIO_PORT_NUM 5
#define | USB1_VBUS_GPIO_BIT_NUM 5

## Functions
void | Board_I2C_Init (I2C_ID_T id)
| Sets up board specific I2C interface. More...
STATIC INLINE void | Board_I2C_EnableFastPlus (I2C_ID_T id)
| Sets up I2C Fast Plus mode. More...
STATIC INLINE void | Board_I2C_DisableFastPlus (I2C_ID_T id)
| Disable I2C Fast Plus mode and enables default mode. More...
void | Board_GPIO_Int_Init (void)
| Initializes board specific GPIO Interrupt. More...
void | Board_SSP_Init (LPC_SSP_T *pSSP)
| Initialize pin muxing for SSP interface. More...
void | Board_ENET_GetMacADDR (uint8_t *mcaddr)
| Returns the MAC address assigned to this board. More...
void | Board_UART_Init (LPC_USART_T *pUART)
| Initialize pin muxing for a UART. More...
void | Board_SDMMC_Init (void)
| Initialize pin muxing for SDMMC interface. More...
void | Board_Buttons_Init (void)
| Initialize button(s) interface on board. More...
void | Board_Joystick_Init (void)
| Initialize joystick interface on board. More...
uint8_t | Joystick_GetStatus (void)
| Returns joystick states on board. More...
uint32_t | Buttons_GetStatus (void)
| Returns button(s) state on board. More...
void | Board_Audio_Init (LPC_I2S_T *pI2S, int micIn)
| Initialize I2S interface for the board and UDA1380. More...
__STATIC_INLINE void | Board_USB1_EnableVbus (void)
| Enable VBUS to USB1 port in Host mode. More...
__STATIC_INLINE void | Board_USB1_DisableVbus (void)
| Disable VBUS to USB1 port. More...
void | Board_DAC_Init (LPC_DAC_T *pDAC)
| Initialize DAC. More...
STATIC INLINE void | Board_ADC_Init (void)
| Initialize ADC. More...
void | Board_LCD_Init (void)
| Initialize Pinmuxing for the LCD interface. More...
void | Board_LCD_WriteData (const uint8_t *data, uint16_t size)
| Write given data to LCD module. More...

## Macro Definition Documentation

#define AUDCFG_SAMPLE_RATE 16000

Definition at line 106 of file board.h.

#define BOARD_ENET_PHY_ADDR 0x01

Definition at line 91 of file board.h.

#define BOARD_ENET_PHY_ADDR 0x00

Definition at line 91 of file board.h.

#define BOARD_NGX_XPLORER_4330

Definition at line 77 of file board.h.

#define BOARD_NXP_LPCXPRESSO_4337

Definition at line 77 of file board.h.

#define BUTTONS_BUTTON1 0x01

Definition at line 104 of file board.h.

#define BUTTONS_BUTTON1 0x01

Definition at line 114 of file board.h.

#define BUTTONS_BUTTON1_GPIO_BIT_NUM 7

Definition at line 116 of file board.h.

#define BUTTONS_BUTTON1_GPIO_BIT_NUM 7

Definition at line 126 of file board.h.

#define BUTTONS_BUTTON1_GPIO_PORT_NUM 0

Definition at line 115 of file board.h.

#define BUTTONS_BUTTON1_GPIO_PORT_NUM 0

Definition at line 125 of file board.h.

#define CODEC_LINE_IN 0 /* Mic */

Definition at line 105 of file board.h.

#define I2CDEV_UDA1380_ADDR (0x34 >> 1)

Definition at line 95 of file board.h.

#define I2CDEV_WM8904_ADDR (0x34 >> 1)

Definition at line 103 of file board.h.

#define JOY_DOWN 0x02

Definition at line 106 of file board.h.

#define JOY_DOWN 0x02

Definition at line 116 of file board.h.

#define JOY_LEFT 0x04

Definition at line 107 of file board.h.

#define JOY_LEFT 0x04

Definition at line 117 of file board.h.

#define JOY_PRESS 0x10

Definition at line 109 of file board.h.

#define JOY_PRESS 0x10

Definition at line 119 of file board.h.

#define JOY_RIGHT 0x08

Definition at line 108 of file board.h.

#define JOY_RIGHT 0x08

Definition at line 118 of file board.h.

#define JOY_UP 0x01

Definition at line 105 of file board.h.

#define JOY_UP 0x01

Definition at line 115 of file board.h.

#define LCD_BIT_RATE 1000000 /* 1 MHz */

Definition at line 100 of file board.h.

#define LCD_CDM_PORT 6

Definition at line 95 of file board.h.

#define LCD_CMD_CFG (SCU_MODE_INBUFF_EN | SCU_MODE_PULLUP | SCU_MODE_FUNC0)

Definition at line 97 of file board.h.

#define LCD_CMD_GPIO_PIN 4

Definition at line 99 of file board.h.

#define LCD_CMD_GPIO_PORT 3

Definition at line 98 of file board.h.

#define LCD_CMD_PIN 5

Definition at line 96 of file board.h.

#define LCD_SSP LPC_SSP1

Definition at line 94 of file board.h.

#define LED1_GPIO_BIT_NUM 11

Definition at line 118 of file board.h.

#define LED1_GPIO_BIT_NUM 11

Definition at line 128 of file board.h.

#define LED1_GPIO_PORT_NUM 1

Definition at line 117 of file board.h.

#define LED1_GPIO_PORT_NUM 1

Definition at line 127 of file board.h.

#define LED2_GPIO_BIT_NUM 12

Definition at line 120 of file board.h.

#define LED2_GPIO_BIT_NUM 12

Definition at line 130 of file board.h.

#define LED2_GPIO_PORT_NUM 1

Definition at line 119 of file board.h.

#define LED2_GPIO_PORT_NUM 1

Definition at line 129 of file board.h.

#define LEDS_LED1 0x01

Definition at line 99 of file board.h.

#define LEDS_LED1 0x01

Definition at line 109 of file board.h.

#define LEDS_LED2 0x02

Definition at line 100 of file board.h.

#define LEDS_LED2 0x02

Definition at line 110 of file board.h.

#define LEDS_LED3 0x04

Definition at line 101 of file board.h.

#define LEDS_LED3 0x04

Definition at line 111 of file board.h.

#define LEDS_LED4 0x08

Definition at line 102 of file board.h.

#define LEDS_LED4 0x08

Definition at line 112 of file board.h.

#define LEDS_NO_LEDS 0x00

Definition at line 103 of file board.h.

#define LEDS_NO_LEDS 0x00

Definition at line 113 of file board.h.

#define NO_BUTTON_PRESSED 0x00

Definition at line 110 of file board.h.

#define NO_BUTTON_PRESSED 0x00

Definition at line 120 of file board.h.

#define UDA1380_I2C_BUS I2C0

Definition at line 96 of file board.h.

#define USB1_VBUS_GPIO_BIT_NUM 5

Definition at line 137 of file board.h.

#define USB1_VBUS_GPIO_PORT_NUM 5

Definition at line 136 of file board.h.

#define USB1_VBUS_PIN_CFG (SCU_MODE_PULLUP | SCU_MODE_INBUFF_EN | SCU_MODE_ZIF_DIS | SCU_MODE_FUNC4)

Definition at line 135 of file board.h.

#define USB1_VBUS_PIN_NUM 5

Definition at line 134 of file board.h.

#define USB1_VBUS_PORT_NUM 2

Definition at line 133 of file board.h.

#define USE_RMII

Definition at line 90 of file board.h.

#define USE_RMII

Definition at line 90 of file board.h.

#define WM8904_I2C_BUS I2C1

Definition at line 104 of file board.h.

## Function Documentation

STATIC INLINE void Board_ADC_Init | ( | void |  | ) |

Initialize ADC.

Sets up board specific ADC interface.

Returns
  Nothing

Definition at line 269 of file board.h.

void Board_Audio_Init | ( | LPC_I2S_T * | pI2S,
|  | int | micIn
| ) |  |

Initialize I2S interface for the board and UDA1380.

Parameters

  pI2S | : Pointer to I2S register interface used on this board
  micIn | : If 1 MIC will be used as input, if 0 LINE_IN will be used

Returns
  Nothing

Sets up board specific I2S interface and UDA1380.

Parameters

  pI2S | : Pointer to I2S register interface used on this board
  micIn | : If 1 MIC will be used as input, if 0 LINE_IN will be used

Returns
  Nothing

Sets up board specific I2S interface and UDA1380.

Parameters

  pI2S | : Pointer to I2S register interface used on this board
  micIn | : If 1 selects MIC as input device, If 0 selects LINE_IN

Returns
  Nothing

Parameters

  pI2S | : Pointer to I2S register interface used on this board
  micIn | : If 1 MIC will be used as input, if 0 LINE_IN will be used

Returns
  Nothing

Definition at line 738 of file board.c.

void Board_Buttons_Init | ( | void |  | ) |

Initialize button(s) interface on board.

Returns
  Nothing

Initializes board specific buttons.

Returns
  Nothing

Definition at line 472 of file board.c.

void Board_DAC_Init | ( | LPC_DAC_T * | pDAC | ) |

Initialize DAC.

Parameters

  pDAC | : Pointer to DAC register interface used on this board

Returns
  Nothing

Initialize DAC.

Parameters

  pDAC | : Pointer to DAC register interface used on this board

Returns
  Nothing

Definition at line 754 of file board.c.

void Board_ENET_GetMacADDR | ( | uint8_t * | mcaddr | ) |

Returns the MAC address assigned to this board.

Parameters

  mcaddr | : Pointer to 6-byte character array to populate with MAC address

Returns
  Nothing

Definition at line 499 of file board.c.

void Board_GPIO_Int_Init | ( | void |  | ) |

Initializes board specific GPIO Interrupt.

Returns
  Nothing

STATIC INLINE void Board_I2C_DisableFastPlus | ( | I2C_ID_T | id | ) |

Disable I2C Fast Plus mode and enables default mode.

Parameters

  id | : Must always be I2C0

Returns
  Nothing

See Also
  Board_I2C_EnableFastPlus()

Definition at line 149 of file board.h.

STATIC INLINE void Board_I2C_EnableFastPlus | ( | I2C_ID_T | id | ) |

Sets up I2C Fast Plus mode.

Parameters

  id | : Must always be I2C0

Returns
  Nothing

Note
  This function must be called before calling Chip_I2C_SetClockRate() to set clock rates above normal range 100KHz to 400KHz. Only I2C0 supports this mode.

Definition at line 138 of file board.h.

void Board_I2C_Init | ( | I2C_ID_T | id | ) |

Sets up board specific I2C interface.

Parameters

  id | : I2C Peripheral ID (I2C0, I2C1)

Returns
  Nothing

Parameters

  id | : I2C Peripheral ID (I2C0 or I2C1)

Returns
  Nothing

Parameters

  id | : I2C Peripheral ID (I2C0, I2C1)

Returns
  Nothing

Definition at line 541 of file board.c.

void Board_Joystick_Init | ( | void |  | ) |

Initialize joystick interface on board.

Returns
  Nothing

Initializes board specific joystick.

Returns
  Nothing

Definition at line 489 of file board.c.

void Board_LCD_Init | ( | void |  | ) |

Initialize Pinmuxing for the LCD interface.

Returns
  Nothing

Initialize Pinmuxing for the LCD interface.

Returns
  Nothing

Definition at line 554 of file board.c.

void Board_LCD_WriteData | ( | const uint8_t * | data,
|  | uint16_t | size
| ) |  |

Write given data to LCD module.

Parameters

  data | : data to be written
  size | : number of data items

Returns
  Nothing

Definition at line 285 of file board.c.

void Board_SDMMC_Init | ( | void |  | ) |

Initialize pin muxing for SDMMC interface.

Returns
  Nothing

Sets up board specific SDMMC interface.

Returns
  Nothing

Definition at line 689 of file board.c.

void Board_SSP_Init | ( | LPC_SSP_T * | pSSP | ) |

Initialize pin muxing for SSP interface.

Parameters

  pSSP | : Pointer to SSP interface to initialize

Returns
  Nothing

Sets up board specific SSP interface.

Parameters

  pSSP | : Pointer to SSP interface to initialize

Returns
  Nothing

Definition at line 704 of file board.c.

void Board_UART_Init | ( | LPC_USART_T * | pUART | ) |

Initialize pin muxing for a UART.

Parameters

  pUART | : Pointer to UART register block for UART pins to init

Returns
  Nothing

Definition at line 356 of file board.c.

__STATIC_INLINE void Board_USB1_DisableVbus | ( | void |  | ) |

Disable VBUS to USB1 port.

Returns
  Nothing

See Also
  Board_USB1_EnableVbus()

Definition at line 187 of file board.h.

__STATIC_INLINE void Board_USB1_EnableVbus | ( | void |  | ) |

Enable VBUS to USB1 port in Host mode.

Returns
  Nothing

See Also
  Board_USB1_DisableVbus()

Definition at line 176 of file board.h.

uint32_t Buttons_GetStatus | ( | void |  | ) |

Returns button(s) state on board.

Returns
  Returns BUTTONS_BUTTON1 if button1 is pressed

Definition at line 479 of file board.c.

uint8_t Joystick_GetStatus | ( | void |  | ) |

Returns joystick states on board.

Returns
  Returns a JOY_* value, ir JOY_PRESS or JOY_UP

Initialize joystick interface on board.

Returns
  Returns a JOY_* value, ir JOY_PRESS or JOY_UP

Definition at line 493 of file board.c.