libNeon
Loading...
Searching...
No Matches
neo Namespace Reference

Namespaces

namespace  literals
 
namespace  timings
 

Classes

class  any_fx
 
class  any_fx_config
 
struct  any_fx_config_data
 
struct  any_fx_config_data< fx_type::gradient >
 
struct  any_fx_config_data< fx_type::matrix >
 
struct  any_fx_config_data< fx_type::solid >
 
struct  channel_pack
 
struct  channel_pack< Channel >
 
struct  channel_storage
 
class  cref
 
class  fixed_gradient_entry
 
struct  gamma_table
 
class  gamma_table_cache
 
class  generic_timer
 
class  gradient
 
class  gradient_entry
 
class  gradient_fx
 
struct  gradient_fx_config
 
struct  hsv
 
struct  keep_t
 
class  led
 
class  matrix_fx
 
struct  matrix_fx_config
 
struct  maybe_update
 
class  ref
 
struct  rgb
 
class  rmt_manager
 
class  solid_fx
 
struct  solid_fx_config
 
class  steady_timer
 
class  strip
 
class  transmittable_rgb_strip
 

Typedefs

using blending_method = rgb(&)(rgb l, rgb r, float t)
 
using grb_led = led< led_channel::green, led_channel::red, led_channel::blue >
 
using rgb_led = led< led_channel::red, led_channel::green, led_channel::blue >
 

Enumerations

enum struct  fx_type : std::uint8_t { solid = 0 , gradient = 1 , matrix = 2 }
 
enum struct  led_channel { red , green , blue }
 
enum struct  controller { ws2811_400khz , ws2812_800khz }
 

Functions

float srgb_to_linear (std::uint8_t v)
 
std::uint8_t linear_to_srgb (float v)
 
gamma_table const & get_cached_gamma_table (float gamma)
 
rgb blend_linear (rgb l, rgb r, float t)
 
rgb blend_round_down (rgb l, rgb, float)
 
rgb blend_round_up (rgb, rgb r, float)
 
rgb blend_nearest_neighbor (rgb l, rgb r, float t)
 
const char * to_string (controller c)
 
rmt_config_t make_rmt_config (rmt_channel_t channel, gpio_num_t gpio)
 
std::pair< rmt_item32_t, rmt_item32_t > make_zero_one (rmt_manager const &manager, controller chip, bool inverted)
 
template<class OutputIt >
OutputIt populate (OutputIt it, std::uint8_t b, rmt_item32_t zero, rmt_item32_t one)
 
template<class OutputIt , class T , class = std::enable_if_t<not std::is_polymorphic_v<T>>>
OutputIt populate (OutputIt it, T const &t, rmt_item32_t zero, rmt_item32_t one)
 

Variables

static constexpr auto rmt_config_neopixel_default
 
static constexpr keep_t keep {}
 

Typedef Documentation

◆ blending_method

using neo::blending_method = typedef rgb (&)(rgb l, rgb r, float t)

◆ grb_led

◆ rgb_led

Enumeration Type Documentation

◆ controller

enum struct neo::controller
strong
Enumerator
ws2811_400khz 
ws2812_800khz 

◆ fx_type

enum struct neo::fx_type : std::uint8_t
strong
Enumerator
solid 
gradient 
matrix 

◆ led_channel

enum struct neo::led_channel
strong
Enumerator
red 
green 
blue 

Function Documentation

◆ blend_linear()

rgb neo::blend_linear ( rgb  l,
rgb  r,
float  t 
)

◆ blend_nearest_neighbor()

rgb neo::blend_nearest_neighbor ( rgb  l,
rgb  r,
float  t 
)

◆ blend_round_down()

rgb neo::blend_round_down ( rgb  l,
rgb  ,
float   
)

◆ blend_round_up()

rgb neo::blend_round_up ( rgb  ,
rgb  r,
float   
)

◆ get_cached_gamma_table()

gamma_table const & neo::get_cached_gamma_table ( float  gamma)

Looks up a cached local copy of a gamma table for the given gamma. Lookup is done via a std::map, so it's logarithmic. Note that due to gamma being a floating point, the lookup is done by looking at at most gamma_table_cache::default_precision fractional decimal digits, e.g. gamma = 2.200 and gamma = 2.201 yield the same table.

Returns
A reference to the gamma table. It is safe to store such reference, it's guaranteed to stay alive as long as the program runs (it is stored in a unique_ptr inside a static storage duration map).

◆ linear_to_srgb()

std::uint8_t neo::linear_to_srgb ( float  v)

◆ make_rmt_config()

rmt_config_t neo::make_rmt_config ( rmt_channel_t  channel,
gpio_num_t  gpio 
)

◆ make_zero_one()

std::pair< rmt_item32_t, rmt_item32_t > neo::make_zero_one ( rmt_manager const &  manager,
controller  chip,
bool  inverted 
)

◆ populate() [1/2]

template<class OutputIt >
OutputIt neo::populate ( OutputIt  it,
std::uint8_t  b,
rmt_item32_t  zero,
rmt_item32_t  one 
)

◆ populate() [2/2]

template<class OutputIt , class T , class = std::enable_if_t<not std::is_polymorphic_v<T>>>
OutputIt neo::populate ( OutputIt  it,
T const &  t,
rmt_item32_t  zero,
rmt_item32_t  one 
)

◆ srgb_to_linear()

float neo::srgb_to_linear ( std::uint8_t  v)

◆ to_string()

const char * neo::to_string ( controller  c)

Variable Documentation

◆ keep

constexpr keep_t neo::keep {}
staticconstexpr

◆ rmt_config_neopixel_default

constexpr auto neo::rmt_config_neopixel_default
staticconstexpr
Initial value:
= rmt_config_t{
.rmt_mode = RMT_MODE_TX,
.channel = RMT_CHANNEL_MAX,
.gpio_num = GPIO_NUM_MAX,
.clk_div = 2,
.mem_block_num = 1,
.flags = 0,
.tx_config = {
.carrier_freq_hz = 38000,
.carrier_level = RMT_CARRIER_LEVEL_HIGH,
.idle_level = RMT_IDLE_LEVEL_LOW,
.carrier_duty_percent = 33,
.carrier_en = false,
.loop_en = false,
.idle_output_en = true,
}}