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:
authorDaniel Garcia <danielgarcia@gmail.com>2019-08-26 02:58:19 +0300
committerGitHub <noreply@github.com>2019-08-26 02:58:19 +0300
commit8ac3dd7f00e933a376530ecf86d360d167e1b82a (patch)
tree3a7189b462579d54fd3afe5f0a14bef73803b84b /PORTING.md
parent3c5484c336230f8346f2fd6ed8fb5a18ce835edc (diff)
Defpin cleanup (#866)
* Bring fastpin_avr in line with standard defpin macros (to simplify porting document notes * checkpoint - bring all the arm and esp platforms in line w/defpin macro naming/ordering * checkpoint - update PORTING.md to include information around just adding pin definitions if needed * Kick all the pin definitions to allow for some runtime querying of ports and tweak pintest to have it provide pin definitions for platforms that have port definitions but might be missing pin specifics (e.g. not yet-supported avr platforms
Diffstat (limited to 'PORTING.md')
-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)