Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MCP23008 port state hack and correctly set SPI bus speed #100

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Meadow.ProjectLab/ProjectLabHardwareV1.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ internal ProjectLabHardwareV1(IF7FeatherMeadowDevice device, II2cBus i2cBus) : b
colorMode: ColorMode.Format16bppRgb565)
{
SpiBusMode = SpiClockConfiguration.Mode.Mode3,
SpiBusSpeed = new Frequency(48000, Frequency.UnitType.Kilohertz)
SpiBusSpeed = new Frequency(24000, Frequency.UnitType.Kilohertz)
};
((St7789)_display).SetRotation(RotationType._270Degrees);

Expand Down
2 changes: 1 addition & 1 deletion Source/Meadow.ProjectLab/ProjectLabHardwareV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ internal ProjectLabHardwareV2(IF7FeatherMeadowDevice device, II2cBus i2cBus, Mcp
colorMode: ColorMode.Format16bppRgb565)
{
SpiBusMode = SpiClockConfiguration.Mode.Mode3,
SpiBusSpeed = new Frequency(48000, Frequency.UnitType.Kilohertz)
SpiBusSpeed = new Frequency(24000, Frequency.UnitType.Kilohertz)
};
((St7789)_display).SetRotation(RotationType._270Degrees);

Expand Down
1 change: 0 additions & 1 deletion Source/Meadow.ProjectLab/ProjectLabHardwareV3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ internal ProjectLabHardwareV3(IF7CoreComputeMeadowDevice device, II2cBus i2cBus)
protected override IPixelDisplay? GetDefaultDisplay()
{
DisplayEnablePort ??= Mcp_1?.CreateDigitalOutputPort(Mcp_1.Pins.GP4, false);
DisplayEnablePort!.State = false;

if (_display == null)
{
Expand Down
2 changes: 0 additions & 2 deletions Source/Meadow.ProjectLab/ProjectLabHardwareV4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ internal ProjectLabHardwareV4(IF7CoreComputeMeadowDevice device, II2cBus i2cBus)
protected override IPixelDisplay? GetDefaultDisplay()
{
DisplayEnablePort ??= Mcp_1?.CreateDigitalOutputPort(Mcp_1.Pins.GP4, false);
DisplayEnablePort.State = false;
DisplayLedPort ??= Mcp_1?.CreateDigitalOutputPort(DisplayHeader.Pins.DISPLAY_LED, true);
DisplayLedPort.State = true; //Mcp23008 isn't setting state correctly on create

if (_display == null)
{
Expand Down
Loading