rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
MBED Platform configuration

The following defines are used to configure the library to use with the MBED. More...

Clock configuration

Dividers and multipliers for controlling the CPU clock.

The PLL output clock frequency is given by: (2*PLL_MULTIPLIER*MAIN_OSCILLATOR_FREQUENCY)/INPUT_DIVIDER This clock is then divided by CPU_DIVIDER to clock the CPU.

CPU is set to 96Mhz using the 12Mhz source for PLL0. (see mbed schematic, main oscillator is a 12Mhz crystal connected to pins XTAL1 and XTAL2)

As this setup is suitable for USB, PPL0 can be used to clock USB (need a 48Mhz mutiple)

With the given configuration (INPUT_DIVIDER=1, PLL_MULTIPLIER=12, CPU_DIVIDER=3), PLL ouput is 2*12*12000000/1 = 288Mhz Divided by 3 -> CPU is at 96 Mhz

Warning
Be carefull when modifing these parameters. Clock the ARM at more than 100Mhz is a bad idea...
#define RFLPC_CLOCK_USE_MAIN_OSCILLATOR
 If defined, the rflpc_clock_init() function will use the main oscillator. More...
 
#define RFLPC_CLOCK_MAIN_OSCILLATOR_FREQUENCY   12000000
 The frequency of the main oscillator if used. More...
 
#define RFLPC_CLOCK_INPUT_DIVIDER   1
 PLL0 will divide its input by this value. More...
 
#define RFLPC_CLOCK_PLL_MULTIPLIER   12
 PLL0 will multiply its input by this value. More...
 
#define RFLPC_CLOCK_CPU_DIVIDER   3
 The PLL0 output will be divided by this value to provide CPU clock. More...
 

MBED DIP Pins.

This represents the mapping between MBED breadboard and LPC17xx pins.

They are never used in the library in itself, by can be used for application that targets only MBED

#define MBED_DIP5   RFLPC_PIN_P0_9
 
#define MBED_DIP6   RFLPC_PIN_P0_8
 
#define MBED_DIP7   RFLPC_PIN_P0_7
 
#define MBED_DIP8   RFLPC_PIN_P0_6
 
#define MBED_DIP9   RFLPC_PIN_P0_0
 
#define MBED_DIP10   RFLPC_PIN_P0_1
 
#define MBED_DIP11   RFLPC_PIN_P0_18
 
#define MBED_DIP12   RFLPC_PIN_P0_17
 
#define MBED_DIP13   RFLPC_PIN_P0_15
 
#define MBED_DIP14   RFLPC_PIN_P0_16
 
#define MBED_DIP15   RFLPC_PIN_P0_23
 
#define MBED_DIP16   RFLPC_PIN_P0_24
 
#define MBED_DIP17   RFLPC_PIN_P0_25
 
#define MBED_DIP18   RFLPC_PIN_P0_26
 
#define MBED_DIP19   RFLPC_PIN_P1_30
 
#define MBED_DIP20   RFLPC_PIN_P1_31
 
#define MBED_DIP21   RFLPC_PIN_P2_5
 
#define MBED_DIP22   RFLPC_PIN_P2_4
 
#define MBED_DIP23   RFLPC_PIN_P2_3
 
#define MBED_DIP24   RFLPC_PIN_P2_2
 
#define MBED_DIP25   RFLPC_PIN_P2_1
 
#define MBED_DIP26   RFLPC_PIN_P2_0
 
#define MBED_DIP27   RFLPC_PIN_P0_11
 
#define MBED_DIP28   RFLPC_PIN_P0_10
 
#define MBED_DIP29   RFLPC_PIN_P0_5
 
#define MBED_DIP30   RFLPC_PIN_P0_4
 

LEDs configuration

#define RFLPC_LED_1_PIN   RFLPC_PIN_P1_18
 On which pin is the LED1 ?
 
#define RFLPC_LED_2_PIN   RFLPC_PIN_P1_20
 On which pin is the LED2 ?
 
#define RFLPC_LED_3_PIN   RFLPC_PIN_P1_21
 On which pin is the LED3 ?
 
#define RFLPC_LED_4_PIN   RFLPC_PIN_P1_23
 On which pin is the LED4 ?
 

PHY device configuration

#define RFLPC_ETH_PHY_ADDR   (0x01)
 MII Address of the PHY device. More...
 
#define RFLPC_ETH_USE_EXTENDED_MII
 Define this constant to use the MII extended register set. More...
 

UART Configuration

#define RFLPC_UART0_TXD_PIN   RFLPC_PIN_P0_2
 UART0 TX Pin.
 
#define RFLPC_UART0_RXD_PIN   RFLPC_PIN_P0_3
 UART0 RX Pin.
 
#define RFLPC_UART0_PIN_FUNCTION   1
 Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf. More...
 
#define RFLPC_UART2_TXD_PIN   10
 UART2 TX Pin.
 
#define RFLPC_UART2_RXD_PIN   11
 UART2 RX Pin.
 
#define RFLPC_UART2_PIN_FUNCTION   1
 Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf. More...
 
#define RFLPC_UART3_TXD_PIN   0
 UART3 TX Pin.
 
#define RFLPC_UART3_RXD_PIN   1
 UART3 RX Pin.
 
#define RFLPC_UART3_PIN_FUNCTION   2
 Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf. More...
 

Stack configuration

#define RFLPC_STACK_SIZE   1024
 size of the stack in bytes
 

Interrupt configuration

#define RFLPC_IRQ_DEBUG_ENABLE
 If this constant is defined, then freeze the device on unhandled interrupt.
 
#define RFLPC_IRQn_COUNT   (PLL1_IRQn + 16 +1)
 This is the size of the interrupt vector.
 

Detailed Description

The following defines are used to configure the library to use with the MBED.

Macro Definition Documentation

#define RFLPC_CLOCK_CPU_DIVIDER   3

The PLL0 output will be divided by this value to provide CPU clock.

Definition at line 79 of file config-mbed.h.

#define RFLPC_CLOCK_INPUT_DIVIDER   1

PLL0 will divide its input by this value.

Definition at line 75 of file config-mbed.h.

#define RFLPC_CLOCK_MAIN_OSCILLATOR_FREQUENCY   12000000

The frequency of the main oscillator if used.

Definition at line 71 of file config-mbed.h.

#define RFLPC_CLOCK_PLL_MULTIPLIER   12

PLL0 will multiply its input by this value.

Definition at line 77 of file config-mbed.h.

#define RFLPC_CLOCK_USE_MAIN_OSCILLATOR

If defined, the rflpc_clock_init() function will use the main oscillator.

Definition at line 66 of file config-mbed.h.

#define RFLPC_ETH_PHY_ADDR   (0x01)

MII Address of the PHY device.

Definition at line 149 of file config-mbed.h.

#define RFLPC_ETH_USE_EXTENDED_MII

Define this constant to use the MII extended register set.

Disabling this will:

  • Disable fine control of auto-negociation (performing a link auto negociation will select a mode regardless the specified one (because of the non availability of the auto negociation ability (ANAR) register
  • Make the detection of the link mode not accurate (by using control registers which may not always reflect the real link mode)

Definition at line 161 of file config-mbed.h.

#define RFLPC_UART0_PIN_FUNCTION   1

Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf.

user manual PINSEL* registers) .

Definition at line 173 of file config-mbed.h.

#define RFLPC_UART2_PIN_FUNCTION   1

Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf.

user manual PINSEL* registers) .

Definition at line 180 of file config-mbed.h.

#define RFLPC_UART3_PIN_FUNCTION   2

Depending on the platform, the pins used for uart0 are not the same and they do not use the same value for configuring multi-purpose pins (cf.

user manual PINSEL* registers) .

Definition at line 187 of file config-mbed.h.