请问CH341A使用USB转SPI时, 是否能设置SPI的MSB在前模式?
int ch341_set_stream(uint8_t 模式)
{
uint8_t cmd_set_stream[4];
诠释n;
cmd_set_stream[0] = CH341A_CMD_I2C_STREAM;
cmd_set_stream[1] = CH341A_CMD_I2C_STREAM_SET;
cmd_set_stream[2] = 模式;
cmd_set_stream[3] = CH341A_CMD_I2C_STREAM_END;
n = usb_bulk_transfer(__func__, BULK_WRITE_ENDPOINT,
cmd_set_stream,
sizeof(cmd_set_stream));
如果 (n != (sizeof(cmd_set_stream))) {
fprintf(stderr, "ch341 set stream to %02X failed: (%d)n",
模式,n);
返回-1;
}
返回0;
}
我使用libusb按照这种方式设置, 不起作用.