Class PicoPiSDK
Represents a SDK to access devices based on a Raspberry Pi Pico.
Implements
Inherited Members
Namespace: RGB.NET.Devices.PicoPi
Assembly: RGB.NET.Devices.PicoPi.dll
Syntax
public sealed class PicoPiSDK : IDisposable
Constructors
| Edit this page View SourcePicoPiSDK(HidDevice)
Initializes a new instance of the PicoPiSDK class.
Declaration
public PicoPiSDK(HidDevice device)
Parameters
Type | Name | Description |
---|---|---|
HidDevice | device | The underlying hid device. |
Fields
| Edit this page View SourceHID_BULK_CONTROLLER_PID
The product id used by the pico-pi firmware. Registered at https://pid.codes/1209/2812/
Declaration
public const int HID_BULK_CONTROLLER_PID = 10258
Field Value
Type | Description |
---|---|
int |
HID_OFFSET_MULTIPLIER
Declaration
public const int HID_OFFSET_MULTIPLIER = 60
Field Value
Type | Description |
---|---|
int |
VENDOR_ID
The vendor id used by the pico-pi firmware. Registered at https://pid.codes/1209/2812/
Declaration
public const int VENDOR_ID = 4617
Field Value
Type | Description |
---|---|
int |
Properties
| Edit this page View SourceChannels
Gets a collection of channels, led counts and pins that are available on this device.
Declaration
public IReadOnlyList<(int channel, int ledCount, int pin)> Channels { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<(int channel, int ledCount, int pin)> |
Id
Gets the Id of the device.
Declaration
public string Id { get; }
Property Value
Type | Description |
---|---|
string |
IsBulkSupported
Gets if updates via the Bulk-Enbpoint are possible.
Declaration
public bool IsBulkSupported { get; }
Property Value
Type | Description |
---|---|
bool |
Version
Gets the version of the device firmware.
Declaration
public int Version { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceDispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
FlushBulk()
Flushing the bulk endpoint, causing the device to update.
Declaration
public void FlushBulk()
Reset()
Resets all leds to black.
Declaration
public void Reset()
SendBulkUpdate(in Span<byte>, int)
Sends a update to the device using the bulk-endpoint.
Declaration
public void SendBulkUpdate(in Span<byte> data, int channel)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | data | The data packet to send. |
int | channel | The channel to update. |
Remarks
Silently fails if not bulk-updates are supported. (Check IsBulkSupported)
SendHidUpdate(in Span<byte>, int)
Sends a update to the device using the HID-endpoint and fragments the data if needed.
Declaration
public void SendHidUpdate(in Span<byte> buffer, int channel)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | buffer | |
int | channel | The channel to update. |
SendHidUpdate(in Span<byte>, int, int, bool)
Sends a update to the device using the HID-endpoint.
Declaration
public void SendHidUpdate(in Span<byte> data, int channel, int chunk, bool update)
Parameters
Type | Name | Description |
---|---|---|
Span<byte> | data | The data packet to send. |
int | channel | The channel to update. |
int | chunk | The chunk id of the packet. (Required if packets are fragmented.) |
bool | update | A value indicating if the device should update directly after receiving this packet. (If packets are fragmented this should only be true for the last chunk.) |
SetLedCounts(params (int channel, int ledCount)[])
Configures the amount of leds to update on the specified channels.
Declaration
public void SetLedCounts(params (int channel, int ledCount)[] ledCounts)
Parameters
Type | Name | Description |
---|---|---|
(int channel, int ledCount)[] | ledCounts | The values to set on the device. |
Remarks
This is a configuration function. The value is persistent on the device.
SetPins(params (int channel, int pin)[])
Configures the pins used by the specified channels.
Declaration
public void SetPins(params (int channel, int pin)[] pins)
Parameters
Type | Name | Description |
---|---|---|
(int channel, int ledCount)[] | pins | T values to set on the device. |
Remarks
This is a configuration function. The value is persistent on the device.