Lines Matching +full:data +full:- +full:bus +full:- +full:width

4  * SPDX-License-Identifier: Apache-2.0
25 * -> high/1 means white, low/0 means black
26 * -> Display expects LSB first
29 #define LS0XX_PANEL_WIDTH DT_INST_PROP(0, width)
35 * +-------------------+-------------------+----------------+
36 * | line num (8 bits) | data (WIDTH bits) | dummy (8 bits) |
37 * +-------------------+-------------------+----------------+
46 struct spi_dt_spec bus; member
62 gpio_pin_toggle_dt(&config->extcomin_gpio); in ls0xx_vcom_toggle()
64 gpio_pin_toggle_dt(&config->extcomin_gpio); in ls0xx_vcom_toggle()
76 const struct ls0xx_config *config = dev->config; in ls0xx_blanking_off()
78 return gpio_pin_set_dt(&config->disp_en_gpio, 1); in ls0xx_blanking_off()
81 return -ENOTSUP; in ls0xx_blanking_off()
88 const struct ls0xx_config *config = dev->config; in ls0xx_blanking_on()
90 return gpio_pin_set_dt(&config->disp_en_gpio, 0); in ls0xx_blanking_on()
93 return -ENOTSUP; in ls0xx_blanking_on()
99 const struct ls0xx_config *config = dev->config; in ls0xx_cmd()
103 return spi_write_dt(&config->bus, &buf_set); in ls0xx_cmd()
108 const struct ls0xx_config *config = dev->config; in ls0xx_clear()
113 spi_release_dt(&config->bus); in ls0xx_clear()
121 const uint8_t *data) in ls0xx_update_display() argument
123 const struct ls0xx_config *config = dev->config; in ls0xx_update_display()
133 .len = LS0XX_BYTES_PER_LINE - 2, in ls0xx_update_display()
146 LOG_DBG("Lines %d to %d", start_line, start_line + num_lines - 1); in ls0xx_update_display()
152 for (; ln <= start_line + num_lines - 1; ln++) { in ls0xx_update_display()
153 line_buf[1].buf = (uint8_t *)data; in ls0xx_update_display()
154 err |= spi_write_dt(&config->bus, &line_set); in ls0xx_update_display()
155 data += LS0XX_PANEL_WIDTH / LS0XX_PIXELS_PER_BYTE; in ls0xx_update_display()
164 spi_release_dt(&config->bus); in ls0xx_update_display()
169 /* Buffer width should be equal to display width */
175 LOG_DBG("X: %d, Y: %d, W: %d, H: %d", x, y, desc->width, desc->height); in ls0xx_write()
179 return -EINVAL; in ls0xx_write()
182 if (desc->width != LS0XX_PANEL_WIDTH) { in ls0xx_write()
183 LOG_ERR("Width not a multiple of %d", LS0XX_PANEL_WIDTH); in ls0xx_write()
184 return -EINVAL; in ls0xx_write()
187 if (desc->pitch != desc->width) { in ls0xx_write()
189 return -ENOTSUP; in ls0xx_write()
192 if ((y + desc->height) > LS0XX_PANEL_HEIGHT) { in ls0xx_write()
194 return -EINVAL; in ls0xx_write()
198 LOG_ERR("X-coordinate has to be 0"); in ls0xx_write()
199 return -EINVAL; in ls0xx_write()
203 return ls0xx_update_display(dev, y + 1, desc->height, buf); in ls0xx_write()
210 caps->x_resolution = LS0XX_PANEL_WIDTH; in ls0xx_get_capabilities()
211 caps->y_resolution = LS0XX_PANEL_HEIGHT; in ls0xx_get_capabilities()
212 caps->supported_pixel_formats = PIXEL_FORMAT_MONO01; in ls0xx_get_capabilities()
213 caps->current_pixel_format = PIXEL_FORMAT_MONO01; in ls0xx_get_capabilities()
214 caps->screen_info = SCREEN_INFO_X_ALIGNMENT_WIDTH; in ls0xx_get_capabilities()
225 return -ENOTSUP; in ls0xx_set_pixel_format()
230 const struct ls0xx_config *config = dev->config; in ls0xx_init()
232 if (!spi_is_ready_dt(&config->bus)) { in ls0xx_init()
233 LOG_ERR("SPI bus %s not ready", config->bus.bus->name); in ls0xx_init()
234 return -ENODEV; in ls0xx_init()
238 if (!gpio_is_ready_dt(&config->disp_en_gpio)) { in ls0xx_init()
240 return -ENODEV; in ls0xx_init()
243 gpio_pin_configure_dt(&config->disp_en_gpio, GPIO_OUTPUT_HIGH); in ls0xx_init()
247 if (!gpio_is_ready_dt(&config->extcomin_gpio)) { in ls0xx_init()
249 return -ENODEV; in ls0xx_init()
252 gpio_pin_configure_dt(&config->extcomin_gpio, GPIO_OUTPUT_LOW); in ls0xx_init()
264 /* Clear display else it shows random data */ in ls0xx_init()
269 .bus = SPI_DT_SPEC_INST_GET(