diff --git a/src/devices/QwiicButton/QwiicButton.ButtonStatus.cs b/src/devices/QwiicButton/QwiicButton.ButtonStatus.cs index ee496ac375..3b7c74a5de 100644 --- a/src/devices/QwiicButton/QwiicButton.ButtonStatus.cs +++ b/src/devices/QwiicButton/QwiicButton.ButtonStatus.cs @@ -10,7 +10,7 @@ namespace Iot.Device.QwiicButton public sealed partial class QwiicButton { /// - /// Returns whether the button is pressed. + /// Returns whether the button is pressed, i.e. pushed in. /// public bool IsPressed() { @@ -19,7 +19,7 @@ public bool IsPressed() } /// - /// Returns whether the button is clicked. + /// Returns whether the button is clicked, i.e. pressed and released. /// public bool HasBeenClicked() { @@ -30,20 +30,20 @@ public bool HasBeenClicked() /// /// Returns whether a new button status event has occurred. /// - public bool EventAvailable() + public bool IsEventAvailable() { var status = new StatusRegisterBitField(_registerAccess.ReadRegister(Register.ButtonStatus)); - return status.EventAvailable; + return status.IsEventAvailable; } /// - /// Sets , and to false. + /// Sets , and to false. /// public void ClearEventBits() { var status = new StatusRegisterBitField(_registerAccess.ReadRegister(Register.ButtonStatus)) { - EventAvailable = false, + IsEventAvailable = false, HasBeenClicked = false, IsPressed = false }; diff --git a/src/devices/QwiicButton/QwiicButton.InterruptConfiguration.cs b/src/devices/QwiicButton/QwiicButton.InterruptConfiguration.cs index 529a18430e..84610af0d7 100644 --- a/src/devices/QwiicButton/QwiicButton.InterruptConfiguration.cs +++ b/src/devices/QwiicButton/QwiicButton.InterruptConfiguration.cs @@ -84,7 +84,7 @@ public void ResetInterruptConfig() var status = new StatusRegisterBitField { - EventAvailable = false + IsEventAvailable = false }; _registerAccess.WriteRegister(Register.ButtonStatus, status.StatusRegisterValue); } diff --git a/src/devices/QwiicButton/RegisterMapping/StatusRegisterBitField.cs b/src/devices/QwiicButton/RegisterMapping/StatusRegisterBitField.cs index 9f7fbb9f9c..33cc6902e0 100644 --- a/src/devices/QwiicButton/RegisterMapping/StatusRegisterBitField.cs +++ b/src/devices/QwiicButton/RegisterMapping/StatusRegisterBitField.cs @@ -11,7 +11,7 @@ internal struct StatusRegisterBitField [Flags] private enum StatusRegisterBits { - EventAvailable = 1, + IsEventAvailable = 1, HasBeenClicked = 2, IsPressed = 4, } @@ -29,14 +29,14 @@ public StatusRegisterBitField(byte statusRegisterValue) /// Gets set to true when a new event occurs. /// Must be manually set to false to clear the flag. /// - public bool EventAvailable + public bool IsEventAvailable { - get { return FlagsHelper.IsSet(_statusRegisterValue, StatusRegisterBits.EventAvailable); } - set { FlagsHelper.SetValue(ref _statusRegisterValue, StatusRegisterBits.EventAvailable, value); } + get { return FlagsHelper.IsSet(_statusRegisterValue, StatusRegisterBits.IsEventAvailable); } + set { FlagsHelper.SetValue(ref _statusRegisterValue, StatusRegisterBits.IsEventAvailable, value); } } /// - /// Gets set to true if button is pushed. + /// Gets set to true if button is pressed, i.e. pushed in. /// public bool IsPressed { @@ -45,7 +45,7 @@ public bool IsPressed } /// - /// Gets set to true when the button gets clicked. + /// Gets set to true when the button gets clicked, i.e. pressed and released. /// Must be manually set to false to clear the flag. /// public bool HasBeenClicked