-
-
Notifications
You must be signed in to change notification settings - Fork 111
/
Copy pathInterruptConfiguration.cs
90 lines (78 loc) · 2.5 KB
/
InterruptConfiguration.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
namespace Iot.Device.Bh1745
{
/// <summary>
/// Represents the configuration for the interrupt persistence functionality of the Bh1745.
/// </summary>
public enum InterruptPersistence : byte
{
/// <summary>
/// Interrupt status is toggled at each measurement end.
/// </summary>
ToggleMeasurementEnd = 0b00,
/// <summary>
/// Interrupt status is updated at each measurement end.
/// </summary>
UpdateMeasurementEnd = 0b01,
/// <summary>
/// Interrupt status is updated if 4 consecutive threshold judgments are the same.
/// </summary>
UpdateConsecutiveX4 = 0b10,
/// <summary>
/// Interrupt status is updated if 8 consecutive threshold judgments are the same.
/// </summary>
UpdateConsecutiveX8 = 0b11
}
/// <summary>
/// Represents the interrupt source which is one of the 4 color channels of the Bh1745.
/// </summary>
public enum InterruptSource : byte
{
/// <summary>
/// The red color channel.
/// </summary>
RedChannel = 0b00,
/// <summary>
/// The green color channel.
/// </summary>
GreenChannel = 0b01,
/// <summary>
/// The blue color channel.
/// </summary>
BlueChannel = 0b10,
/// <summary>
/// The clear color channel.
/// </summary>
ClearChannel = 0b11
}
/// <summary>
/// Represents the latch behavior of the interrupt pin of the Bh1745.
/// </summary>
public enum LatchBehavior : byte
{
/// <summary>
/// Interrupt pin is latched until interrupt register is read or initialized.
/// or initialized.
/// </summary>
LatchUntilReadOrInitialized = 0b00,
/// <summary>
/// Interrupt pin is latched after each measurement.
/// </summary>
LatchEachMeasurement = 0b01
}
/// <summary>
/// Represents the state of the interrupt pin of the Bh1745.
/// </summary>
public enum InterruptStatus : byte
{
/// <summary>
/// Default state in which the interrupt pin is not initialized (active).
/// </summary>
Active = 0b00,
/// <summary>
/// Sets the pin to high impedance (inactive).
/// </summary>
Inactive = 0b01
}
}