Skip to content

Commit

Permalink
Release 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianstevens committed Nov 29, 2023
1 parent 8d66c51 commit 98a5616
Show file tree
Hide file tree
Showing 24 changed files with 680 additions and 1,539 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added Hardware/Schematic_v1.pdf
Binary file not shown.
File renamed without changes.
Binary file added Hardware/Schematic_v2.c.pdf
Binary file not shown.
Binary file added Hardware/Schematic_v3.b.pdf
Binary file not shown.
Binary file removed Hardware/v2.d/BoM_v2.d.csv
Binary file not shown.
695 changes: 0 additions & 695 deletions Hardware/v2.d/EasyEDA_Source_v2.d.json

This file was deleted.

Binary file removed Hardware/v2.d/Schematic_v2.d.pdf
Binary file not shown.
Binary file removed Hardware/v2.e/BoM_v2.e.csv
Binary file not shown.
725 changes: 0 additions & 725 deletions Hardware/v2.e/EasyEDA_Source_v2.e.json

This file was deleted.

Binary file removed Hardware/v2.e/Schematic_v2.e.pdf
Binary file not shown.
32 changes: 0 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,35 +180,3 @@ Includes five games:
</tr>
</table>

## Release Notes

### v2.e

* Added STEMMA QT I2C connector for additional peripheral integrations.
* Added I2C Accelerator to drive external I2C Peripherals.

### v2.d

* Fixed `VBAT` on mcu so it wasn't getting overvoltaged. Was `3.3V`, should be `1.8V` or disconnected.

### v2.c

* Changed form-factor to be much smaller.
* Added optional debug header footprint.

### v2.b

* Added LED for debugging.
* Added I2C pull-ups.

### v2.a

* Converted to Meadow CCM Design.
* Added a much larger screen.
* Added an MCP23008 for button IO.
* Added a solar power/charging circuit.
* Upgraded the batter mount to an off-the-shelf holder.

### v1

* Inital design.
102 changes: 102 additions & 0 deletions Source/Juego/DisplayConnector.cs
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))
{
}
}
63 changes: 63 additions & 0 deletions Source/Juego/IJuegoHardware.cs
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; }
}
}
55 changes: 50 additions & 5 deletions Source/Juego/Juego.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
using Meadow;
using Meadow.Foundation.Audio;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Logging;
using System;

namespace WildernessLabs.Hardware.Juego
{
/// <summary>
/// Juego hardware factory class for Juego v1, v2, and v3 hardware
/// </summary>
public class Juego
{
private Juego() { }

/// <summary>
/// Create an instance of the Juego class
/// Create an instance of the Juego class for the current hardware
/// </summary>
public static IJuegoHardware Create()
public static IJuegoHardware? Create()
{
IJuegoHardware hardware;
IJuegoHardware? hardware;
Logger? logger = Resolver.Log;

logger?.Debug("Initializing Juego...");
Expand All @@ -35,8 +40,48 @@ public static IJuegoHardware Create()
}
else if (device is IF7CoreComputeMeadowDevice { } ccm)
{
logger?.Info("Instantiating Juego v2 hardware");
hardware = new JuegoHardwareV2(ccm);
try
{
// hack for PWM init bug .... move back into the hardware classes once it's fixed
var leftSpeaker = new PiezoSpeaker(ccm.Pins.PB8);
var rightSpeaker = new PiezoSpeaker(ccm.Pins.PB9);

var i2cBus = ccm.CreateI2cBus(busSpeed: Meadow.Hardware.I2cBusSpeed.FastPlus);
logger?.Info("I2C Bus instantiated");

var mcpVersion = new Mcp23008(i2cBus, address: 0x23);

logger?.Trace("McpVersion up");
var version = mcpVersion.ReadFromPorts();

logger?.Info($"Hardware version is {version}");

if (version >= JuegoHardwareV3.MinimumHardareVersion)
{
logger?.Info("Instantiating Juego v3 hardware");
hardware = new JuegoHardwareV3(ccm, i2cBus)
{
Mcp_VersionInfo = mcpVersion,
LeftSpeaker = leftSpeaker,
RightSpeaker = rightSpeaker,
};
}
else
{
logger?.Info("Instantiating Juego v2 hardware");
hardware = new JuegoHardwareV2(ccm, i2cBus)
{
Mcp_VersionInfo = mcpVersion,
LeftSpeaker = leftSpeaker,
RightSpeaker = rightSpeaker,
};
}
}
catch (Exception e)
{
logger?.Debug($"Failed to create McpVersion: {e.Message}");
hardware = null;
}
}
else
{
Expand Down
10 changes: 6 additions & 4 deletions Source/Juego/Juego.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Meadow.Sdk/1.1.0">
<Project Sdk="Meadow.Sdk/1.1.0">
<PropertyGroup>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<PackageIcon>icon.png</PackageIcon>
Expand All @@ -24,8 +24,10 @@
<None Include="icon.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Meadow.F7" Version="*" />
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="*" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Mcp23xxx" Version="*" />
<PackageReference Include="Meadow.F7" Version="1.5.0" />
<PackageReference Include="Meadow.Foundation.Audio.MicroAudio" Version="1.5.0" />
<PackageReference Include="Meadow.Foundation.Displays.TftSpi" Version="1.5.0" />
<PackageReference Include="Meadow.Foundation.ICs.IOExpanders.Mcp23xxx" Version="1.5.0" />
<PackageReference Include="Meadow.Foundation.Sensors.Motion.Bmi270" Version="1.5.0" />
</ItemGroup>
</Project>
Loading

0 comments on commit 98a5616

Please sign in to comment.