Show / Hide Table of Contents

Class PicoPiSDK

Represents a SDK to access devices based on a Raspberry Pi Pico.

Inheritance
object
PicoPiSDK
Implements
IDisposable
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: RGB.NET.Devices.PicoPi
Assembly: RGB.NET.Devices.PicoPi.dll
Syntax
public sealed class PicoPiSDK : IDisposable

Constructors

| Edit this page View Source

PicoPiSDK(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 Source

HID_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
| Edit this page View Source

HID_OFFSET_MULTIPLIER

Declaration
public const int HID_OFFSET_MULTIPLIER = 60
Field Value
Type Description
int
| Edit this page View Source

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 Source

Channels

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)>
| Edit this page View Source

Id

Gets the Id of the device.

Declaration
public string Id { get; }
Property Value
Type Description
string
| Edit this page View Source

IsBulkSupported

Gets if updates via the Bulk-Enbpoint are possible.

Declaration
public bool IsBulkSupported { get; }
Property Value
Type Description
bool
| Edit this page View Source

Version

Gets the version of the device firmware.

Declaration
public int Version { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Declaration
public void Dispose()
| Edit this page View Source

FlushBulk()

Flushing the bulk endpoint, causing the device to update.

Declaration
public void FlushBulk()
| Edit this page View Source

Reset()

Resets all leds to black.

Declaration
public void Reset()
| Edit this page View Source

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)

| Edit this page View Source

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.

| Edit this page View Source

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.)

| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

IDisposable
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX