Lines Matching +full:count +full:- +full:width

4  * SPDX-License-Identifier: Apache-2.0
48 uint16_t width; member
71 const struct ssd1306_config *config = dev->config; in ssd1306_bus_ready_i2c()
73 return i2c_is_ready_dt(&config->bus.i2c); in ssd1306_bus_ready_i2c()
78 const struct ssd1306_config *config = dev->config; in ssd1306_write_bus_i2c()
80 return i2c_burst_write_dt(&config->bus.i2c, in ssd1306_write_bus_i2c()
88 const struct ssd1306_config *config = dev->config; in ssd1306_bus_name_i2c()
90 return config->bus.i2c.bus->name; in ssd1306_bus_name_i2c()
98 const struct ssd1306_config *config = dev->config; in ssd1306_bus_ready_spi()
100 if (gpio_pin_configure_dt(&config->data_cmd, GPIO_OUTPUT_INACTIVE) < 0) { in ssd1306_bus_ready_spi()
104 return spi_is_ready_dt(&config->bus.spi); in ssd1306_bus_ready_spi()
109 const struct ssd1306_config *config = dev->config; in ssd1306_write_bus_spi()
112 gpio_pin_set_dt(&config->data_cmd, command ? 0 : 1); in ssd1306_write_bus_spi()
120 .count = 1 in ssd1306_write_bus_spi()
123 ret = spi_write_dt(&config->bus.spi, &tx_bufs); in ssd1306_write_bus_spi()
130 const struct ssd1306_config *config = dev->config; in ssd1306_bus_name_spi()
132 return config->bus.spi.bus->name; in ssd1306_bus_name_spi()
138 const struct ssd1306_config *config = dev->config; in ssd1306_bus_ready()
140 return config->bus_ready(dev); in ssd1306_bus_ready()
146 const struct ssd1306_config *config = dev->config; in ssd1306_write_bus()
148 return config->write_bus(dev, buf, len, command); in ssd1306_write_bus()
153 const struct ssd1306_config *config = dev->config; in ssd1306_set_panel_orientation()
154 uint8_t cmd_buf[] = {(config->segment_remap ? SSD1306_SET_SEGMENT_MAP_REMAPED in ssd1306_set_panel_orientation()
156 (config->com_invdir ? SSD1306_SET_COM_OUTPUT_SCAN_FLIPPED in ssd1306_set_panel_orientation()
164 const struct ssd1306_config *config = dev->config; in ssd1306_set_timing_setting()
168 config->prechargep, in ssd1306_set_timing_setting()
177 const struct ssd1306_config *config = dev->config; in ssd1306_set_hardware_config()
181 config->display_offset, in ssd1306_set_hardware_config()
183 (config->com_sequential ? SSD1306_SET_PADS_HW_SEQUENTIAL in ssd1306_set_hardware_config()
186 config->multiplex_ratio, in ssd1306_set_hardware_config()
194 const struct ssd1306_config *config = dev->config; in ssd1306_set_charge_pump()
196 (config->sh1106_compatible ? SH1106_SET_DCDC_MODE : SSD1306_SET_CHARGE_PUMP_ON), in ssd1306_set_charge_pump()
197 (config->sh1106_compatible ? SH1106_SET_DCDC_ENABLED in ssd1306_set_charge_pump()
208 const struct ssd1306_config *config = dev->config; in ssd1306_set_iref_mode()
214 if (config->use_internal_iref) { in ssd1306_set_iref_mode()
243 const struct ssd1306_config *config = dev->config; in ssd1306_write_default()
244 uint8_t x_off = config->segment_offset; in ssd1306_write_default()
250 (x + desc->width - 1) + x_off, in ssd1306_write_default()
253 ((y + desc->height)/8 - 1) in ssd1306_write_default()
258 return -1; in ssd1306_write_default()
268 const struct ssd1306_config *config = dev->config; in ssd1306_write_sh1106()
269 uint8_t x_offset = x + config->segment_offset; in ssd1306_write_sh1106()
279 for (uint8_t n = 0; n < desc->height / 8; n++) { in ssd1306_write_sh1106()
280 cmd_buf[sizeof(cmd_buf) - 1] = in ssd1306_write_sh1106()
285 return -1; in ssd1306_write_sh1106()
288 if (ssd1306_write_bus(dev, buf_ptr, desc->width, false)) { in ssd1306_write_sh1106()
289 return -1; in ssd1306_write_sh1106()
292 buf_ptr = buf_ptr + desc->width; in ssd1306_write_sh1106()
295 return -1; in ssd1306_write_sh1106()
305 const struct ssd1306_config *config = dev->config; in ssd1306_write()
308 if (desc->pitch < desc->width) { in ssd1306_write()
309 LOG_ERR("Pitch is smaller than width"); in ssd1306_write()
310 return -1; in ssd1306_write()
313 buf_len = MIN(desc->buf_size, desc->height * desc->width / 8); in ssd1306_write()
316 return -1; in ssd1306_write()
319 if (desc->pitch > desc->width) { in ssd1306_write()
321 return -1; in ssd1306_write()
326 return -1; in ssd1306_write()
329 LOG_DBG("x %u, y %u, pitch %u, width %u, height %u, buf_len %u", x, y, desc->pitch, in ssd1306_write()
330 desc->width, desc->height, buf_len); in ssd1306_write()
332 if (config->sh1106_compatible) { in ssd1306_write()
352 const struct ssd1306_config *config = dev->config; in ssd1306_get_capabilities()
353 struct ssd1306_data *data = dev->data; in ssd1306_get_capabilities()
355 caps->x_resolution = config->width; in ssd1306_get_capabilities()
356 caps->y_resolution = config->height; in ssd1306_get_capabilities()
357 caps->supported_pixel_formats = PIXEL_FORMAT_MONO10 | PIXEL_FORMAT_MONO01; in ssd1306_get_capabilities()
358 caps->current_pixel_format = data->pf; in ssd1306_get_capabilities()
359 caps->screen_info = SCREEN_INFO_MONO_VTILED; in ssd1306_get_capabilities()
360 caps->current_orientation = DISPLAY_ORIENTATION_NORMAL; in ssd1306_get_capabilities()
366 struct ssd1306_data *data = dev->data; in ssd1306_set_pixel_format()
370 if (pf == data->pf) { in ssd1306_set_pixel_format()
380 return -ENOTSUP; in ssd1306_set_pixel_format()
388 data->pf = pf; in ssd1306_set_pixel_format()
395 const struct ssd1306_config *config = dev->config; in ssd1306_init_device()
396 struct ssd1306_data *data = dev->data; in ssd1306_init_device()
400 (config->color_inversion ? SSD1306_SET_REVERSE_DISPLAY in ssd1306_init_device()
404 data->pf = config->color_inversion ? PIXEL_FORMAT_MONO10 : PIXEL_FORMAT_MONO01; in ssd1306_init_device()
407 if (config->reset.port) { in ssd1306_init_device()
409 gpio_pin_set_dt(&config->reset, 1); in ssd1306_init_device()
411 gpio_pin_set_dt(&config->reset, 0); in ssd1306_init_device()
416 return -EIO; in ssd1306_init_device()
420 return -EIO; in ssd1306_init_device()
424 return -EIO; in ssd1306_init_device()
428 return -EIO; in ssd1306_init_device()
432 return -EIO; in ssd1306_init_device()
436 return -EIO; in ssd1306_init_device()
440 return -EIO; in ssd1306_init_device()
444 return -EIO; in ssd1306_init_device()
454 const struct ssd1306_config *config = dev->config; in ssd1306_init()
456 k_sleep(K_TIMEOUT_ABS_MS(config->ready_time_ms)); in ssd1306_init()
459 LOG_ERR("Bus device %s not ready!", config->bus_name(dev)); in ssd1306_init()
460 return -EINVAL; in ssd1306_init()
463 if (config->reset.port) { in ssd1306_init()
466 ret = gpio_pin_configure_dt(&config->reset, in ssd1306_init()
475 return -EIO; in ssd1306_init()
510 .width = DT_PROP(node_id, width), \