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

Raspberry fixes #42

Merged
merged 6 commits into from
Jan 6, 2017
Merged

Raspberry fixes #42

merged 6 commits into from
Jan 6, 2017

Conversation

marschap
Copy link
Contributor

@marschap marschap commented Jan 6, 2017

The attached patch series contains fixes for hd44780's ConnectionType raspberrypi.

  • it detects Rapsberry all raspberry versions correctly and in a more secure manner
    • tested with Pi B, Pi2 as well as Pi3 and one as well as two-controller displays
    • the previous implementation failed even detecting my Pi2
  • it saves code by introducing a function send_nibble() following hd44780-gpio.c
  • it remove unnecessary 0-ing of GPIO pins before outputting the real values

Everything tested with Pi B, Pi2, P3 as well as single-controller (16x2, 20x4) and multi-controller-displays (27x4)

Copied from wiringpi/wiringpi.c of git://git.drogon.net/wiringPi/:

  This is undocumented and really only intended for the GPIO command.
  Use at your own risk!

  Seems there are some boards with 0000 in them (mistake in manufacture)
  So the distinction between boards that I can see is:

        0000 - Error
        0001 - Not used

  Original Pi boards:
        0002 - Model B,  Rev 1,   256MB, Egoman
        0003 - Model B,  Rev 1.1, 256MB, Egoman, Fuses/D14 removed.

  Newer Pi's with remapped GPIO:
        0004 - Model B,  Rev 2,   256MB, Sony
        0005 - Model B,  Rev 2,   256MB, Qisda
        0006 - Model B,  Rev 2,   256MB, Egoman
        0007 - Model A,  Rev 2,   256MB, Egoman
        0008 - Model A,  Rev 2,   256MB, Sony
        0009 - Model A,  Rev 2,   256MB, Qisda
        000d - Model B,  Rev 2,   512MB, Egoman (Red Pi, Blue Pi?)
        000e - Model B,  Rev 2,   512MB, Sony
        000f - Model B,  Rev 2,   512MB, Qisda
        0010 - Model B+, Rev 1.2, 512MB, Sony
        0011 - Pi CM,    Rev 1.2, 512MB, Sony
        0012 - Model A+  Rev 1.2, 256MB, Sony
        0014 - Pi CM,    Rev 1.1, 512MB, Sony (Actual Revision might be different)
        0015 - Model A+  Rev 1.1, 256MB, Sony

  A small thorn is the olde style overvolting - that will add in
        1000000

  The Pi compute module has an revision of 0011 or 0014 - since we only
  check the last digit, then it's 1, therefore it'll default to not 2 or
  3 for a Rev 1, so will appear as a Rev 2. This is fine for the most part, but
  we'll properly detect the Compute Module later and adjust accordingly.

  And then things changed with the introduction of the v2...

  For Pi v2 and subsequent models - e.g. the Zero:

    [USER:8] [NEW:1] [MEMSIZE:3] [MANUFACTURER:4] [PROCESSOR:4] [TYPE:8] [REV:4]
    NEW          23: will be 1 for the new scheme, 0 for the old scheme
    MEMSIZE      20: 0=256M 1=512M 2=1G
    MANUFACTURER 16: 0=SONY 1=EGOMAN 2=EMBEST
    PROCESSOR    12: 0=2835 1=2836
    TYPE         04: 0=A 1=B 2=A+ 3=B+ 4=Pi2 B 5=ALPHA 6=CM, 8=Pi3 B
    REV          00: 0=REV0 1=REV1 2=REV2
- follow wiringPi's naming convention for constants: GPPUD
- simplify "if ... then .. else ..." to ternary expression
No need to explicitly clear the GPIO values before setting them to the
values wanted.
@haraldg haraldg merged commit 6faa38a into lcdproc:master Jan 6, 2017
@marschap marschap deleted the raspberry-fixes branch January 7, 2017 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants