Classes | Functions | Variables
fadecandy_driver Namespace Reference

Classes

struct  Color
 The color struct contains the r, g and b colors. More...
 
class  FadecandyDriver
 
class  FadecandyDriverROS
 

Functions

std::vector< unsigned char > intToCharArray (int in, const size_t bytes_per_int)
 
std::vector< int > 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 > > 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 > > 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 FINAL_PACKET_BIT = 0x20
 
constexpr int INTERFACE_NO = 0x00
 
constexpr int LEDS_PER_PACKET = 21
 
constexpr int LEDS_PER_STRIP = 64
 
constexpr int LOOKUP_VALUES_PER_CHANNEL = 257
 
constexpr int LOOKUP_VALUES_PER_PACKET = 31
 
constexpr int NUM_STRIPS = 8
 
constexpr int PACKET_TYPE_LUT = 0x40
 
constexpr int PACKET_TYPE_VIDEO = 0x00
 
constexpr int USB_ENDPOINT = 1
 
constexpr int USB_PACKET_SIZE = 64
 
constexpr int USB_PRODUCT_ID = 0x607a
 
constexpr int USB_VENDOR_ID = 0x1d50
 

Function Documentation

◆ intToCharArray()

std::vector<unsigned char> fadecandy_driver::intToCharArray ( int  in,
const size_t  bytes_per_int 
)

Definition at line 59 of file util.cpp.

◆ makeDefaultLookupTable()

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.

Definition at line 221 of file util.cpp.

◆ makeLookupTablePackets()

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.

Definition at line 152 of file util.cpp.

◆ makeVideoUsbPackets()

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.

Definition at line 78 of file util.cpp.

Variable Documentation

◆ FINAL_PACKET_BIT

constexpr int fadecandy_driver::FINAL_PACKET_BIT = 0x20

Definition at line 51 of file util.cpp.

◆ INTERFACE_NO

constexpr int fadecandy_driver::INTERFACE_NO = 0x00

Definition at line 45 of file fadecandy_driver.cpp.

◆ LEDS_PER_PACKET

constexpr int fadecandy_driver::LEDS_PER_PACKET = 21

Definition at line 45 of file util.cpp.

◆ LEDS_PER_STRIP

constexpr int fadecandy_driver::LEDS_PER_STRIP = 64

Definition at line 52 of file util.cpp.

◆ LOOKUP_VALUES_PER_CHANNEL

constexpr int fadecandy_driver::LOOKUP_VALUES_PER_CHANNEL = 257

Definition at line 47 of file util.cpp.

◆ LOOKUP_VALUES_PER_PACKET

constexpr int fadecandy_driver::LOOKUP_VALUES_PER_PACKET = 31

Definition at line 46 of file util.cpp.

◆ NUM_STRIPS

constexpr int fadecandy_driver::NUM_STRIPS = 8

Definition at line 53 of file util.cpp.

◆ PACKET_TYPE_LUT

constexpr int fadecandy_driver::PACKET_TYPE_LUT = 0x40

Definition at line 50 of file util.cpp.

◆ PACKET_TYPE_VIDEO

constexpr int fadecandy_driver::PACKET_TYPE_VIDEO = 0x00

Definition at line 49 of file util.cpp.

◆ USB_ENDPOINT

constexpr int fadecandy_driver::USB_ENDPOINT = 1

Definition at line 44 of file fadecandy_driver.cpp.

◆ USB_PACKET_SIZE

constexpr int fadecandy_driver::USB_PACKET_SIZE = 64

Definition at line 41 of file fadecandy_driver.cpp.

◆ USB_PRODUCT_ID

constexpr int fadecandy_driver::USB_PRODUCT_ID = 0x607a

Definition at line 42 of file fadecandy_driver.cpp.

◆ USB_VENDOR_ID

constexpr int fadecandy_driver::USB_VENDOR_ID = 0x1d50

Definition at line 43 of file fadecandy_driver.cpp.



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