Ttelmah Guest
|
|
Posted: Fri Sep 04, 2009 2:21 am |
|
|
You don't....
The changes need to be in your 'physical' serial code beyond the USB stuff.
For example, if you look at the structure usb_cdc_carrier, this contains a byte, with bits reflecting the hardware flow control status, and carrier detect status. All you need to do, is read this byte, and make _your_ external hardware bits reflect this (and vice versa). Similarly, the driver will already receive from the PC, data, which it puts into usb_cdc_line_coding, when a baud rate change etc., is sent. You check the flag 'usb_cdc_got_set_line_coding', if if it goes 'true', read the structure, and make your serial connection match what the PC has requested (and then clear this flag).
Basically, whenever the PC asks for a change to the serial setup, it sends a 'set line coding' message to the USB device, containing the required settings. It is up to you whether you simply ignore them, or adjust your hardware to match. The USB driver _already_ receives these messages, stores them for you, and sets a flag.
You don't ned to change the USB drivers at all. They already handle the messages.
Best Wishes |
|