

/*
 * Definitions for Fadecandy, based on the number of supported LEDs
 */

#pragma once
//#include <MatrixShimHardware_KitV1.h>
#include <MatrixHardware_KitV1_16x32.h>

#define LEDS_PER_STRIP          MATRIX_WIDTH
#define LEDS_TOTAL              (LEDS_PER_STRIP * MATRIX_HEIGHT)
#define CHANNELS_TOTAL          (LEDS_TOTAL * 3)

#define LUT_CH_SIZE             257
#define LUT_TOTAL_SIZE          (LUT_CH_SIZE * 3)

// USB packet layout
#define PIXELS_PER_PACKET       21
#define LUTENTRIES_PER_PACKET   31
//#define PACKETS_PER_FRAME       49
#define PACKETS_PER_FRAME       ((LEDS_TOTAL / PIXELS_PER_PACKET) +1) // +1 for rounding up
#define PACKETS_PER_LUT         25

//#define NUM_USB_BUFFERS         ((3*PACKETS_PER_FRAME) + PACKETS_PER_LUT + 4)       // Three full frames, one LUT buffer, a little extra (4)
//#define NUM_USB_BUFFERS         (2 * PACKETS_PER_FRAME) // two framebuffers worth

#define NUM_USB_BUFFERS         16

#define VENDOR_ID               0x1d50    // OpenMoko
#define PRODUCT_ID              0x607a    // Assigned to Fadecandy project
#define DEVICE_VER              0x0107	  // BCD device version
#define DEVICE_VER_STRING		"1.07"


