Code was obtained from: https://drive.google.com/drive/folders/0B_jncvz2HAYCblR3Zkt4LVh5REE?pageId=102377604871671942921&tid=0B_jncvz2HAYCfkVDd2taYlFrdnR1N0M2WUg5NC1sSS15ckJ6enJnXzk4YnNzZkw4ZHR0NTQ
Diffs to make work with HiFive board:
diff -Naur …/…/esp8266/projects/TFT22_raytrace/TFT22_raytrace.ino TFT22_raytrace/TFT22_raytrace.ino
— …/…/esp8266/projects/TFT22_raytrace/TFT22_raytrace.ino 2016-04-03 08:57:26.000000000 -0700
+++ TFT22_raytrace/TFT22_raytrace.ino 2017-02-19 11:14:13.460868690 -0800
@@ -7,6 +7,9 @@
Source code for my YouTube videos:
not_https://www.youtube.com/watch?v=RD5VO8o9bD4
https://www.youtube.com/watch?v=H9uUO-UQtzE
+
+Added SiFive HiFive Freedom 300 board 19-Feb-2017 RS
+
*/
/*
@@ -55,6 +58,21 @@
CS D1 (GPIO5)
GND GND
VCC +3.3V
+
+SiFive:
+Board: HiFive Freedom 300, 16, 256, or 320MHz
+
+TFT2.2 ILI9341 from top left:
- MISO 12 (SPI1:SD1/MISO)
- LED +3.3V
- SCK 13 (SPI1:SCK)
- MOSI 11 (SPI1:SD0/MOSI)
- DC 6
- RST 4
- CS 5
- GND GND
- VCC +3.3V
-
*/
/*
@@ -70,6 +88,10 @@
ESP8266@160 320x240x1 1S 33s nodraw 30s (37s using slow lib)
ESP8266@80 320x240x1 8S ??? reboot
ESP8266@160 320x240x1 8S 246s
+
+SiFive@16 320x240x1 1S n/a nodraw 1125s
+SiFive@256 320x240x1 1S 73s nodraw 62s
+SiFive@320 320x240x1 1S 68s nodraw 46s
*/
#include “SPI.h”
@@ -98,20 +120,29 @@
//#endif
// ESP8266
-#ifdef ESP8266
-#include “Adafruit_GFX.h”
-#include “Adafruit_ILI9341.h”
-#define TFT_DC 2
-#define TFT_CS 5
-Adafruit_ILI9341 display = Adafruit_ILI9341(TFT_CS, TFT_DC);
-#endif
+//#ifdef ESP8266
+//#include “Adafruit_GFX.h”
+//#include “Adafruit_ILI9341.h”
+//#define TFT_DC 2
+//#define TFT_CS 5
+//Adafruit_ILI9341 display = Adafruit_ILI9341(TFT_CS, TFT_DC);
+//#endif
+
+// SiFive HiFive 1
+#include <Adafruit_GFX.h>
+#include <Adafruit_ILI9341.h>
+#define TFT_CS 5
+#define TFT_DC 6
+#define TFT_RST 4
+Adafruit_ILI9341 display = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
+
#define RGBTO565(_r, _g, _b) ((((_r) & B11111000)<<8) | (((_g) & B11111100)<<3) | ((_b) >>3))
#include “raytracer.h”
void setup() {
-// Serial.begin(115200);
-
Serial.begin(115200);
+// Serial.begin(9600);
Serial.println(“ILI9341 raytracing”);
display.begin();
@@ -150,4 +181,4 @@
void loop(void) {
}
Will need to modify Adafruit’s library as outlined above.