-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: José Simões <jose.simoes@eclo.solutions>
- Loading branch information
1 parent
cf73b3a
commit 8b6b285
Showing
11 changed files
with
387 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
System.IO.FileSystem/nanoFramework/CardDetectChangedEventArgs.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// | ||
// Copyright (c) .NET Foundation and Contributors | ||
// See LICENSE file in the project root for full license information. | ||
// | ||
|
||
using System; | ||
|
||
namespace nanoFramework.System.IO | ||
{ | ||
/// <summary> | ||
/// State of card detect | ||
/// </summary> | ||
public enum CardDetectState | ||
{ | ||
/// <summary> | ||
/// Card Inserted | ||
/// </summary> | ||
Inserted, | ||
|
||
/// <summary> | ||
/// Card removed | ||
/// </summary> | ||
Removed | ||
}; | ||
|
||
/// <summary> | ||
/// Arguments for Card detect event | ||
/// </summary> | ||
public class CardDetectChangedEventArgs : EventArgs | ||
{ | ||
readonly private CardDetectState _cardState; | ||
readonly private uint _slotIndex; | ||
|
||
internal CardDetectChangedEventArgs(CardDetectState state, uint SlotIndex) | ||
{ | ||
_cardState = state; | ||
_slotIndex = SlotIndex; | ||
} | ||
|
||
/// <summary> | ||
/// State of Card Detect. | ||
/// </summary> | ||
public CardDetectState CardState => _cardState; | ||
|
||
/// <summary> | ||
/// SD card slot index | ||
/// </summary> | ||
public uint SlotIndex => _slotIndex; | ||
} | ||
} |
41 changes: 41 additions & 0 deletions
41
System.IO.FileSystem/nanoFramework/CardDetectParameters.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// | ||
// Copyright (c) .NET Foundation and Contributors | ||
// See LICENSE file in the project root for full license information. | ||
// | ||
|
||
namespace nanoFramework.System.IO.FileSystem | ||
{ | ||
/// <summary> | ||
/// Parameter used for Card detection when creating a SDcard instance. | ||
/// </summary> | ||
public class CardDetectParameters | ||
{ | ||
/// <summary> | ||
/// Set true when an Card Detect Pin is used. | ||
/// The cardDetectPin parameter must have a valid GPIO pin. | ||
/// </summary> | ||
/// <remarks> | ||
/// Not all SD Card modules have a card detect pin or the pin connected to a GPIO pin. | ||
/// </remarks> | ||
public bool enableCardDetectPin; | ||
|
||
/// <summary> | ||
/// The state of the pin when the card is detected. | ||
/// Defaults to false(low) if not specified. | ||
/// If using card detect logic then this depends on connected hardware. | ||
/// </summary> | ||
public bool cardDetectedState; | ||
|
||
/// <summary> | ||
/// The optional card detect GPIO pin which must be set to a valid pin if EnableCardDetectPin is true. | ||
/// If defined a StorageEventManager event will be raised when a card is inserted or removed. | ||
/// </summary> | ||
public uint cardDetectPin; | ||
|
||
/// <summary> | ||
/// When enabled will try to automatically mount the SD card when the card is inserted. | ||
/// If the card is removed unexpectedly it will try to unmount card to release resources. | ||
/// </summary> | ||
public bool autoMount; | ||
} | ||
} |
Oops, something went wrong.