Zephyr display driver implementation for a shift matrix display. This driver start it's own thread during initialization, parameters for which are set in the kconfig. Currently the driver only supports a 3bit colour depth but supports a 16 bit interface.
More...
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/drivers/display.h>
#include <zephyr/devicetree.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/pwm.h>
#include <zephyr/logging/log.h>
#include <zephyr/irq.h>
|
#define | MATRIX_NODE DT_INST(0, adafruit_shift_matrix_display) |
|
#define | X_PIXELS DT_PROP(MATRIX_NODE, width) |
|
#define | Y_PIXELS DT_PROP(MATRIX_NODE, height) |
|
#define | PIXEL_COUNT (X_PIXELS * Y_PIXELS) |
|
#define | NR_RGB_GPIOS (Y_PIXELS / 16) |
|
#define | NR_MUX_GPIOS (Y_PIXELS / 8 ) |
|
#define | GET_GPIO_SPEC(node_id, prop, idx) GPIO_DT_SPEC_GET_BY_IDX(node_id, prop, idx), |
|
#define | RED_BIT_LEN 5 |
|
#define | GREEN_BIT_LEN 6 |
|
#define | BLUE_BIT_LEN 5 |
|
|
| LOG_MODULE_REGISTER (shift_matrix_display, CONFIG_DISPLAY_LOG_LEVEL) |
|
| K_SEM_DEFINE (framebuf_sem, 0, 1) |
|
| K_SEM_DEFINE (brightness_sem, 0, 1) |
|
| K_THREAD_STACK_DEFINE (shift_matrix_display_stack_area, CONFIG_SHIFT_MATRIX_DISPLAY_STACK_SIZE) |
|
| DEVICE_DT_DEFINE (MATRIX_NODE, instance_init, NULL, &instance_data, &instance_config, POST_KERNEL, CONFIG_DISPLAY_INIT_PRIORITY, &driver_api) |
|
|
struct k_thread | shift_matrix_display_thread_data |
|
const struct display_driver_api | driver_api |
|
Zephyr display driver implementation for a shift matrix display. This driver start it's own thread during initialization, parameters for which are set in the kconfig. Currently the driver only supports a 3bit colour depth but supports a 16 bit interface.
- Author
- Theis theis.nosp@m.mejn.nosp@m.ertse.nosp@m.n@gm.nosp@m.ail.c.nosp@m.om
- Date
- 15-09-2024
- Copyright
- (c) 2024 Theis Mejnertsen
- License:\n This project is released under the MIT license.
◆ driver_api
const struct display_driver_api driver_api |
Initial value:= {
.blanking_on = api_blanking_on,
.blanking_off = api_blanking_off,
.write = api_write,
.read = api_read,
.get_framebuffer = api_get_framebuffer,
.set_brightness = api_set_brightness,
.set_contrast = api_set_contrast,
.get_capabilities = api_get_capabilities,
.set_pixel_format = api_set_pixel_format,
.set_orientation = api_set_orientation,
}