max7219 - Driver for 8-Digit LED display drivers, MAX7219/MAX7221

Warning

This component does not support (yet) ESP8266 RTOS SDK!

group max7219

ESP-IDF driver for MAX7219/MAX7221 Serially Interfaced, 8-Digit LED Display Drivers.

Ported from esp-open-rtos

Copyright (C) 2017, 2018 Ruslan V. Uss unclerus@gmail.com

BSD Licensed as described in the file LICENSE

Defines

MAX7219_MAX_CASCADE_SIZE
MAX7219_MAX_BRIGHTNESS

Functions

esp_err_t max7219_init_desc(max7219_t *dev, spi_host_device_t host, gpio_num_t cs_pin)

Initialize device descriptor.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

  • host: SPI host

  • cs_pin: CS GPIO number

esp_err_t max7219_free_desc(max7219_t *dev)

Free device descriptor.

Return

ESP_OK on success

Parameters
  • dev: Device descriptor

esp_err_t max7219_init(max7219_t *dev)

Initialize display Switch it to normal operation from shutdown mode, set scan limit to the max and clear.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

esp_err_t max7219_set_decode_mode(max7219_t *dev, bool bcd)

Set decode mode and clear display.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • bcd: true to set BCD decode mode, false to normal

esp_err_t max7219_set_brightness(max7219_t *dev, uint8_t value)

Set display brightness.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • value: Brightness value, 0..MAX7219_MAX_BRIGHTNESS

esp_err_t max7219_set_shutdown_mode(max7219_t *dev, bool shutdown)

Shutdown display or set it to normal mode.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • shutdown: Shutdown display if true

esp_err_t max7219_set_digit(max7219_t *dev, uint8_t digit, uint8_t val)

Write data to display digit.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • digit: Digit index, 0..dev->digits - 1

  • val: Data

esp_err_t max7219_clear(max7219_t *dev)

Clear display.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

esp_err_t max7219_draw_text_7seg(max7219_t *dev, uint8_t pos, const char *s)

Draw text on 7-segment display.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • pos: Start digit

  • s: Text

esp_err_t max7219_draw_image_8x8(max7219_t *dev, uint8_t pos, const void *image)

Draw 64-bit image on 8x8 matrix.

Return

ESP_OK on success

Parameters
  • dev: Display descriptor

  • pos: Start digit

  • image: 64-bit buffer with image data

struct max7219_t
#include <max7219.h>

Display descriptor.