For the people who have this question later, here is the answer:
I ended up using DTR1 (DIP21) for flow control, the goal was to make a single directional flow controlled UART.
#include "mbed.h"
// look here for LPC regs:
// http://mbed.org/projects/libraries/svn/mbed/trunk/LPC1768/LPC17xx.h
Serial pc(USBTX, USBRX);
Serial uart(p26, p25);
DigitalOut pc_activity(LED1);
DigitalOut uart_activity(LED2);
int main() {
//
// Configure uart1 to be placed within the PWD section
//
LPC_PINCON->PINSEL4 &= 0x0ffff;
LPC_PINCON->PINSEL4 |= 0x0AAAA;
LPC_UART1->RS485CTRL = (1<<3)|(1<<4)|(1<<5);
LPC_UART1->RS485DLY = 128;
while (1) {
if(pc.readable()) {
uart.putc(pc.getc());
pc_activity = !pc_activity;
}
if(uart.readable()) {
pc.putc(uart.getc());
uart_activity = !uart_activity;
}
}
}
Is there support for DTR setup in the mbed lib? I took a look and it seems like it does not, if not, is the source around so I can add it? I need flow control and it would be nice to interface to the serial port like all other mbed examples without rewriting it.