#include <Adafruit_GFX.h>
#include <SPI.h>
#include "gfx.hpp"

// Pin definition
#define RAM_CS     47

#define TFT_CS     53
#define TFT_RESET  49
#define TFT_DC     48

#define TFT2_CS     45
#define TFT2_RESET  44
#define TFT2_DC     43

void setup() {
  // Start serial communication for debugging
  Serial.begin(9600);

  // Dakotath GFX
  GFXRenderer renderer(TFT_CS, TFT_DC, TFT_RESET);
  GFXRenderer renderer2(TFT2_CS, TFT2_DC, TFT2_RESET);

  // Draw 32 random color rectangles at random positions
  for (int i = 0; i < 32; i++) {
    // Random position on the screen (x, y)
    int x = random(0, renderer.width() - 50);  // Ensure rectangle fits within screen width
    int y = random(0, renderer.height() - 50);  // Ensure rectangle fits within screen height

    // Random size for the rectangle (width, height)
    int width = random(20, 100);  // Width between 20 and 100 pixels
    int height = random(20, 100);  // Height between 20 and 100 pixels

    // Random color (16-bit)
    uint16_t color = random(0x0000, 0xFFFF);  // Generate random color

    // Create a GFXRectangle object with the random properties
    GFXRectangle rect(x, y, width, height, color);

    // Draw the rectangle
    renderer.GFXDrawShape(rect);
  }
}

void loop() {
  // Nothing to do here as we just want to fill the screen once
}
sramBreakout