This is the Visual Basic wrapper for CH341DLL library.
It realize all the available working modes of ch341a chip: serial
(SPI, IIC) and parallel
(EPP, MEM).
- USB driver for CH341 must be installed;
- ch341dll.dll must be placed near to your executable.
First, imports Ch341 namespace:
Imports Ch341
''' <summary>
''' Read ID register of BMP280 sensor.
''' </summary>
Private Sub CheckBmp280_spi()
Dim ch341 As New SpiMaster(0, True)
Dim buf As Byte() = ch341.StreamSpi({&HD0}, 1)
For Each b As Byte In buf
Console.Write(b.ToString("X2"))
Console.Write(" ")
Next
Console.WriteLine()
ch341.CloseDevice()
End Sub
Dim ch341 As New I2cMaster(0, True, I2cMaster.I2cSpeed.Standard)
More complex description: