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