Lines Matching +full:off +full:- +full:on +full:- +full:delay +full:- +full:us

4  * Copyright (c) 2022-2023 Jamie McCrae
6 * SPDX-License-Identifier: Apache-2.0
79 { 0, 0, 0 }, /* Off */
95 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_print()
102 rc = i2c_write_dt(&config->bus, buf, sizeof(buf)); in auxdisplay_jhd1313_print()
112 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_cursor_position_set()
116 return -EINVAL; in auxdisplay_jhd1313_cursor_position_set()
128 return i2c_write_dt(&config->bus, data, 2); in auxdisplay_jhd1313_cursor_position_set()
134 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_clear()
137 rc = i2c_write_dt(&config->bus, clear, sizeof(clear)); in auxdisplay_jhd1313_clear()
138 LOG_DBG("Clear, delay 20 ms"); in auxdisplay_jhd1313_clear()
152 if (data->power) { in auxdisplay_jhd1313_update_display_state()
156 if (data->cursor) { in auxdisplay_jhd1313_update_display_state()
160 if (data->blinking) { in auxdisplay_jhd1313_update_display_state()
164 rc = i2c_write_dt(&config->bus, buf, sizeof(buf)); in auxdisplay_jhd1313_update_display_state()
166 LOG_DBG("Set display_state options, delay 5 ms"); in auxdisplay_jhd1313_update_display_state()
174 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_cursor_set_enabled()
175 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_cursor_set_enabled()
177 data->cursor = enabled; in auxdisplay_jhd1313_cursor_set_enabled()
183 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_position_blinking_set_enabled()
184 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_position_blinking_set_enabled()
186 data->blinking = enabled; in auxdisplay_jhd1313_position_blinking_set_enabled()
192 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_input_state_set()
193 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_input_state_set()
196 data->input_set = opt; in auxdisplay_jhd1313_input_state_set()
199 i2c_write_dt(&config->bus, buf, sizeof(buf)); in auxdisplay_jhd1313_input_state_set()
200 LOG_DBG("Set the input_set, no delay"); in auxdisplay_jhd1313_input_state_set()
205 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_backlight_set()
206 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_backlight_set()
210 return -EINVAL; in auxdisplay_jhd1313_backlight_set()
213 data->backlight = colour; in auxdisplay_jhd1313_backlight_set()
215 auxdisplay_jhd1313_reg_set(config->bus.bus, JHD1313_LED_REG_R, colour_define[colour][0]); in auxdisplay_jhd1313_backlight_set()
216 auxdisplay_jhd1313_reg_set(config->bus.bus, JHD1313_LED_REG_G, colour_define[colour][1]); in auxdisplay_jhd1313_backlight_set()
217 auxdisplay_jhd1313_reg_set(config->bus.bus, JHD1313_LED_REG_B, colour_define[colour][2]); in auxdisplay_jhd1313_backlight_set()
224 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_backlight_get()
226 *backlight = data->backlight; in auxdisplay_jhd1313_backlight_get()
233 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_function_set()
234 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_function_set()
237 data->function = opt; in auxdisplay_jhd1313_function_set()
240 i2c_write_dt(&config->bus, buf, sizeof(buf)); in auxdisplay_jhd1313_function_set()
242 LOG_DBG("Set function options, delay 5 ms"); in auxdisplay_jhd1313_function_set()
248 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_initialize()
249 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_initialize()
254 if (!device_is_ready(config->bus.bus)) { in auxdisplay_jhd1313_initialize()
255 return -ENODEV; in auxdisplay_jhd1313_initialize()
260 * 1 - Power on in auxdisplay_jhd1313_initialize()
261 * - Wait for more than 30 ms AFTER VDD rises to 4.5v in auxdisplay_jhd1313_initialize()
262 * 2 - Send FUNCTION set in auxdisplay_jhd1313_initialize()
263 * - Wait for 39 us in auxdisplay_jhd1313_initialize()
264 * 3 - Send DISPLAY Control in auxdisplay_jhd1313_initialize()
265 * - wait for 39 us in auxdisplay_jhd1313_initialize()
266 * 4 - send DISPLAY Clear in auxdisplay_jhd1313_initialize()
267 * - wait for 1.5 ms in auxdisplay_jhd1313_initialize()
268 * 5 - send ENTRY Mode in auxdisplay_jhd1313_initialize()
269 * 6 - Initialization is done in auxdisplay_jhd1313_initialize()
274 * VDD to power on, so pause a little here, 30 ms min, so we go 50 in auxdisplay_jhd1313_initialize()
276 LOG_DBG("Delay 50 ms while the VDD powers on"); in auxdisplay_jhd1313_initialize()
283 /* Turn the display on - by default no cursor and no blinking */ in auxdisplay_jhd1313_initialize()
297 /* Now power on the background RGB control */ in auxdisplay_jhd1313_initialize()
299 auxdisplay_jhd1313_reg_set(config->bus.bus, 0x00, 0x00); in auxdisplay_jhd1313_initialize()
300 auxdisplay_jhd1313_reg_set(config->bus.bus, 0x01, 0x05); in auxdisplay_jhd1313_initialize()
301 auxdisplay_jhd1313_reg_set(config->bus.bus, 0x08, 0xAA); in auxdisplay_jhd1313_initialize()
304 LOG_DBG("Background set to off"); in auxdisplay_jhd1313_initialize()
312 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_display_on()
313 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_display_on()
315 data->power = true; in auxdisplay_jhd1313_display_on()
321 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_display_off()
322 struct auxdisplay_jhd1313_data *data = dev->data; in auxdisplay_jhd1313_display_off()
324 data->power = false; in auxdisplay_jhd1313_display_off()
331 const struct auxdisplay_jhd1313_config *config = dev->config; in auxdisplay_jhd1313_capabilities_get()
333 memcpy(capabilities, &config->capabilities, sizeof(struct auxdisplay_capabilities)); in auxdisplay_jhd1313_capabilities_get()