请问CH341A使用USB转SPI时, 是否能设置SPI的MSB在前模式?
int ch341_set_stream(uint8_t mode) { uint8_t cmd_set_stream[4]; int n; cmd_set_stream[0] = CH341A_CMD_I2C_STREAM; cmd_set_stream[1] = CH341A_CMD_I2C_STREAM_SET; cmd_set_stream[2] = mode; cmd_set_stream[3] = CH341A_CMD_I2C_STREAM_END; n = usb_bulk_transfer(__func__, BULK_WRITE_ENDPOINT, cmd_set_stream, sizeof(cmd_set_stream)); if (n != (sizeof(cmd_set_stream))) { fprintf(stderr, "ch341 set stream to %02X failed: (%d)\n", mode, n); return -1; } return 0; }
我使用libusb按照这种方式设置, 不起作用.
热门产品 :
CH397: 高集成度、低功耗USB网卡芯片