CH341A universal interface dongle

dongle [1]

The CH341A provides USB accessible UART, I2C and SPI peripherals and some GPIO. The UART could theoretically be hooked to an RS232 transciever with hardware flow control etc. The problem is that the software support for this chip isn't that good even in Linux kernel. USB -> UART works out of the box, but I2C and SPI need their respective non upstream kernel modules loaded by the user.

From the design of these kernel modules it might not be possible to use both SPI and I2C simultaneously. This hasn't been confirmed as there was not enough experience in Linux kernel module development.

Working modules for the board are for example these:

These modules however need some small changes in the Makefile (at least for building on Arch/Manjaro changing line 7 to KERNEL_DIR = /usr/lib/modules/$(KVERSION)/build was required, DKMS failed on this operating system meaning that the modules need to be rebuilt when kernel updates).

It might be an interesting task to at first combine the module for I2C and SPI into one and also to write the kernel module in Rust for better maintainibility.

[1] https://zoobab.wdfiles.com/local--files/ch341-usb-spi-i2c-uart-isp-dongle/ch341a-devboard2.jpg