Lines Matching +full:gpio +full:- +full:width
9 * SPDX-License-Identifier: Apache-2.0
18 #include <zephyr/drivers/gpio.h>
48 uint16_t width; member
65 struct st7789v_data *data = dev->data; in st7789v_set_lcd_margins()
67 data->x_offset = x_offset; in st7789v_set_lcd_margins()
68 data->y_offset = y_offset; in st7789v_set_lcd_margins()
74 const struct st7789v_config *config = dev->config; in st7789v_transmit()
80 if (config->cmd_data_gpio.port != NULL) { in st7789v_transmit()
82 gpio_pin_set_dt(&config->cmd_data_gpio, 1); in st7789v_transmit()
83 spi_write_dt(&config->bus, &tx_bufs); in st7789v_transmit()
89 gpio_pin_set_dt(&config->cmd_data_gpio, 0); in st7789v_transmit()
90 spi_write_dt(&config->bus, &tx_bufs); in st7789v_transmit()
97 spi_write_dt(&config->bus, &tx_bufs); in st7789v_transmit()
103 spi_write_dt(&config->bus, &tx_bufs); in st7789v_transmit()
119 const struct st7789v_config *config = dev->config; in st7789v_reset_display()
120 if (config->reset_gpio.port != NULL) { in st7789v_reset_display()
122 gpio_pin_set_dt(&config->reset_gpio, 1); in st7789v_reset_display()
124 gpio_pin_set_dt(&config->reset_gpio, 0); in st7789v_reset_display()
150 return -ENOTSUP; in st7789v_read()
156 struct st7789v_data *data = dev->data; in st7789v_set_mem_area()
159 uint16_t ram_x = x + data->x_offset; in st7789v_set_mem_area()
160 uint16_t ram_y = y + data->y_offset; in st7789v_set_mem_area()
163 spi_data[1] = sys_cpu_to_be16(ram_x + w - 1); in st7789v_set_mem_area()
167 spi_data[1] = sys_cpu_to_be16(ram_y + h - 1); in st7789v_set_mem_area()
181 __ASSERT(desc->width <= desc->pitch, "Pitch is smaller then width"); in st7789v_write()
182 __ASSERT((desc->pitch * ST7789V_PIXEL_SIZE * desc->height) <= desc->buf_size, in st7789v_write()
186 desc->width, desc->height, x, y); in st7789v_write()
187 st7789v_set_mem_area(dev, x, y, desc->width, desc->height); in st7789v_write()
189 if (desc->pitch > desc->width) { in st7789v_write()
191 nbr_of_writes = desc->height; in st7789v_write()
193 write_h = desc->height; in st7789v_write()
200 desc->width * ST7789V_PIXEL_SIZE * write_h); in st7789v_write()
201 write_data_start += (desc->pitch * ST7789V_PIXEL_SIZE); in st7789v_write()
215 return -ENOTSUP; in st7789v_set_brightness()
221 return -ENOTSUP; in st7789v_set_contrast()
227 const struct st7789v_config *config = dev->config; in st7789v_get_capabilities()
230 capabilities->x_resolution = config->width; in st7789v_get_capabilities()
231 capabilities->y_resolution = config->height; in st7789v_get_capabilities()
234 capabilities->supported_pixel_formats = PIXEL_FORMAT_RGB_565; in st7789v_get_capabilities()
235 capabilities->current_pixel_format = PIXEL_FORMAT_RGB_565; in st7789v_get_capabilities()
237 capabilities->supported_pixel_formats = PIXEL_FORMAT_RGB_888; in st7789v_get_capabilities()
238 capabilities->current_pixel_format = PIXEL_FORMAT_RGB_888; in st7789v_get_capabilities()
240 capabilities->current_orientation = DISPLAY_ORIENTATION_NORMAL; in st7789v_get_capabilities()
254 return -ENOTSUP;
264 return -ENOTSUP;
269 struct st7789v_data *data = dev->data;
270 const struct st7789v_config *config = dev->config;
273 st7789v_set_lcd_margins(dev, data->x_offset,
274 data->y_offset);
277 (uint8_t *)config->cmd2en_param,
278 sizeof(config->cmd2en_param));
281 (uint8_t *)config->porch_param,
282 sizeof(config->porch_param));
292 tmp = config->gctrl;
295 tmp = config->vcom;
298 if (config->vdv_vrh_enable) {
302 tmp = config->vrh_value;
305 tmp = config->vdv_value;
310 (uint8_t *)config->pwctrl1_param,
311 sizeof(config->pwctrl1_param));
314 tmp = config->mdac;
318 tmp = config->colmod;
321 tmp = config->lcm;
324 tmp = config->gamma;
330 (uint8_t *)config->pvgam_param,
331 sizeof(config->pvgam_param));
334 (uint8_t *)config->nvgam_param,
335 sizeof(config->nvgam_param));
338 (uint8_t *)config->ram_param,
339 sizeof(config->ram_param));
342 (uint8_t *)config->rgb_param,
343 sizeof(config->rgb_param));
348 const struct st7789v_config *config = dev->config;
350 if (!spi_is_ready_dt(&config->bus)) {
352 return -ENODEV;
355 if (config->reset_gpio.port != NULL) {
356 if (!gpio_is_ready_dt(&config->reset_gpio)) {
357 LOG_ERR("Reset GPIO device not ready");
358 return -ENODEV;
361 if (gpio_pin_configure_dt(&config->reset_gpio, GPIO_OUTPUT_INACTIVE)) {
363 return -EIO;
367 if (config->cmd_data_gpio.port != NULL) {
368 if (!gpio_is_ready_dt(&config->cmd_data_gpio)) {
369 LOG_ERR("CMD/DATA GPIO device not ready");
370 return -ENODEV;
373 if (gpio_pin_configure_dt(&config->cmd_data_gpio, GPIO_OUTPUT)) {
375 return -EIO;
404 ret = -ENOTSUP;
451 .width = DT_INST_PROP(inst, width), \