Lines Matching +full:gpio +full:- +full:width
4 * SPDX-License-Identifier: Apache-2.0
12 #include <zephyr/drivers/gpio.h>
27 uint16_t width; member
47 struct display_ra_data *data = dev->data; in renesas_ra_glcdc_isr()
50 if (data->front_buf != data->pend_buf) { in renesas_ra_glcdc_isr()
51 data->front_buf = data->pend_buf; in renesas_ra_glcdc_isr()
52 k_sem_give(&data->sem); in renesas_ra_glcdc_isr()
59 struct display_ra_data *data = dev->data; in ra_display_write()
60 const struct display_ra_config *config = dev->config; in ra_display_write()
67 __ASSERT(desc->width <= desc->pitch, "Pitch is smaller than width"); in ra_display_write()
68 __ASSERT((desc->pitch * BYTE_PER_PIXEL * desc->height) <= desc->buf_size, in ra_display_write()
71 if (x == 0 && y == 0 && desc->height == DISPLAY_VSIZE && desc->width == DISPLAY_HSIZE && in ra_display_write()
72 desc->pitch == DISPLAY_HSIZE) { in ra_display_write()
77 return -ENOTSUP; in ra_display_write()
79 dst = data->frame_buffer; in ra_display_write()
82 if (data->front_buf == data->frame_buffer) { in ra_display_write()
83 dst = data->frame_buffer + data->frame_buffer_len; in ra_display_write()
86 memcpy(dst, data->front_buf, data->frame_buffer_len); in ra_display_write()
94 dst += (x * data->pixel_size); in ra_display_write()
95 dst += (y * config->width * data->pixel_size); in ra_display_write()
97 for (row = 0; row < desc->height; row++) { in ra_display_write()
98 (void)memcpy(dst, src, desc->width * data->pixel_size); in ra_display_write()
99 dst += (config->width * data->pixel_size); in ra_display_write()
100 src += (desc->pitch * data->pixel_size); in ra_display_write()
104 if (data->front_buf == l_pend_buf) { in ra_display_write()
108 k_sem_reset(&data->sem); in ra_display_write()
110 data->pend_buf = l_pend_buf; in ra_display_write()
112 err = R_GLCDC_BufferChange(&data->display_ctrl, (uint8_t *)data->pend_buf, in ra_display_write()
116 return -EIO; in ra_display_write()
119 k_sem_take(&data->sem, K_FOREVER); in ra_display_write()
127 struct display_ra_data *data = dev->data; in ra_display_read()
128 const struct display_ra_config *config = dev->config; in ra_display_read()
130 const uint8_t *src = data->front_buf; in ra_display_read()
134 src += (x * data->pixel_size); in ra_display_read()
135 src += (y * config->width * data->pixel_size); in ra_display_read()
137 for (row = 0; row < desc->height; row++) { in ra_display_read()
138 (void)memcpy(dst, src, desc->width * data->pixel_size); in ra_display_read()
139 src += (config->width * data->pixel_size); in ra_display_read()
140 dst += (desc->pitch * data->pixel_size); in ra_display_read()
148 const struct display_ra_config *config = dev->config; in ra_display_blanking_on()
151 if (config->backlight_gpio.port != NULL) { in ra_display_blanking_on()
152 err = gpio_pin_set_dt(&config->backlight_gpio, 0); in ra_display_blanking_on()
158 return -ENOTSUP; in ra_display_blanking_on()
166 const struct display_ra_config *config = dev->config; in ra_display_blanking_off()
169 if (config->backlight_gpio.port != NULL) { in ra_display_blanking_off()
170 err = gpio_pin_set_dt(&config->backlight_gpio, 1); in ra_display_blanking_off()
176 return -ENOTSUP; in ra_display_blanking_off()
185 const struct display_ra_config *config = dev->config; in ra_display_get_capabilities()
188 capabilities->x_resolution = config->width; in ra_display_get_capabilities()
189 capabilities->y_resolution = config->height; in ra_display_get_capabilities()
190 capabilities->current_orientation = DISPLAY_ORIENTATION_NORMAL; in ra_display_get_capabilities()
191 capabilities->supported_pixel_formats = in ra_display_get_capabilities()
193 capabilities->current_pixel_format = (config->pixel_format == PIXEL_FORMAT_RGB_888) in ra_display_get_capabilities()
195 : config->pixel_format; in ra_display_get_capabilities()
201 const struct display_ra_config *config = dev->config; in ra_display_set_pixel_format()
203 if (pixel_format == config->pixel_format) { in ra_display_set_pixel_format()
207 return -ENOTSUP; in ra_display_set_pixel_format()
221 const struct display_ra_config *config = dev->config; in display_init()
222 struct display_ra_data *data = dev->data; in display_init()
229 (R_SYSTEM->PDCTRGD & (R_SYSTEM_PDCTRGD_PDCSF_Msk | R_SYSTEM_PDCTRGD_PDPGSF_Msk)), in display_init()
231 R_SYSTEM->PDCTRGD = 0; in display_init()
233 (R_SYSTEM->PDCTRGD & (R_SYSTEM_PDCTRGD_PDCSF_Msk | R_SYSTEM_PDCTRGD_PDPGSF_Msk)), in display_init()
238 err = pinctrl_apply_state(config->pincfg, PINCTRL_STATE_DEFAULT); in display_init()
243 k_sem_init(&data->sem, 0, 1); in display_init()
245 err = clock_control_on(config->clock_dev, in display_init()
246 (clock_control_subsys_t)&config->clock_glcdc_subsys); in display_init()
252 err = R_GLCDC_Open(&data->display_ctrl, &data->display_fsp_cfg); in display_init()
255 return -EIO; in display_init()
258 err = gpio_pin_configure_dt(&config->backlight_gpio, GPIO_OUTPUT_ACTIVE); in display_init()
260 LOG_ERR("config backlight gpio failed"); in display_init()
264 err = R_GLCDC_Start(&data->display_ctrl); in display_init()
267 return -EIO; in display_init()
270 config->irq_configure(); in display_init()
278 R_ICU->IELSR[DT_INST_IRQ_BY_NAME(id, line, irq)] = ELC_EVENT_GLCDC_LINE_DETECT; \
288 (BYTE_PER_PIXEL * DT_INST_PROP(id, height) * DT_INST_PROP(id, width))
354 DT_INST_PROP(id, width) + \
361 .display_cyc = DT_INST_PROP(id, width), \
420 .width = DT_INST_PROP(id, width), \
423 (DT_INST_PROP(id, width)) * (DT_INST_PROP(id, height)) * BYTE_PER_PIXEL, \