2 ******************************************************************************
3 * @file stm32f4xx_hal_dsi.h
4 * @author MCD Application Team
7 * @brief Header file of DSI HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32F4xx_HAL_DSI_H
40 #define __STM32F4xx_HAL_DSI_H
46 #if defined(STM32F469xx) || defined(STM32F479xx)
47 /* Includes ------------------------------------------------------------------*/
48 #include "stm32f4xx_hal_def.h"
50 /** @addtogroup STM32F4xx_HAL_Driver
55 * @brief DSI HAL module driver
59 /* Exported types ------------------------------------------------------------*/
61 * @brief DSI Init Structure definition
65 uint32_t AutomaticClockLaneControl
; /*!< Automatic clock lane control
66 This parameter can be any value of @ref DSI_Automatic_Clk_Lane_Control */
68 uint32_t TXEscapeCkdiv
; /*!< TX Escape clock division
69 The values 0 and 1 stop the TX_ESC clock generation */
71 uint32_t NumberOfLanes
; /*!< Number of lanes
72 This parameter can be any value of @ref DSI_Number_Of_Lanes */
77 * @brief DSI PLL Clock structure definition
81 uint32_t PLLNDIV
; /*!< PLL Loop Division Factor
82 This parameter must be a value between 10 and 125 */
84 uint32_t PLLIDF
; /*!< PLL Input Division Factor
85 This parameter can be any value of @ref DSI_PLL_IDF */
87 uint32_t PLLODF
; /*!< PLL Output Division Factor
88 This parameter can be any value of @ref DSI_PLL_ODF */
93 * @brief DSI Video mode configuration
97 uint32_t VirtualChannelID
; /*!< Virtual channel ID */
99 uint32_t ColorCoding
; /*!< Color coding for LTDC interface
100 This parameter can be any value of @ref DSI_Color_Coding */
102 uint32_t LooselyPacked
; /*!< Enable or disable loosely packed stream (needed only when using
103 18-bit configuration).
104 This parameter can be any value of @ref DSI_LooselyPacked */
106 uint32_t Mode
; /*!< Video mode type
107 This parameter can be any value of @ref DSI_Video_Mode_Type */
109 uint32_t PacketSize
; /*!< Video packet size */
111 uint32_t NumberOfChunks
; /*!< Number of chunks */
113 uint32_t NullPacketSize
; /*!< Null packet size */
115 uint32_t HSPolarity
; /*!< HSYNC pin polarity
116 This parameter can be any value of @ref DSI_HSYNC_Polarity */
118 uint32_t VSPolarity
; /*!< VSYNC pin polarity
119 This parameter can be any value of @ref DSI_VSYNC_Active_Polarity */
121 uint32_t DEPolarity
; /*!< Data Enable pin polarity
122 This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
124 uint32_t HorizontalSyncActive
; /*!< Horizontal synchronism active duration (in lane byte clock cycles) */
126 uint32_t HorizontalBackPorch
; /*!< Horizontal back-porch duration (in lane byte clock cycles) */
128 uint32_t HorizontalLine
; /*!< Horizontal line duration (in lane byte clock cycles) */
130 uint32_t VerticalSyncActive
; /*!< Vertical synchronism active duration */
132 uint32_t VerticalBackPorch
; /*!< Vertical back-porch duration */
134 uint32_t VerticalFrontPorch
; /*!< Vertical front-porch duration */
136 uint32_t VerticalActive
; /*!< Vertical active duration */
138 uint32_t LPCommandEnable
; /*!< Low-power command enable
139 This parameter can be any value of @ref DSI_LP_Command */
141 uint32_t LPLargestPacketSize
; /*!< The size, in bytes, of the low power largest packet that
142 can fit in a line during VSA, VBP and VFP regions */
144 uint32_t LPVACTLargestPacketSize
; /*!< The size, in bytes, of the low power largest packet that
145 can fit in a line during VACT region */
147 uint32_t LPHorizontalFrontPorchEnable
; /*!< Low-power horizontal front-porch enable
148 This parameter can be any value of @ref DSI_LP_HFP */
150 uint32_t LPHorizontalBackPorchEnable
; /*!< Low-power horizontal back-porch enable
151 This parameter can be any value of @ref DSI_LP_HBP */
153 uint32_t LPVerticalActiveEnable
; /*!< Low-power vertical active enable
154 This parameter can be any value of @ref DSI_LP_VACT */
156 uint32_t LPVerticalFrontPorchEnable
; /*!< Low-power vertical front-porch enable
157 This parameter can be any value of @ref DSI_LP_VFP */
159 uint32_t LPVerticalBackPorchEnable
; /*!< Low-power vertical back-porch enable
160 This parameter can be any value of @ref DSI_LP_VBP */
162 uint32_t LPVerticalSyncActiveEnable
; /*!< Low-power vertical sync active enable
163 This parameter can be any value of @ref DSI_LP_VSYNC */
165 uint32_t FrameBTAAcknowledgeEnable
; /*!< Frame bus-turn-around acknowledge enable
166 This parameter can be any value of @ref DSI_FBTA_acknowledge */
171 * @brief DSI Adapted command mode configuration
175 uint32_t VirtualChannelID
; /*!< Virtual channel ID */
177 uint32_t ColorCoding
; /*!< Color coding for LTDC interface
178 This parameter can be any value of @ref DSI_Color_Coding */
180 uint32_t CommandSize
; /*!< Maximum allowed size for an LTDC write memory command, measured in
181 pixels. This parameter can be any value between 0x00 and 0xFFFFU */
183 uint32_t TearingEffectSource
; /*!< Tearing effect source
184 This parameter can be any value of @ref DSI_TearingEffectSource */
186 uint32_t TearingEffectPolarity
; /*!< Tearing effect pin polarity
187 This parameter can be any value of @ref DSI_TearingEffectPolarity */
189 uint32_t HSPolarity
; /*!< HSYNC pin polarity
190 This parameter can be any value of @ref DSI_HSYNC_Polarity */
192 uint32_t VSPolarity
; /*!< VSYNC pin polarity
193 This parameter can be any value of @ref DSI_VSYNC_Active_Polarity */
195 uint32_t DEPolarity
; /*!< Data Enable pin polarity
196 This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
198 uint32_t VSyncPol
; /*!< VSync edge on which the LTDC is halted
199 This parameter can be any value of @ref DSI_Vsync_Polarity */
201 uint32_t AutomaticRefresh
; /*!< Automatic refresh mode
202 This parameter can be any value of @ref DSI_AutomaticRefresh */
204 uint32_t TEAcknowledgeRequest
; /*!< Tearing Effect Acknowledge Request Enable
205 This parameter can be any value of @ref DSI_TE_AcknowledgeRequest */
210 * @brief DSI command transmission mode configuration
214 uint32_t LPGenShortWriteNoP
; /*!< Generic Short Write Zero parameters Transmission
215 This parameter can be any value of @ref DSI_LP_LPGenShortWriteNoP */
217 uint32_t LPGenShortWriteOneP
; /*!< Generic Short Write One parameter Transmission
218 This parameter can be any value of @ref DSI_LP_LPGenShortWriteOneP */
220 uint32_t LPGenShortWriteTwoP
; /*!< Generic Short Write Two parameters Transmission
221 This parameter can be any value of @ref DSI_LP_LPGenShortWriteTwoP */
223 uint32_t LPGenShortReadNoP
; /*!< Generic Short Read Zero parameters Transmission
224 This parameter can be any value of @ref DSI_LP_LPGenShortReadNoP */
226 uint32_t LPGenShortReadOneP
; /*!< Generic Short Read One parameter Transmission
227 This parameter can be any value of @ref DSI_LP_LPGenShortReadOneP */
229 uint32_t LPGenShortReadTwoP
; /*!< Generic Short Read Two parameters Transmission
230 This parameter can be any value of @ref DSI_LP_LPGenShortReadTwoP */
232 uint32_t LPGenLongWrite
; /*!< Generic Long Write Transmission
233 This parameter can be any value of @ref DSI_LP_LPGenLongWrite */
235 uint32_t LPDcsShortWriteNoP
; /*!< DCS Short Write Zero parameters Transmission
236 This parameter can be any value of @ref DSI_LP_LPDcsShortWriteNoP */
238 uint32_t LPDcsShortWriteOneP
; /*!< DCS Short Write One parameter Transmission
239 This parameter can be any value of @ref DSI_LP_LPDcsShortWriteOneP */
241 uint32_t LPDcsShortReadNoP
; /*!< DCS Short Read Zero parameters Transmission
242 This parameter can be any value of @ref DSI_LP_LPDcsShortReadNoP */
244 uint32_t LPDcsLongWrite
; /*!< DCS Long Write Transmission
245 This parameter can be any value of @ref DSI_LP_LPDcsLongWrite */
247 uint32_t LPMaxReadPacket
; /*!< Maximum Read Packet Size Transmission
248 This parameter can be any value of @ref DSI_LP_LPMaxReadPacket */
250 uint32_t AcknowledgeRequest
; /*!< Acknowledge Request Enable
251 This parameter can be any value of @ref DSI_AcknowledgeRequest */
256 * @brief DSI PHY Timings definition
260 uint32_t ClockLaneHS2LPTime
; /*!< The maximum time that the D-PHY clock lane takes to go from high-speed
261 to low-power transmission */
263 uint32_t ClockLaneLP2HSTime
; /*!< The maximum time that the D-PHY clock lane takes to go from low-power
264 to high-speed transmission */
266 uint32_t DataLaneHS2LPTime
; /*!< The maximum time that the D-PHY data lanes takes to go from high-speed
267 to low-power transmission */
269 uint32_t DataLaneLP2HSTime
; /*!< The maximum time that the D-PHY data lanes takes to go from low-power
270 to high-speed transmission */
272 uint32_t DataLaneMaxReadTime
; /*!< The maximum time required to perform a read command */
274 uint32_t StopWaitTime
; /*!< The minimum wait period to request a High-Speed transmission after the
277 }DSI_PHY_TimerTypeDef
;
280 * @brief DSI HOST Timeouts definition
284 uint32_t TimeoutCkdiv
; /*!< Time-out clock division */
286 uint32_t HighSpeedTransmissionTimeout
; /*!< High-speed transmission time-out */
288 uint32_t LowPowerReceptionTimeout
; /*!< Low-power reception time-out */
290 uint32_t HighSpeedReadTimeout
; /*!< High-speed read time-out */
292 uint32_t LowPowerReadTimeout
; /*!< Low-power read time-out */
294 uint32_t HighSpeedWriteTimeout
; /*!< High-speed write time-out */
296 uint32_t HighSpeedWritePrespMode
; /*!< High-speed write presp mode
297 This parameter can be any value of @ref DSI_HS_PrespMode */
299 uint32_t LowPowerWriteTimeout
; /*!< Low-speed write time-out */
301 uint32_t BTATimeout
; /*!< BTA time-out */
303 }DSI_HOST_TimeoutTypeDef
;
306 * @brief DSI States Structure definition
310 HAL_DSI_STATE_RESET
= 0x00U
,
311 HAL_DSI_STATE_READY
= 0x01U
,
312 HAL_DSI_STATE_ERROR
= 0x02U
,
313 HAL_DSI_STATE_BUSY
= 0x03U
,
314 HAL_DSI_STATE_TIMEOUT
= 0x04U
315 }HAL_DSI_StateTypeDef
;
318 * @brief DSI Handle Structure definition
322 DSI_TypeDef
*Instance
; /*!< Register base address */
323 DSI_InitTypeDef Init
; /*!< DSI required parameters */
324 HAL_LockTypeDef Lock
; /*!< DSI peripheral status */
325 __IO HAL_DSI_StateTypeDef State
; /*!< DSI communication state */
326 __IO
uint32_t ErrorCode
; /*!< DSI Error code */
327 uint32_t ErrorMsk
; /*!< DSI Error monitoring mask */
330 /* Exported constants --------------------------------------------------------*/
331 /** @defgroup DSI_DCS_Command DSI DCS Command
334 #define DSI_ENTER_IDLE_MODE 0x39U
335 #define DSI_ENTER_INVERT_MODE 0x21U
336 #define DSI_ENTER_NORMAL_MODE 0x13U
337 #define DSI_ENTER_PARTIAL_MODE 0x12U
338 #define DSI_ENTER_SLEEP_MODE 0x10U
339 #define DSI_EXIT_IDLE_MODE 0x38U
340 #define DSI_EXIT_INVERT_MODE 0x20U
341 #define DSI_EXIT_SLEEP_MODE 0x11U
342 #define DSI_GET_3D_CONTROL 0x3FU
343 #define DSI_GET_ADDRESS_MODE 0x0BU
344 #define DSI_GET_BLUE_CHANNEL 0x08U
345 #define DSI_GET_DIAGNOSTIC_RESULT 0x0FU
346 #define DSI_GET_DISPLAY_MODE 0x0DU
347 #define DSI_GET_GREEN_CHANNEL 0x07U
348 #define DSI_GET_PIXEL_FORMAT 0x0CU
349 #define DSI_GET_POWER_MODE 0x0AU
350 #define DSI_GET_RED_CHANNEL 0x06U
351 #define DSI_GET_SCANLINE 0x45U
352 #define DSI_GET_SIGNAL_MODE 0x0EU
353 #define DSI_NOP 0x00U
354 #define DSI_READ_DDB_CONTINUE 0xA8U
355 #define DSI_READ_DDB_START 0xA1U
356 #define DSI_READ_MEMORY_CONTINUE 0x3EU
357 #define DSI_READ_MEMORY_START 0x2EU
358 #define DSI_SET_3D_CONTROL 0x3DU
359 #define DSI_SET_ADDRESS_MODE 0x36U
360 #define DSI_SET_COLUMN_ADDRESS 0x2AU
361 #define DSI_SET_DISPLAY_OFF 0x28U
362 #define DSI_SET_DISPLAY_ON 0x29U
363 #define DSI_SET_GAMMA_CURVE 0x26U
364 #define DSI_SET_PAGE_ADDRESS 0x2BU
365 #define DSI_SET_PARTIAL_COLUMNS 0x31U
366 #define DSI_SET_PARTIAL_ROWS 0x30U
367 #define DSI_SET_PIXEL_FORMAT 0x3AU
368 #define DSI_SET_SCROLL_AREA 0x33U
369 #define DSI_SET_SCROLL_START 0x37U
370 #define DSI_SET_TEAR_OFF 0x34U
371 #define DSI_SET_TEAR_ON 0x35U
372 #define DSI_SET_TEAR_SCANLINE 0x44U
373 #define DSI_SET_VSYNC_TIMING 0x40U
374 #define DSI_SOFT_RESET 0x01U
375 #define DSI_WRITE_LUT 0x2DU
376 #define DSI_WRITE_MEMORY_CONTINUE 0x3CU
377 #define DSI_WRITE_MEMORY_START 0x2CU
382 /** @defgroup DSI_Video_Mode_Type DSI Video Mode Type
385 #define DSI_VID_MODE_NB_PULSES 0U
386 #define DSI_VID_MODE_NB_EVENTS 1U
387 #define DSI_VID_MODE_BURST 2U
392 /** @defgroup DSI_Color_Mode DSI Color Mode
395 #define DSI_COLOR_MODE_FULL 0x00000000U
396 #define DSI_COLOR_MODE_EIGHT DSI_WCR_COLM
401 /** @defgroup DSI_ShutDown DSI ShutDown
404 #define DSI_DISPLAY_ON 0x00000000U
405 #define DSI_DISPLAY_OFF DSI_WCR_SHTDN
410 /** @defgroup DSI_LP_Command DSI LP Command
413 #define DSI_LP_COMMAND_DISABLE 0x00000000U
414 #define DSI_LP_COMMAND_ENABLE DSI_VMCR_LPCE
419 /** @defgroup DSI_LP_HFP DSI LP HFP
422 #define DSI_LP_HFP_DISABLE 0x00000000U
423 #define DSI_LP_HFP_ENABLE DSI_VMCR_LPHFPE
428 /** @defgroup DSI_LP_HBP DSI LP HBP
431 #define DSI_LP_HBP_DISABLE 0x00000000U
432 #define DSI_LP_HBP_ENABLE DSI_VMCR_LPHBPE
437 /** @defgroup DSI_LP_VACT DSI LP VACT
440 #define DSI_LP_VACT_DISABLE 0x00000000U
441 #define DSI_LP_VACT_ENABLE DSI_VMCR_LPVAE
446 /** @defgroup DSI_LP_VFP DSI LP VFP
449 #define DSI_LP_VFP_DISABLE 0x00000000U
450 #define DSI_LP_VFP_ENABLE DSI_VMCR_LPVFPE
455 /** @defgroup DSI_LP_VBP DSI LP VBP
458 #define DSI_LP_VBP_DISABLE 0x00000000U
459 #define DSI_LP_VBP_ENABLE DSI_VMCR_LPVBPE
464 /** @defgroup DSI_LP_VSYNC DSI LP VSYNC
467 #define DSI_LP_VSYNC_DISABLE 0x00000000U
468 #define DSI_LP_VSYNC_ENABLE DSI_VMCR_LPVSAE
473 /** @defgroup DSI_FBTA_acknowledge DSI FBTA Acknowledge
476 #define DSI_FBTAA_DISABLE 0x00000000U
477 #define DSI_FBTAA_ENABLE DSI_VMCR_FBTAAE
482 /** @defgroup DSI_TearingEffectSource DSI Tearing Effect Source
485 #define DSI_TE_DSILINK 0x00000000U
486 #define DSI_TE_EXTERNAL DSI_WCFGR_TESRC
491 /** @defgroup DSI_TearingEffectPolarity DSI Tearing Effect Polarity
494 #define DSI_TE_RISING_EDGE 0x00000000U
495 #define DSI_TE_FALLING_EDGE DSI_WCFGR_TEPOL
500 /** @defgroup DSI_Vsync_Polarity DSI Vsync Polarity
503 #define DSI_VSYNC_FALLING 0x00000000U
504 #define DSI_VSYNC_RISING DSI_WCFGR_VSPOL
509 /** @defgroup DSI_AutomaticRefresh DSI Automatic Refresh
512 #define DSI_AR_DISABLE 0x00000000U
513 #define DSI_AR_ENABLE DSI_WCFGR_AR
518 /** @defgroup DSI_TE_AcknowledgeRequest DSI TE Acknowledge Request
521 #define DSI_TE_ACKNOWLEDGE_DISABLE 0x00000000U
522 #define DSI_TE_ACKNOWLEDGE_ENABLE DSI_CMCR_TEARE
527 /** @defgroup DSI_AcknowledgeRequest DSI Acknowledge Request
530 #define DSI_ACKNOWLEDGE_DISABLE 0x00000000U
531 #define DSI_ACKNOWLEDGE_ENABLE DSI_CMCR_ARE
536 /** @defgroup DSI_LP_LPGenShortWriteNoP DSI LP LPGen Short Write NoP
539 #define DSI_LP_GSW0P_DISABLE 0x00000000U
540 #define DSI_LP_GSW0P_ENABLE DSI_CMCR_GSW0TX
545 /** @defgroup DSI_LP_LPGenShortWriteOneP DSI LP LPGen Short Write OneP
548 #define DSI_LP_GSW1P_DISABLE 0x00000000U
549 #define DSI_LP_GSW1P_ENABLE DSI_CMCR_GSW1TX
554 /** @defgroup DSI_LP_LPGenShortWriteTwoP DSI LP LPGen Short Write TwoP
557 #define DSI_LP_GSW2P_DISABLE 0x00000000U
558 #define DSI_LP_GSW2P_ENABLE DSI_CMCR_GSW2TX
563 /** @defgroup DSI_LP_LPGenShortReadNoP DSI LP LPGen Short Read NoP
566 #define DSI_LP_GSR0P_DISABLE 0x00000000U
567 #define DSI_LP_GSR0P_ENABLE DSI_CMCR_GSR0TX
572 /** @defgroup DSI_LP_LPGenShortReadOneP DSI LP LPGen Short Read OneP
575 #define DSI_LP_GSR1P_DISABLE 0x00000000U
576 #define DSI_LP_GSR1P_ENABLE DSI_CMCR_GSR1TX
581 /** @defgroup DSI_LP_LPGenShortReadTwoP DSI LP LPGen Short Read TwoP
584 #define DSI_LP_GSR2P_DISABLE 0x00000000U
585 #define DSI_LP_GSR2P_ENABLE DSI_CMCR_GSR2TX
590 /** @defgroup DSI_LP_LPGenLongWrite DSI LP LPGen LongWrite
593 #define DSI_LP_GLW_DISABLE 0x00000000U
594 #define DSI_LP_GLW_ENABLE DSI_CMCR_GLWTX
599 /** @defgroup DSI_LP_LPDcsShortWriteNoP DSI LP LPDcs Short Write NoP
602 #define DSI_LP_DSW0P_DISABLE 0x00000000U
603 #define DSI_LP_DSW0P_ENABLE DSI_CMCR_DSW0TX
608 /** @defgroup DSI_LP_LPDcsShortWriteOneP DSI LP LPDcs Short Write OneP
611 #define DSI_LP_DSW1P_DISABLE 0x00000000U
612 #define DSI_LP_DSW1P_ENABLE DSI_CMCR_DSW1TX
617 /** @defgroup DSI_LP_LPDcsShortReadNoP DSI LP LPDcs Short Read NoP
620 #define DSI_LP_DSR0P_DISABLE 0x00000000U
621 #define DSI_LP_DSR0P_ENABLE DSI_CMCR_DSR0TX
626 /** @defgroup DSI_LP_LPDcsLongWrite DSI LP LPDcs Long Write
629 #define DSI_LP_DLW_DISABLE 0x00000000U
630 #define DSI_LP_DLW_ENABLE DSI_CMCR_DLWTX
635 /** @defgroup DSI_LP_LPMaxReadPacket DSI LP LPMax Read Packet
638 #define DSI_LP_MRDP_DISABLE 0x00000000U
639 #define DSI_LP_MRDP_ENABLE DSI_CMCR_MRDPS
644 /** @defgroup DSI_HS_PrespMode DSI HS Presp Mode
647 #define DSI_HS_PM_DISABLE 0x00000000U
648 #define DSI_HS_PM_ENABLE DSI_TCCR3_PM
654 /** @defgroup DSI_Automatic_Clk_Lane_Control DSI Automatic Clk Lane Control
657 #define DSI_AUTO_CLK_LANE_CTRL_DISABLE 0x00000000U
658 #define DSI_AUTO_CLK_LANE_CTRL_ENABLE DSI_CLCR_ACR
663 /** @defgroup DSI_Number_Of_Lanes DSI Number Of Lanes
666 #define DSI_ONE_DATA_LANE 0U
667 #define DSI_TWO_DATA_LANES 1U
672 /** @defgroup DSI_FlowControl DSI Flow Control
675 #define DSI_FLOW_CONTROL_CRC_RX DSI_PCR_CRCRXE
676 #define DSI_FLOW_CONTROL_ECC_RX DSI_PCR_ECCRXE
677 #define DSI_FLOW_CONTROL_BTA DSI_PCR_BTAE
678 #define DSI_FLOW_CONTROL_EOTP_RX DSI_PCR_ETRXE
679 #define DSI_FLOW_CONTROL_EOTP_TX DSI_PCR_ETTXE
680 #define DSI_FLOW_CONTROL_ALL (DSI_FLOW_CONTROL_CRC_RX | DSI_FLOW_CONTROL_ECC_RX | \
681 DSI_FLOW_CONTROL_BTA | DSI_FLOW_CONTROL_EOTP_RX | \
682 DSI_FLOW_CONTROL_EOTP_TX)
687 /** @defgroup DSI_Color_Coding DSI Color Coding
690 #define DSI_RGB565 0x00000000U /*!< The values 0x00000001 and 0x00000002 can also be used for the RGB565 color mode configuration */
691 #define DSI_RGB666 0x00000003U /*!< The value 0x00000004 can also be used for the RGB666 color mode configuration */
692 #define DSI_RGB888 0x00000005U
697 /** @defgroup DSI_LooselyPacked DSI Loosely Packed
700 #define DSI_LOOSELY_PACKED_ENABLE DSI_LCOLCR_LPE
701 #define DSI_LOOSELY_PACKED_DISABLE 0x00000000U
706 /** @defgroup DSI_HSYNC_Polarity DSI HSYNC Polarity
709 #define DSI_HSYNC_ACTIVE_HIGH 0x00000000U
710 #define DSI_HSYNC_ACTIVE_LOW DSI_LPCR_HSP
715 /** @defgroup DSI_VSYNC_Active_Polarity DSI VSYNC Active Polarity
718 #define DSI_VSYNC_ACTIVE_HIGH 0x00000000U
719 #define DSI_VSYNC_ACTIVE_LOW DSI_LPCR_VSP
724 /** @defgroup DSI_DATA_ENABLE_Polarity DSI DATA ENABLE Polarity
727 #define DSI_DATA_ENABLE_ACTIVE_HIGH 0x00000000U
728 #define DSI_DATA_ENABLE_ACTIVE_LOW DSI_LPCR_DEP
733 /** @defgroup DSI_PLL_IDF DSI PLL IDF
736 #define DSI_PLL_IN_DIV1 0x00000001U
737 #define DSI_PLL_IN_DIV2 0x00000002U
738 #define DSI_PLL_IN_DIV3 0x00000003U
739 #define DSI_PLL_IN_DIV4 0x00000004U
740 #define DSI_PLL_IN_DIV5 0x00000005U
741 #define DSI_PLL_IN_DIV6 0x00000006U
742 #define DSI_PLL_IN_DIV7 0x00000007U
747 /** @defgroup DSI_PLL_ODF DSI PLL ODF
750 #define DSI_PLL_OUT_DIV1 0x00000000U
751 #define DSI_PLL_OUT_DIV2 0x00000001U
752 #define DSI_PLL_OUT_DIV4 0x00000002U
753 #define DSI_PLL_OUT_DIV8 0x00000003U
758 /** @defgroup DSI_Flags DSI Flags
761 #define DSI_FLAG_TE DSI_WISR_TEIF
762 #define DSI_FLAG_ER DSI_WISR_ERIF
763 #define DSI_FLAG_BUSY DSI_WISR_BUSY
764 #define DSI_FLAG_PLLLS DSI_WISR_PLLLS
765 #define DSI_FLAG_PLLL DSI_WISR_PLLLIF
766 #define DSI_FLAG_PLLU DSI_WISR_PLLUIF
767 #define DSI_FLAG_RRS DSI_WISR_RRS
768 #define DSI_FLAG_RR DSI_WISR_RRIF
773 /** @defgroup DSI_Interrupts DSI Interrupts
776 #define DSI_IT_TE DSI_WIER_TEIE
777 #define DSI_IT_ER DSI_WIER_ERIE
778 #define DSI_IT_PLLL DSI_WIER_PLLLIE
779 #define DSI_IT_PLLU DSI_WIER_PLLUIE
780 #define DSI_IT_RR DSI_WIER_RRIE
785 /** @defgroup DSI_SHORT_WRITE_PKT_Data_Type DSI SHORT WRITE PKT Data Type
788 #define DSI_DCS_SHORT_PKT_WRITE_P0 0x00000005U /*!< DCS short write, no parameters */
789 #define DSI_DCS_SHORT_PKT_WRITE_P1 0x00000015U /*!< DCS short write, one parameter */
790 #define DSI_GEN_SHORT_PKT_WRITE_P0 0x00000003U /*!< Generic short write, no parameters */
791 #define DSI_GEN_SHORT_PKT_WRITE_P1 0x00000013U /*!< Generic short write, one parameter */
792 #define DSI_GEN_SHORT_PKT_WRITE_P2 0x00000023U /*!< Generic short write, two parameters */
797 /** @defgroup DSI_LONG_WRITE_PKT_Data_Type DSI LONG WRITE PKT Data Type
800 #define DSI_DCS_LONG_PKT_WRITE 0x00000039U /*!< DCS long write */
801 #define DSI_GEN_LONG_PKT_WRITE 0x00000029U /*!< Generic long write */
806 /** @defgroup DSI_SHORT_READ_PKT_Data_Type DSI SHORT READ PKT Data Type
809 #define DSI_DCS_SHORT_PKT_READ 0x00000006U /*!< DCS short read */
810 #define DSI_GEN_SHORT_PKT_READ_P0 0x00000004U /*!< Generic short read, no parameters */
811 #define DSI_GEN_SHORT_PKT_READ_P1 0x00000014U /*!< Generic short read, one parameter */
812 #define DSI_GEN_SHORT_PKT_READ_P2 0x00000024U /*!< Generic short read, two parameters */
817 /** @defgroup DSI_Error_Data_Type DSI Error Data Type
820 #define HAL_DSI_ERROR_NONE 0U
821 #define HAL_DSI_ERROR_ACK 0x00000001U /*!< acknowledge errors */
822 #define HAL_DSI_ERROR_PHY 0x00000002U /*!< PHY related errors */
823 #define HAL_DSI_ERROR_TX 0x00000004U /*!< transmission error */
824 #define HAL_DSI_ERROR_RX 0x00000008U /*!< reception error */
825 #define HAL_DSI_ERROR_ECC 0x00000010U /*!< ECC errors */
826 #define HAL_DSI_ERROR_CRC 0x00000020U /*!< CRC error */
827 #define HAL_DSI_ERROR_PSE 0x00000040U /*!< Packet Size error */
828 #define HAL_DSI_ERROR_EOT 0x00000080U /*!< End Of Transmission error */
829 #define HAL_DSI_ERROR_OVF 0x00000100U /*!< FIFO overflow error */
830 #define HAL_DSI_ERROR_GEN 0x00000200U /*!< Generic FIFO related errors */
835 /** @defgroup DSI_Lane_Group DSI Lane Group
838 #define DSI_CLOCK_LANE 0x00000000U
839 #define DSI_DATA_LANES 0x00000001U
844 /** @defgroup DSI_Communication_Delay DSI Communication Delay
847 #define DSI_SLEW_RATE_HSTX 0x00000000U
848 #define DSI_SLEW_RATE_LPTX 0x00000001U
849 #define DSI_HS_DELAY 0x00000002U
854 /** @defgroup DSI_CustomLane DSI CustomLane
857 #define DSI_SWAP_LANE_PINS 0x00000000U
858 #define DSI_INVERT_HS_SIGNAL 0x00000001U
863 /** @defgroup DSI_Lane_Select DSI Lane Select
866 #define DSI_CLOCK_LANE 0x00000000U
867 #define DSI_DATA_LANE0 0x00000001U
868 #define DSI_DATA_LANE1 0x00000002U
873 /** @defgroup DSI_PHY_Timing DSI PHY Timing
876 #define DSI_TCLK_POST 0x00000000U
877 #define DSI_TLPX_CLK 0x00000001U
878 #define DSI_THS_EXIT 0x00000002U
879 #define DSI_TLPX_DATA 0x00000003U
880 #define DSI_THS_ZERO 0x00000004U
881 #define DSI_THS_TRAIL 0x00000005U
882 #define DSI_THS_PREPARE 0x00000006U
883 #define DSI_TCLK_ZERO 0x00000007U
884 #define DSI_TCLK_PREPARE 0x00000008U
889 /* Exported macros -----------------------------------------------------------*/
891 * @brief Enables the DSI host.
892 * @param __HANDLE__: DSI handle
895 #define __HAL_DSI_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CR |= DSI_CR_EN)
898 * @brief Disables the DSI host.
899 * @param __HANDLE__: DSI handle
902 #define __HAL_DSI_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CR &= ~DSI_CR_EN)
905 * @brief Enables the DSI wrapper.
906 * @param __HANDLE__: DSI handle
909 #define __HAL_DSI_WRAPPER_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->WCR |= DSI_WCR_DSIEN)
912 * @brief Disable the DSI wrapper.
913 * @param __HANDLE__: DSI handle
916 #define __HAL_DSI_WRAPPER_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->WCR &= ~DSI_WCR_DSIEN)
919 * @brief Enables the DSI PLL.
920 * @param __HANDLE__: DSI handle
923 #define __HAL_DSI_PLL_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->WRPCR |= DSI_WRPCR_PLLEN)
926 * @brief Disables the DSI PLL.
927 * @param __HANDLE__: DSI handle
930 #define __HAL_DSI_PLL_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->WRPCR &= ~DSI_WRPCR_PLLEN)
933 * @brief Enables the DSI regulator.
934 * @param __HANDLE__: DSI handle
937 #define __HAL_DSI_REG_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->WRPCR |= DSI_WRPCR_REGEN)
940 * @brief Disables the DSI regulator.
941 * @param __HANDLE__: DSI handle
944 #define __HAL_DSI_REG_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->WRPCR &= ~DSI_WRPCR_REGEN)
947 * @brief Get the DSI pending flags.
948 * @param __HANDLE__: DSI handle.
949 * @param __FLAG__: Get the specified flag.
950 * This parameter can be any combination of the following values:
951 * @arg DSI_FLAG_TE : Tearing Effect Interrupt Flag
952 * @arg DSI_FLAG_ER : End of Refresh Interrupt Flag
953 * @arg DSI_FLAG_BUSY : Busy Flag
954 * @arg DSI_FLAG_PLLLS: PLL Lock Status
955 * @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
956 * @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
957 * @arg DSI_FLAG_RRS : Regulator Ready Flag
958 * @arg DSI_FLAG_RR : Regulator Ready Interrupt Flag
959 * @retval The state of FLAG (SET or RESET).
961 #define __HAL_DSI_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WISR & (__FLAG__))
964 * @brief Clears the DSI pending flags.
965 * @param __HANDLE__: DSI handle.
966 * @param __FLAG__: specifies the flag to clear.
967 * This parameter can be any combination of the following values:
968 * @arg DSI_FLAG_TE : Tearing Effect Interrupt Flag
969 * @arg DSI_FLAG_ER : End of Refresh Interrupt Flag
970 * @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
971 * @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
972 * @arg DSI_FLAG_RR : Regulator Ready Interrupt Flag
975 #define __HAL_DSI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WIFCR = (__FLAG__))
978 * @brief Enables the specified DSI interrupts.
979 * @param __HANDLE__: DSI handle.
980 * @param __INTERRUPT__: specifies the DSI interrupt sources to be enabled.
981 * This parameter can be any combination of the following values:
982 * @arg DSI_IT_TE : Tearing Effect Interrupt
983 * @arg DSI_IT_ER : End of Refresh Interrupt
984 * @arg DSI_IT_PLLL: PLL Lock Interrupt
985 * @arg DSI_IT_PLLU: PLL Unlock Interrupt
986 * @arg DSI_IT_RR : Regulator Ready Interrupt
989 #define __HAL_DSI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER |= (__INTERRUPT__))
992 * @brief Disables the specified DSI interrupts.
993 * @param __HANDLE__: DSI handle
994 * @param __INTERRUPT__: specifies the DSI interrupt sources to be disabled.
995 * This parameter can be any combination of the following values:
996 * @arg DSI_IT_TE : Tearing Effect Interrupt
997 * @arg DSI_IT_ER : End of Refresh Interrupt
998 * @arg DSI_IT_PLLL: PLL Lock Interrupt
999 * @arg DSI_IT_PLLU: PLL Unlock Interrupt
1000 * @arg DSI_IT_RR : Regulator Ready Interrupt
1003 #define __HAL_DSI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER &= ~(__INTERRUPT__))
1006 * @brief Checks whether the specified DSI interrupt has occurred or not.
1007 * @param __HANDLE__: DSI handle
1008 * @param __INTERRUPT__: specifies the DSI interrupt source to check.
1009 * This parameter can be one of the following values:
1010 * @arg DSI_IT_TE : Tearing Effect Interrupt
1011 * @arg DSI_IT_ER : End of Refresh Interrupt
1012 * @arg DSI_IT_PLLL: PLL Lock Interrupt
1013 * @arg DSI_IT_PLLU: PLL Unlock Interrupt
1014 * @arg DSI_IT_RR : Regulator Ready Interrupt
1015 * @retval The state of INTERRUPT (SET or RESET).
1017 #define __HAL_DSI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER & (__INTERRUPT__))
1019 /* Exported functions --------------------------------------------------------*/
1020 /** @defgroup DSI_Exported_Functions DSI Exported Functions
1023 HAL_StatusTypeDef
HAL_DSI_Init(DSI_HandleTypeDef
*hdsi
, DSI_PLLInitTypeDef
*PLLInit
);
1024 HAL_StatusTypeDef
HAL_DSI_DeInit(DSI_HandleTypeDef
*hdsi
);
1025 void HAL_DSI_MspInit(DSI_HandleTypeDef
*hdsi
);
1026 void HAL_DSI_MspDeInit(DSI_HandleTypeDef
*hdsi
);
1028 void HAL_DSI_IRQHandler(DSI_HandleTypeDef
*hdsi
);
1029 void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef
*hdsi
);
1030 void HAL_DSI_EndOfRefreshCallback(DSI_HandleTypeDef
*hdsi
);
1031 void HAL_DSI_ErrorCallback(DSI_HandleTypeDef
*hdsi
);
1033 HAL_StatusTypeDef
HAL_DSI_SetGenericVCID(DSI_HandleTypeDef
*hdsi
, uint32_t VirtualChannelID
);
1034 HAL_StatusTypeDef
HAL_DSI_ConfigVideoMode(DSI_HandleTypeDef
*hdsi
, DSI_VidCfgTypeDef
*VidCfg
);
1035 HAL_StatusTypeDef
HAL_DSI_ConfigAdaptedCommandMode(DSI_HandleTypeDef
*hdsi
, DSI_CmdCfgTypeDef
*CmdCfg
);
1036 HAL_StatusTypeDef
HAL_DSI_ConfigCommand(DSI_HandleTypeDef
*hdsi
, DSI_LPCmdTypeDef
*LPCmd
);
1037 HAL_StatusTypeDef
HAL_DSI_ConfigFlowControl(DSI_HandleTypeDef
*hdsi
, uint32_t FlowControl
);
1038 HAL_StatusTypeDef
HAL_DSI_ConfigPhyTimer(DSI_HandleTypeDef
*hdsi
, DSI_PHY_TimerTypeDef
*PhyTimers
);
1039 HAL_StatusTypeDef
HAL_DSI_ConfigHostTimeouts(DSI_HandleTypeDef
*hdsi
, DSI_HOST_TimeoutTypeDef
*HostTimeouts
);
1040 HAL_StatusTypeDef
HAL_DSI_Start(DSI_HandleTypeDef
*hdsi
);
1041 HAL_StatusTypeDef
HAL_DSI_Stop(DSI_HandleTypeDef
*hdsi
);
1042 HAL_StatusTypeDef
HAL_DSI_Refresh(DSI_HandleTypeDef
*hdsi
);
1043 HAL_StatusTypeDef
HAL_DSI_ColorMode(DSI_HandleTypeDef
*hdsi
, uint32_t ColorMode
);
1044 HAL_StatusTypeDef
HAL_DSI_Shutdown(DSI_HandleTypeDef
*hdsi
, uint32_t Shutdown
);
1045 HAL_StatusTypeDef
HAL_DSI_ShortWrite(DSI_HandleTypeDef
*hdsi
,
1050 HAL_StatusTypeDef
HAL_DSI_LongWrite(DSI_HandleTypeDef
*hdsi
,
1055 uint8_t* ParametersTable
);
1056 HAL_StatusTypeDef
HAL_DSI_Read(DSI_HandleTypeDef
*hdsi
,
1057 uint32_t ChannelNbr
,
1062 uint8_t* ParametersTable
);
1063 HAL_StatusTypeDef
HAL_DSI_EnterULPMData(DSI_HandleTypeDef
*hdsi
);
1064 HAL_StatusTypeDef
HAL_DSI_ExitULPMData(DSI_HandleTypeDef
*hdsi
);
1065 HAL_StatusTypeDef
HAL_DSI_EnterULPM(DSI_HandleTypeDef
*hdsi
);
1066 HAL_StatusTypeDef
HAL_DSI_ExitULPM(DSI_HandleTypeDef
*hdsi
);
1068 HAL_StatusTypeDef
HAL_DSI_PatternGeneratorStart(DSI_HandleTypeDef
*hdsi
, uint32_t Mode
, uint32_t Orientation
);
1069 HAL_StatusTypeDef
HAL_DSI_PatternGeneratorStop(DSI_HandleTypeDef
*hdsi
);
1071 HAL_StatusTypeDef
HAL_DSI_SetSlewRateAndDelayTuning(DSI_HandleTypeDef
*hdsi
, uint32_t CommDelay
, uint32_t Lane
, uint32_t Value
);
1072 HAL_StatusTypeDef
HAL_DSI_SetLowPowerRXFilter(DSI_HandleTypeDef
*hdsi
, uint32_t Frequency
);
1073 HAL_StatusTypeDef
HAL_DSI_SetSDD(DSI_HandleTypeDef
*hdsi
, FunctionalState State
);
1074 HAL_StatusTypeDef
HAL_DSI_SetLanePinsConfiguration(DSI_HandleTypeDef
*hdsi
, uint32_t CustomLane
, uint32_t Lane
, FunctionalState State
);
1075 HAL_StatusTypeDef
HAL_DSI_SetPHYTimings(DSI_HandleTypeDef
*hdsi
, uint32_t Timing
, FunctionalState State
, uint32_t Value
);
1076 HAL_StatusTypeDef
HAL_DSI_ForceTXStopMode(DSI_HandleTypeDef
*hdsi
, uint32_t Lane
, FunctionalState State
);
1077 HAL_StatusTypeDef
HAL_DSI_ForceRXLowPower(DSI_HandleTypeDef
*hdsi
, FunctionalState State
);
1078 HAL_StatusTypeDef
HAL_DSI_ForceDataLanesInRX(DSI_HandleTypeDef
*hdsi
, FunctionalState State
);
1079 HAL_StatusTypeDef
HAL_DSI_SetPullDown(DSI_HandleTypeDef
*hdsi
, FunctionalState State
);
1080 HAL_StatusTypeDef
HAL_DSI_SetContentionDetectionOff(DSI_HandleTypeDef
*hdsi
, FunctionalState State
);
1082 uint32_t HAL_DSI_GetError(DSI_HandleTypeDef
*hdsi
);
1083 HAL_StatusTypeDef
HAL_DSI_ConfigErrorMonitor(DSI_HandleTypeDef
*hdsi
, uint32_t ActiveErrors
);
1084 HAL_DSI_StateTypeDef
HAL_DSI_GetState(DSI_HandleTypeDef
*hdsi
);
1089 /* Private types -------------------------------------------------------------*/
1090 /** @defgroup DSI_Private_Types DSI Private Types
1098 /* Private defines -----------------------------------------------------------*/
1099 /** @defgroup DSI_Private_Defines DSI Private Defines
1107 /* Private variables ---------------------------------------------------------*/
1108 /** @defgroup DSI_Private_Variables DSI Private Variables
1116 /* Private constants ---------------------------------------------------------*/
1117 /** @defgroup DSI_Private_Constants DSI Private Constants
1120 #define DSI_MAX_RETURN_PKT_SIZE ((uint32_t)0x00000037U) /*!< Maximum return packet configuration */
1125 /* Private macros ------------------------------------------------------------*/
1126 /** @defgroup DSI_Private_Macros DSI Private Macros
1129 #define IS_DSI_PLL_NDIV(NDIV) ((10U <= (NDIV)) && ((NDIV) <= 125U))
1130 #define IS_DSI_PLL_IDF(IDF) (((IDF) == DSI_PLL_IN_DIV1) || \
1131 ((IDF) == DSI_PLL_IN_DIV2) || \
1132 ((IDF) == DSI_PLL_IN_DIV3) || \
1133 ((IDF) == DSI_PLL_IN_DIV4) || \
1134 ((IDF) == DSI_PLL_IN_DIV5) || \
1135 ((IDF) == DSI_PLL_IN_DIV6) || \
1136 ((IDF) == DSI_PLL_IN_DIV7))
1137 #define IS_DSI_PLL_ODF(ODF) (((ODF) == DSI_PLL_OUT_DIV1) || \
1138 ((ODF) == DSI_PLL_OUT_DIV2) || \
1139 ((ODF) == DSI_PLL_OUT_DIV4) || \
1140 ((ODF) == DSI_PLL_OUT_DIV8))
1141 #define IS_DSI_AUTO_CLKLANE_CONTROL(AutoClkLane) (((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_DISABLE) || ((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_ENABLE))
1142 #define IS_DSI_NUMBER_OF_LANES(NumberOfLanes) (((NumberOfLanes) == DSI_ONE_DATA_LANE) || ((NumberOfLanes) == DSI_TWO_DATA_LANES))
1143 #define IS_DSI_FLOW_CONTROL(FlowControl) (((FlowControl) | DSI_FLOW_CONTROL_ALL) == DSI_FLOW_CONTROL_ALL)
1144 #define IS_DSI_COLOR_CODING(ColorCoding) ((ColorCoding) <= 5U)
1145 #define IS_DSI_LOOSELY_PACKED(LooselyPacked) (((LooselyPacked) == DSI_LOOSELY_PACKED_ENABLE) || ((LooselyPacked) == DSI_LOOSELY_PACKED_DISABLE))
1146 #define IS_DSI_DE_POLARITY(DataEnable) (((DataEnable) == DSI_DATA_ENABLE_ACTIVE_HIGH) || ((DataEnable) == DSI_DATA_ENABLE_ACTIVE_LOW))
1147 #define IS_DSI_VSYNC_POLARITY(VSYNC) (((VSYNC) == DSI_VSYNC_ACTIVE_HIGH) || ((VSYNC) == DSI_VSYNC_ACTIVE_LOW))
1148 #define IS_DSI_HSYNC_POLARITY(HSYNC) (((HSYNC) == DSI_HSYNC_ACTIVE_HIGH) || ((HSYNC) == DSI_HSYNC_ACTIVE_LOW))
1149 #define IS_DSI_VIDEO_MODE_TYPE(VideoModeType) (((VideoModeType) == DSI_VID_MODE_NB_PULSES) || \
1150 ((VideoModeType) == DSI_VID_MODE_NB_EVENTS) || \
1151 ((VideoModeType) == DSI_VID_MODE_BURST))
1152 #define IS_DSI_COLOR_MODE(ColorMode) (((ColorMode) == DSI_COLOR_MODE_FULL) || ((ColorMode) == DSI_COLOR_MODE_EIGHT))
1153 #define IS_DSI_SHUT_DOWN(ShutDown) (((ShutDown) == DSI_DISPLAY_ON) || ((ShutDown) == DSI_DISPLAY_OFF))
1154 #define IS_DSI_LP_COMMAND(LPCommand) (((LPCommand) == DSI_LP_COMMAND_DISABLE) || ((LPCommand) == DSI_LP_COMMAND_ENABLE))
1155 #define IS_DSI_LP_HFP(LPHFP) (((LPHFP) == DSI_LP_HFP_DISABLE) || ((LPHFP) == DSI_LP_HFP_ENABLE))
1156 #define IS_DSI_LP_HBP(LPHBP) (((LPHBP) == DSI_LP_HBP_DISABLE) || ((LPHBP) == DSI_LP_HBP_ENABLE))
1157 #define IS_DSI_LP_VACTIVE(LPVActive) (((LPVActive) == DSI_LP_VACT_DISABLE) || ((LPVActive) == DSI_LP_VACT_ENABLE))
1158 #define IS_DSI_LP_VFP(LPVFP) (((LPVFP) == DSI_LP_VFP_DISABLE) || ((LPVFP) == DSI_LP_VFP_ENABLE))
1159 #define IS_DSI_LP_VBP(LPVBP) (((LPVBP) == DSI_LP_VBP_DISABLE) || ((LPVBP) == DSI_LP_VBP_ENABLE))
1160 #define IS_DSI_LP_VSYNC(LPVSYNC) (((LPVSYNC) == DSI_LP_VSYNC_DISABLE) || ((LPVSYNC) == DSI_LP_VSYNC_ENABLE))
1161 #define IS_DSI_FBTAA(FrameBTAAcknowledge) (((FrameBTAAcknowledge) == DSI_FBTAA_DISABLE) || ((FrameBTAAcknowledge) == DSI_FBTAA_ENABLE))
1162 #define IS_DSI_TE_SOURCE(TESource) (((TESource) == DSI_TE_DSILINK) || ((TESource) == DSI_TE_EXTERNAL))
1163 #define IS_DSI_TE_POLARITY(TEPolarity) (((TEPolarity) == DSI_TE_RISING_EDGE) || ((TEPolarity) == DSI_TE_FALLING_EDGE))
1164 #define IS_DSI_AUTOMATIC_REFRESH(AutomaticRefresh) (((AutomaticRefresh) == DSI_AR_DISABLE) || ((AutomaticRefresh) == DSI_AR_ENABLE))
1165 #define IS_DSI_VS_POLARITY(VSPolarity) (((VSPolarity) == DSI_VSYNC_FALLING) || ((VSPolarity) == DSI_VSYNC_RISING))
1166 #define IS_DSI_TE_ACK_REQUEST(TEAcknowledgeRequest) (((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_DISABLE) || ((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_ENABLE))
1167 #define IS_DSI_ACK_REQUEST(AcknowledgeRequest) (((AcknowledgeRequest) == DSI_ACKNOWLEDGE_DISABLE) || ((AcknowledgeRequest) == DSI_ACKNOWLEDGE_ENABLE))
1168 #define IS_DSI_LP_GSW0P(LP_GSW0P) (((LP_GSW0P) == DSI_LP_GSW0P_DISABLE) || ((LP_GSW0P) == DSI_LP_GSW0P_ENABLE))
1169 #define IS_DSI_LP_GSW1P(LP_GSW1P) (((LP_GSW1P) == DSI_LP_GSW1P_DISABLE) || ((LP_GSW1P) == DSI_LP_GSW1P_ENABLE))
1170 #define IS_DSI_LP_GSW2P(LP_GSW2P) (((LP_GSW2P) == DSI_LP_GSW2P_DISABLE) || ((LP_GSW2P) == DSI_LP_GSW2P_ENABLE))
1171 #define IS_DSI_LP_GSR0P(LP_GSR0P) (((LP_GSR0P) == DSI_LP_GSR0P_DISABLE) || ((LP_GSR0P) == DSI_LP_GSR0P_ENABLE))
1172 #define IS_DSI_LP_GSR1P(LP_GSR1P) (((LP_GSR1P) == DSI_LP_GSR1P_DISABLE) || ((LP_GSR1P) == DSI_LP_GSR1P_ENABLE))
1173 #define IS_DSI_LP_GSR2P(LP_GSR2P) (((LP_GSR2P) == DSI_LP_GSR2P_DISABLE) || ((LP_GSR2P) == DSI_LP_GSR2P_ENABLE))
1174 #define IS_DSI_LP_GLW(LP_GLW) (((LP_GLW) == DSI_LP_GLW_DISABLE) || ((LP_GLW) == DSI_LP_GLW_ENABLE))
1175 #define IS_DSI_LP_DSW0P(LP_DSW0P) (((LP_DSW0P) == DSI_LP_DSW0P_DISABLE) || ((LP_DSW0P) == DSI_LP_DSW0P_ENABLE))
1176 #define IS_DSI_LP_DSW1P(LP_DSW1P) (((LP_DSW1P) == DSI_LP_DSW1P_DISABLE) || ((LP_DSW1P) == DSI_LP_DSW1P_ENABLE))
1177 #define IS_DSI_LP_DSR0P(LP_DSR0P) (((LP_DSR0P) == DSI_LP_DSR0P_DISABLE) || ((LP_DSR0P) == DSI_LP_DSR0P_ENABLE))
1178 #define IS_DSI_LP_DLW(LP_DLW) (((LP_DLW) == DSI_LP_DLW_DISABLE) || ((LP_DLW) == DSI_LP_DLW_ENABLE))
1179 #define IS_DSI_LP_MRDP(LP_MRDP) (((LP_MRDP) == DSI_LP_MRDP_DISABLE) || ((LP_MRDP) == DSI_LP_MRDP_ENABLE))
1180 #define IS_DSI_SHORT_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_WRITE_P0) || \
1181 ((MODE) == DSI_DCS_SHORT_PKT_WRITE_P1) || \
1182 ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P0) || \
1183 ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P1) || \
1184 ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P2))
1185 #define IS_DSI_LONG_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_LONG_PKT_WRITE) || \
1186 ((MODE) == DSI_GEN_LONG_PKT_WRITE))
1187 #define IS_DSI_READ_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_READ) || \
1188 ((MODE) == DSI_GEN_SHORT_PKT_READ_P0) || \
1189 ((MODE) == DSI_GEN_SHORT_PKT_READ_P1) || \
1190 ((MODE) == DSI_GEN_SHORT_PKT_READ_P2))
1191 #define IS_DSI_COMMUNICATION_DELAY(CommDelay) (((CommDelay) == DSI_SLEW_RATE_HSTX) || ((CommDelay) == DSI_SLEW_RATE_LPTX) || ((CommDelay) == DSI_HS_DELAY))
1192 #define IS_DSI_LANE_GROUP(Lane) (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANES))
1193 #define IS_DSI_CUSTOM_LANE(CustomLane) (((CustomLane) == DSI_SWAP_LANE_PINS) || ((CustomLane) == DSI_INVERT_HS_SIGNAL))
1194 #define IS_DSI_LANE(Lane) (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANE0) || ((Lane) == DSI_DATA_LANE1))
1195 #define IS_DSI_PHY_TIMING(Timing) (((Timing) == DSI_TCLK_POST ) || \
1196 ((Timing) == DSI_TLPX_CLK ) || \
1197 ((Timing) == DSI_THS_EXIT ) || \
1198 ((Timing) == DSI_TLPX_DATA ) || \
1199 ((Timing) == DSI_THS_ZERO ) || \
1200 ((Timing) == DSI_THS_TRAIL ) || \
1201 ((Timing) == DSI_THS_PREPARE ) || \
1202 ((Timing) == DSI_TCLK_ZERO ) || \
1203 ((Timing) == DSI_TCLK_PREPARE))
1209 /* Private functions prototypes ----------------------------------------------*/
1210 /** @defgroup DSI_Private_Functions_Prototypes DSI Private Functions Prototypes
1218 /* Private functions ---------------------------------------------------------*/
1219 /** @defgroup DSI_Private_Functions DSI Private Functions
1234 #endif /* STM32F469xx || STM32F479xx */
1240 #endif /* __STM32F4xx_HAL_DSI_H */
1242 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/