#include <ftdi.h>
void setupUART(void) {
int ret;
ftdi_init(&ftdic);
if((ret = ftdi_usb_open(&ftdic, 0x0403, 0x6001)) < 0) {
fprintf(stderr, "unable to open ftdi device: %d (%s)\n", ret, ftdi_get_error_string(&ftdic));
}
ftdi_set_baudrate(&ftdic, 115200);
unsigned char buf[2];
buf[0] = 0x55;
buf[1] = 0xAA;
ftdi_write_data(&ftdic, buf, 2);
}
This is more simple than the previous code I used. And the baud rate is 115.2 kbaud. I will try to set it to even faster speeds and do some adjustments on the timing in the emulator code.
1 comment:
CYBERWIN TECHNOLOGY LTD
FTDI agent in Hongkong . www.cyberwin.com.cn email: deo@cyberwin.com.cn
Post a Comment