uart _uidx and pins

tx USBTX rx USBRX UART0

tx p13 rx p14 UART1

tx p28 rx p27 UART2

tx p9 rx p10 UART3

code

class MySerial : public Serial {
public:
  MySerial(PinName tx, PinName rx, const char *name = NULL) : Serial(tx, rx, name)
  {
  }
  
  int idx() { return _uidx; }
};

MySerial pc(USBTX, USBRX);
MySerial a(p9, p10);
MySerial b(p13, p14);
MySerial c(p28, p27);

int main() {
 pc.baud(115200);   

 pc.printf("usbtx %d\n", pc.idx());
 pc.printf("p9 %d\n", a.idx());
 pc.printf("p13 %d\n", b.idx());
 pc.printf("p28 %d\n", c.idx());


1 comment on uart _uidx and pins:

26 Nov 2013

I am still confused about the PINs. Are they identical between platforms? KL25Z, LPC1768 and LPC812?

Please log in to post comments.