LPCOpen Platform for LPC18XX/43XX microcontrollers  18XX43XX
LPCOpen Platform for the NXP LPC18XX/43XX family of Microcontrollers
Modules | Macros | Functions | Variables
LPC4357 Keil MCB board support software API functions

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: LPC4357 Keil MCB board build options
 

Macros

#define BOARD_KEIL_MCB_4357
 
#define USE_RMII
 
#define BOARD_ENET_PHY_ADDR   0x01
 
#define LED_NUMBER_OF   1
 
#define BUTTONS_BUTTON1_GPIO_PORT_NUM   2
 
#define BUTTONS_BUTTON1_GPIO_BIT_NUM   0
 
#define JOYSTICK_UP_GPIO_PORT_NUM   6
 
#define JOYSTICK_UP_GPIO_BIT_NUM   10
 
#define JOYSTICK_DOWN_GPIO_PORT_NUM   6
 
#define JOYSTICK_DOWN_GPIO_BIT_NUM   11
 
#define JOYSTICK_LEFT_GPIO_PORT_NUM   6
 
#define JOYSTICK_LEFT_GPIO_BIT_NUM   12
 
#define JOYSTICK_RIGHT_GPIO_PORT_NUM   6
 
#define JOYSTICK_RIGHT_GPIO_BIT_NUM   13
 
#define JOYSTICK_PRESS_GPIO_PORT_NUM   6
 
#define JOYSTICK_PRESS_GPIO_BIT_NUM   8
 
#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   0x01
 
#define LEDS_LED1   0x01
 
#define LEDS_LED2   0x02
 
#define LEDS_LED3   0x04
 
#define LEDS_LED4   0x08
 
#define LEDS_NO_LEDS   0x00
 
#define I2CDEV_UDA1380_ADDR   (0x34 >> 1)
 
#define UDA1380_I2C_BUS   I2C0
 
#define FRAMEBUFFER_ADDR   0x28000000
 
#define BOARD_LCD   MCB4300_LCD
 
#define SSP_ID   LPC_SSP0
 
#define C_GLCD_H_SIZE   240
 
#define C_GLCD_V_SIZE   320
 
#define TSC_I2C_ADDR   (0x82 >> 1) /* Touchscreen 7-bit I2C address */
 
#define TSC_I2C_BUS   I2C0
 
#define SYS_CTRL1   0x03
 
#define SYS_CTRL2   0x04
 
#define INT_CTRL   0x09
 
#define INT_EN   0x0A
 
#define INT_STA   0x0B
 
#define GPIO_ALT_FUNCT   0x17
 
#define ADC_CTRL1   0x20
 
#define ADC_CTRL2   0x21
 
#define TSC_CTRL   0x40
 
#define TSC_CFG   0x41
 
#define FIFO_TH   0x4A
 
#define FIFO_STA   0x4B
 
#define FIFO_SIZE   0x4C
 
#define DATA_X   0x4D
 
#define DATA_Y   0x4F
 
#define DATA_Z   0x51
 
#define TSC_FRACTION_Z   0x56
 
#define TSC_I_DRIVE   0x58
 
#define TSC_SHIELD   0x59
 
#define DATA_XYZ   0xD7
 

Functions

void Board_ADC_Init (void)
 Sets up board specific ADC interface. More...
 
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_SDMMC_Init (void)
 Sets up board specific SDMMC interface. More...
 
void Board_SSP_Init (LPC_SSP_T *pSSP)
 Sets up board specific 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_LCD_Init (void)
 Initialize the LCD interface. More...
 
void Board_InitLCDController (void)
 Initializes the LCD Controller. More...
 
void Board_InitTouchController (void)
 Initialize touchscreen controller. More...
 
bool Board_GetTouchPos (int16_t *pX, int16_t *pY)
 Get touch screen position (Polled mode) More...
 
bool Board_I2C_GetTouchPos (int16_t *pX, int16_t *pY)
 Get touch screen position (Interrupt Based) More...
 
void Board_SetLCDBacklight (uint8_t Intensity)
 Set LCD Backlight. More...
 
void Board_Buttons_Init (void)
 Initializes board specific buttons. More...
 
void Board_Joystick_Init (void)
 Initializes board specific joystick. More...
 
uint8_t Joystick_GetStatus (void)
 Initialize joystick interface 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)
 Sets up board specific I2S interface and UDA1380. More...
 

Variables

const LCD_CONFIG_T MCB4300_LCD
 

Macro Definition Documentation

#define ADC_CTRL1   0x20

Definition at line 140 of file board.h.

#define ADC_CTRL2   0x21

Definition at line 141 of file board.h.

#define BOARD_ENET_PHY_ADDR   0x01

Definition at line 81 of file board.h.

#define BOARD_KEIL_MCB_4357

Definition at line 77 of file board.h.

#define BOARD_LCD   MCB4300_LCD

Definition at line 121 of file board.h.

#define BUTTONS_BUTTON1   0x01

Definition at line 105 of file board.h.

#define BUTTONS_BUTTON1_GPIO_BIT_NUM   0

Definition at line 86 of file board.h.

#define BUTTONS_BUTTON1_GPIO_PORT_NUM   2

Definition at line 85 of file board.h.

#define C_GLCD_H_SIZE   240

Definition at line 125 of file board.h.

#define C_GLCD_V_SIZE   320

Definition at line 126 of file board.h.

#define DATA_X   0x4D

Definition at line 147 of file board.h.

#define DATA_XYZ   0xD7

Definition at line 153 of file board.h.

#define DATA_Y   0x4F

Definition at line 148 of file board.h.

#define DATA_Z   0x51

Definition at line 149 of file board.h.

#define FIFO_SIZE   0x4C

Definition at line 146 of file board.h.

#define FIFO_STA   0x4B

Definition at line 145 of file board.h.

#define FIFO_TH   0x4A

Definition at line 144 of file board.h.

#define FRAMEBUFFER_ADDR   0x28000000

Definition at line 118 of file board.h.

#define GPIO_ALT_FUNCT   0x17

Definition at line 139 of file board.h.

#define I2CDEV_UDA1380_ADDR   (0x34 >> 1)

Definition at line 114 of file board.h.

#define INT_CTRL   0x09

Definition at line 136 of file board.h.

#define INT_EN   0x0A

Definition at line 137 of file board.h.

#define INT_STA   0x0B

Definition at line 138 of file board.h.

#define JOY_DOWN   0x02

Definition at line 99 of file board.h.

#define JOY_LEFT   0x04

Definition at line 100 of file board.h.

#define JOY_PRESS   0x10

Definition at line 102 of file board.h.

#define JOY_RIGHT   0x08

Definition at line 101 of file board.h.

#define JOY_UP   0x01

Definition at line 98 of file board.h.

#define JOYSTICK_DOWN_GPIO_BIT_NUM   11

Definition at line 90 of file board.h.

#define JOYSTICK_DOWN_GPIO_PORT_NUM   6

Definition at line 89 of file board.h.

#define JOYSTICK_LEFT_GPIO_BIT_NUM   12

Definition at line 92 of file board.h.

#define JOYSTICK_LEFT_GPIO_PORT_NUM   6

Definition at line 91 of file board.h.

#define JOYSTICK_PRESS_GPIO_BIT_NUM   8

Definition at line 96 of file board.h.

#define JOYSTICK_PRESS_GPIO_PORT_NUM   6

Definition at line 95 of file board.h.

#define JOYSTICK_RIGHT_GPIO_BIT_NUM   13

Definition at line 94 of file board.h.

#define JOYSTICK_RIGHT_GPIO_PORT_NUM   6

Definition at line 93 of file board.h.

#define JOYSTICK_UP_GPIO_BIT_NUM   10

Definition at line 88 of file board.h.

#define JOYSTICK_UP_GPIO_PORT_NUM   6

Definition at line 87 of file board.h.

#define LED_NUMBER_OF   1

Definition at line 83 of file board.h.

#define LEDS_LED1   0x01

Definition at line 107 of file board.h.

#define LEDS_LED2   0x02

Definition at line 108 of file board.h.

#define LEDS_LED3   0x04

Definition at line 109 of file board.h.

#define LEDS_LED4   0x08

Definition at line 110 of file board.h.

#define LEDS_NO_LEDS   0x00

Definition at line 111 of file board.h.

#define NO_BUTTON_PRESSED   0x00

Definition at line 103 of file board.h.

#define SSP_ID   LPC_SSP0

LCD controller definitions

Definition at line 124 of file board.h.

#define SYS_CTRL1   0x03

STMPE811 Register addresses

Definition at line 134 of file board.h.

#define SYS_CTRL2   0x04

Definition at line 135 of file board.h.

#define TSC_CFG   0x41

Definition at line 143 of file board.h.

#define TSC_CTRL   0x40

Definition at line 142 of file board.h.

#define TSC_FRACTION_Z   0x56

Definition at line 150 of file board.h.

#define TSC_I2C_ADDR   (0x82 >> 1) /* Touchscreen 7-bit I2C address */

Private types/definitions for touch screen controller (STMPE811)

Definition at line 130 of file board.h.

#define TSC_I2C_BUS   I2C0

Definition at line 131 of file board.h.

#define TSC_I_DRIVE   0x58

Definition at line 151 of file board.h.

#define TSC_SHIELD   0x59

Definition at line 152 of file board.h.

#define UDA1380_I2C_BUS   I2C0

Definition at line 115 of file board.h.

#define USE_RMII

Definition at line 80 of file board.h.

Function Documentation

void Board_ADC_Init ( void  )

Sets up board specific ADC interface.

Returns
Nothing

Sets up board specific ADC interface.

Returns
Nothing

Definition at line 534 of file board.c.

void Board_Audio_Init ( LPC_I2S_T pI2S,
int  micIn 
)

Sets up board specific I2S interface and UDA1380.

Parameters
pI2S: Pointer to I2S interface to initialize
micIn: If 1 selects MIC as input device, if 0 selects LINE_IN
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  )

Initializes board specific buttons.

Returns
Nothing

Initializes board specific buttons.

Returns
Nothing

Definition at line 472 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.

bool Board_GetTouchPos ( int16_t *  pX,
int16_t *  pY 
)

Get touch screen position (Polled mode)

Parameters
pX: pointer to X position
pY: pointer to Y position
Returns
true if touch is detected or false if otherwise
Note
When using OS use Board_I2C_GetTouchPos(), instead of this function as this function uses busy wait to do I2C transfers.

Get touch screen position (Polled mode)

Parameters
pX: Pointer to x-Coord to populate
pY: Pointer to y-Coord to populate
Returns
true if touch is detected or false if otherwise

Definition at line 621 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 188 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 177 of file board.h.

bool Board_I2C_GetTouchPos ( int16_t *  pX,
int16_t *  pY 
)

Get touch screen position (Interrupt Based)

Parameters
pX: pointer to X position
pY: pointer to Y position
Returns
true if touch is detected or false if otherwise
Note
To use this function, I2C interrupt for TSC_I2C_BUS must be enabled, and the corresponding handler must call Chip_I2C_MasterStateHandler()

Definition at line 561 of file board.c.

void Board_I2C_Init ( I2C_ID_T  id)

Sets up board specific I2C interface.

Parameters
id: I2C Interface ID (I2C0, I2C1 ... etc)
Returns
Nothing
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_InitLCDController ( void  )

Initializes the LCD Controller.

Returns
Nothing

Initializes the LCD Controller.

Returns
Nothing

Definition at line 565 of file board.c.

void Board_InitTouchController ( void  )

Initialize touchscreen controller.

Returns
Nothing

Definition at line 590 of file board.c.

void Board_Joystick_Init ( void  )

Initializes board specific joystick.

Returns
Nothing

Initializes board specific joystick.

Returns
Nothing

Definition at line 489 of file board.c.

void Board_LCD_Init ( void  )

Initialize the LCD interface.

Returns
Nothing

Definition at line 554 of file board.c.

void Board_SDMMC_Init ( void  )

Sets up board specific SDMMC interface.

Returns
Nothing

Sets up board specific SDMMC interface.

Returns
Nothing

Definition at line 689 of file board.c.

void Board_SetLCDBacklight ( uint8_t  Intensity)

Set LCD Backlight.

Returns
Nothing

Set LCD Backlight.

Parameters
Intensity: Backlight intensity (0 = off, >=1 = on)
Returns
None
Note
On boards where a GPIO is used to control backlight on/off state, a '0' or '1' value will turn off or on the backlight. On some boards, a non-0 value will control backlight intensity via a PWN. For PWM systems, the intensity value is a percentage value between 0 and 100%.

Definition at line 681 of file board.c.

void Board_SSP_Init ( LPC_SSP_T pSSP)

Sets up board specific 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.

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  )

Initialize joystick interface on board.

Returns
joystick status: up, down, left or right

Initialize joystick interface on board.

Returns
Returns a JOY_* value, ir JOY_PRESS or JOY_UP

Definition at line 493 of file board.c.

Variable Documentation

const LCD_CONFIG_T MCB4300_LCD

Definition at line 60 of file board.c.