-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d66c51
commit 98a5616
Showing
24 changed files
with
680 additions
and
1,539 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
using System; | ||
using static Meadow.Hardware.DisplayConnector; | ||
|
||
namespace Meadow.Hardware; | ||
|
||
/// <summary> | ||
/// Represents the display connector on Juego | ||
/// </summary> | ||
public class DisplayConnector : Connector<DisplayConnectorPinDefinitions> | ||
{ | ||
/// <summary> | ||
/// The set of Display connector connector pins | ||
/// </summary> | ||
public static class PinNames | ||
{ | ||
/// <summary> | ||
/// Chip Select pin | ||
/// </summary> | ||
public const string CS = "CS"; | ||
/// <summary> | ||
/// Reset pin | ||
/// </summary> | ||
public const string RST = "RST"; | ||
/// <summary> | ||
/// Data/Command pin | ||
/// </summary> | ||
public const string DC = "DC"; | ||
/// <summary> | ||
/// SPI Clock pin | ||
/// </summary> | ||
public const string CLK = "CLK"; | ||
/// <summary> | ||
/// SPI controller ouy, peripheral in pin | ||
/// </summary> | ||
public const string COPI = "COPI"; | ||
} | ||
|
||
/// <summary> | ||
/// Represents the pins definitions for the Display connector on Juego | ||
/// </summary> | ||
public class DisplayConnectorPinDefinitions : PinDefinitionBase | ||
{ | ||
private readonly IPin? _cs; | ||
private readonly IPin? _rst; | ||
private readonly IPin? _dc; | ||
private readonly IPin? _clk; | ||
private readonly IPin? _copi; | ||
|
||
/// <summary> | ||
/// Chip Select pin | ||
/// </summary> | ||
public IPin CS => _cs ?? throw new PlatformNotSupportedException("Pin not connected"); | ||
/// <summary> | ||
/// Reset pin | ||
/// </summary> | ||
public IPin RST => _rst ?? throw new PlatformNotSupportedException("Pin not connected"); | ||
/// <summary> | ||
/// Data/Command pin | ||
/// </summary> | ||
public IPin DC => _dc ?? throw new PlatformNotSupportedException("Pin not connected"); | ||
/// <summary> | ||
/// SPI Clock pin | ||
/// </summary> | ||
public IPin CLK => _clk ?? throw new PlatformNotSupportedException("Pin not connected"); | ||
/// <summary> | ||
/// SPI controller in, peripheral out pin | ||
/// </summary> | ||
public IPin COPI => _copi ?? throw new PlatformNotSupportedException("Pin not connected"); | ||
|
||
internal DisplayConnectorPinDefinitions(PinMapping mapping) | ||
{ | ||
foreach (var m in mapping) | ||
{ | ||
switch (m.PinName) | ||
{ | ||
case PinNames.CS: | ||
_cs = m.ConnectsTo; | ||
break; | ||
case PinNames.RST: | ||
_rst = m.ConnectsTo; | ||
break; | ||
case PinNames.DC: | ||
_dc = m.ConnectsTo; | ||
break; | ||
case PinNames.CLK: | ||
_clk = m.ConnectsTo; | ||
break; | ||
case PinNames.COPI: | ||
_copi = m.ConnectsTo; | ||
break; | ||
} | ||
} | ||
} | ||
} | ||
|
||
/// <param name="name">The connector name</param> | ||
/// <param name="mapping">The mappings to the host controller</param> | ||
public DisplayConnector(string name, PinMapping mapping) | ||
: base(name, new DisplayConnectorPinDefinitions(mapping)) | ||
{ | ||
} | ||
} |
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 |
---|---|---|
@@ -1,30 +1,93 @@ | ||
using Meadow.Foundation.Audio; | ||
using Meadow.Foundation.Graphics; | ||
using Meadow.Foundation.Leds; | ||
using Meadow.Foundation.Sensors.Accelerometers; | ||
using Meadow.Foundation.Sensors.Buttons; | ||
using Meadow.Hardware; | ||
|
||
namespace WildernessLabs.Hardware.Juego | ||
{ | ||
/// <summary> | ||
/// Represents the hardware interface for the Juego device | ||
/// </summary> | ||
public interface IJuegoHardware | ||
{ | ||
/// <summary> | ||
/// Gets the graphics display interface | ||
/// </summary> | ||
public IGraphicsDisplay? Display { get; } | ||
|
||
/// <summary> | ||
/// Gets the right/up button | ||
/// </summary> | ||
public PushButton? Right_UpButton { get; } | ||
/// <summary> | ||
/// Gets the right/down button | ||
/// </summary> | ||
public PushButton? Right_DownButton { get; } | ||
/// <summary> | ||
/// Gets the right/left button | ||
/// </summary> | ||
public PushButton? Right_LeftButton { get; } | ||
/// <summary> | ||
/// Gets the right/right button | ||
/// </summary> | ||
public PushButton? Right_RightButton { get; } | ||
|
||
/// <summary> | ||
/// Gets the left/up button | ||
/// </summary> | ||
public PushButton? Left_UpButton { get; } | ||
/// <summary> | ||
/// Gets the left/down button | ||
/// </summary> | ||
public PushButton? Left_DownButton { get; } | ||
/// <summary> | ||
/// Gets the left/left button | ||
/// </summary> | ||
public PushButton? Left_LeftButton { get; } | ||
/// <summary> | ||
/// Gets the left/right button | ||
/// </summary> | ||
public PushButton? Left_RightButton { get; } | ||
|
||
/// <summary> | ||
/// Gets the start button | ||
/// </summary> | ||
public PushButton? StartButton { get; } | ||
/// <summary> | ||
/// Gets the select button | ||
/// </summary> | ||
public PushButton? SelectButton { get; } | ||
|
||
// Speakers | ||
/// <summary> | ||
/// Gets the left speaker | ||
/// </summary> | ||
public PiezoSpeaker? LeftSpeaker { get; } | ||
/// <summary> | ||
/// Gets the right speaker | ||
/// </summary> | ||
public PiezoSpeaker? RightSpeaker { get; } | ||
|
||
/// <summary> | ||
/// Gets the PWM LED | ||
/// </summary> | ||
public PwmLed? BlinkyLed { get; } | ||
|
||
/// <summary> | ||
/// Gets the motion sensor | ||
/// </summary> | ||
public Bmi270? MotionSensor { get; } | ||
|
||
/// <summary> | ||
/// Gets the display header connector | ||
/// </summary> | ||
public DisplayConnector DisplayHeader { get; } | ||
|
||
/// <summary> | ||
/// Gets the Stemma QT I2C Qwiic connector | ||
/// </summary> | ||
public I2cConnector? Qwiic { get; } | ||
} | ||
} |
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
Oops, something went wrong.