Developer World
Spresense SDK Library v3.3.0-375c679
mipi_dsi.h
1/****************************************************************************
2 * include/nuttx/video/mipi_dsi.h
3 *
4 * Licensed to the Apache Software Foundation (ASF) under one or more
5 * contributor license agreements. See the NOTICE file distributed with
6 * this work for additional information regarding copyright ownership. The
7 * ASF licenses this file to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance with the
9 * License. You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 * License for the specific language governing permissions and limitations
17 * under the License.
18 *
19 ****************************************************************************/
20
21#ifndef __INCLUDE_NUTTX_VIDEO_MIPI_DSI_H
22#define __INCLUDE_NUTTX_VIDEO_MIPI_DSI_H
23
24/****************************************************************************
25 * Included Files
26 ****************************************************************************/
27
28#include <nuttx/fs/ioctl.h>
29
30#include <stdbool.h>
31#include <stddef.h>
32
33/****************************************************************************
34 * Pre-processor Definitions
35 ****************************************************************************/
36
37/* Define cmd for dsi device */
38
39#define MIPIDSI_GETDEVLANES _MIPIDSIIOC(1)
40#define MIPIDSI_GETDEVFMT _MIPIDSIIOC(2)
41#define MIPIDSI_GETDEVMODE _MIPIDSIIOC(3)
42#define MIPIDSI_GETDEVHSRATE _MIPIDSIIOC(4)
43#define MIPIDSI_GETDEVLPRATE _MIPIDSIIOC(5)
44
45/* Define cmd for dsi host */
46
47#define MIPIDSI_TRANSFER _MIPIDSIIOC(6)
48
49/* Define msg flags */
50
51#define MIPI_DSI_MSG_REQ_ACK (1 << 0) /* Request ACK from peripheral */
52#define MIPI_DSI_MSG_USE_LPM (1 << 1) /* Use Low Power Mode to
53 * transmit message */
54#define MIPI_DSI_MSG_AFTER_FRAME (1 << 2) /* Transmit message after frame */
55
56/* Tearing Effect Output Line mode */
57
58#define MIPI_DSI_DCS_TEAR_MODE_VBLANK 0 /* The TE output line consists of
59 * V-Blanking information only */
60#define MIPI_DSI_DCS_TEAR_MODE_VHBLANK 1 /* The TE output line consists of
61 * both V-Blanking and H-Blanking
62 * information */
63
64/* Define pixel color format */
65
66#define MIPI_DSI_FMT_RGB888 0
67#define MIPI_DSI_FMT_RGB666 1
68#define MIPI_DSI_FMT_RGB666_PACKED 2
69#define MIPI_DSI_FMT_RGB565 3
70
71/* Indicates the status of register 0Ah */
72
73#define MIPI_DSI_DCS_POWER_MODE_DISPLAY (1 << 2)
74#define MIPI_DSI_DCS_POWER_MODE_NORMAL (1 << 3)
75#define MIPI_DSI_DCS_POWER_MODE_SLEEP (1 << 4)
76#define MIPI_DSI_DCS_POWER_MODE_PARTIAL (1 << 5)
77#define MIPI_DSI_DCS_POWER_MODE_IDLE (1 << 6)
78
79/* DSI mode flags define */
80
81#define MIPI_DSI_MODE_VIDEO (1 << 0) /* Video mode */
82#define MIPI_DSI_MODE_VIDEO_BURST (1 << 1) /* Video burst mode */
83#define MIPI_DSI_MODE_VIDEO_SYNC_PULSE (1 << 2) /* Video pulse mode */
84#define MIPI_DSI_MODE_VIDEO_AUTO_VERT (1 << 3) /* Enable auto vertical
85 * count mode */
86#define MIPI_DSI_MODE_VIDEO_HSE (1 << 4) /* Enable hsync-end packets
87 * in vsync-pulse and
88 * v-porch area */
89#define MIPI_DSI_MODE_VIDEO_NO_HFP (1 << 5) /* Disable hfront-porch area */
90#define MIPI_DSI_MODE_VIDEO_NO_HBP (1 << 6) /* Disable hback-porch area */
91#define MIPI_DSI_MODE_VIDEO_NO_HSA (1 << 7) /* Disable hsync-active area */
92#define MIPI_DSI_MODE_VSYNC_FLUSH (1 << 8) /* Flush display FIFO on vsync
93 * pulse */
94#define MIPI_DSI_MODE_NO_EOT_PACKET (1 << 9) /* Disable EoT packets in HS
95 * mode */
96#define MIPI_DSI_CLOCK_NON_CONTINUOUS (1 << 10) /* Device supports
97 * non-continuous clock
98 * behavior (DSI spec 5.6.1) */
99#define MIPI_DSI_MODE_LPM (1 << 11) /* Transmit data in low
100 * power */
101#define MIPI_DSI_MODE_AFTER_FRAME (1 << 12) /* Transmit data after frame
102 * transfer done */
103#define MIPI_DSI_HS_PKT_END_ALIGNED (1 << 13) /* Transmit data ending at
104 * the same time for all
105 * lanes within one hsync */
106
107/****************************************************************************
108 * Public Types
109 ****************************************************************************/
110
111struct mipi_dsi_host;
112struct mipi_dsi_device;
113
114/* Read/write DSI buffer */
115
117{
118 uint8_t channel; /* Virtual channel id */
119 uint8_t type; /* Payload data type */
120 uint8_t flags; /* Flags controlling this message transmission */
121
122 size_t tx_len; /* Length of tx_buf */
123 FAR const void *tx_buf; /* Data to be written */
124
125 size_t rx_len; /* Lenght of rx_buf */
126 FAR void *rx_buf; /* Data to be read, or NULL */
127};
128
129/* Represents a MIPI DSI packet in protocol format */
130
131struct mipi_dsi_packet
132{
133 size_t size; /* Size (in bytes) of the packet */
134 uint8_t header[4]; /* The four bytes that make up the header
135 * (Data ID, Word Count or Packet Data,
136 * and ECC) */
137 size_t payload_length; /* Number of bytes in the payload */
138 FAR const uint8_t *payload; /* A pointer to a buffer containing
139 * the payload */
140};
141
142/* DSI bus operations
143 *
144 * DSI packets transmitted by .transfer() are passed in as mipi_dsi_msg
145 * structures. This structure contains information about the type of packet
146 * being transmitted as well as the transmit and receive buffers. When an
147 * error is encountered during transmission, this function will return a
148 * negative error code. On success it shall return the number of bytes
149 * transmitted for write packets or the number of bytes received for read
150 * packets.
151 *
152 * Note that typically DSI packet transmission is atomic, so the .transfer()
153 * function will seldomly return anything other than the number of bytes
154 * contained in the transmit buffer on success.
155 *
156 * Also note that those callbacks can be called no matter the state the
157 * host is in. Drivers that need the underlying device to be powered to
158 * perform these operations will first need to make sure it's been
159 * properly enabled.
160 */
161
163{
164 /* Attach DSI device to DSI host */
165
166 CODE int (*attach)(FAR struct mipi_dsi_host *host,
167 FAR struct mipi_dsi_device *device);
168
169 /* Detach DSI device from DSI host */
170
171 CODE int (*detach)(FAR struct mipi_dsi_host *host,
172 FAR struct mipi_dsi_device *device);
173
174 /* Transmit a DSI packet */
176 CODE ssize_t (*transfer)(FAR struct mipi_dsi_host *host,
177 FAR const struct mipi_dsi_msg *msg);
178};
179
180/* Dsi host structure */
181
182struct mipi_dsi_host
183{
184 int bus;
185 FAR const struct mipi_dsi_host_ops *ops;
186};
187
188/* Dsi peripheral device structure panel dsi device */
189
190struct mipi_dsi_device
191{
192 FAR struct mipi_dsi_host *host; /* DSI host for this peripheral,
193 * almost on the panel */
194 char name[32]; /* DSI peripheral chip type */
195 uint16_t channel; /* Vitural channel assigned to this */
196 uint16_t lanes; /* Number of active data lanes */
197 uint8_t format; /* Pixel formal */
198 uint32_t mode_flags; /* Dsi operate mode flag */
199 uint32_t hs_rate; /* Maximum lane frequency for high speed
200 * mode in hertz, this shoud be set
201 * to the real limits of the hardware. */
202 uint32_t lp_rate; /* Maximum lane frequency for low power
203 * mode in hertz, this shoud be set
204 * to the real limits of the hardware. */
205};
206
207/****************************************************************************
208 * Public Functions Definitions
209 ****************************************************************************/
210
211#ifdef __cplusplus
212#define EXTERN extern "C"
213extern "C"
214{
215#else
216#define EXTERN extern
217#endif
218
219/****************************************************************************
220 * Name: mipi_dsi_packet_format_is_short
221 *
222 * Description:
223 * Check if a packet is of the short format
224 *
225 * Input Parameters:
226 * type - MIPI DSI data type of the packet
227 *
228 * Returned Value:
229 * True if the packet for the given data type is a short packet, false
230 * otherwise.
231 *
232 ****************************************************************************/
233
234bool mipi_dsi_packet_format_is_short(uint8_t type);
235
236/****************************************************************************
237 * Name: mipi_dsi_packet_format_is_long
238 *
239 * Description:
240 * Check if a packet is of the long format
241 *
242 * Input Parameters:
243 * type - MIPI DSI data type of the packet
244 *
245 * Returned Value:
246 * True if the packet for the given data type is a long packet, false
247 * otherwise.
248 *
249 ****************************************************************************/
250
251bool mipi_dsi_packet_format_is_long(uint8_t type);
252
253/****************************************************************************
254 * Name: mipi_dsi_create_packet
255 *
256 * Description:
257 * Create a packet from a message according to the DSI protocol
258 *
259 * Input Parameters:
260 * packet - Pointer to a DSI packet structure
261 * msg - Message to translate into a packet
262 *
263 * Returned Value:
264 * Return: 0 on success or a negative error code on failure.
265 *
266 ****************************************************************************/
267
268int mipi_dsi_create_packet(FAR struct mipi_dsi_packet *packet,
269 FAR const struct mipi_dsi_msg *msg);
270
271/****************************************************************************
272 * Name: mipi_dsi_host_register
273 *
274 * Description:
275 * Register mipi dsi host, if defined CONFIG_MIPI_DSI_DRIVER, will create
276 * character device at /dev.
277 *
278 * Input Parameters:
279 * host - An instance of the dsi host
280 *
281 * Returned Value:
282 * OK if the driver was successfully register; A negated errno value is
283 * returned on any failure.
284 *
285 ****************************************************************************/
286
287int mipi_dsi_host_register(FAR struct mipi_dsi_host *host);
288
289/****************************************************************************
290 * Name: mipi_dsi_host_get
291 *
292 * Description:
293 * Find host in list by bus number. Lcd driver can get host by this
294 * interface to register dsi device.
295 *
296 * Input Parameters:
297 * bus - The dsi host bus number.
298 *
299 * Returned Value:
300 * struct mipi_dsi_host pointer if the host was successfully registered;
301 * NULL pointer is returned on any failure.
302 *
303 ****************************************************************************/
304
305FAR struct mipi_dsi_host *mipi_dsi_host_get(int bus);
306
307/****************************************************************************
308 * Name: mipi_dsi_pixel_format_to_bpp
309 *
310 * Description:
311 * Obtain the number of bits per pixel for any given pixel format defined
312 * by the MIPI DSI specification
313 *
314 * Input Parameters:
315 * fmt - MIPI DSI pixel format
316 *
317 * Returned Value:
318 * The number of bits per pixel of the given pixel format.
319 *
320 ****************************************************************************/
321
322int mipi_dsi_pixel_format_to_bpp(uint8_t fmt);
323
324/****************************************************************************
325 * Name: mipi_dsi_device_register_full
326 *
327 * Description:
328 * Register mipi dsi device, if defined CONFIG_MIPI_DSI_DRIVER, will create
329 * character device at /dev/dsiN/dev-xxx.
330 *
331 * Input Parameters:
332 * host - An instance of the dsi host
333 * name - The name of the dsi device
334 * channel - The channel used by dsi device
335 *
336 * Returned Value:
337 * struct mipi_dsi_device* if the driver was successfully register; NULL is
338 * returned on any failure.
339 *
340 ****************************************************************************/
341
342FAR struct mipi_dsi_device *
343mipi_dsi_device_register(FAR struct mipi_dsi_host *host,
344 FAR const char *name, int channel);
345
346/****************************************************************************
347 * Name: mipi_dsi_attach
348 *
349 * Description:
350 * Attach a DSI device to its DSI host
351 *
352 * Input Parameters:
353 * device - DSI peripheral
354 *
355 * Returned Value:
356 * OK on success or a negative error code on failure.
357 *
358 ****************************************************************************/
359
360int mipi_dsi_attach(FAR struct mipi_dsi_device *device);
361
362/****************************************************************************
363 * Name: mipi_dsi_detach
364 *
365 * Description:
366 * Detach a DSI device from its DSI host
367 *
368 * Input Parameters:
369 * device - DSI peripheral device
370 *
371 * Returned Value:
372 * OK on success or a negative error code on failure.
373 *
374 ****************************************************************************/
375
376int mipi_dsi_detach(FAR struct mipi_dsi_device *device);
377
378/****************************************************************************
379 * Name: mipi_dsi_transfer
380 *
381 * Description:
382 * Transfer message to display modules
383 *
384 * Input Parameters:
385 * device - DSI peripheral
386 * msg - Message to transfer
387 *
388 * Returned Value:
389 * The number of bytes successfully transfered or a negative error code on
390 * failure.
391 *
392 ****************************************************************************/
393
394ssize_t mipi_dsi_transfer(FAR struct mipi_dsi_device *device,
395 FAR struct mipi_dsi_msg *msg);
396
397/****************************************************************************
398 * Name: mipi_dsi_shutdown_peripheral
399 *
400 * Description:
401 * Send a Shutdown Peripheral command to the dsi device
402 *
403 * Input Parameters:
404 * device - DSI peripheral device
405 *
406 * Returned Value:
407 * OK on success or a negative error code on failure.
408 *
409 ****************************************************************************/
410
411int mipi_dsi_shutdown_peripheral(FAR struct mipi_dsi_device *device);
412
413/****************************************************************************
414 * Name: mipi_dsi_turn_on_peripheral
415 *
416 * Description:
417 * Send a Turn On Peripheral command to the dsi device
418 *
419 * Input Parameters:
420 * device - DSI peripheral device
421 *
422 * Returned Value:
423 * OK on success or a negative error code on failure.
424 *
425 ****************************************************************************/
426
427int mipi_dsi_turn_on_peripheral(FAR struct mipi_dsi_device *device);
428
429/****************************************************************************
430 * Name: mipi_dsi_set_maximum_return_packet_size
431 *
432 * Description:
433 * Specify the maximum size of the payload in a long packet transmitted
434 * from the peripheral back to the device host processor
435 *
436 * Input Parameters:
437 * device - DSI peripheral device
438 * value - The maximum size of the payload
439 *
440 * Returned Value:
441 * OK on success or a negative error code on failure.
442 *
443 ****************************************************************************/
444
445int mipi_dsi_set_maximum_return_packet_size(
446 FAR struct mipi_dsi_device *device, uint16_t value);
447
448/****************************************************************************
449 * Name: mipi_dsi_compression_mode
450 *
451 * Description:
452 * Enable / disable DSC on the peripheral. Enable or disable Display Stream
453 * Compression on the peripheral using the default Picture Parameter Set
454 * and VESA DSC 1.1 algorithm.
455 *
456 * Input Parameters:
457 * device - DSI peripheral device
458 * enable - Whether to enable or disable the DSC
459 *
460 * Returned Value:
461 * OK on success or a negative error code on failure.
462 *
463 ****************************************************************************/
464
465int mipi_dsi_compression_mode(FAR struct mipi_dsi_device *device,
466 bool enable);
467
468/****************************************************************************
469 * Name: mipi_dsi_generic_write
470 *
471 * Description:
472 * Transmit data using a generic write packet
473 *
474 * Input Parameters:
475 * device - DSI peripheral device
476 * payload - buffer containing the payload
477 * size - size of the payload
478 *
479 * Returned Value:
480 * OK on success or a negative error code on failure.
481 *
482 ****************************************************************************/
483
484int mipi_dsi_generic_write(FAR struct mipi_dsi_device *device,
485 FAR const void *payload, size_t size);
486
487/****************************************************************************
488 * Name: mipi_dsi_generic_read
489 *
490 * Description:
491 * Receive data using a generic read packet.
492 * This function will automatically choose the right data type depending on
493 * the number of parameters passed in.
494 *
495 * Input Parameters:
496 * device - DSI peripheral device
497 * params - buffer containing the request parameters
498 * num_params - number of request parameters
499 * data - buffer in which to return the received data
500 * size - size of receive buffer
501 *
502 * Returned Value:
503 * The number of bytes successfully read or a negative error code on
504 * failure.
505 *
506 ****************************************************************************/
507
508ssize_t mipi_dsi_generic_read(FAR struct mipi_dsi_device *device,
509 FAR const void *params, size_t num_params,
510 FAR void *data, size_t size);
511
512/****************************************************************************
513 * Name: mipi_dsi_dcs_write_buffer
514 *
515 * Description:
516 * Transmit a DCS command with payload.
517 * This function will automatically choose the right data type depending on
518 * the command payload length.
519 *
520 * Input Parameters:
521 * device - DSI peripheral device
522 * data - buffer containing data to be transmitted
523 * len - size of transmission buffer
524 *
525 * Returned Value:
526 * The number of bytes successfully transmitted or a negative error
527 * code on failure.
528 *
529 ****************************************************************************/
530
531ssize_t mipi_dsi_dcs_write_buffer(FAR struct mipi_dsi_device *device,
532 FAR const void *data, size_t len);
533
534/****************************************************************************
535 * Name: mipi_dsi_dcs_write
536 *
537 * Description:
538 * Send DCS write command.
539 * This function will automatically choose the right data type depending on
540 * the command payload length.
541 *
542 * Input Parameters:
543 * device - DSI peripheral device
544 * cmd - DCS command
545 * data - buffer containing the command payload
546 * len - command payload length
547 *
548 * Returned Value:
549 * The number of bytes successfully transmitted or a negative error
550 * code on failure.
551 *
552 ****************************************************************************/
553
554ssize_t mipi_dsi_dcs_write(FAR struct mipi_dsi_device *device, uint8_t cmd,
555 FAR const void *data, size_t len);
556
557/****************************************************************************
558 * Name: mipi_dsi_dcs_read
559 *
560 * Description:
561 * Send DCS read request command.
562 *
563 * Input Parameters:
564 * device - DSI peripheral device
565 * cmd - DCS command
566 * data - buffer in which to receive data
567 * len - size of receive buffer
568 *
569 * Returned Value:
570 * The number of bytes read or a negative error code on failure.
571 *
572 ****************************************************************************/
573
574ssize_t mipi_dsi_dcs_read(FAR struct mipi_dsi_device *device, uint8_t cmd,
575 FAR void *data, size_t len);
576
577/****************************************************************************
578 * Name: mipi_dsi_dcs_nop
579 *
580 * Description:
581 * Send DCS nop packet
582 *
583 * Input Parameters:
584 * device - DSI peripheral device
585 *
586 * Returned Value:
587 * OK on success or a negative error code on failure.
588 *
589 ****************************************************************************/
590
591int mipi_dsi_dcs_nop(FAR struct mipi_dsi_device *device);
592
593/****************************************************************************
594 * Name: mipi_dsi_dcs_soft_reset
595 *
596 * Description:
597 * Send a software reset of the display module
598 *
599 * Input Parameters:
600 * device - DSI peripheral device
601 *
602 * Returned Value:
603 * OK on success or a negative error code on failure.
604 *
605 ****************************************************************************/
606
607int mipi_dsi_dcs_soft_reset(FAR struct mipi_dsi_device *device);
608
609/****************************************************************************
610 * Name: mipi_dsi_dcs_get_power_mode
611 *
612 * Description:
613 * Query the display module's current power mode
614 *
615 * Input Parameters:
616 * device - DSI peripheral device
617 * mode - return location of the current power mode
618 *
619 * Returned Value:
620 * OK on success or a negative error code on failure.
621 *
622 ****************************************************************************/
623
624int mipi_dsi_dcs_get_power_mode(FAR struct mipi_dsi_device *device,
625 FAR uint8_t *mode);
626
627/****************************************************************************
628 * Name: mipi_dsi_dcs_get_pixel_format
629 *
630 * Description:
631 * Gets the pixel format for the RGB image data used by the display module.
632 *
633 * Input Parameters:
634 * device - DSI peripheral device
635 * format - return location of the pixel format
636 *
637 * Returned Value:
638 * OK on success or a negative error code on failure.
639 *
640 ****************************************************************************/
641
642int mipi_dsi_dcs_get_pixel_format(FAR struct mipi_dsi_device *device,
643 FAR uint8_t *format);
644
645/****************************************************************************
646 * Name: mipi_dsi_dcs_enter_sleep_mode
647 *
648 * Description:
649 * Send a Enter Sleep Mode command to display module.
650 *
651 * Input Parameters:
652 * device - DSI peripheral device
653 *
654 * Returned Value:
655 * OK on success or a negative error code on failure.
656 *
657 ****************************************************************************/
658
659int mipi_dsi_dcs_enter_sleep_mode(FAR struct mipi_dsi_device *device);
660
661/****************************************************************************
662 * Name: mipi_dsi_dcs_exit_sleep_mode
663 *
664 * Description:
665 * Send a Exit Sleep Mode command to display module.
666 *
667 * Input Parameters:
668 * device - DSI peripheral device
669 *
670 * Returned Value:
671 * OK on success or a negative error code on failure.
672 *
673 ****************************************************************************/
674
675int mipi_dsi_dcs_exit_sleep_mode(FAR struct mipi_dsi_device *device);
676
677/****************************************************************************
678 * Name: mipi_dsi_dcs_set_display_off
679 *
680 * Description:
681 * Send a Display OFF command to display module. Stop displaying the image
682 * data on the display device.
683 *
684 * Input Parameters:
685 * device - DSI peripheral device
686 *
687 * Returned Value:
688 * OK on success or a negative error code on failure.
689 *
690 ****************************************************************************/
691
692int mipi_dsi_dcs_set_display_off(FAR struct mipi_dsi_device *device);
693
694/****************************************************************************
695 * Name: mipi_dsi_dcs_set_display_on
696 *
697 * Description:
698 * Send a Display On command to display module. Start displaying the image
699 * data on the display device.
700 *
701 * Input Parameters:
702 * device - DSI peripheral device
703 *
704 * Returned Value:
705 * OK on success or a negative error code on failure.
706 *
707 ****************************************************************************/
708
709int mipi_dsi_dcs_set_display_on(FAR struct mipi_dsi_device *device);
710
711/****************************************************************************
712 * Name: mipi_dsi_dcs_set_column_address
713 *
714 * Description:
715 * Define the column extent of the frame memory accessed by the host
716 * processor
717 *
718 * Input Parameters:
719 * device - DSI peripheral device
720 * start - first column address of frame memory
721 * end - last column address of frame memory
722 *
723 * Returned Value:
724 * OK on success or a negative error code on failure.
725 *
726 ****************************************************************************/
727
728int mipi_dsi_dcs_set_column_address(FAR struct mipi_dsi_device *device,
729 uint16_t start, uint16_t end);
730
731/****************************************************************************
732 * Name: mipi_dsi_dcs_set_page_address
733 *
734 * Description:
735 * Define the page extent of the frame memory accessed by the host
736 * processor
737 *
738 * Input Parameters:
739 * device - DSI peripheral device
740 * start - first page address of frame memory
741 * end - last page address of frame memory
742 *
743 * Returned Value:
744 * OK on success or a negative error code on failure.
745 *
746 ****************************************************************************/
747
748int mipi_dsi_dcs_set_page_address(FAR struct mipi_dsi_device *device,
749 uint16_t start, uint16_t end);
750
751/****************************************************************************
752 * Name: mipi_dsi_dcs_set_tear_off
753 *
754 * Description:
755 * Turn off the display module's Tearing Effect output signal on the TE
756 * signal line
757 *
758 * Input Parameters:
759 * device - DSI peripheral device
760 *
761 * Returned Value:
762 * OK on success or a negative error code on failure.
763 *
764 ****************************************************************************/
765
766int mipi_dsi_dcs_set_tear_off(FAR struct mipi_dsi_device *device);
767
768/****************************************************************************
769 * Name: mipi_dsi_dcs_set_tear_on
770 *
771 * Description:
772 * Turn on the display module's Tearing Effect output signal on the TE
773 * signal line.
774 *
775 * Input Parameters:
776 * device - DSI peripheral device
777 * mode - Tearing Mode, MIPI_DSI_DCS_TEAR_MODE_VBLANK or
778 * MIPI_DSI_DCS_TEAR_MODE_VHBLANK
779 *
780 * Returned Value:
781 * OK on success or a negative error code on failure.
782 *
783 ****************************************************************************/
784
785int mipi_dsi_dcs_set_tear_on(FAR struct mipi_dsi_device *device,
786 uint8_t mode);
787
788/****************************************************************************
789 * Name: mipi_dsi_dcs_set_pixel_format
790 *
791 * Description:
792 * Sets the pixel format for the RGB image data used by the display module.
793 *
794 * Input Parameters:
795 * device - DSI peripheral device
796 * format - pixel format
797 *
798 * Returned Value:
799 * OK on success or a negative error code on failure.
800 *
801 ****************************************************************************/
802
803int mipi_dsi_dcs_set_pixel_format(FAR struct mipi_dsi_device *device,
804 uint8_t format);
805
806/****************************************************************************
807 * Name: mipi_dsi_dcs_set_tear_scanline
808 *
809 * Description:
810 * Set the scanline to use as trigger for the Tearing Effect output signal
811 * of the display module.
812 *
813 * Input Parameters:
814 * device - DSI peripheral device
815 * scanline - scanline to use as trigger
816 *
817 * Returned Value:
818 * OK on success or a negative error code on failure.
819 *
820 ****************************************************************************/
821
822int mipi_dsi_dcs_set_tear_scanline(FAR struct mipi_dsi_device *device,
823 uint16_t scanline);
824
825/****************************************************************************
826 * Name: mipi_dsi_dcs_set_display_brightness
827 *
828 * Description:
829 * Sets the brightness value of the display.
830 *
831 * Input Parameters:
832 * device - DSI peripheral device
833 * brightness - brightness value
834 *
835 * Returned Value:
836 * OK on success or a negative error code on failure.
837 *
838 ****************************************************************************/
839
840int mipi_dsi_dcs_set_display_brightness(FAR struct mipi_dsi_device *device,
841 uint16_t brightness);
842
843/****************************************************************************
844 * Name: mipi_dsi_dcs_get_display_brightness
845 *
846 * Description:
847 * Gets the current brightness value of the display.
848 *
849 * Input Parameters:
850 * device - DSI peripheral device
851 * brightness - brightness value
852 *
853 * Returned Value:
854 * OK on success or a negative error code on failure.
855 *
856 ****************************************************************************/
857
858int mipi_dsi_dcs_get_display_brightness(FAR struct mipi_dsi_device *device,
859 FAR uint16_t *brightness);
860
861#undef EXTERN
862#ifdef __cplusplus
863}
864#endif
865#endif /* __INCLUDE_NUTTX_VIDEO_MIPI_DSI_H */
Definition: mipi_dsi.h:176
Definition: mipi_dsi.h:148
Definition: mipi_dsi.h:168
Definition: mipi_dsi.h:102
Definition: mipi_dsi.h:117