RGBMatrixConfig

Struct RGBMatrixConfig 

Source
pub struct RGBMatrixConfig {
Show 18 fields pub hardware_mapping: HardwareMapping, pub rows: usize, pub cols: usize, pub refresh_rate: usize, pub pi_chip: Option<PiChip>, pub pwm_bits: usize, pub pwm_lsb_nanoseconds: u32, pub slowdown: Option<u32>, pub interlaced: bool, pub dither_bits: usize, pub chain_length: usize, pub parallel: usize, pub panel_type: Option<PanelType>, pub multiplexing: Option<MultiplexMapperType>, pub pixelmapper: Vec<NamedPixelMapperType>, pub row_setter: RowAddressSetterType, pub led_sequence: LedSequence, pub led_brightness: u8,
}
Expand description

Configuration for an RGB matrix panel controller.

Fields§

§hardware_mapping: HardwareMapping

the display wiring e.g. “Regular”, “AdafruitHat”, “AdafruitHatPwm”, etc. Default: “Regular”

§rows: usize

the number of display rows. Default: 64

§cols: usize

the number of display columns. Default: 64

§refresh_rate: usize

the display refresh rate. Default: 120

§pi_chip: Option<PiChip>

the Raspberry Pi chip model e.g. “BCM2711”, Default: automatic

§pwm_bits: usize

the LEDs can only be switched on or off, so the shaded brightness perception is achieved via PWM (Pulse Width Modulation). In order to get a good 8 bit per color resolution (24 bit RGB), the 11 bits default per color are good because our eyes are actually perceiving brightness logarithmically, so we need a lot more physical resolution to get 24Bit sRGB. This flag sets the bits used for this; lowering it means the lower bits (=more subtle color nuances) are omitted. Typically you might be mostly interested in the extremes: 1 Bit for situations that only require 8 colors (e.g. for high contrast text displays) or 11 Bit for everything else (e.g. showing images or videos). Lower number of bits use slightly less CPU and result in a higher refresh rate. Default: 11

§pwm_lsb_nanoseconds: u32

base time-unit for the on-time in the lowest significant bit in nanoseconds. Lower values will allow higher frame rate, but will also negatively impact quality in some panels. Good values for full-color display (pwm_bits=11) are somewhere between 100 and 300. Default: 130

§slowdown: Option<u32>

the Raspberry Pi starting with Pi2 are putting out data too fast for almost all LED panels. In this case, you want to slow down writing to GPIO. Zero for this parameter means ‘no slowdown’. The default 1 typically works fine, but often you have to even go further by setting it to 2. If you have a Raspberry Pi with a slower processor (Model A, A+, B+, Zero), then a value of 0 might work and is desirable. A Raspberry Pi3 or Pi4 might even need higher values for the panels to be happy. Default: automatic

§interlaced: bool

interlaced scan mode. Default: false

§dither_bits: usize

the lower bits can be time dithered, i.e. their brightness contribution is achieved by only showing them some frames (this is possible, because the PWM is implemented as binary code modulation). This will allow higher refresh rate (or same refresh rate with increased –pwm_lsb_nanoseconds). The disadvantage could be slightly lower brightness, in particular for longer chains, and higher CPU use. CPU use is not of concern for Raspberry Pi 2, 3 and 4 (as we run on a dedicated core anyway) but probably for Raspberry Pi 1 or Pi Zero. Default: 0 (no dithering)

§chain_length: usize

number of daisy-chained panels. Default: 1

§parallel: usize

how many chains to run in parallel. Default: 1

§panel_type: Option<PanelType>

typically left empty, but some panels need a particular initialization sequence. This can be e.g. “FM6126A” for that particular panel type.

§multiplexing: Option<MultiplexMapperType>

the kind of multiplexing mapper.

§pixelmapper: Vec<NamedPixelMapperType>

the kind of pixel mapper.

§row_setter: RowAddressSetterType

the row address setter.

§led_sequence: LedSequence

the LED sequence, Default: “RGB”

§led_brightness: u8

brightness in percent. Default: 100

Trait Implementations§

Source§

impl Debug for RGBMatrixConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RGBMatrixConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl FromArgs for RGBMatrixConfig

Source§

fn from_args(__cmd_name: &[&str], __args: &[&str]) -> Result<Self, EarlyExit>

Construct the type from an input set of arguments. Read more
Source§

fn redact_arg_values( __cmd_name: &[&str], __args: &[&str], ) -> Result<Vec<String>, EarlyExit>

Get a String with just the argument names, e.g., options, flags, subcommands, etc, but without the values of the options and arguments. This can be useful as a means to capture anonymous usage statistics without revealing the content entered by the end user. Read more
Source§

impl Hash for RGBMatrixConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RGBMatrixConfig

Source§

fn eq(&self, other: &RGBMatrixConfig) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for RGBMatrixConfig

Source§

impl StructuralPartialEq for RGBMatrixConfig

Source§

impl TopLevelCommand for RGBMatrixConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.