Namespaces | Functions | Variables
util.cpp File Reference
#include <algorithm>
#include <libusb-1.0/libusb.h>
#include <list>
#include <math.h>
#include <stdexcept>
#include "./util.h"
Include dependency graph for util.cpp:

Go to the source code of this file.

Namespaces

 fadecandy_driver
 

Functions

std::vector< unsigned char > fadecandy_driver::intToCharArray (int in, const size_t bytes_per_int)
 
std::vector< int > fadecandy_driver::makeDefaultLookupTable ()
 makeLookupTablePackets Return lookup tables as 3 lists of lookup values - one for the red channel, one for the green channel, and one for the blue channel. More...
 
std::vector< std::vector< unsigned char > > fadecandy_driver::makeLookupTablePackets (const std::vector< int > &red_lookup_values, const std::vector< int > &green_lookup_values, const std::vector< int > &blue_lookup_values)
 makeLookupTablePackets Create USB packets for a simple color lookup table. The entire red lookup table comes first, then the entire green channel, then the entire red channel. More...
 
std::vector< std::vector< unsigned char > > fadecandy_driver::makeVideoUsbPackets (const std::vector< std::vector< Color >> &led_array_colors)
 makeVideoUsbPackets Construct the USB packets to set all LED strips to the given colors. To simplify things, we always send values for all 8 * 64 LEDs. If the physical strips are shorter, or there are less then 8 strips, the extra data doesn't do anything. If the user gives us values for less than the total number of strips, or less than the total number of LEDs in any given strip, all unspecified LEDs are left dark. More...
 

Variables

constexpr int fadecandy_driver::FINAL_PACKET_BIT = 0x20
 
constexpr int fadecandy_driver::LEDS_PER_PACKET = 21
 
constexpr int fadecandy_driver::LEDS_PER_STRIP = 64
 
constexpr int fadecandy_driver::LOOKUP_VALUES_PER_CHANNEL = 257
 
constexpr int fadecandy_driver::LOOKUP_VALUES_PER_PACKET = 31
 
constexpr int fadecandy_driver::NUM_STRIPS = 8
 
constexpr int fadecandy_driver::PACKET_TYPE_LUT = 0x40
 
constexpr int fadecandy_driver::PACKET_TYPE_VIDEO = 0x00
 


fadecandy_driver
Author(s):
autogenerated on Mon Feb 28 2022 22:18:46