-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathSettings.cs
50 lines (43 loc) · 1.13 KB
/
Settings.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Generic;
using System.Collections.ObjectModel;
using WS281x.Native;
namespace WS281x
{
/// <summary>
/// Settings which are required to initialize the WS281x controller
/// </summary>
public class Settings
{
/// <summary>
/// Settings to initialize the WS281x controller
/// </summary>
/// <param name="frequency">Set frequency in Hz</param>
/// <param name="dmaChannel">Set DMA channel to use</param>
public Settings(uint frequency, int dmaChannel)
{
Frequency = frequency;
DMAChannel = dmaChannel;
}
/// <summary>
/// Returns default settings.
/// Use a frequency of 800000 Hz and DMA channel 10
/// </summary>
/// <returns></returns>
public static Settings CreateDefaultSettings()
{
return new Settings(800000, 10);
}
/// <summary>
/// Returns the used frequency in Hz
/// </summary>
public uint Frequency { get; private set; }
/// <summary>
/// Returns the DMA channel
/// </summary>
public int DMAChannel { get; private set; }
/// <summary>
/// Returns the channels which holds the LEDs
/// </summary>
public Channel Channel { get; set; }
}
}