CH341: Use 923077 baud
Signed-off-by: Tormod Volden <debian.tormod@gmail.com>
This commit is contained in:
parent
3d95a5806e
commit
a1f64d8008
|
@ -301,6 +301,7 @@ static bool configure_keyboard(const usb_hcd_t *hcd, const usb_ep_t *ep0, int in
|
|||
}
|
||||
|
||||
#define CH341_REQ_SERIAL_INIT 0xA1
|
||||
#define CH341_REQ_WRITE_REG 0x9A
|
||||
|
||||
static bool configure_ch341(const usb_hcd_t *hcd, const usb_ep_t *ep0)
|
||||
{
|
||||
|
@ -312,6 +313,12 @@ static bool configure_ch341(const usb_hcd_t *hcd, const usb_ep_t *ep0)
|
|||
return false;
|
||||
}
|
||||
|
||||
// div/prescale F3 07 gives 923077 baud, set bit 7 for non-buffered
|
||||
build_setup_packet(&setup_pkt, USB_REQ_TO_DEVICE | USB_REQ_VENDOR, CH341_REQ_WRITE_REG, 0x1312, 0xf387, 0);
|
||||
if (!hcd->methods->setup_request(hcd, ep0, &setup_pkt)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue