pin name support for EA baseboard

02 Jan 2011

How about adding support for the EA baseboard to PinNames.h. That way you can refer directly to PIO1_2 rather than referring to the schematic and then the pinout card to find the corresponding pin name of P17.

02 Jan 2011

Hi Steve,

The PinNames.h supports pin names of the form:

  • pNN - mbed pin names
  • PN_MM - LPC1768 port based pin names

So, for example, you can write p5 or P0_9. This also means you can use all the pins on the raw LPC chip if you make your own board. I assume the second form corresponds to the EA board pin names (if it doesn't, then the best solution is your own custom mapping file, as this is not something to have in the core libraries).


03 Jan 2011

Mostly the pin names overlap, but not all. For example p7 maps to P0_7 (mbed) and PIO2_11 (EA).

I've created a mapping using #defines, because the mbed libraries won't accept an enum other than PinNames, and there's no way to extend/derive enums. Actually I guess it could be done with templates and derived mbed functions but that's a little over the top. So for anyone else using the EA baseboard and desiring to instantiate mbed objects referring to baseboard pin names here is EA_PinNames.h:


// #defines to cross reference Embedded Artists baseboard net names to mbed pin names.  There is
// some overlap between these net names and the LPC pin names in PinNames.h, but they are not
// all the same, due to mbed being mapped to LPC1768 and the baseboard being mapped to LPC1114.
// ie:  p5 maps to P0_9 (mbed) and PIO0_9 (EA)  (mbed and EA are the same)
//      p7 maps to P0_7 (mbed) and PIO2_11 (EA) (mbed and EA are different)

#define  PIO0_9 p5
#define  PIO0_8 p6
#define  PIO2_11 p7
#define  PIO0_2 p8
#define  PIO1_7 p9
#define  PIO1_6 p10
#define  PIO0_7 p11
#define  PIO2_0 p12
#define  PIO2_1 p13
#define  PIO2_2 p14
#define  PIO0_11 p15
#define  PIO1_0 p16
#define  PIO1_1 p17
#define  PIO1_2 p18
#define  PIO1_3 p19
#define  PIO1_4 p20
#define  PIO2_5 p21
#define  PIO2_4 p22
#define  PIO2_3 p23
#define  PIO1_11 p24
#define  PIO1_10 p25
#define  PIO1_9 p26
#define  PIO0_4 p27
#define  PIO0_5 p28
#define  PIO0_3 p29
#define  PIO0_1 p30