-
-
Notifications
You must be signed in to change notification settings - Fork 122
Add LcmEn2r13 driver for Heltec Vision Master E213 and improve rotated Graphics rendering #1504
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
Open
garydyksman
wants to merge
9
commits into
nanoframework:main
Choose a base branch
from
garydyksman:add-LcmEn2r13
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
59ca1e1
Add LCMEN2R13 2.13" e-paper driver and sample
garydyksman 91d3f4d
Add Partial update functionality
garydyksman 5cb491e
- move LcmEn2r13 to its own driver folder and remove duplicate wrappers
garydyksman 0d29633
Address PR review feedback for LcmEn2r13
garydyksman 2486b03
Address PR review feedback for LcmEn2r13 and ePaper
garydyksman eafa106
Merge branch 'main' into add-LcmEn2r13
garydyksman a624778
Apply Copilot review feedback on sample headers and Clear()
garydyksman 27472e1
Merge branch 'add-LcmEn2r13' of https://github.com/garydyksman/nanoFr…
garydyksman 6466b03
Merge branch 'main' into add-LcmEn2r13
garydyksman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -51,16 +51,7 @@ public abstract class Jd79653A : IEPaperDisplay | |
| /// <param name="shouldDispose">True to dispose the Gpio Controller.</param> | ||
| /// <exception cref="ArgumentNullException"><paramref name="spiDevice"/> is null.</exception> | ||
| /// <exception cref="ArgumentOutOfRangeException">Display width and height can't be less than 0 or greater than 200.</exception> | ||
| protected Jd79653A( | ||
| SpiDevice spiDevice, | ||
| int resetPin, | ||
| int busyPin, | ||
| int dataCommandPin, | ||
| int width, | ||
| int height, | ||
| GpioController gpioController = null, | ||
| bool enableFramePaging = false, | ||
| bool shouldDispose = true) | ||
| protected Jd79653A(SpiDevice spiDevice, int resetPin, int busyPin, int dataCommandPin, int width, int height, GpioController gpioController = null, bool enableFramePaging = false, bool shouldDispose = true) | ||
| { | ||
| _spiDevice = spiDevice ?? throw new ArgumentNullException(nameof(spiDevice)); | ||
| _gpioController = gpioController ?? new GpioController(); | ||
|
|
@@ -75,7 +66,7 @@ protected Jd79653A( | |
| Height = height; | ||
| PagedFrameDrawEnabled = enableFramePaging; | ||
|
|
||
| _whiteBuffer = new byte[Width * Height]; | ||
| _whiteBuffer = new byte[(Width * Height) / 8]; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why this change? |
||
| for (int i = 0; i < _whiteBuffer.Length; i++) | ||
| { | ||
| _whiteBuffer[i] = 0xff; | ||
|
|
@@ -224,9 +215,6 @@ public void DirectDrawBuffer(params byte[] buffer) | |
| SendData(_whiteBuffer); | ||
| SendCommand((byte)Command.DataStartTransmission2); | ||
| SendData(buffer); | ||
| WaitMs(5); | ||
|
|
||
| PerformFullRefresh(); | ||
| } | ||
|
|
||
| /// <summary> | ||
|
|
||
This file contains hidden or 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,42 @@ | ||
| // Copyright (c) 2024 The nanoFramework project contributors | ||
| // See LICENSE file in the project root for full license information. | ||
|
|
||
| namespace Iot.Device.EPaper.Drivers.LcmEn2r13 | ||
| { | ||
| /// <summary> | ||
| /// Commands used by the LCMEN2R13 display driver. | ||
| /// </summary> | ||
| internal enum Command : byte | ||
| { | ||
| PanelSetting = 0x00, | ||
| PowerSetting = 0x01, | ||
| PowerOff = 0x02, | ||
| PowerOn = 0x04, | ||
| BoosterSoftStart = 0x06, | ||
| DeepSleep = 0x07, | ||
| WritePreviousImage = 0x10, | ||
| DisplayRefresh = 0x12, | ||
| WriteCurrentImage = 0x13, | ||
| TemperatureSensorControl = 0x18, | ||
| WriteLutVcom = 0x20, | ||
| WriteLutWhiteToWhite = 0x21, | ||
| WriteLutBlackToWhite = 0x22, | ||
| WriteLutWhiteToBlack = 0x23, | ||
| WriteLutBlackToBlack = 0x24, | ||
| PLLControl = 0x30, | ||
| BorderWaveform = 0x3C, | ||
| SetXAddressRange = 0x44, | ||
| SetYAddressRange = 0x45, | ||
| SetXAddressCounter = 0x4E, | ||
| SetYAddressCounter = 0x4F, | ||
| VcomAndDataIntervalSetting = 0x50, | ||
| TconSetting = 0x60, | ||
| ResolutionSetting = 0x61, | ||
| VcmDcSetting = 0x82, | ||
| PartialWindow = 0x90, | ||
| PartialIn = 0x91, | ||
| PartialOut = 0x92, | ||
| CascadeSetting = 0xE0, | ||
| ForceTemperature = 0xE5, | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Round up the packed buffer size.
Line 69 uses floor division, so geometries whose total pixel count is not divisible by 8 will allocate one byte too few and truncate the final partial byte during upload. Use ceiling division here instead.
Proposed fix
📝 Committable suggestion
🤖 Prompt for AI Agents