Hi Hervé
The break control is presently not in the NXP projects.
However it looks to be quite easy to do:
- fnStartBreak() needs to set UxLCR |= BREAK_CONTROL; (where x is the UART channel)
The code would probably be
extern void fnStartBreak(QUEUE_HANDLE Channel)
{
LPC23XX_UART_CONTROL *uart_reg = fnSelectChannel(Channel);
uart_reg->LCR |= BREAK_CONTROL;
}
extern void fnStopBreak(QUEUE_HANDLE Channel)
{
LPC23XX_UART_CONTROL *uart_reg = fnSelectChannel(Channel);
uart_reg->LCR &= ~BREAK_CONTROL;
}
I haven't tested this on the HW though (yet)!
The channel associated with a queue handle is:
que_ids[driver_id - 1].qHandle, where driver_id is the queue handle number
However it may be best to have a function in Driver.c which returns this value (with some checking in case it is called with the wrong handle).
Also it may be best to be able to be able to control the break state via the fnDriver(driver_id, x, y); routine, as the RTS line can be controlled.
I'll look into adding these functions for future versions but you can probably very easily do all controlling that you need using the details above.
Note that the UART driver offers a mode (BREAK_AFTER_TX) #define UART_BREAK_SUPPORT which automatically sets the transmit line to the break state when transmission of a 'message' completes. This is useful in certain protocols. The length of tiem that the state remains then needs to be controlled at the application layer.
Regards
Mark