Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FastLED/FastLED.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Garcia <dangarcia@apple.com>2019-08-15 04:00:07 +0300
committerDan Garcia <dangarcia@apple.com>2019-08-15 04:00:07 +0300
commit958a83e1acd346752d6077b8289ba1ebb45bfe14 (patch)
tree6b4e933a249f18e904a39e6e7581937fa95a479a
parent289cd7f1e29cbebce40c6e076d6ad404de2478c6 (diff)
checkpoint - update PORTING.md to include information around just adding pin definitions if needed
-rw-r--r--PORTING.md26
1 files changed, 26 insertions, 0 deletions
diff --git a/PORTING.md b/PORTING.md
index 2b4ade2e..2f925ab2 100644
--- a/PORTING.md
+++ b/PORTING.md
@@ -1,5 +1,31 @@
=New platform porting guide=
+== Fast porting for a new board on existing hardware ==
+
+Sometimes "porting" FastLED simply consists of supplying new pin definitions for the given platform. For example, platforms/avr/fastpin_avr.h contains various pin definitions for all the AVR variant chipsets/boards that FastLED supports. Defining a set of pins involves setting up a set of definitions - for example here's one full set from the avr fastpin file:
+
+```
+#elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644P__)
+
+_FL_IO(A); _FL_IO(B); _FL_IO(C); _FL_IO(D);
+
+#define MAX_PIN 31
+_FL_DEFPIN(0, 0, B); _FL_DEFPIN(1, 1, B); _FL_DEFPIN(2, 2, B); _FL_DEFPIN(3, 3, B);
+_FL_DEFPIN(4, 4, B); _FL_DEFPIN(5, 5, B); _FL_DEFPIN(6, 6, B); _FL_DEFPIN(7, 7, B);
+_FL_DEFPIN(8, 0, D); _FL_DEFPIN(9, 1, D); _FL_DEFPIN(10, 2, D); _FL_DEFPIN(11, 3, D);
+_FL_DEFPIN(12, 4, D); _FL_DEFPIN(13, 5, D); _FL_DEFPIN(14, 6, D); _FL_DEFPIN(15, 7, D);
+_FL_DEFPIN(16, 0, C); _FL_DEFPIN(17, 1, C); _FL_DEFPIN(18, 2, C); _FL_DEFPIN(19, 3, C);
+_FL_DEFPIN(20, 4, C); _FL_DEFPIN(21, 5, C); _FL_DEFPIN(22, 6, C); _FL_DEFPIN(23, 7, C);
+_FL_DEFPIN(24, 0, A); _FL_DEFPIN(25, 1, A); _FL_DEFPIN(26, 2, A); _FL_DEFPIN(27, 3, A);
+_FL_DEFPIN(28, 4, A); _FL_DEFPIN(29, 5, A); _FL_DEFPIN(30, 6, A); _FL_DEFPIN(31, 7, A);
+
+#define HAS_HARDWARE_PIN_SUPPORT 1
+```
+
+The ```_FL_IO``` macro is used to define the port registers for the platform while the ```_FL_DEFPIN``` macro is used to define pins. The parameters to the macro are the pin number, the bit on the port that represents that pin, and the port identifier itself. On some platforms, like the AVR, ports are identified by letter. On other platforms, like arm, ports are identified by number.
+
+The ```HAS_HARDWARE_PIN_SUPPORT``` define tells the rest of the FastLED library that there is hardware pin support available. There may be other platform specific defines for things like hardware SPI ports and such.
+
== Setting up the basic files/folders ==
* Create platform directory (e.g. platforms/arm/kl26)