Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:35

0001 /**
0002   ******************************************************************************
0003   * @file    stm32h7xx_hal_dsi.h
0004   * @author  MCD Application Team
0005   * @brief   Header file of DSI HAL module.
0006   ******************************************************************************
0007   * @attention
0008   *
0009   * Copyright (c) 2017 STMicroelectronics.
0010   * All rights reserved.
0011   *
0012   * This software is licensed under terms that can be found in the LICENSE file
0013   * in the root directory of this software component.
0014   * If no LICENSE file comes with this software, it is provided AS-IS.
0015   *
0016   ******************************************************************************
0017   */
0018 
0019 /* Define to prevent recursive inclusion -------------------------------------*/
0020 #ifndef STM32H7xx_HAL_DSI_H
0021 #define STM32H7xx_HAL_DSI_H
0022 
0023 #ifdef __cplusplus
0024 extern "C" {
0025 #endif
0026 
0027 /* Includes ------------------------------------------------------------------*/
0028 #include "stm32h7xx_hal_def.h"
0029 
0030 #if defined(DSI)
0031 
0032 /** @addtogroup STM32H7xx_HAL_Driver
0033   * @{
0034   */
0035 
0036 /** @defgroup DSI DSI
0037   * @ingroup RTEMSBSPsARMSTM32H7
0038   * @brief DSI HAL module driver
0039   * @{
0040   */
0041 
0042 /* Exported types ------------------------------------------------------------*/
0043 /** @defgroup DSI_Exported_Types DSI Exported Types
0044   * @ingroup RTEMSBSPsARMSTM32H7
0045   * @{
0046   */
0047 /**
0048   * @brief  DSI Init Structure definition
0049   */
0050 typedef struct
0051 {
0052   uint32_t AutomaticClockLaneControl;    /*!< Automatic clock lane control
0053                                               This parameter can be any value of @ref DSI_Automatic_Clk_Lane_Control */
0054 
0055   uint32_t TXEscapeCkdiv;                /*!< TX Escape clock division
0056                                               The values 0 and 1 stop the TX_ESC clock generation                    */
0057 
0058   uint32_t NumberOfLanes;                /*!< Number of lanes
0059                                               This parameter can be any value of @ref DSI_Number_Of_Lanes            */
0060 
0061 } DSI_InitTypeDef;
0062 
0063 /**
0064   * @brief  DSI PLL Clock structure definition
0065   */
0066 typedef struct
0067 {
0068   uint32_t PLLNDIV;                 /*!< PLL Loop Division Factor
0069                                          This parameter must be a value between 10 and 125                    */
0070 
0071   uint32_t PLLIDF;                  /*!< PLL Input Division Factor
0072                                          This parameter can be any value of @ref DSI_PLL_IDF                  */
0073 
0074   uint32_t PLLODF;                  /*!< PLL Output Division Factor
0075                                          This parameter can be any value of @ref DSI_PLL_ODF                  */
0076 
0077 } DSI_PLLInitTypeDef;
0078 
0079 /**
0080   * @brief  DSI Video mode configuration
0081   */
0082 typedef struct
0083 {
0084   uint32_t VirtualChannelID;             /*!< Virtual channel ID                                                 */
0085 
0086   uint32_t ColorCoding;                  /*!< Color coding for LTDC interface
0087                                               This parameter can be any value of @ref DSI_Color_Coding           */
0088 
0089   uint32_t LooselyPacked;                /*!< Enable or disable loosely packed stream (needed only when using
0090                                               18-bit configuration).
0091                                               This parameter can be any value of @ref DSI_LooselyPacked          */
0092 
0093   uint32_t Mode;                         /*!< Video mode type
0094                                               This parameter can be any value of @ref DSI_Video_Mode_Type        */
0095 
0096   uint32_t PacketSize;                   /*!< Video packet size                                                  */
0097 
0098   uint32_t NumberOfChunks;               /*!< Number of chunks                                                   */
0099 
0100   uint32_t NullPacketSize;               /*!< Null packet size                                                   */
0101 
0102   uint32_t HSPolarity;                   /*!< HSYNC pin polarity
0103                                               This parameter can be any value of @ref DSI_HSYNC_Polarity         */
0104 
0105   uint32_t VSPolarity;                   /*!< VSYNC pin polarity
0106                                               This parameter can be any value of @ref DSI_VSYNC_Active_Polarity  */
0107 
0108   uint32_t DEPolarity;                   /*!< Data Enable pin polarity
0109                                               This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity   */
0110 
0111   uint32_t HorizontalSyncActive;         /*!< Horizontal synchronism active duration (in lane byte clock cycles) */
0112 
0113   uint32_t HorizontalBackPorch;          /*!< Horizontal back-porch duration (in lane byte clock cycles)         */
0114 
0115   uint32_t HorizontalLine;               /*!< Horizontal line duration (in lane byte clock cycles)               */
0116 
0117   uint32_t VerticalSyncActive;           /*!< Vertical synchronism active duration                               */
0118 
0119   uint32_t VerticalBackPorch;            /*!< Vertical back-porch duration                                       */
0120 
0121   uint32_t VerticalFrontPorch;           /*!< Vertical front-porch duration                                      */
0122 
0123   uint32_t VerticalActive;               /*!< Vertical active duration                                           */
0124 
0125   uint32_t LPCommandEnable;              /*!< Low-power command enable
0126                                               This parameter can be any value of @ref DSI_LP_Command             */
0127 
0128   uint32_t LPLargestPacketSize;          /*!< The size, in bytes, of the low power largest packet that
0129                                               can fit in a line during VSA, VBP and VFP regions                  */
0130 
0131   uint32_t LPVACTLargestPacketSize;      /*!< The size, in bytes, of the low power largest packet that
0132                                               can fit in a line during VACT region                               */
0133 
0134   uint32_t LPHorizontalFrontPorchEnable; /*!< Low-power horizontal front-porch enable
0135                                               This parameter can be any value of @ref DSI_LP_HFP                 */
0136 
0137   uint32_t LPHorizontalBackPorchEnable;  /*!< Low-power horizontal back-porch enable
0138                                               This parameter can be any value of @ref DSI_LP_HBP                 */
0139 
0140   uint32_t LPVerticalActiveEnable;       /*!< Low-power vertical active enable
0141                                               This parameter can be any value of @ref DSI_LP_VACT                */
0142 
0143   uint32_t LPVerticalFrontPorchEnable;   /*!< Low-power vertical front-porch enable
0144                                               This parameter can be any value of @ref DSI_LP_VFP                 */
0145 
0146   uint32_t LPVerticalBackPorchEnable;    /*!< Low-power vertical back-porch enable
0147                                               This parameter can be any value of @ref DSI_LP_VBP                 */
0148 
0149   uint32_t LPVerticalSyncActiveEnable;   /*!< Low-power vertical sync active enable
0150                                               This parameter can be any value of @ref DSI_LP_VSYNC               */
0151 
0152   uint32_t FrameBTAAcknowledgeEnable;    /*!< Frame bus-turn-around acknowledge enable
0153                                               This parameter can be any value of @ref DSI_FBTA_acknowledge       */
0154 
0155 } DSI_VidCfgTypeDef;
0156 
0157 /**
0158   * @brief  DSI Adapted command mode configuration
0159   */
0160 typedef struct
0161 {
0162   uint32_t VirtualChannelID;             /*!< Virtual channel ID                                                */
0163 
0164   uint32_t ColorCoding;                  /*!< Color coding for LTDC interface
0165                                               This parameter can be any value of @ref DSI_Color_Coding          */
0166 
0167   uint32_t CommandSize;                  /*!< Maximum allowed size for an LTDC write memory command, measured in
0168                                               pixels. This parameter can be any value between 0x00 and 0xFFFFU   */
0169 
0170   uint32_t TearingEffectSource;          /*!< Tearing effect source
0171                                               This parameter can be any value of @ref DSI_TearingEffectSource   */
0172 
0173   uint32_t TearingEffectPolarity;        /*!< Tearing effect pin polarity
0174                                               This parameter can be any value of @ref DSI_TearingEffectPolarity */
0175 
0176   uint32_t HSPolarity;                   /*!< HSYNC pin polarity
0177                                               This parameter can be any value of @ref DSI_HSYNC_Polarity        */
0178 
0179   uint32_t VSPolarity;                   /*!< VSYNC pin polarity
0180                                               This parameter can be any value of @ref DSI_VSYNC_Active_Polarity */
0181 
0182   uint32_t DEPolarity;                   /*!< Data Enable pin polarity
0183                                               This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity  */
0184 
0185   uint32_t VSyncPol;                     /*!< VSync edge on which the LTDC is halted
0186                                               This parameter can be any value of @ref DSI_Vsync_Polarity        */
0187 
0188   uint32_t AutomaticRefresh;             /*!< Automatic refresh mode
0189                                               This parameter can be any value of @ref DSI_AutomaticRefresh      */
0190 
0191   uint32_t TEAcknowledgeRequest;         /*!< Tearing Effect Acknowledge Request Enable
0192                                               This parameter can be any value of @ref DSI_TE_AcknowledgeRequest */
0193 
0194 } DSI_CmdCfgTypeDef;
0195 
0196 /**
0197   * @brief  DSI command transmission mode configuration
0198   */
0199 typedef struct
0200 {
0201   uint32_t LPGenShortWriteNoP;           /*!< Generic Short Write Zero parameters Transmission
0202                                               This parameter can be any value of @ref DSI_LP_LPGenShortWriteNoP  */
0203 
0204   uint32_t LPGenShortWriteOneP;          /*!< Generic Short Write One parameter Transmission
0205                                               This parameter can be any value of @ref DSI_LP_LPGenShortWriteOneP */
0206 
0207   uint32_t LPGenShortWriteTwoP;          /*!< Generic Short Write Two parameters Transmission
0208                                               This parameter can be any value of @ref DSI_LP_LPGenShortWriteTwoP */
0209 
0210   uint32_t LPGenShortReadNoP;            /*!< Generic Short Read Zero parameters Transmission
0211                                               This parameter can be any value of @ref DSI_LP_LPGenShortReadNoP   */
0212 
0213   uint32_t LPGenShortReadOneP;           /*!< Generic Short Read One parameter Transmission
0214                                               This parameter can be any value of @ref DSI_LP_LPGenShortReadOneP  */
0215 
0216   uint32_t LPGenShortReadTwoP;           /*!< Generic Short Read Two parameters Transmission
0217                                               This parameter can be any value of @ref DSI_LP_LPGenShortReadTwoP  */
0218 
0219   uint32_t LPGenLongWrite;               /*!< Generic Long Write Transmission
0220                                               This parameter can be any value of @ref DSI_LP_LPGenLongWrite      */
0221 
0222   uint32_t LPDcsShortWriteNoP;           /*!< DCS Short Write Zero parameters Transmission
0223                                               This parameter can be any value of @ref DSI_LP_LPDcsShortWriteNoP  */
0224 
0225   uint32_t LPDcsShortWriteOneP;          /*!< DCS Short Write One parameter Transmission
0226                                               This parameter can be any value of @ref DSI_LP_LPDcsShortWriteOneP */
0227 
0228   uint32_t LPDcsShortReadNoP;            /*!< DCS Short Read Zero parameters Transmission
0229                                               This parameter can be any value of @ref DSI_LP_LPDcsShortReadNoP   */
0230 
0231   uint32_t LPDcsLongWrite;               /*!< DCS Long Write Transmission
0232                                               This parameter can be any value of @ref DSI_LP_LPDcsLongWrite      */
0233 
0234   uint32_t LPMaxReadPacket;              /*!< Maximum Read Packet Size Transmission
0235                                               This parameter can be any value of @ref DSI_LP_LPMaxReadPacket     */
0236 
0237   uint32_t AcknowledgeRequest;           /*!< Acknowledge Request Enable
0238                                               This parameter can be any value of @ref DSI_AcknowledgeRequest     */
0239 
0240 } DSI_LPCmdTypeDef;
0241 
0242 /**
0243   * @brief  DSI PHY Timings definition
0244   */
0245 typedef struct
0246 {
0247   uint32_t ClockLaneHS2LPTime;           /*!< The maximum time that the D-PHY clock lane takes to go from high-speed
0248                                               to low-power transmission                                              */
0249 
0250   uint32_t ClockLaneLP2HSTime;           /*!< The maximum time that the D-PHY clock lane takes to go from low-power
0251                                               to high-speed transmission                                             */
0252 
0253   uint32_t DataLaneHS2LPTime;            /*!< The maximum time that the D-PHY data lanes takes to go from high-speed
0254                                               to low-power transmission                                              */
0255 
0256   uint32_t DataLaneLP2HSTime;            /*!< The maximum time that the D-PHY data lanes takes to go from low-power
0257                                               to high-speed transmission                                             */
0258 
0259   uint32_t DataLaneMaxReadTime;          /*!< The maximum time required to perform a read command */
0260 
0261   uint32_t StopWaitTime;                 /*!< The minimum wait period to request a High-Speed transmission after the
0262                                               Stop state                                                             */
0263 
0264 } DSI_PHY_TimerTypeDef;
0265 
0266 /**
0267   * @brief  DSI HOST Timeouts definition
0268   */
0269 typedef struct
0270 {
0271   uint32_t TimeoutCkdiv;                 /*!< Time-out clock division                                  */
0272 
0273   uint32_t HighSpeedTransmissionTimeout; /*!< High-speed transmission time-out                         */
0274 
0275   uint32_t LowPowerReceptionTimeout;     /*!< Low-power reception time-out                             */
0276 
0277   uint32_t HighSpeedReadTimeout;         /*!< High-speed read time-out                                 */
0278 
0279   uint32_t LowPowerReadTimeout;          /*!< Low-power read time-out                                  */
0280 
0281   uint32_t HighSpeedWriteTimeout;        /*!< High-speed write time-out                                */
0282 
0283   uint32_t HighSpeedWritePrespMode;      /*!< High-speed write presp mode
0284                                               This parameter can be any value of @ref DSI_HS_PrespMode */
0285 
0286   uint32_t LowPowerWriteTimeout;         /*!< Low-speed write time-out                                 */
0287 
0288   uint32_t BTATimeout;                   /*!< BTA time-out                                             */
0289 
0290 } DSI_HOST_TimeoutTypeDef;
0291 
0292 /**
0293   * @brief  DSI States Structure definition
0294   */
0295 typedef enum
0296 {
0297   HAL_DSI_STATE_RESET   = 0x00U,
0298   HAL_DSI_STATE_READY   = 0x01U,
0299   HAL_DSI_STATE_ERROR   = 0x02U,
0300   HAL_DSI_STATE_BUSY    = 0x03U,
0301   HAL_DSI_STATE_TIMEOUT = 0x04U
0302 } HAL_DSI_StateTypeDef;
0303 
0304 /**
0305   * @brief  DSI Handle Structure definition
0306   */
0307 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
0308 typedef struct __DSI_HandleTypeDef
0309 #else
0310 typedef struct
0311 #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
0312 {
0313   DSI_TypeDef               *Instance;    /*!< Register base address      */
0314   DSI_InitTypeDef           Init;         /*!< DSI required parameters    */
0315   HAL_LockTypeDef           Lock;         /*!< DSI peripheral status      */
0316   __IO HAL_DSI_StateTypeDef State;        /*!< DSI communication state    */
0317   __IO uint32_t             ErrorCode;    /*!< DSI Error code             */
0318   uint32_t                  ErrorMsk;     /*!< DSI Error monitoring mask  */
0319 
0320 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
0321   void (* TearingEffectCallback)(struct __DSI_HandleTypeDef *hdsi);   /*!< DSI Tearing Effect Callback */
0322   void (* EndOfRefreshCallback)(struct __DSI_HandleTypeDef *hdsi);    /*!< DSI End Of Refresh Callback */
0323   void (* ErrorCallback)(struct __DSI_HandleTypeDef *hdsi);           /*!< DSI Error Callback          */
0324 
0325   void (* MspInitCallback)(struct __DSI_HandleTypeDef *hdsi);         /*!< DSI Msp Init callback       */
0326   void (* MspDeInitCallback)(struct __DSI_HandleTypeDef *hdsi);       /*!< DSI Msp DeInit callback     */
0327 
0328 #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
0329 
0330 } DSI_HandleTypeDef;
0331 
0332 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
0333 /**
0334   * @brief  HAL DSI Callback ID enumeration definition
0335   */
0336 typedef enum
0337 {
0338   HAL_DSI_MSPINIT_CB_ID            = 0x00U,    /*!< DSI MspInit callback ID        */
0339   HAL_DSI_MSPDEINIT_CB_ID          = 0x01U,    /*!< DSI MspDeInit callback ID      */
0340 
0341   HAL_DSI_TEARING_EFFECT_CB_ID     = 0x02U,    /*!< DSI Tearing Effect Callback ID */
0342   HAL_DSI_ENDOF_REFRESH_CB_ID      = 0x03U,    /*!< DSI End Of Refresh Callback ID */
0343   HAL_DSI_ERROR_CB_ID              = 0x04U     /*!< DSI Error Callback ID          */
0344 
0345 } HAL_DSI_CallbackIDTypeDef;
0346 
0347 /**
0348   * @brief  HAL DSI Callback pointer definition
0349   */
0350 typedef  void (*pDSI_CallbackTypeDef)(DSI_HandleTypeDef *hdsi);  /*!< pointer to an DSI callback function */
0351 
0352 #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
0353 /**
0354   * @}
0355   */
0356 
0357 /* Exported constants --------------------------------------------------------*/
0358 /** @defgroup DSI_Exported_Constants DSI Exported Constants
0359   * @ingroup RTEMSBSPsARMSTM32H7
0360   * @{
0361   */
0362 /** @defgroup DSI_DCS_Command DSI DCS Command
0363   * @ingroup RTEMSBSPsARMSTM32H7
0364   * @{
0365   */
0366 #define DSI_ENTER_IDLE_MODE       0x39U
0367 #define DSI_ENTER_INVERT_MODE     0x21U
0368 #define DSI_ENTER_NORMAL_MODE     0x13U
0369 #define DSI_ENTER_PARTIAL_MODE    0x12U
0370 #define DSI_ENTER_SLEEP_MODE      0x10U
0371 #define DSI_EXIT_IDLE_MODE        0x38U
0372 #define DSI_EXIT_INVERT_MODE      0x20U
0373 #define DSI_EXIT_SLEEP_MODE       0x11U
0374 #define DSI_GET_3D_CONTROL        0x3FU
0375 #define DSI_GET_ADDRESS_MODE      0x0BU
0376 #define DSI_GET_BLUE_CHANNEL      0x08U
0377 #define DSI_GET_DIAGNOSTIC_RESULT 0x0FU
0378 #define DSI_GET_DISPLAY_MODE      0x0DU
0379 #define DSI_GET_GREEN_CHANNEL     0x07U
0380 #define DSI_GET_PIXEL_FORMAT      0x0CU
0381 #define DSI_GET_POWER_MODE        0x0AU
0382 #define DSI_GET_RED_CHANNEL       0x06U
0383 #define DSI_GET_SCANLINE          0x45U
0384 #define DSI_GET_SIGNAL_MODE       0x0EU
0385 #define DSI_NOP                   0x00U
0386 #define DSI_READ_DDB_CONTINUE     0xA8U
0387 #define DSI_READ_DDB_START        0xA1U
0388 #define DSI_READ_MEMORY_CONTINUE  0x3EU
0389 #define DSI_READ_MEMORY_START     0x2EU
0390 #define DSI_SET_3D_CONTROL        0x3DU
0391 #define DSI_SET_ADDRESS_MODE      0x36U
0392 #define DSI_SET_COLUMN_ADDRESS    0x2AU
0393 #define DSI_SET_DISPLAY_OFF       0x28U
0394 #define DSI_SET_DISPLAY_ON        0x29U
0395 #define DSI_SET_GAMMA_CURVE       0x26U
0396 #define DSI_SET_PAGE_ADDRESS      0x2BU
0397 #define DSI_SET_PARTIAL_COLUMNS   0x31U
0398 #define DSI_SET_PARTIAL_ROWS      0x30U
0399 #define DSI_SET_PIXEL_FORMAT      0x3AU
0400 #define DSI_SET_SCROLL_AREA       0x33U
0401 #define DSI_SET_SCROLL_START      0x37U
0402 #define DSI_SET_TEAR_OFF          0x34U
0403 #define DSI_SET_TEAR_ON           0x35U
0404 #define DSI_SET_TEAR_SCANLINE     0x44U
0405 #define DSI_SET_VSYNC_TIMING      0x40U
0406 #define DSI_SOFT_RESET            0x01U
0407 #define DSI_WRITE_LUT             0x2DU
0408 #define DSI_WRITE_MEMORY_CONTINUE 0x3CU
0409 #define DSI_WRITE_MEMORY_START    0x2CU
0410 /**
0411   * @}
0412   */
0413 
0414 /** @defgroup DSI_Video_Mode_Type DSI Video Mode Type
0415   * @ingroup RTEMSBSPsARMSTM32H7
0416   * @{
0417   */
0418 #define DSI_VID_MODE_NB_PULSES    0U
0419 #define DSI_VID_MODE_NB_EVENTS    1U
0420 #define DSI_VID_MODE_BURST        2U
0421 /**
0422   * @}
0423   */
0424 
0425 /** @defgroup DSI_Color_Mode DSI Color Mode
0426   * @ingroup RTEMSBSPsARMSTM32H7
0427   * @{
0428   */
0429 #define DSI_COLOR_MODE_FULL       0x00000000U
0430 #define DSI_COLOR_MODE_EIGHT      DSI_WCR_COLM
0431 /**
0432   * @}
0433   */
0434 
0435 /** @defgroup DSI_ShutDown DSI ShutDown
0436   * @ingroup RTEMSBSPsARMSTM32H7
0437   * @{
0438   */
0439 #define DSI_DISPLAY_ON            0x00000000U
0440 #define DSI_DISPLAY_OFF           DSI_WCR_SHTDN
0441 /**
0442   * @}
0443   */
0444 
0445 /** @defgroup DSI_LP_Command DSI LP Command
0446   * @ingroup RTEMSBSPsARMSTM32H7
0447   * @{
0448   */
0449 #define DSI_LP_COMMAND_DISABLE    0x00000000U
0450 #define DSI_LP_COMMAND_ENABLE     DSI_VMCR_LPCE
0451 /**
0452   * @}
0453   */
0454 
0455 /** @defgroup DSI_LP_HFP DSI LP HFP
0456   * @ingroup RTEMSBSPsARMSTM32H7
0457   * @{
0458   */
0459 #define DSI_LP_HFP_DISABLE        0x00000000U
0460 #define DSI_LP_HFP_ENABLE         DSI_VMCR_LPHFPE
0461 /**
0462   * @}
0463   */
0464 
0465 /** @defgroup DSI_LP_HBP DSI LP HBP
0466   * @ingroup RTEMSBSPsARMSTM32H7
0467   * @{
0468   */
0469 #define DSI_LP_HBP_DISABLE        0x00000000U
0470 #define DSI_LP_HBP_ENABLE         DSI_VMCR_LPHBPE
0471 /**
0472   * @}
0473   */
0474 
0475 /** @defgroup DSI_LP_VACT DSI LP VACT
0476   * @ingroup RTEMSBSPsARMSTM32H7
0477   * @{
0478   */
0479 #define DSI_LP_VACT_DISABLE       0x00000000U
0480 #define DSI_LP_VACT_ENABLE        DSI_VMCR_LPVAE
0481 /**
0482   * @}
0483   */
0484 
0485 /** @defgroup DSI_LP_VFP DSI LP VFP
0486   * @ingroup RTEMSBSPsARMSTM32H7
0487   * @{
0488   */
0489 #define DSI_LP_VFP_DISABLE       0x00000000U
0490 #define DSI_LP_VFP_ENABLE        DSI_VMCR_LPVFPE
0491 /**
0492   * @}
0493   */
0494 
0495 /** @defgroup DSI_LP_VBP DSI LP VBP
0496   * @ingroup RTEMSBSPsARMSTM32H7
0497   * @{
0498   */
0499 #define DSI_LP_VBP_DISABLE       0x00000000U
0500 #define DSI_LP_VBP_ENABLE        DSI_VMCR_LPVBPE
0501 /**
0502   * @}
0503   */
0504 
0505 /** @defgroup DSI_LP_VSYNC DSI LP VSYNC
0506   * @ingroup RTEMSBSPsARMSTM32H7
0507   * @{
0508   */
0509 #define DSI_LP_VSYNC_DISABLE     0x00000000U
0510 #define DSI_LP_VSYNC_ENABLE      DSI_VMCR_LPVSAE
0511 /**
0512   * @}
0513   */
0514 
0515 /** @defgroup DSI_FBTA_acknowledge DSI FBTA Acknowledge
0516   * @ingroup RTEMSBSPsARMSTM32H7
0517   * @{
0518   */
0519 #define DSI_FBTAA_DISABLE        0x00000000U
0520 #define DSI_FBTAA_ENABLE         DSI_VMCR_FBTAAE
0521 /**
0522   * @}
0523   */
0524 
0525 /** @defgroup DSI_TearingEffectSource DSI Tearing Effect Source
0526   * @ingroup RTEMSBSPsARMSTM32H7
0527   * @{
0528   */
0529 #define DSI_TE_DSILINK           0x00000000U
0530 #define DSI_TE_EXTERNAL          DSI_WCFGR_TESRC
0531 /**
0532   * @}
0533   */
0534 
0535 /** @defgroup DSI_TearingEffectPolarity DSI Tearing Effect Polarity
0536   * @ingroup RTEMSBSPsARMSTM32H7
0537   * @{
0538   */
0539 #define DSI_TE_RISING_EDGE       0x00000000U
0540 #define DSI_TE_FALLING_EDGE      DSI_WCFGR_TEPOL
0541 /**
0542   * @}
0543   */
0544 
0545 /** @defgroup DSI_Vsync_Polarity DSI Vsync Polarity
0546   * @ingroup RTEMSBSPsARMSTM32H7
0547   * @{
0548   */
0549 #define DSI_VSYNC_FALLING        0x00000000U
0550 #define DSI_VSYNC_RISING         DSI_WCFGR_VSPOL
0551 /**
0552   * @}
0553   */
0554 
0555 /** @defgroup DSI_AutomaticRefresh DSI Automatic Refresh
0556   * @ingroup RTEMSBSPsARMSTM32H7
0557   * @{
0558   */
0559 #define DSI_AR_DISABLE           0x00000000U
0560 #define DSI_AR_ENABLE            DSI_WCFGR_AR
0561 /**
0562   * @}
0563   */
0564 
0565 /** @defgroup DSI_TE_AcknowledgeRequest DSI TE Acknowledge Request
0566   * @ingroup RTEMSBSPsARMSTM32H7
0567   * @{
0568   */
0569 #define DSI_TE_ACKNOWLEDGE_DISABLE 0x00000000U
0570 #define DSI_TE_ACKNOWLEDGE_ENABLE  DSI_CMCR_TEARE
0571 /**
0572   * @}
0573   */
0574 
0575 /** @defgroup DSI_AcknowledgeRequest DSI Acknowledge Request
0576   * @ingroup RTEMSBSPsARMSTM32H7
0577   * @{
0578   */
0579 #define DSI_ACKNOWLEDGE_DISABLE   0x00000000U
0580 #define DSI_ACKNOWLEDGE_ENABLE    DSI_CMCR_ARE
0581 /**
0582   * @}
0583   */
0584 
0585 /** @defgroup DSI_LP_LPGenShortWriteNoP DSI LP LPGen Short Write NoP
0586   * @ingroup RTEMSBSPsARMSTM32H7
0587   * @{
0588   */
0589 #define DSI_LP_GSW0P_DISABLE     0x00000000U
0590 #define DSI_LP_GSW0P_ENABLE      DSI_CMCR_GSW0TX
0591 /**
0592   * @}
0593   */
0594 
0595 /** @defgroup DSI_LP_LPGenShortWriteOneP DSI LP LPGen Short Write OneP
0596   * @ingroup RTEMSBSPsARMSTM32H7
0597   * @{
0598   */
0599 #define DSI_LP_GSW1P_DISABLE     0x00000000U
0600 #define DSI_LP_GSW1P_ENABLE      DSI_CMCR_GSW1TX
0601 /**
0602   * @}
0603   */
0604 
0605 /** @defgroup DSI_LP_LPGenShortWriteTwoP DSI LP LPGen Short Write TwoP
0606   * @ingroup RTEMSBSPsARMSTM32H7
0607   * @{
0608   */
0609 #define DSI_LP_GSW2P_DISABLE     0x00000000U
0610 #define DSI_LP_GSW2P_ENABLE      DSI_CMCR_GSW2TX
0611 /**
0612   * @}
0613   */
0614 
0615 /** @defgroup DSI_LP_LPGenShortReadNoP DSI LP LPGen Short Read NoP
0616   * @ingroup RTEMSBSPsARMSTM32H7
0617   * @{
0618   */
0619 #define DSI_LP_GSR0P_DISABLE     0x00000000U
0620 #define DSI_LP_GSR0P_ENABLE      DSI_CMCR_GSR0TX
0621 /**
0622   * @}
0623   */
0624 
0625 /** @defgroup DSI_LP_LPGenShortReadOneP DSI LP LPGen Short Read OneP
0626   * @ingroup RTEMSBSPsARMSTM32H7
0627   * @{
0628   */
0629 #define DSI_LP_GSR1P_DISABLE     0x00000000U
0630 #define DSI_LP_GSR1P_ENABLE      DSI_CMCR_GSR1TX
0631 /**
0632   * @}
0633   */
0634 
0635 /** @defgroup DSI_LP_LPGenShortReadTwoP DSI LP LPGen Short Read TwoP
0636   * @ingroup RTEMSBSPsARMSTM32H7
0637   * @{
0638   */
0639 #define DSI_LP_GSR2P_DISABLE     0x00000000U
0640 #define DSI_LP_GSR2P_ENABLE      DSI_CMCR_GSR2TX
0641 /**
0642   * @}
0643   */
0644 
0645 /** @defgroup DSI_LP_LPGenLongWrite DSI LP LPGen LongWrite
0646   * @ingroup RTEMSBSPsARMSTM32H7
0647   * @{
0648   */
0649 #define DSI_LP_GLW_DISABLE       0x00000000U
0650 #define DSI_LP_GLW_ENABLE        DSI_CMCR_GLWTX
0651 /**
0652   * @}
0653   */
0654 
0655 /** @defgroup DSI_LP_LPDcsShortWriteNoP DSI LP LPDcs Short Write NoP
0656   * @ingroup RTEMSBSPsARMSTM32H7
0657   * @{
0658   */
0659 #define DSI_LP_DSW0P_DISABLE     0x00000000U
0660 #define DSI_LP_DSW0P_ENABLE      DSI_CMCR_DSW0TX
0661 /**
0662   * @}
0663   */
0664 
0665 /** @defgroup DSI_LP_LPDcsShortWriteOneP DSI LP LPDcs Short Write OneP
0666   * @ingroup RTEMSBSPsARMSTM32H7
0667   * @{
0668   */
0669 #define DSI_LP_DSW1P_DISABLE     0x00000000U
0670 #define DSI_LP_DSW1P_ENABLE      DSI_CMCR_DSW1TX
0671 /**
0672   * @}
0673   */
0674 
0675 /** @defgroup DSI_LP_LPDcsShortReadNoP DSI LP LPDcs Short Read NoP
0676   * @ingroup RTEMSBSPsARMSTM32H7
0677   * @{
0678   */
0679 #define DSI_LP_DSR0P_DISABLE     0x00000000U
0680 #define DSI_LP_DSR0P_ENABLE      DSI_CMCR_DSR0TX
0681 /**
0682   * @}
0683   */
0684 
0685 /** @defgroup DSI_LP_LPDcsLongWrite DSI LP LPDcs Long Write
0686   * @ingroup RTEMSBSPsARMSTM32H7
0687   * @{
0688   */
0689 #define DSI_LP_DLW_DISABLE       0x00000000U
0690 #define DSI_LP_DLW_ENABLE        DSI_CMCR_DLWTX
0691 /**
0692   * @}
0693   */
0694 
0695 /** @defgroup DSI_LP_LPMaxReadPacket DSI LP LPMax Read Packet
0696   * @ingroup RTEMSBSPsARMSTM32H7
0697   * @{
0698   */
0699 #define DSI_LP_MRDP_DISABLE      0x00000000U
0700 #define DSI_LP_MRDP_ENABLE       DSI_CMCR_MRDPS
0701 /**
0702   * @}
0703   */
0704 
0705 /** @defgroup DSI_HS_PrespMode DSI HS Presp Mode
0706   * @ingroup RTEMSBSPsARMSTM32H7
0707   * @{
0708   */
0709 #define DSI_HS_PM_DISABLE        0x00000000U
0710 #define DSI_HS_PM_ENABLE         DSI_TCCR3_PM
0711 /**
0712   * @}
0713   */
0714 
0715 
0716 /** @defgroup DSI_Automatic_Clk_Lane_Control DSI Automatic Clk Lane Control
0717   * @ingroup RTEMSBSPsARMSTM32H7
0718   * @{
0719   */
0720 #define DSI_AUTO_CLK_LANE_CTRL_DISABLE 0x00000000U
0721 #define DSI_AUTO_CLK_LANE_CTRL_ENABLE  DSI_CLCR_ACR
0722 /**
0723   * @}
0724   */
0725 
0726 /** @defgroup DSI_Number_Of_Lanes DSI Number Of Lanes
0727   * @ingroup RTEMSBSPsARMSTM32H7
0728   * @{
0729   */
0730 #define DSI_ONE_DATA_LANE          0U
0731 #define DSI_TWO_DATA_LANES         1U
0732 /**
0733   * @}
0734   */
0735 
0736 /** @defgroup DSI_FlowControl DSI Flow Control
0737   * @ingroup RTEMSBSPsARMSTM32H7
0738   * @{
0739   */
0740 #define DSI_FLOW_CONTROL_CRC_RX    DSI_PCR_CRCRXE
0741 #define DSI_FLOW_CONTROL_ECC_RX    DSI_PCR_ECCRXE
0742 #define DSI_FLOW_CONTROL_BTA       DSI_PCR_BTAE
0743 #define DSI_FLOW_CONTROL_EOTP_RX   DSI_PCR_ETRXE
0744 #define DSI_FLOW_CONTROL_EOTP_TX   DSI_PCR_ETTXE
0745 #define DSI_FLOW_CONTROL_ALL       (DSI_FLOW_CONTROL_CRC_RX | DSI_FLOW_CONTROL_ECC_RX  | \
0746                                     DSI_FLOW_CONTROL_BTA    | DSI_FLOW_CONTROL_EOTP_RX | \
0747                                     DSI_FLOW_CONTROL_EOTP_TX)
0748 /**
0749   * @}
0750   */
0751 
0752 /** @defgroup DSI_Color_Coding DSI Color Coding
0753   * @ingroup RTEMSBSPsARMSTM32H7
0754   * @{
0755   */
0756 #define DSI_RGB565                 0x00000000U /*!< The values 0x00000001 and 0x00000002 can also be used for the RGB565 color mode configuration */
0757 #define DSI_RGB666                 0x00000003U /*!< The value 0x00000004 can also be used for the RGB666 color mode configuration                 */
0758 #define DSI_RGB888                 0x00000005U
0759 /**
0760   * @}
0761   */
0762 
0763 /** @defgroup DSI_LooselyPacked DSI Loosely Packed
0764   * @ingroup RTEMSBSPsARMSTM32H7
0765   * @{
0766   */
0767 #define DSI_LOOSELY_PACKED_ENABLE  DSI_LCOLCR_LPE
0768 #define DSI_LOOSELY_PACKED_DISABLE 0x00000000U
0769 /**
0770   * @}
0771   */
0772 
0773 /** @defgroup DSI_HSYNC_Polarity DSI HSYNC Polarity
0774   * @ingroup RTEMSBSPsARMSTM32H7
0775   * @{
0776   */
0777 #define DSI_HSYNC_ACTIVE_HIGH       0x00000000U
0778 #define DSI_HSYNC_ACTIVE_LOW        DSI_LPCR_HSP
0779 /**
0780   * @}
0781   */
0782 
0783 /** @defgroup DSI_VSYNC_Active_Polarity DSI VSYNC Active Polarity
0784   * @ingroup RTEMSBSPsARMSTM32H7
0785   * @{
0786   */
0787 #define DSI_VSYNC_ACTIVE_HIGH       0x00000000U
0788 #define DSI_VSYNC_ACTIVE_LOW        DSI_LPCR_VSP
0789 /**
0790   * @}
0791   */
0792 
0793 /** @defgroup DSI_DATA_ENABLE_Polarity DSI DATA ENABLE Polarity
0794   * @ingroup RTEMSBSPsARMSTM32H7
0795   * @{
0796   */
0797 #define DSI_DATA_ENABLE_ACTIVE_HIGH 0x00000000U
0798 #define DSI_DATA_ENABLE_ACTIVE_LOW  DSI_LPCR_DEP
0799 /**
0800   * @}
0801   */
0802 
0803 /** @defgroup DSI_PLL_IDF DSI PLL IDF
0804   * @ingroup RTEMSBSPsARMSTM32H7
0805   * @{
0806   */
0807 #define DSI_PLL_IN_DIV1             0x00000001U
0808 #define DSI_PLL_IN_DIV2             0x00000002U
0809 #define DSI_PLL_IN_DIV3             0x00000003U
0810 #define DSI_PLL_IN_DIV4             0x00000004U
0811 #define DSI_PLL_IN_DIV5             0x00000005U
0812 #define DSI_PLL_IN_DIV6             0x00000006U
0813 #define DSI_PLL_IN_DIV7             0x00000007U
0814 /**
0815   * @}
0816   */
0817 
0818 /** @defgroup DSI_PLL_ODF DSI PLL ODF
0819   * @ingroup RTEMSBSPsARMSTM32H7
0820   * @{
0821   */
0822 #define DSI_PLL_OUT_DIV1            0x00000000U
0823 #define DSI_PLL_OUT_DIV2            0x00000001U
0824 #define DSI_PLL_OUT_DIV4            0x00000002U
0825 #define DSI_PLL_OUT_DIV8            0x00000003U
0826 /**
0827   * @}
0828   */
0829 
0830 /** @defgroup DSI_Flags DSI Flags
0831   * @ingroup RTEMSBSPsARMSTM32H7
0832   * @{
0833   */
0834 #define DSI_FLAG_TE                 DSI_WISR_TEIF
0835 #define DSI_FLAG_ER                 DSI_WISR_ERIF
0836 #define DSI_FLAG_BUSY               DSI_WISR_BUSY
0837 #define DSI_FLAG_PLLLS              DSI_WISR_PLLLS
0838 #define DSI_FLAG_PLLL               DSI_WISR_PLLLIF
0839 #define DSI_FLAG_PLLU               DSI_WISR_PLLUIF
0840 #define DSI_FLAG_RRS                DSI_WISR_RRS
0841 #define DSI_FLAG_RR                 DSI_WISR_RRIF
0842 /**
0843   * @}
0844   */
0845 
0846 /** @defgroup DSI_Interrupts DSI Interrupts
0847   * @ingroup RTEMSBSPsARMSTM32H7
0848   * @{
0849   */
0850 #define DSI_IT_TE                   DSI_WIER_TEIE
0851 #define DSI_IT_ER                   DSI_WIER_ERIE
0852 #define DSI_IT_PLLL                 DSI_WIER_PLLLIE
0853 #define DSI_IT_PLLU                 DSI_WIER_PLLUIE
0854 #define DSI_IT_RR                   DSI_WIER_RRIE
0855 /**
0856   * @}
0857   */
0858 
0859 /** @defgroup DSI_SHORT_WRITE_PKT_Data_Type DSI SHORT WRITE PKT Data Type
0860   * @ingroup RTEMSBSPsARMSTM32H7
0861   * @{
0862   */
0863 #define DSI_DCS_SHORT_PKT_WRITE_P0  0x00000005U /*!< DCS short write, no parameters      */
0864 #define DSI_DCS_SHORT_PKT_WRITE_P1  0x00000015U /*!< DCS short write, one parameter      */
0865 #define DSI_GEN_SHORT_PKT_WRITE_P0  0x00000003U /*!< Generic short write, no parameters  */
0866 #define DSI_GEN_SHORT_PKT_WRITE_P1  0x00000013U /*!< Generic short write, one parameter  */
0867 #define DSI_GEN_SHORT_PKT_WRITE_P2  0x00000023U /*!< Generic short write, two parameters */
0868 /**
0869   * @}
0870   */
0871 
0872 /** @defgroup DSI_LONG_WRITE_PKT_Data_Type DSI LONG WRITE PKT Data Type
0873   * @ingroup RTEMSBSPsARMSTM32H7
0874   * @{
0875   */
0876 #define DSI_DCS_LONG_PKT_WRITE      0x00000039U /*!< DCS long write     */
0877 #define DSI_GEN_LONG_PKT_WRITE      0x00000029U /*!< Generic long write */
0878 /**
0879   * @}
0880   */
0881 
0882 /** @defgroup DSI_SHORT_READ_PKT_Data_Type DSI SHORT READ PKT Data Type
0883   * @ingroup RTEMSBSPsARMSTM32H7
0884   * @{
0885   */
0886 #define DSI_DCS_SHORT_PKT_READ      0x00000006U /*!< DCS short read                     */
0887 #define DSI_GEN_SHORT_PKT_READ_P0   0x00000004U /*!< Generic short read, no parameters  */
0888 #define DSI_GEN_SHORT_PKT_READ_P1   0x00000014U /*!< Generic short read, one parameter  */
0889 #define DSI_GEN_SHORT_PKT_READ_P2   0x00000024U /*!< Generic short read, two parameters */
0890 /**
0891   * @}
0892   */
0893 
0894 /** @defgroup DSI_Error_Data_Type DSI Error Data Type
0895   * @ingroup RTEMSBSPsARMSTM32H7
0896   * @{
0897   */
0898 #define HAL_DSI_ERROR_NONE              0U
0899 #define HAL_DSI_ERROR_ACK               0x00000001U /*!< Acknowledge errors             */
0900 #define HAL_DSI_ERROR_PHY               0x00000002U /*!< PHY related errors             */
0901 #define HAL_DSI_ERROR_TX                0x00000004U /*!< Transmission error             */
0902 #define HAL_DSI_ERROR_RX                0x00000008U /*!< Reception error                */
0903 #define HAL_DSI_ERROR_ECC               0x00000010U /*!< ECC errors                     */
0904 #define HAL_DSI_ERROR_CRC               0x00000020U /*!< CRC error                      */
0905 #define HAL_DSI_ERROR_PSE               0x00000040U /*!< Packet Size error              */
0906 #define HAL_DSI_ERROR_EOT               0x00000080U /*!< End Of Transmission error      */
0907 #define HAL_DSI_ERROR_OVF               0x00000100U /*!< FIFO overflow error            */
0908 #define HAL_DSI_ERROR_GEN               0x00000200U /*!< Generic FIFO related errors    */
0909 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
0910 #define HAL_DSI_ERROR_INVALID_CALLBACK  0x00000400U /*!< DSI Invalid Callback error      */
0911 #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
0912 /**
0913   * @}
0914   */
0915 
0916 /** @defgroup DSI_Lane_Group DSI Lane Group
0917   * @ingroup RTEMSBSPsARMSTM32H7
0918   * @{
0919   */
0920 #define DSI_CLOCK_LANE              0x00000000U
0921 #define DSI_DATA_LANES              0x00000001U
0922 /**
0923   * @}
0924   */
0925 
0926 /** @defgroup DSI_Communication_Delay DSI Communication Delay
0927   * @ingroup RTEMSBSPsARMSTM32H7
0928   * @{
0929   */
0930 #define DSI_SLEW_RATE_HSTX          0x00000000U
0931 #define DSI_SLEW_RATE_LPTX          0x00000001U
0932 #define DSI_HS_DELAY                0x00000002U
0933 /**
0934   * @}
0935   */
0936 
0937 /** @defgroup DSI_CustomLane DSI CustomLane
0938   * @ingroup RTEMSBSPsARMSTM32H7
0939   * @{
0940   */
0941 #define DSI_SWAP_LANE_PINS          0x00000000U
0942 #define DSI_INVERT_HS_SIGNAL        0x00000001U
0943 /**
0944   * @}
0945   */
0946 
0947 /** @defgroup DSI_Lane_Select DSI Lane Select
0948   * @ingroup RTEMSBSPsARMSTM32H7
0949   * @{
0950   */
0951 #define DSI_CLK_LANE                0x00000000U
0952 #define DSI_DATA_LANE0              0x00000001U
0953 #define DSI_DATA_LANE1              0x00000002U
0954 /**
0955   * @}
0956   */
0957 
0958 /** @defgroup DSI_PHY_Timing DSI PHY Timing
0959   * @ingroup RTEMSBSPsARMSTM32H7
0960   * @{
0961   */
0962 #define DSI_TCLK_POST               0x00000000U
0963 #define DSI_TLPX_CLK                0x00000001U
0964 #define DSI_THS_EXIT                0x00000002U
0965 #define DSI_TLPX_DATA               0x00000003U
0966 #define DSI_THS_ZERO                0x00000004U
0967 #define DSI_THS_TRAIL               0x00000005U
0968 #define DSI_THS_PREPARE             0x00000006U
0969 #define DSI_TCLK_ZERO               0x00000007U
0970 #define DSI_TCLK_PREPARE            0x00000008U
0971 /**
0972   * @}
0973   */
0974 
0975 
0976 /**
0977   * @}
0978   */
0979 
0980 /* Exported macros -----------------------------------------------------------*/
0981 /** @defgroup DSI_Exported_Macros DSI Exported Macros
0982   * @ingroup RTEMSBSPsARMSTM32H7
0983   * @{
0984   */
0985 
0986 /**
0987   * @brief Reset DSI handle state.
0988   * @param  __HANDLE__ DSI handle
0989   * @retval None
0990   */
0991 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
0992 #define __HAL_DSI_RESET_HANDLE_STATE(__HANDLE__) do{                                               \
0993                                                      (__HANDLE__)->State = HAL_DSI_STATE_RESET;    \
0994                                                      (__HANDLE__)->MspInitCallback = NULL;         \
0995                                                      (__HANDLE__)->MspDeInitCallback = NULL;       \
0996                                                    } while(0)
0997 #else
0998 #define __HAL_DSI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DSI_STATE_RESET)
0999 #endif /*USE_HAL_DSI_REGISTER_CALLBACKS */
1000 
1001 /**
1002   * @brief  Enables the DSI host.
1003   * @param  __HANDLE__  DSI handle
1004   * @retval None.
1005   */
1006 #define __HAL_DSI_ENABLE(__HANDLE__) do { \
1007                                           __IO uint32_t tmpreg = 0x00U; \
1008                                           SET_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
1009                                           /* Delay after an DSI Host enabling */ \
1010                                           tmpreg = READ_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
1011                                           UNUSED(tmpreg); \
1012                                         } while(0U)
1013 
1014 /**
1015   * @brief  Disables the DSI host.
1016   * @param  __HANDLE__  DSI handle
1017   * @retval None.
1018   */
1019 #define __HAL_DSI_DISABLE(__HANDLE__) do { \
1020                                            __IO uint32_t tmpreg = 0x00U; \
1021                                            CLEAR_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
1022                                            /* Delay after an DSI Host disabling */ \
1023                                            tmpreg = READ_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
1024                                            UNUSED(tmpreg); \
1025                                          } while(0U)
1026 
1027 /**
1028   * @brief  Enables the DSI wrapper.
1029   * @param  __HANDLE__  DSI handle
1030   * @retval None.
1031   */
1032 #define __HAL_DSI_WRAPPER_ENABLE(__HANDLE__) do { \
1033                                                   __IO uint32_t tmpreg = 0x00U; \
1034                                                   SET_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
1035                                                   /* Delay after an DSI wrapper enabling */ \
1036                                                   tmpreg = READ_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
1037                                                   UNUSED(tmpreg); \
1038                                                 } while(0U)
1039 
1040 /**
1041   * @brief  Disable the DSI wrapper.
1042   * @param  __HANDLE__  DSI handle
1043   * @retval None.
1044   */
1045 #define __HAL_DSI_WRAPPER_DISABLE(__HANDLE__) do { \
1046                                                    __IO uint32_t tmpreg = 0x00U; \
1047                                                    CLEAR_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
1048                                                    /* Delay after an DSI wrapper disabling*/ \
1049                                                    tmpreg = READ_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
1050                                                    UNUSED(tmpreg); \
1051                                                  } while(0U)
1052 
1053 /**
1054   * @brief  Enables the DSI PLL.
1055   * @param  __HANDLE__  DSI handle
1056   * @retval None.
1057   */
1058 #define __HAL_DSI_PLL_ENABLE(__HANDLE__) do { \
1059                                               __IO uint32_t tmpreg = 0x00U; \
1060                                               SET_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
1061                                               /* Delay after an DSI PLL enabling */ \
1062                                               tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
1063                                               UNUSED(tmpreg); \
1064                                             } while(0U)
1065 
1066 /**
1067   * @brief  Disables the DSI PLL.
1068   * @param  __HANDLE__  DSI handle
1069   * @retval None.
1070   */
1071 #define __HAL_DSI_PLL_DISABLE(__HANDLE__) do { \
1072                                                __IO uint32_t tmpreg = 0x00U; \
1073                                                CLEAR_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
1074                                                /* Delay after an DSI PLL disabling */ \
1075                                                tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
1076                                                UNUSED(tmpreg); \
1077                                              } while(0U)
1078 
1079 /**
1080   * @brief  Enables the DSI regulator.
1081   * @param  __HANDLE__  DSI handle
1082   * @retval None.
1083   */
1084 #define __HAL_DSI_REG_ENABLE(__HANDLE__) do { \
1085                                               __IO uint32_t tmpreg = 0x00U; \
1086                                               SET_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
1087                                               /* Delay after an DSI regulator enabling */ \
1088                                               tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
1089                                               UNUSED(tmpreg); \
1090                                             } while(0U)
1091 
1092 /**
1093   * @brief  Disables the DSI regulator.
1094   * @param  __HANDLE__  DSI handle
1095   * @retval None.
1096   */
1097 #define __HAL_DSI_REG_DISABLE(__HANDLE__) do { \
1098                                                __IO uint32_t tmpreg = 0x00U; \
1099                                                CLEAR_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
1100                                                /* Delay after an DSI regulator disabling */ \
1101                                                tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
1102                                                UNUSED(tmpreg); \
1103                                              } while(0U)
1104 
1105 /**
1106   * @brief  Get the DSI pending flags.
1107   * @param  __HANDLE__  DSI handle.
1108   * @param  __FLAG__  Get the specified flag.
1109   *          This parameter can be any combination of the following values:
1110   *            @arg DSI_FLAG_TE   : Tearing Effect Interrupt Flag
1111   *            @arg DSI_FLAG_ER   : End of Refresh Interrupt Flag
1112   *            @arg DSI_FLAG_BUSY : Busy Flag
1113   *            @arg DSI_FLAG_PLLLS: PLL Lock Status
1114   *            @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
1115   *            @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
1116   *            @arg DSI_FLAG_RRS  : Regulator Ready Flag
1117   *            @arg DSI_FLAG_RR   : Regulator Ready Interrupt Flag
1118   * @retval The state of FLAG (SET or RESET).
1119   */
1120 #define __HAL_DSI_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WISR & (__FLAG__))
1121 
1122 /**
1123   * @brief  Clears the DSI pending flags.
1124   * @param  __HANDLE__  DSI handle.
1125   * @param  __FLAG__  specifies the flag to clear.
1126   *          This parameter can be any combination of the following values:
1127   *            @arg DSI_FLAG_TE   : Tearing Effect Interrupt Flag
1128   *            @arg DSI_FLAG_ER   : End of Refresh Interrupt Flag
1129   *            @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
1130   *            @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
1131   *            @arg DSI_FLAG_RR   : Regulator Ready Interrupt Flag
1132   * @retval None
1133   */
1134 #define __HAL_DSI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WIFCR = (__FLAG__))
1135 
1136 /**
1137   * @brief  Enables the specified DSI interrupts.
1138   * @param  __HANDLE__  DSI handle.
1139   * @param __INTERRUPT__  specifies the DSI interrupt sources to be enabled.
1140   *          This parameter can be any combination of the following values:
1141   *            @arg DSI_IT_TE  : Tearing Effect Interrupt
1142   *            @arg DSI_IT_ER  : End of Refresh Interrupt
1143   *            @arg DSI_IT_PLLL: PLL Lock Interrupt
1144   *            @arg DSI_IT_PLLU: PLL Unlock Interrupt
1145   *            @arg DSI_IT_RR  : Regulator Ready Interrupt
1146   * @retval None
1147   */
1148 #define __HAL_DSI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER |= (__INTERRUPT__))
1149 
1150 /**
1151   * @brief  Disables the specified DSI interrupts.
1152   * @param  __HANDLE__  DSI handle
1153   * @param __INTERRUPT__  specifies the DSI interrupt sources to be disabled.
1154   *          This parameter can be any combination of the following values:
1155   *            @arg DSI_IT_TE  : Tearing Effect Interrupt
1156   *            @arg DSI_IT_ER  : End of Refresh Interrupt
1157   *            @arg DSI_IT_PLLL: PLL Lock Interrupt
1158   *            @arg DSI_IT_PLLU: PLL Unlock Interrupt
1159   *            @arg DSI_IT_RR  : Regulator Ready Interrupt
1160   * @retval None
1161   */
1162 #define __HAL_DSI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER &= ~(__INTERRUPT__))
1163 
1164 /**
1165   * @brief  Checks whether the specified DSI interrupt source is enabled or not.
1166   * @param  __HANDLE__  DSI handle
1167   * @param  __INTERRUPT__  specifies the DSI interrupt source to check.
1168   *          This parameter can be one of the following values:
1169   *            @arg DSI_IT_TE  : Tearing Effect Interrupt
1170   *            @arg DSI_IT_ER  : End of Refresh Interrupt
1171   *            @arg DSI_IT_PLLL: PLL Lock Interrupt
1172   *            @arg DSI_IT_PLLU: PLL Unlock Interrupt
1173   *            @arg DSI_IT_RR  : Regulator Ready Interrupt
1174   * @retval The state of INTERRUPT (SET or RESET).
1175   */
1176 #define __HAL_DSI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER & (__INTERRUPT__))
1177 
1178 /**
1179   * @}
1180   */
1181 
1182 /* Exported functions --------------------------------------------------------*/
1183 /** @defgroup DSI_Exported_Functions DSI Exported Functions
1184   * @ingroup RTEMSBSPsARMSTM32H7
1185   * @{
1186   */
1187 /** @defgroup DSI_Group1 Initialization and Configuration functions
1188   * @ingroup RTEMSBSPsARMSTM32H7
1189   *  @brief   Initialization and Configuration functions
1190   * @{
1191   */
1192 HAL_StatusTypeDef HAL_DSI_Init(DSI_HandleTypeDef *hdsi, DSI_PLLInitTypeDef *PLLInit);
1193 HAL_StatusTypeDef HAL_DSI_DeInit(DSI_HandleTypeDef *hdsi);
1194 void HAL_DSI_MspInit(DSI_HandleTypeDef *hdsi);
1195 void HAL_DSI_MspDeInit(DSI_HandleTypeDef *hdsi);
1196 HAL_StatusTypeDef HAL_DSI_ConfigErrorMonitor(DSI_HandleTypeDef *hdsi, uint32_t ActiveErrors);
1197 /* Callbacks Register/UnRegister functions  ***********************************/
1198 #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
1199 HAL_StatusTypeDef HAL_DSI_RegisterCallback(DSI_HandleTypeDef *hdsi, HAL_DSI_CallbackIDTypeDef CallbackID,
1200                                            pDSI_CallbackTypeDef pCallback);
1201 HAL_StatusTypeDef HAL_DSI_UnRegisterCallback(DSI_HandleTypeDef *hdsi, HAL_DSI_CallbackIDTypeDef CallbackID);
1202 #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
1203 /**
1204   * @}
1205   */
1206 
1207 /** @defgroup DSI_Group2 IO operation functions
1208   * @ingroup RTEMSBSPsARMSTM32H7
1209   *  @brief    IO operation functions
1210   * @{
1211   */
1212 void HAL_DSI_IRQHandler(DSI_HandleTypeDef *hdsi);
1213 void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef *hdsi);
1214 void HAL_DSI_EndOfRefreshCallback(DSI_HandleTypeDef *hdsi);
1215 void HAL_DSI_ErrorCallback(DSI_HandleTypeDef *hdsi);
1216 /**
1217   * @}
1218   */
1219 
1220 /** @defgroup DSI_Group3 Peripheral Control functions
1221   * @ingroup RTEMSBSPsARMSTM32H7
1222   *  @brief    Peripheral Control functions
1223   * @{
1224   */
1225 HAL_StatusTypeDef HAL_DSI_SetGenericVCID(DSI_HandleTypeDef *hdsi, uint32_t VirtualChannelID);
1226 HAL_StatusTypeDef HAL_DSI_ConfigVideoMode(DSI_HandleTypeDef *hdsi, DSI_VidCfgTypeDef *VidCfg);
1227 HAL_StatusTypeDef HAL_DSI_ConfigAdaptedCommandMode(DSI_HandleTypeDef *hdsi, DSI_CmdCfgTypeDef *CmdCfg);
1228 HAL_StatusTypeDef HAL_DSI_ConfigCommand(DSI_HandleTypeDef *hdsi, DSI_LPCmdTypeDef *LPCmd);
1229 HAL_StatusTypeDef HAL_DSI_ConfigFlowControl(DSI_HandleTypeDef *hdsi, uint32_t FlowControl);
1230 HAL_StatusTypeDef HAL_DSI_ConfigPhyTimer(DSI_HandleTypeDef *hdsi, DSI_PHY_TimerTypeDef *PhyTimers);
1231 HAL_StatusTypeDef HAL_DSI_ConfigHostTimeouts(DSI_HandleTypeDef *hdsi, DSI_HOST_TimeoutTypeDef *HostTimeouts);
1232 HAL_StatusTypeDef HAL_DSI_Start(DSI_HandleTypeDef *hdsi);
1233 HAL_StatusTypeDef HAL_DSI_Stop(DSI_HandleTypeDef *hdsi);
1234 HAL_StatusTypeDef HAL_DSI_Refresh(DSI_HandleTypeDef *hdsi);
1235 HAL_StatusTypeDef HAL_DSI_ColorMode(DSI_HandleTypeDef *hdsi, uint32_t ColorMode);
1236 HAL_StatusTypeDef HAL_DSI_Shutdown(DSI_HandleTypeDef *hdsi, uint32_t Shutdown);
1237 HAL_StatusTypeDef HAL_DSI_ShortWrite(DSI_HandleTypeDef *hdsi,
1238                                      uint32_t ChannelID,
1239                                      uint32_t Mode,
1240                                      uint32_t Param1,
1241                                      uint32_t Param2);
1242 HAL_StatusTypeDef HAL_DSI_LongWrite(DSI_HandleTypeDef *hdsi,
1243                                     uint32_t ChannelID,
1244                                     uint32_t Mode,
1245                                     uint32_t NbParams,
1246                                     uint32_t Param1,
1247                                     const uint8_t *ParametersTable);
1248 HAL_StatusTypeDef HAL_DSI_Read(DSI_HandleTypeDef *hdsi,
1249                                uint32_t ChannelNbr,
1250                                uint8_t *Array,
1251                                uint32_t Size,
1252                                uint32_t Mode,
1253                                uint32_t DCSCmd,
1254                                uint8_t *ParametersTable);
1255 HAL_StatusTypeDef HAL_DSI_EnterULPMData(DSI_HandleTypeDef *hdsi);
1256 HAL_StatusTypeDef HAL_DSI_ExitULPMData(DSI_HandleTypeDef *hdsi);
1257 HAL_StatusTypeDef HAL_DSI_EnterULPM(DSI_HandleTypeDef *hdsi);
1258 HAL_StatusTypeDef HAL_DSI_ExitULPM(DSI_HandleTypeDef *hdsi);
1259 
1260 HAL_StatusTypeDef HAL_DSI_PatternGeneratorStart(DSI_HandleTypeDef *hdsi, uint32_t Mode, uint32_t Orientation);
1261 HAL_StatusTypeDef HAL_DSI_PatternGeneratorStop(DSI_HandleTypeDef *hdsi);
1262 
1263 HAL_StatusTypeDef HAL_DSI_SetSlewRateAndDelayTuning(DSI_HandleTypeDef *hdsi, uint32_t CommDelay, uint32_t Lane,
1264                                                     uint32_t Value);
1265 HAL_StatusTypeDef HAL_DSI_SetLowPowerRXFilter(DSI_HandleTypeDef *hdsi, uint32_t Frequency);
1266 HAL_StatusTypeDef HAL_DSI_SetSDD(DSI_HandleTypeDef *hdsi, FunctionalState State);
1267 HAL_StatusTypeDef HAL_DSI_SetLanePinsConfiguration(DSI_HandleTypeDef *hdsi, uint32_t CustomLane, uint32_t Lane,
1268                                                    FunctionalState State);
1269 HAL_StatusTypeDef HAL_DSI_SetPHYTimings(DSI_HandleTypeDef *hdsi, uint32_t Timing, FunctionalState State,
1270                                         uint32_t Value);
1271 HAL_StatusTypeDef HAL_DSI_ForceTXStopMode(DSI_HandleTypeDef *hdsi, uint32_t Lane, FunctionalState State);
1272 HAL_StatusTypeDef HAL_DSI_ForceRXLowPower(DSI_HandleTypeDef *hdsi, FunctionalState State);
1273 HAL_StatusTypeDef HAL_DSI_ForceDataLanesInRX(DSI_HandleTypeDef *hdsi, FunctionalState State);
1274 HAL_StatusTypeDef HAL_DSI_SetPullDown(DSI_HandleTypeDef *hdsi, FunctionalState State);
1275 HAL_StatusTypeDef HAL_DSI_SetContentionDetectionOff(DSI_HandleTypeDef *hdsi, FunctionalState State);
1276 
1277 /**
1278   * @}
1279   */
1280 
1281 /** @defgroup DSI_Group4 Peripheral State and Errors functions
1282   * @ingroup RTEMSBSPsARMSTM32H7
1283   *  @brief    Peripheral State and Errors functions
1284   * @{
1285   */
1286 uint32_t HAL_DSI_GetError(const DSI_HandleTypeDef *hdsi);
1287 HAL_DSI_StateTypeDef HAL_DSI_GetState(const DSI_HandleTypeDef *hdsi);
1288 
1289 /**
1290   * @}
1291   */
1292 
1293 /**
1294   * @}
1295   */
1296 
1297 /* Private types -------------------------------------------------------------*/
1298 /* Private defines -----------------------------------------------------------*/
1299 /* Private variables ---------------------------------------------------------*/
1300 /* Private constants ---------------------------------------------------------*/
1301 /** @defgroup DSI_Private_Constants DSI Private Constants
1302   * @ingroup RTEMSBSPsARMSTM32H7
1303   * @{
1304   */
1305 #define DSI_MAX_RETURN_PKT_SIZE (0x00000037U) /*!< Maximum return packet configuration */
1306 /**
1307   * @}
1308   */
1309 
1310 /* Private macros ------------------------------------------------------------*/
1311 /** @defgroup DSI_Private_Macros DSI Private Macros
1312   * @ingroup RTEMSBSPsARMSTM32H7
1313   * @{
1314   */
1315 #define IS_DSI_PLL_NDIV(NDIV)                       ((10U <= (NDIV)) && ((NDIV) <= 125U))
1316 #define IS_DSI_PLL_IDF(IDF)                         (((IDF) == DSI_PLL_IN_DIV1) || \
1317                                                      ((IDF) == DSI_PLL_IN_DIV2) || \
1318                                                      ((IDF) == DSI_PLL_IN_DIV3) || \
1319                                                      ((IDF) == DSI_PLL_IN_DIV4) || \
1320                                                      ((IDF) == DSI_PLL_IN_DIV5) || \
1321                                                      ((IDF) == DSI_PLL_IN_DIV6) || \
1322                                                      ((IDF) == DSI_PLL_IN_DIV7))
1323 #define IS_DSI_PLL_ODF(ODF)                         (((ODF) == DSI_PLL_OUT_DIV1) || \
1324                                                      ((ODF) == DSI_PLL_OUT_DIV2) || \
1325                                                      ((ODF) == DSI_PLL_OUT_DIV4) || \
1326                                                      ((ODF) == DSI_PLL_OUT_DIV8))
1327 #define IS_DSI_AUTO_CLKLANE_CONTROL(AutoClkLane)    (((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_DISABLE)\
1328                                                      || ((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_ENABLE))
1329 #define IS_DSI_NUMBER_OF_LANES(NumberOfLanes)       (((NumberOfLanes) == DSI_ONE_DATA_LANE)\
1330                                                      || ((NumberOfLanes) == DSI_TWO_DATA_LANES))
1331 #define IS_DSI_FLOW_CONTROL(FlowControl)            (((FlowControl) | DSI_FLOW_CONTROL_ALL) == DSI_FLOW_CONTROL_ALL)
1332 #define IS_DSI_COLOR_CODING(ColorCoding)            ((ColorCoding) <= 5U)
1333 #define IS_DSI_LOOSELY_PACKED(LooselyPacked)        (((LooselyPacked) == DSI_LOOSELY_PACKED_ENABLE)\
1334                                                      || ((LooselyPacked) == DSI_LOOSELY_PACKED_DISABLE))
1335 #define IS_DSI_DE_POLARITY(DataEnable)              (((DataEnable) == DSI_DATA_ENABLE_ACTIVE_HIGH)\
1336                                                      || ((DataEnable) == DSI_DATA_ENABLE_ACTIVE_LOW))
1337 #define IS_DSI_VSYNC_POLARITY(Vsync)                (((Vsync) == DSI_VSYNC_ACTIVE_HIGH)\
1338                                                      || ((Vsync) == DSI_VSYNC_ACTIVE_LOW))
1339 #define IS_DSI_HSYNC_POLARITY(Hsync)                (((Hsync) == DSI_HSYNC_ACTIVE_HIGH)\
1340                                                      || ((Hsync) == DSI_HSYNC_ACTIVE_LOW))
1341 #define IS_DSI_VIDEO_MODE_TYPE(VideoModeType)       (((VideoModeType) == DSI_VID_MODE_NB_PULSES) || \
1342                                                      ((VideoModeType) == DSI_VID_MODE_NB_EVENTS) || \
1343                                                      ((VideoModeType) == DSI_VID_MODE_BURST))
1344 #define IS_DSI_COLOR_MODE(ColorMode)                (((ColorMode) == DSI_COLOR_MODE_FULL)\
1345                                                      || ((ColorMode) == DSI_COLOR_MODE_EIGHT))
1346 #define IS_DSI_SHUT_DOWN(ShutDown)                  (((ShutDown) == DSI_DISPLAY_ON) || ((ShutDown) == DSI_DISPLAY_OFF))
1347 #define IS_DSI_LP_COMMAND(LPCommand)                (((LPCommand) == DSI_LP_COMMAND_DISABLE)\
1348                                                      || ((LPCommand) == DSI_LP_COMMAND_ENABLE))
1349 #define IS_DSI_LP_HFP(LPHFP)                        (((LPHFP) == DSI_LP_HFP_DISABLE) || ((LPHFP) == DSI_LP_HFP_ENABLE))
1350 #define IS_DSI_LP_HBP(LPHBP)                        (((LPHBP) == DSI_LP_HBP_DISABLE) || ((LPHBP) == DSI_LP_HBP_ENABLE))
1351 #define IS_DSI_LP_VACTIVE(LPVActive)                (((LPVActive) == DSI_LP_VACT_DISABLE)\
1352                                                      || ((LPVActive) == DSI_LP_VACT_ENABLE))
1353 #define IS_DSI_LP_VFP(LPVFP)                        (((LPVFP) == DSI_LP_VFP_DISABLE) || ((LPVFP) == DSI_LP_VFP_ENABLE))
1354 #define IS_DSI_LP_VBP(LPVBP)                        (((LPVBP) == DSI_LP_VBP_DISABLE) || ((LPVBP) == DSI_LP_VBP_ENABLE))
1355 #define IS_DSI_LP_VSYNC(LPVSYNC)                    (((LPVSYNC) == DSI_LP_VSYNC_DISABLE)\
1356                                                      || ((LPVSYNC) == DSI_LP_VSYNC_ENABLE))
1357 #define IS_DSI_FBTAA(FrameBTAAcknowledge)           (((FrameBTAAcknowledge) == DSI_FBTAA_DISABLE)\
1358                                                      || ((FrameBTAAcknowledge) == DSI_FBTAA_ENABLE))
1359 #define IS_DSI_TE_SOURCE(TESource)                  (((TESource) == DSI_TE_DSILINK) || ((TESource) == DSI_TE_EXTERNAL))
1360 #define IS_DSI_TE_POLARITY(TEPolarity)              (((TEPolarity) == DSI_TE_RISING_EDGE)\
1361                                                      || ((TEPolarity) == DSI_TE_FALLING_EDGE))
1362 #define IS_DSI_AUTOMATIC_REFRESH(AutomaticRefresh)  (((AutomaticRefresh) == DSI_AR_DISABLE)\
1363                                                      || ((AutomaticRefresh) == DSI_AR_ENABLE))
1364 #define IS_DSI_VS_POLARITY(VSPolarity)              (((VSPolarity) == DSI_VSYNC_FALLING)\
1365                                                      || ((VSPolarity) == DSI_VSYNC_RISING))
1366 #define IS_DSI_TE_ACK_REQUEST(TEAcknowledgeRequest) (((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_DISABLE)\
1367                                                      || ((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_ENABLE))
1368 #define IS_DSI_ACK_REQUEST(AcknowledgeRequest)      (((AcknowledgeRequest) == DSI_ACKNOWLEDGE_DISABLE)\
1369                                                      || ((AcknowledgeRequest) == DSI_ACKNOWLEDGE_ENABLE))
1370 #define IS_DSI_LP_GSW0P(LP_GSW0P)                   (((LP_GSW0P) == DSI_LP_GSW0P_DISABLE)\
1371                                                      || ((LP_GSW0P) == DSI_LP_GSW0P_ENABLE))
1372 #define IS_DSI_LP_GSW1P(LP_GSW1P)                   (((LP_GSW1P) == DSI_LP_GSW1P_DISABLE)\
1373                                                      || ((LP_GSW1P) == DSI_LP_GSW1P_ENABLE))
1374 #define IS_DSI_LP_GSW2P(LP_GSW2P)                   (((LP_GSW2P) == DSI_LP_GSW2P_DISABLE)\
1375                                                      || ((LP_GSW2P) == DSI_LP_GSW2P_ENABLE))
1376 #define IS_DSI_LP_GSR0P(LP_GSR0P)                   (((LP_GSR0P) == DSI_LP_GSR0P_DISABLE)\
1377                                                      || ((LP_GSR0P) == DSI_LP_GSR0P_ENABLE))
1378 #define IS_DSI_LP_GSR1P(LP_GSR1P)                   (((LP_GSR1P) == DSI_LP_GSR1P_DISABLE)\
1379                                                      || ((LP_GSR1P) == DSI_LP_GSR1P_ENABLE))
1380 #define IS_DSI_LP_GSR2P(LP_GSR2P)                   (((LP_GSR2P) == DSI_LP_GSR2P_DISABLE)\
1381                                                      || ((LP_GSR2P) == DSI_LP_GSR2P_ENABLE))
1382 #define IS_DSI_LP_GLW(LP_GLW)                       (((LP_GLW) == DSI_LP_GLW_DISABLE)\
1383                                                      || ((LP_GLW) == DSI_LP_GLW_ENABLE))
1384 #define IS_DSI_LP_DSW0P(LP_DSW0P)                   (((LP_DSW0P) == DSI_LP_DSW0P_DISABLE)\
1385                                                      || ((LP_DSW0P) == DSI_LP_DSW0P_ENABLE))
1386 #define IS_DSI_LP_DSW1P(LP_DSW1P)                   (((LP_DSW1P) == DSI_LP_DSW1P_DISABLE)\
1387                                                      || ((LP_DSW1P) == DSI_LP_DSW1P_ENABLE))
1388 #define IS_DSI_LP_DSR0P(LP_DSR0P)                   (((LP_DSR0P) == DSI_LP_DSR0P_DISABLE)\
1389                                                      || ((LP_DSR0P) == DSI_LP_DSR0P_ENABLE))
1390 #define IS_DSI_LP_DLW(LP_DLW)                       (((LP_DLW) == DSI_LP_DLW_DISABLE)\
1391                                                      || ((LP_DLW) == DSI_LP_DLW_ENABLE))
1392 #define IS_DSI_LP_MRDP(LP_MRDP)                     (((LP_MRDP) == DSI_LP_MRDP_DISABLE)\
1393                                                      || ((LP_MRDP) == DSI_LP_MRDP_ENABLE))
1394 #define IS_DSI_SHORT_WRITE_PACKET_TYPE(MODE)        (((MODE) == DSI_DCS_SHORT_PKT_WRITE_P0) || \
1395                                                      ((MODE) == DSI_DCS_SHORT_PKT_WRITE_P1) || \
1396                                                      ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P0) || \
1397                                                      ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P1) || \
1398                                                      ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P2))
1399 #define IS_DSI_LONG_WRITE_PACKET_TYPE(MODE)         (((MODE) == DSI_DCS_LONG_PKT_WRITE) || \
1400                                                      ((MODE) == DSI_GEN_LONG_PKT_WRITE))
1401 #define IS_DSI_READ_PACKET_TYPE(MODE)               (((MODE) == DSI_DCS_SHORT_PKT_READ) || \
1402                                                      ((MODE) == DSI_GEN_SHORT_PKT_READ_P0) || \
1403                                                      ((MODE) == DSI_GEN_SHORT_PKT_READ_P1) || \
1404                                                      ((MODE) == DSI_GEN_SHORT_PKT_READ_P2))
1405 #define IS_DSI_COMMUNICATION_DELAY(CommDelay)       (((CommDelay) == DSI_SLEW_RATE_HSTX) || \
1406                                                      ((CommDelay) == DSI_SLEW_RATE_LPTX) || \
1407                                                      ((CommDelay) == DSI_HS_DELAY))
1408 #define IS_DSI_LANE_GROUP(Lane)                     (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANES))
1409 #define IS_DSI_CUSTOM_LANE(CustomLane)              (((CustomLane) == DSI_SWAP_LANE_PINS)\
1410                                                      || ((CustomLane) == DSI_INVERT_HS_SIGNAL))
1411 #define IS_DSI_LANE(Lane)                           (((Lane) == DSI_CLOCK_LANE) || \
1412                                                      ((Lane) == DSI_DATA_LANE0) || ((Lane) == DSI_DATA_LANE1))
1413 #define IS_DSI_PHY_TIMING(Timing)                   (((Timing) == DSI_TCLK_POST   ) || \
1414                                                      ((Timing) == DSI_TLPX_CLK    ) || \
1415                                                      ((Timing) == DSI_THS_EXIT    ) || \
1416                                                      ((Timing) == DSI_TLPX_DATA   ) || \
1417                                                      ((Timing) == DSI_THS_ZERO    ) || \
1418                                                      ((Timing) == DSI_THS_TRAIL   ) || \
1419                                                      ((Timing) == DSI_THS_PREPARE ) || \
1420                                                      ((Timing) == DSI_TCLK_ZERO   ) || \
1421                                                      ((Timing) == DSI_TCLK_PREPARE))
1422 
1423 /**
1424   * @}
1425   */
1426 
1427 /**
1428   * @}
1429   */
1430 
1431 /**
1432   * @}
1433   */
1434 #endif /* DSI */
1435 
1436 #ifdef __cplusplus
1437 }
1438 #endif
1439 
1440 #endif /* STM32H7xx_HAL_DSI_H */