I'm talking to a sensor using RS232 and the UART of an mbed. However I've noticed that the bits sent to and from the sensor are the exact complement of what they should be. What my mbed sees as a 1, the sensor sees as a 0, and vice versa. I cannot change the sensor, nor to I want to change any of the hardware. How can I invert the input and output of the mbed's UART? The mbed uses a Cortex M3 processor.
EDIT: sorry for any confusion. The whole line is inverted. That means that the start and stop bits are inverted as well. The first bit in the message is luckily a 0 (read as a 1), and the processor interprets that as my start bit. This causes everything to be frame shifted by one bit. Luckily the processor is ignoring framing errors.