This is a Windows 10 IoT Core project on the Raspberry Pi 2/3, coded by C#.
GitHub: https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/IRTM
https://github.com/ZhangGaoxing/windows-iot-demo/tree/master/IRTM/Reference
There is one Serial UART available on the RPi2/3: UART0
You need add the following capability to the Package.appxmanifest file to use Serial UART.
<Capabilities>
<DeviceCapability Name="serialcommunication">
<Device Id="any">
<Function Type="name:serialPort" />
</Device>
</DeviceCapability>
</Capabilities>
In IRTM.cs file
/// <summary>
/// Initialize YS-IRTM
/// </summary>
public async Task InitializeAsync();
/// <summary>
/// Send Order
/// </summary>
/// <param name="code">Order</param>
public async Task SendAsync(byte[] code);
/// <summary>
/// Read Order
/// </summary>
public async Task<byte[]> ReadAsync();
/// <summary>
/// Set YS-IRTM Address
/// </summary>
/// <param name="address">Address from 1 to FF</param>
public async Task SetAddressAsync(byte address);
/// <summary>
/// Set YS-IRTM Baud Rate
/// </summary>
/// <param name="rate">Baud Rate</param>
public async Task SetBaudRateAsync(IrtmBaudRate rate);
/// <summary>
/// Return YS-IRTM
/// </summary>
/// <returns>YS-IRTM</returns>
public SerialDevice GetDevice();
/// <summary>
/// Cleanup
/// </summary>
public void Dispose();
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。