Skip to content

Conversation

@gerph
Copy link
Contributor

@gerph gerph commented Aug 28, 2022

The different model has quite a different protocol which meant that
the original code didn't work. But the principle seems the same.
The main differences are...

  • Command packets are 10 bytes long, framed by the command byte at
    either end.
  • Command bytes are 0xCA-0xCE.
  • A 'HELLO' command elicits a response from the device of 'HELLO'
    followed by 0x0A, 0x12, 0x00. Useful to identify the device format.
  • An 'orientation' packet allows the orientation of the next bitmap
    block to be selected from landscape and portrait (column major or
    row major).
  • The graphics data is still 565, BUT... high 3 bits of green are
    in b0-b2, low 3 bits of green are in b13-15, red is in b3-7,
    blue is in b8-12.
  • A 'lighting' packet lets you select the colours of the backlight
    LEDs with 8bit RGB values.
  • Amusingly the 'lighting' isn't supported by the software that the
    seller included in their listing - although they mention it,
    there's no way to set the colours in their software.
  • There is no Clear, Screen off, or Screen on packet (as far as
    I can tell).

The device has a serial number of '2017-2-25' - so whilst this appears
to be newer, the year implies that it was created longer ago?

These changes are just to make things work, with my own comments and
debug to show what I found.

The different model has quite a different protocol which meant that
the original code didn't work. But the principle seems the same.
The main differences are...

* Command packets are 10 bytes long, framed by the command byte at
  either end.
* Command bytes are 0xCA-0xCE.
* A 'HELLO' command elicits a response from the device of 'HELLO'
  followed by 0x0A, 0x12, 0x00. Useful to identify the device format.
* An 'orientation' packet allows the orientation of the next bitmap
  block to be selected from landscape and portrait (column major or
  row major).
* The graphics data is still 565, BUT... high 3 bits of green are
  in b0-b2, low 3 bits of green are in b13-15, red is in b3-7,
  blue is in b8-12.
* A 'lighting' packet lets you select the colours of the backlight
  LEDs with 8bit RGB values.
* Amusingly the 'lighting' isn't supported by the software that the
  seller included in their listing - although they mention it,
  there's no way to set the colours in their software.
* There is no Clear, Screen off, or Screen on packet (as far as
  I can tell).

The device has a serial number of '2017-2-25' - so whilst this appears
to be newer, the year implies that it was created longer ago?

These changes are just to make things work, with my own comments and
debug to show what I found.
@mathoudebine mathoudebine changed the base branch from main to feature/24-different-smart-screen-implementation-in-newer-models August 28, 2022 16:43
@mathoudebine
Copy link
Owner

Thanks for this PR! I'm merging it on a branch, to rework the original code before merging everything to main branch.
I will keep the original protocol and add an option to select version A or B/flagship at runtime

@mathoudebine mathoudebine added the enhancement New feature or request label Aug 28, 2022
@mathoudebine mathoudebine self-assigned this Aug 28, 2022
@mathoudebine mathoudebine merged commit e9b24dc into mathoudebine:feature/24-different-smart-screen-implementation-in-newer-models Aug 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants