pub fn setup_adapter(
    gpio_dev: &str,
    num_displays: usize,
    data_pin: u32,
    cs_pin: u32,
    clk_pin: u32
) -> Max7219
Expand description

Set’s up the MAX7219-driver using “gpio_cdev”. This only works on Linux. It works for example on Raspberry. The communication uses SPI protocol. This does not require the “SPI Module” on Raspberry Pi to be activated. This works via regular GPIO pins.

  • gpio_dev the gpio device. Probably “/dev/gpiochip0”
  • num_displays number of displays
  • data_pin number of GPIO pin used as data pin
  • clk_pin number of GPIO pin used as clock pin
  • cs_pin number of GPIO pin used as cs (chip select) pin