ADDED: Support for Teensy 3.1/3.2
Added Support for Teensy 3.1. By default:
- data is on PORTD (which is mapped to pins 0 - 7)
- other pins are specified in RGBMatrixPanel.h by define for use full performance of digitalWriteFast.
The rest should work like before. But i can not test it. Teensy stuff was added inside defines CORE_TEENSY
Thanks for your contribution, it is a good starting point for my experiments. In my setup, there is a 32x64 rgb matrix panel connected to a Teensy 3.5. There are a few minor issues with the changes:
- The function
swap(x,y)is not definied. - The Teensy 3.5 running at 120 MHz needs additional cycles to wait for the matrix
- The PIN 21 (line C) and PIN 20 (line D) are connected to PORTD on a Teensy 3.5, too. When using a 64x32 matrix, the D line is neccessary. This mixes up with the RGB lines in my case.
- An actual listing which matrix pin goes to which Teensy pin would be very helpful. At least, are the RGB-lines connected to D0 to DD5 or D2 to D7?
Please have a look at 518b9fff52e748fb9cb7f01ffb664c517a2e88ac for my changes.
Do you think this cleanly extends to 64x64? I've tried this on a Teensy 3.2 with a 64x64 panel I received (which has an extra pin, E), and created a new instantiation - passing in false, 64, 64:
RGBmatrixPanel::RGBmatrixPanel(boolean dbuf, uint8_t width, uint8_t height) :
Adafruit_GFX(width, height) {
init(height/2, dbuf, width);
}
but not getting great results. I can get the full panel to have colors, but never what I expect. I've added the e pin everywhere the d pin is but I wonder if maybe I need to do something specific with the PORTD mapping, or perhaps the e pin needs to be on a specific port...still investigating.