Hi David, I was excited to see you’ve written a TinyDRM driver for the 1.8" Adafruit TFT. Have you tried it out with a BeagleBone?
I’d like to use with the BeagleBone Black and am thinking about how go about it. I imagine I would need to create a device tree overlay to initialize your driver with the appropriate settings?
I have P9.12 connected to LCD reset pin. I have P9.15 connected to
LCD dc pin. For fbtft driver, this translated to GPIO_60 for reset
and GPIO_48 for dc. This is based on this pinout diagram: https://elinux.org/File:Cape_expansion_headers.PNG
For this dts file, I was trying to figure out what appropriate gpio
phandle. I looked at this table for the P9 header: https://elinux.org/File:H9Pinout.PNG
I believe that gpio1[16] corresponds to P9.15 which is LCD dc pin, and
gpio1[28] corresponds to P9.12 which is LCD reset pin.
My understanding of those mappings may be incorrect, so I'd appreciate
any additional feedback.
You understand correct, but I think you have swapped the values in your device tree overlay. You say "gpio1[16] corresponds to P9.15 which is LCD dc pin", but in the overlay, you have dc-gpios = <&gpio1 28 0>;. Likewise "gpio1[28] corresponds to P9.12 which is LCD reset pin.", but you have reset-gpios = <&gpio1 16 0>;.
Thanks! I had DC and Reset swapped in the overlay file. I’ve fixed and the display is now working! The console is displayed after bootup and libdrm modetest is able to display color bars OK.
Drew, David:
I’ve adapted the tinyDRM dtc to work with the Adafruit 2.4" TFT LCD display. It’s working fine with SPI 1. Currently it uses P9_14 for the backlight.
How do I switch it to use P9_16 for the backlight?
I’ve tried changing all the P9_14’s to P9_16s, but that doesn’t work. P9_14 is the A side of the pwm
and P9_16 is the B side, so I think there’s a bit I need to flip, but don’t know what it is.
–Mark
p.s. The exercise for my students will be to switch it to SPI 0!
From the (not so clear) device tree binding docs. The ehrpwm docs say the last number is flags and only PWM_POLARITY_INVERTED is supported. The generic PWM bindings doc says "pwm-specifier typically encodes the chip-relative PWM number and the PWM
period in nanoseconds." So since the EHRPWMs have an A and B channel, the first number can be 0 or 1. The second number is the default period for the PWM.