Lines Matching +full:vsync +full:- +full:len
4 * SPDX-License-Identifier: Apache-2.0
7 * https://github.com/STMicroelectronics/stm32-nt35510/blob/main/nt35510.c
83 /* AVEE: -5.2V */
87 /* VCL: -2.5V */
97 /* VGL_REG: -10V */
103 /* VGMN/VGSN:-4.5V/0V */
105 /* VCOM: -1.325V */
156 static int nt35510_write_reg(const struct device *dev, uint8_t reg, const uint8_t *buf, size_t len) in nt35510_write_reg() argument
159 const struct nt35510_config *cfg = dev->config; in nt35510_write_reg()
161 ret = mipi_dsi_dcs_write(cfg->mipi_dsi, cfg->channel, reg, buf, len); in nt35510_write_reg()
169 /* Write an 8-bit value to a register */
183 ret = nt35510_write_reg(dev, cmd->reg, cmd->cmd, cmd->cmd_len); in nt35510_write_sequence()
192 struct nt35510_data *data = dev->data; in nt35510_config()
203 if (data->orientation == DISPLAY_ORIENTATION_NORMAL) { in nt35510_config()
222 data->pixel_format == PIXEL_FORMAT_RGB_565 in nt35510_config()
236 const struct nt35510_config *cfg = dev->config; in nt35510_blanking_on()
239 if (cfg->backlight.port != NULL) { in nt35510_blanking_on()
240 ret = gpio_pin_set_dt(&cfg->backlight, 0); in nt35510_blanking_on()
251 const struct nt35510_config *cfg = dev->config; in nt35510_blanking_off()
254 if (cfg->backlight.port != NULL) { in nt35510_blanking_off()
255 ret = gpio_pin_set_dt(&cfg->backlight, 1); in nt35510_blanking_off()
272 const struct nt35510_config *cfg = dev->config; in nt35510_get_capabilities()
273 struct nt35510_data *data = dev->data; in nt35510_get_capabilities()
276 capabilities->x_resolution = cfg->width; in nt35510_get_capabilities()
277 capabilities->y_resolution = cfg->height; in nt35510_get_capabilities()
278 capabilities->supported_pixel_formats = PIXEL_FORMAT_RGB_565 | PIXEL_FORMAT_RGB_888; in nt35510_get_capabilities()
279 capabilities->current_pixel_format = data->pixel_format; in nt35510_get_capabilities()
280 capabilities->current_orientation = data->orientation; in nt35510_get_capabilities()
286 struct nt35510_data *data = dev->data; in nt35510_set_pixel_format()
289 data->pixel_format = pixel_format; in nt35510_set_pixel_format()
293 return -ENOTSUP; in nt35510_set_pixel_format()
298 const struct nt35510_config *cfg = dev->config; in nt35510_check_id()
302 ret = mipi_dsi_dcs_read(cfg->mipi_dsi, cfg->channel, NT35510_CMD_RDID2, &id, 1); in nt35510_check_id()
305 return -EIO; in nt35510_check_id()
310 return -EINVAL; in nt35510_check_id()
317 const struct nt35510_config *cfg = dev->config; in nt35510_init()
318 struct nt35510_data *data = dev->data; in nt35510_init()
322 if (cfg->reset.port) { in nt35510_init()
323 if (!gpio_is_ready_dt(&cfg->reset)) { in nt35510_init()
325 return -ENODEV; in nt35510_init()
327 ret = gpio_pin_configure_dt(&cfg->reset, GPIO_OUTPUT_INACTIVE); in nt35510_init()
333 ret = gpio_pin_set_dt(&cfg->reset, 1); in nt35510_init()
342 if (cfg->rotation == 0) { in nt35510_init()
343 data->xres = cfg->width; in nt35510_init()
344 data->yres = cfg->height; in nt35510_init()
345 data->orientation = DISPLAY_ORIENTATION_NORMAL; in nt35510_init()
346 } else if (cfg->rotation == 90) { in nt35510_init()
347 data->xres = cfg->height; in nt35510_init()
348 data->yres = cfg->width; in nt35510_init()
349 data->orientation = DISPLAY_ORIENTATION_ROTATED_90; in nt35510_init()
350 } else if (cfg->rotation == 180) { in nt35510_init()
351 data->xres = cfg->width; in nt35510_init()
352 data->yres = cfg->height; in nt35510_init()
353 data->orientation = DISPLAY_ORIENTATION_ROTATED_180; in nt35510_init()
354 } else if (cfg->rotation == 270) { in nt35510_init()
355 data->xres = cfg->height; in nt35510_init()
356 data->yres = cfg->width; in nt35510_init()
357 data->orientation = DISPLAY_ORIENTATION_ROTATED_270; in nt35510_init()
360 /* Attach to MIPI-DSI host */ in nt35510_init()
361 mdev.data_lanes = cfg->data_lanes; in nt35510_init()
364 if (data->pixel_format == PIXEL_FORMAT_RGB_565) { in nt35510_init()
370 mdev.timings.hactive = data->xres; in nt35510_init()
374 mdev.timings.vactive = data->yres; in nt35510_init()
377 mdev.timings.vsync = NT35510_480X800_VSYNC; in nt35510_init()
379 ret = mipi_dsi_attach(cfg->mipi_dsi, cfg->channel, &mdev); in nt35510_init()
381 LOG_ERR("MIPI-DSI attach failed! (%d)", ret); in nt35510_init()
391 ret = gpio_pin_configure_dt(&cfg->backlight, GPIO_OUTPUT_ACTIVE); in nt35510_init()