stm32l4xx_hal_dsi.h 56 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377
  1. /**
  2. ******************************************************************************
  3. * @file stm32l4xx_hal_dsi.h
  4. * @author MCD Application Team
  5. * @brief Header file of DSI HAL module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * Copyright (c) 2017 STMicroelectronics.
  10. * All rights reserved.
  11. *
  12. * This software is licensed under terms that can be found in the LICENSE file
  13. * in the root directory of this software component.
  14. * If no LICENSE file comes with this software, it is provided AS-IS.
  15. *
  16. ******************************************************************************
  17. */
  18. /* Define to prevent recursive inclusion -------------------------------------*/
  19. #ifndef STM32L4xx_HAL_DSI_H
  20. #define STM32L4xx_HAL_DSI_H
  21. #ifdef __cplusplus
  22. extern "C" {
  23. #endif
  24. /* Includes ------------------------------------------------------------------*/
  25. #include "stm32l4xx_hal_def.h"
  26. #if defined(DSI)
  27. /** @addtogroup STM32L4xx_HAL_Driver
  28. * @{
  29. */
  30. /** @defgroup DSI DSI
  31. * @brief DSI HAL module driver
  32. * @{
  33. */
  34. /* Exported types ------------------------------------------------------------*/
  35. /** @defgroup DSI_Exported_Types DSI Exported Types
  36. * @{
  37. */
  38. /**
  39. * @brief DSI Init Structure definition
  40. */
  41. typedef struct
  42. {
  43. uint32_t AutomaticClockLaneControl; /*!< Automatic clock lane control
  44. This parameter can be any value of @ref DSI_Automatic_Clk_Lane_Control */
  45. uint32_t TXEscapeCkdiv; /*!< TX Escape clock division
  46. The values 0 and 1 stop the TX_ESC clock generation */
  47. uint32_t NumberOfLanes; /*!< Number of lanes
  48. This parameter can be any value of @ref DSI_Number_Of_Lanes */
  49. } DSI_InitTypeDef;
  50. /**
  51. * @brief DSI PLL Clock structure definition
  52. */
  53. typedef struct
  54. {
  55. uint32_t PLLNDIV; /*!< PLL Loop Division Factor
  56. This parameter must be a value between 10 and 125 */
  57. uint32_t PLLIDF; /*!< PLL Input Division Factor
  58. This parameter can be any value of @ref DSI_PLL_IDF */
  59. uint32_t PLLODF; /*!< PLL Output Division Factor
  60. This parameter can be any value of @ref DSI_PLL_ODF */
  61. } DSI_PLLInitTypeDef;
  62. /**
  63. * @brief DSI Video mode configuration
  64. */
  65. typedef struct
  66. {
  67. uint32_t VirtualChannelID; /*!< Virtual channel ID */
  68. uint32_t ColorCoding; /*!< Color coding for LTDC interface
  69. This parameter can be any value of @ref DSI_Color_Coding */
  70. uint32_t LooselyPacked; /*!< Enable or disable loosely packed stream (needed only when using
  71. 18-bit configuration).
  72. This parameter can be any value of @ref DSI_LooselyPacked */
  73. uint32_t Mode; /*!< Video mode type
  74. This parameter can be any value of @ref DSI_Video_Mode_Type */
  75. uint32_t PacketSize; /*!< Video packet size */
  76. uint32_t NumberOfChunks; /*!< Number of chunks */
  77. uint32_t NullPacketSize; /*!< Null packet size */
  78. uint32_t HSPolarity; /*!< HSYNC pin polarity
  79. This parameter can be any value of @ref DSI_HSYNC_Polarity */
  80. uint32_t VSPolarity; /*!< VSYNC pin polarity
  81. This parameter can be any value of @ref DSI_VSYNC_Active_Polarity */
  82. uint32_t DEPolarity; /*!< Data Enable pin polarity
  83. This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
  84. uint32_t HorizontalSyncActive; /*!< Horizontal synchronism active duration (in lane byte clock cycles) */
  85. uint32_t HorizontalBackPorch; /*!< Horizontal back-porch duration (in lane byte clock cycles) */
  86. uint32_t HorizontalLine; /*!< Horizontal line duration (in lane byte clock cycles) */
  87. uint32_t VerticalSyncActive; /*!< Vertical synchronism active duration */
  88. uint32_t VerticalBackPorch; /*!< Vertical back-porch duration */
  89. uint32_t VerticalFrontPorch; /*!< Vertical front-porch duration */
  90. uint32_t VerticalActive; /*!< Vertical active duration */
  91. uint32_t LPCommandEnable; /*!< Low-power command enable
  92. This parameter can be any value of @ref DSI_LP_Command */
  93. uint32_t LPLargestPacketSize; /*!< The size, in bytes, of the low power largest packet that
  94. can fit in a line during VSA, VBP and VFP regions */
  95. uint32_t LPVACTLargestPacketSize; /*!< The size, in bytes, of the low power largest packet that
  96. can fit in a line during VACT region */
  97. uint32_t LPHorizontalFrontPorchEnable; /*!< Low-power horizontal front-porch enable
  98. This parameter can be any value of @ref DSI_LP_HFP */
  99. uint32_t LPHorizontalBackPorchEnable; /*!< Low-power horizontal back-porch enable
  100. This parameter can be any value of @ref DSI_LP_HBP */
  101. uint32_t LPVerticalActiveEnable; /*!< Low-power vertical active enable
  102. This parameter can be any value of @ref DSI_LP_VACT */
  103. uint32_t LPVerticalFrontPorchEnable; /*!< Low-power vertical front-porch enable
  104. This parameter can be any value of @ref DSI_LP_VFP */
  105. uint32_t LPVerticalBackPorchEnable; /*!< Low-power vertical back-porch enable
  106. This parameter can be any value of @ref DSI_LP_VBP */
  107. uint32_t LPVerticalSyncActiveEnable; /*!< Low-power vertical sync active enable
  108. This parameter can be any value of @ref DSI_LP_VSYNC */
  109. uint32_t FrameBTAAcknowledgeEnable; /*!< Frame bus-turn-around acknowledge enable
  110. This parameter can be any value of @ref DSI_FBTA_acknowledge */
  111. } DSI_VidCfgTypeDef;
  112. /**
  113. * @brief DSI Adapted command mode configuration
  114. */
  115. typedef struct
  116. {
  117. uint32_t VirtualChannelID; /*!< Virtual channel ID */
  118. uint32_t ColorCoding; /*!< Color coding for LTDC interface
  119. This parameter can be any value of @ref DSI_Color_Coding */
  120. uint32_t CommandSize; /*!< Maximum allowed size for an LTDC write memory command, measured in
  121. pixels. This parameter can be any value between 0x00 and 0xFFFFU */
  122. uint32_t TearingEffectSource; /*!< Tearing effect source
  123. This parameter can be any value of @ref DSI_TearingEffectSource */
  124. uint32_t TearingEffectPolarity; /*!< Tearing effect pin polarity
  125. This parameter can be any value of @ref DSI_TearingEffectPolarity */
  126. uint32_t HSPolarity; /*!< HSYNC pin polarity
  127. This parameter can be any value of @ref DSI_HSYNC_Polarity */
  128. uint32_t VSPolarity; /*!< VSYNC pin polarity
  129. This parameter can be any value of @ref DSI_VSYNC_Active_Polarity */
  130. uint32_t DEPolarity; /*!< Data Enable pin polarity
  131. This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
  132. uint32_t VSyncPol; /*!< VSync edge on which the LTDC is halted
  133. This parameter can be any value of @ref DSI_Vsync_Polarity */
  134. uint32_t AutomaticRefresh; /*!< Automatic refresh mode
  135. This parameter can be any value of @ref DSI_AutomaticRefresh */
  136. uint32_t TEAcknowledgeRequest; /*!< Tearing Effect Acknowledge Request Enable
  137. This parameter can be any value of @ref DSI_TE_AcknowledgeRequest */
  138. } DSI_CmdCfgTypeDef;
  139. /**
  140. * @brief DSI command transmission mode configuration
  141. */
  142. typedef struct
  143. {
  144. uint32_t LPGenShortWriteNoP; /*!< Generic Short Write Zero parameters Transmission
  145. This parameter can be any value of @ref DSI_LP_LPGenShortWriteNoP */
  146. uint32_t LPGenShortWriteOneP; /*!< Generic Short Write One parameter Transmission
  147. This parameter can be any value of @ref DSI_LP_LPGenShortWriteOneP */
  148. uint32_t LPGenShortWriteTwoP; /*!< Generic Short Write Two parameters Transmission
  149. This parameter can be any value of @ref DSI_LP_LPGenShortWriteTwoP */
  150. uint32_t LPGenShortReadNoP; /*!< Generic Short Read Zero parameters Transmission
  151. This parameter can be any value of @ref DSI_LP_LPGenShortReadNoP */
  152. uint32_t LPGenShortReadOneP; /*!< Generic Short Read One parameter Transmission
  153. This parameter can be any value of @ref DSI_LP_LPGenShortReadOneP */
  154. uint32_t LPGenShortReadTwoP; /*!< Generic Short Read Two parameters Transmission
  155. This parameter can be any value of @ref DSI_LP_LPGenShortReadTwoP */
  156. uint32_t LPGenLongWrite; /*!< Generic Long Write Transmission
  157. This parameter can be any value of @ref DSI_LP_LPGenLongWrite */
  158. uint32_t LPDcsShortWriteNoP; /*!< DCS Short Write Zero parameters Transmission
  159. This parameter can be any value of @ref DSI_LP_LPDcsShortWriteNoP */
  160. uint32_t LPDcsShortWriteOneP; /*!< DCS Short Write One parameter Transmission
  161. This parameter can be any value of @ref DSI_LP_LPDcsShortWriteOneP */
  162. uint32_t LPDcsShortReadNoP; /*!< DCS Short Read Zero parameters Transmission
  163. This parameter can be any value of @ref DSI_LP_LPDcsShortReadNoP */
  164. uint32_t LPDcsLongWrite; /*!< DCS Long Write Transmission
  165. This parameter can be any value of @ref DSI_LP_LPDcsLongWrite */
  166. uint32_t LPMaxReadPacket; /*!< Maximum Read Packet Size Transmission
  167. This parameter can be any value of @ref DSI_LP_LPMaxReadPacket */
  168. uint32_t AcknowledgeRequest; /*!< Acknowledge Request Enable
  169. This parameter can be any value of @ref DSI_AcknowledgeRequest */
  170. } DSI_LPCmdTypeDef;
  171. /**
  172. * @brief DSI PHY Timings definition
  173. */
  174. typedef struct
  175. {
  176. uint32_t ClockLaneHS2LPTime; /*!< The maximum time that the D-PHY clock lane takes to go from high-speed
  177. to low-power transmission */
  178. uint32_t ClockLaneLP2HSTime; /*!< The maximum time that the D-PHY clock lane takes to go from low-power
  179. to high-speed transmission */
  180. uint32_t DataLaneHS2LPTime; /*!< The maximum time that the D-PHY data lanes takes to go from high-speed
  181. to low-power transmission */
  182. uint32_t DataLaneLP2HSTime; /*!< The maximum time that the D-PHY data lanes takes to go from low-power
  183. to high-speed transmission */
  184. uint32_t DataLaneMaxReadTime; /*!< The maximum time required to perform a read command */
  185. uint32_t StopWaitTime; /*!< The minimum wait period to request a High-Speed transmission after the
  186. Stop state */
  187. } DSI_PHY_TimerTypeDef;
  188. /**
  189. * @brief DSI HOST Timeouts definition
  190. */
  191. typedef struct
  192. {
  193. uint32_t TimeoutCkdiv; /*!< Time-out clock division */
  194. uint32_t HighSpeedTransmissionTimeout; /*!< High-speed transmission time-out */
  195. uint32_t LowPowerReceptionTimeout; /*!< Low-power reception time-out */
  196. uint32_t HighSpeedReadTimeout; /*!< High-speed read time-out */
  197. uint32_t LowPowerReadTimeout; /*!< Low-power read time-out */
  198. uint32_t HighSpeedWriteTimeout; /*!< High-speed write time-out */
  199. uint32_t HighSpeedWritePrespMode; /*!< High-speed write presp mode
  200. This parameter can be any value of @ref DSI_HS_PrespMode */
  201. uint32_t LowPowerWriteTimeout; /*!< Low-speed write time-out */
  202. uint32_t BTATimeout; /*!< BTA time-out */
  203. } DSI_HOST_TimeoutTypeDef;
  204. /**
  205. * @brief DSI States Structure definition
  206. */
  207. typedef enum
  208. {
  209. HAL_DSI_STATE_RESET = 0x00U,
  210. HAL_DSI_STATE_READY = 0x01U,
  211. HAL_DSI_STATE_ERROR = 0x02U,
  212. HAL_DSI_STATE_BUSY = 0x03U,
  213. HAL_DSI_STATE_TIMEOUT = 0x04U
  214. } HAL_DSI_StateTypeDef;
  215. /**
  216. * @brief DSI Handle Structure definition
  217. */
  218. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  219. typedef struct __DSI_HandleTypeDef
  220. #else
  221. typedef struct
  222. #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
  223. {
  224. DSI_TypeDef *Instance; /*!< Register base address */
  225. DSI_InitTypeDef Init; /*!< DSI required parameters */
  226. HAL_LockTypeDef Lock; /*!< DSI peripheral status */
  227. __IO HAL_DSI_StateTypeDef State; /*!< DSI communication state */
  228. __IO uint32_t ErrorCode; /*!< DSI Error code */
  229. uint32_t ErrorMsk; /*!< DSI Error monitoring mask */
  230. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  231. void (* TearingEffectCallback)(struct __DSI_HandleTypeDef *hdsi); /*!< DSI Tearing Effect Callback */
  232. void (* EndOfRefreshCallback)(struct __DSI_HandleTypeDef *hdsi); /*!< DSI End Of Refresh Callback */
  233. void (* ErrorCallback)(struct __DSI_HandleTypeDef *hdsi); /*!< DSI Error Callback */
  234. void (* MspInitCallback)(struct __DSI_HandleTypeDef *hdsi); /*!< DSI Msp Init callback */
  235. void (* MspDeInitCallback)(struct __DSI_HandleTypeDef *hdsi); /*!< DSI Msp DeInit callback */
  236. #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
  237. } DSI_HandleTypeDef;
  238. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  239. /**
  240. * @brief HAL DSI Callback ID enumeration definition
  241. */
  242. typedef enum
  243. {
  244. HAL_DSI_MSPINIT_CB_ID = 0x00U, /*!< DSI MspInit callback ID */
  245. HAL_DSI_MSPDEINIT_CB_ID = 0x01U, /*!< DSI MspDeInit callback ID */
  246. HAL_DSI_TEARING_EFFECT_CB_ID = 0x02U, /*!< DSI Tearing Effect Callback ID */
  247. HAL_DSI_ENDOF_REFRESH_CB_ID = 0x03U, /*!< DSI End Of Refresh Callback ID */
  248. HAL_DSI_ERROR_CB_ID = 0x04U /*!< DSI Error Callback ID */
  249. } HAL_DSI_CallbackIDTypeDef;
  250. /**
  251. * @brief HAL DSI Callback pointer definition
  252. */
  253. typedef void (*pDSI_CallbackTypeDef)(DSI_HandleTypeDef *hdsi); /*!< pointer to an DSI callback function */
  254. #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
  255. /**
  256. * @}
  257. */
  258. /* Exported constants --------------------------------------------------------*/
  259. /** @defgroup DSI_Exported_Constants DSI Exported Constants
  260. * @{
  261. */
  262. /** @defgroup DSI_DCS_Command DSI DCS Command
  263. * @{
  264. */
  265. #define DSI_ENTER_IDLE_MODE 0x39U
  266. #define DSI_ENTER_INVERT_MODE 0x21U
  267. #define DSI_ENTER_NORMAL_MODE 0x13U
  268. #define DSI_ENTER_PARTIAL_MODE 0x12U
  269. #define DSI_ENTER_SLEEP_MODE 0x10U
  270. #define DSI_EXIT_IDLE_MODE 0x38U
  271. #define DSI_EXIT_INVERT_MODE 0x20U
  272. #define DSI_EXIT_SLEEP_MODE 0x11U
  273. #define DSI_GET_3D_CONTROL 0x3FU
  274. #define DSI_GET_ADDRESS_MODE 0x0BU
  275. #define DSI_GET_BLUE_CHANNEL 0x08U
  276. #define DSI_GET_DIAGNOSTIC_RESULT 0x0FU
  277. #define DSI_GET_DISPLAY_MODE 0x0DU
  278. #define DSI_GET_GREEN_CHANNEL 0x07U
  279. #define DSI_GET_PIXEL_FORMAT 0x0CU
  280. #define DSI_GET_POWER_MODE 0x0AU
  281. #define DSI_GET_RED_CHANNEL 0x06U
  282. #define DSI_GET_SCANLINE 0x45U
  283. #define DSI_GET_SIGNAL_MODE 0x0EU
  284. #define DSI_NOP 0x00U
  285. #define DSI_READ_DDB_CONTINUE 0xA8U
  286. #define DSI_READ_DDB_START 0xA1U
  287. #define DSI_READ_MEMORY_CONTINUE 0x3EU
  288. #define DSI_READ_MEMORY_START 0x2EU
  289. #define DSI_SET_3D_CONTROL 0x3DU
  290. #define DSI_SET_ADDRESS_MODE 0x36U
  291. #define DSI_SET_COLUMN_ADDRESS 0x2AU
  292. #define DSI_SET_DISPLAY_OFF 0x28U
  293. #define DSI_SET_DISPLAY_ON 0x29U
  294. #define DSI_SET_GAMMA_CURVE 0x26U
  295. #define DSI_SET_PAGE_ADDRESS 0x2BU
  296. #define DSI_SET_PARTIAL_COLUMNS 0x31U
  297. #define DSI_SET_PARTIAL_ROWS 0x30U
  298. #define DSI_SET_PIXEL_FORMAT 0x3AU
  299. #define DSI_SET_SCROLL_AREA 0x33U
  300. #define DSI_SET_SCROLL_START 0x37U
  301. #define DSI_SET_TEAR_OFF 0x34U
  302. #define DSI_SET_TEAR_ON 0x35U
  303. #define DSI_SET_TEAR_SCANLINE 0x44U
  304. #define DSI_SET_VSYNC_TIMING 0x40U
  305. #define DSI_SOFT_RESET 0x01U
  306. #define DSI_WRITE_LUT 0x2DU
  307. #define DSI_WRITE_MEMORY_CONTINUE 0x3CU
  308. #define DSI_WRITE_MEMORY_START 0x2CU
  309. /**
  310. * @}
  311. */
  312. /** @defgroup DSI_Video_Mode_Type DSI Video Mode Type
  313. * @{
  314. */
  315. #define DSI_VID_MODE_NB_PULSES 0U
  316. #define DSI_VID_MODE_NB_EVENTS 1U
  317. #define DSI_VID_MODE_BURST 2U
  318. /**
  319. * @}
  320. */
  321. /** @defgroup DSI_Color_Mode DSI Color Mode
  322. * @{
  323. */
  324. #define DSI_COLOR_MODE_FULL 0x00000000U
  325. #define DSI_COLOR_MODE_EIGHT DSI_WCR_COLM
  326. /**
  327. * @}
  328. */
  329. /** @defgroup DSI_ShutDown DSI ShutDown
  330. * @{
  331. */
  332. #define DSI_DISPLAY_ON 0x00000000U
  333. #define DSI_DISPLAY_OFF DSI_WCR_SHTDN
  334. /**
  335. * @}
  336. */
  337. /** @defgroup DSI_LP_Command DSI LP Command
  338. * @{
  339. */
  340. #define DSI_LP_COMMAND_DISABLE 0x00000000U
  341. #define DSI_LP_COMMAND_ENABLE DSI_VMCR_LPCE
  342. /**
  343. * @}
  344. */
  345. /** @defgroup DSI_LP_HFP DSI LP HFP
  346. * @{
  347. */
  348. #define DSI_LP_HFP_DISABLE 0x00000000U
  349. #define DSI_LP_HFP_ENABLE DSI_VMCR_LPHFPE
  350. /**
  351. * @}
  352. */
  353. /** @defgroup DSI_LP_HBP DSI LP HBP
  354. * @{
  355. */
  356. #define DSI_LP_HBP_DISABLE 0x00000000U
  357. #define DSI_LP_HBP_ENABLE DSI_VMCR_LPHBPE
  358. /**
  359. * @}
  360. */
  361. /** @defgroup DSI_LP_VACT DSI LP VACT
  362. * @{
  363. */
  364. #define DSI_LP_VACT_DISABLE 0x00000000U
  365. #define DSI_LP_VACT_ENABLE DSI_VMCR_LPVAE
  366. /**
  367. * @}
  368. */
  369. /** @defgroup DSI_LP_VFP DSI LP VFP
  370. * @{
  371. */
  372. #define DSI_LP_VFP_DISABLE 0x00000000U
  373. #define DSI_LP_VFP_ENABLE DSI_VMCR_LPVFPE
  374. /**
  375. * @}
  376. */
  377. /** @defgroup DSI_LP_VBP DSI LP VBP
  378. * @{
  379. */
  380. #define DSI_LP_VBP_DISABLE 0x00000000U
  381. #define DSI_LP_VBP_ENABLE DSI_VMCR_LPVBPE
  382. /**
  383. * @}
  384. */
  385. /** @defgroup DSI_LP_VSYNC DSI LP VSYNC
  386. * @{
  387. */
  388. #define DSI_LP_VSYNC_DISABLE 0x00000000U
  389. #define DSI_LP_VSYNC_ENABLE DSI_VMCR_LPVSAE
  390. /**
  391. * @}
  392. */
  393. /** @defgroup DSI_FBTA_acknowledge DSI FBTA Acknowledge
  394. * @{
  395. */
  396. #define DSI_FBTAA_DISABLE 0x00000000U
  397. #define DSI_FBTAA_ENABLE DSI_VMCR_FBTAAE
  398. /**
  399. * @}
  400. */
  401. /** @defgroup DSI_TearingEffectSource DSI Tearing Effect Source
  402. * @{
  403. */
  404. #define DSI_TE_DSILINK 0x00000000U
  405. #define DSI_TE_EXTERNAL DSI_WCFGR_TESRC
  406. /**
  407. * @}
  408. */
  409. /** @defgroup DSI_TearingEffectPolarity DSI Tearing Effect Polarity
  410. * @{
  411. */
  412. #define DSI_TE_RISING_EDGE 0x00000000U
  413. #define DSI_TE_FALLING_EDGE DSI_WCFGR_TEPOL
  414. /**
  415. * @}
  416. */
  417. /** @defgroup DSI_Vsync_Polarity DSI Vsync Polarity
  418. * @{
  419. */
  420. #define DSI_VSYNC_FALLING 0x00000000U
  421. #define DSI_VSYNC_RISING DSI_WCFGR_VSPOL
  422. /**
  423. * @}
  424. */
  425. /** @defgroup DSI_AutomaticRefresh DSI Automatic Refresh
  426. * @{
  427. */
  428. #define DSI_AR_DISABLE 0x00000000U
  429. #define DSI_AR_ENABLE DSI_WCFGR_AR
  430. /**
  431. * @}
  432. */
  433. /** @defgroup DSI_TE_AcknowledgeRequest DSI TE Acknowledge Request
  434. * @{
  435. */
  436. #define DSI_TE_ACKNOWLEDGE_DISABLE 0x00000000U
  437. #define DSI_TE_ACKNOWLEDGE_ENABLE DSI_CMCR_TEARE
  438. /**
  439. * @}
  440. */
  441. /** @defgroup DSI_AcknowledgeRequest DSI Acknowledge Request
  442. * @{
  443. */
  444. #define DSI_ACKNOWLEDGE_DISABLE 0x00000000U
  445. #define DSI_ACKNOWLEDGE_ENABLE DSI_CMCR_ARE
  446. /**
  447. * @}
  448. */
  449. /** @defgroup DSI_LP_LPGenShortWriteNoP DSI LP LPGen Short Write NoP
  450. * @{
  451. */
  452. #define DSI_LP_GSW0P_DISABLE 0x00000000U
  453. #define DSI_LP_GSW0P_ENABLE DSI_CMCR_GSW0TX
  454. /**
  455. * @}
  456. */
  457. /** @defgroup DSI_LP_LPGenShortWriteOneP DSI LP LPGen Short Write OneP
  458. * @{
  459. */
  460. #define DSI_LP_GSW1P_DISABLE 0x00000000U
  461. #define DSI_LP_GSW1P_ENABLE DSI_CMCR_GSW1TX
  462. /**
  463. * @}
  464. */
  465. /** @defgroup DSI_LP_LPGenShortWriteTwoP DSI LP LPGen Short Write TwoP
  466. * @{
  467. */
  468. #define DSI_LP_GSW2P_DISABLE 0x00000000U
  469. #define DSI_LP_GSW2P_ENABLE DSI_CMCR_GSW2TX
  470. /**
  471. * @}
  472. */
  473. /** @defgroup DSI_LP_LPGenShortReadNoP DSI LP LPGen Short Read NoP
  474. * @{
  475. */
  476. #define DSI_LP_GSR0P_DISABLE 0x00000000U
  477. #define DSI_LP_GSR0P_ENABLE DSI_CMCR_GSR0TX
  478. /**
  479. * @}
  480. */
  481. /** @defgroup DSI_LP_LPGenShortReadOneP DSI LP LPGen Short Read OneP
  482. * @{
  483. */
  484. #define DSI_LP_GSR1P_DISABLE 0x00000000U
  485. #define DSI_LP_GSR1P_ENABLE DSI_CMCR_GSR1TX
  486. /**
  487. * @}
  488. */
  489. /** @defgroup DSI_LP_LPGenShortReadTwoP DSI LP LPGen Short Read TwoP
  490. * @{
  491. */
  492. #define DSI_LP_GSR2P_DISABLE 0x00000000U
  493. #define DSI_LP_GSR2P_ENABLE DSI_CMCR_GSR2TX
  494. /**
  495. * @}
  496. */
  497. /** @defgroup DSI_LP_LPGenLongWrite DSI LP LPGen LongWrite
  498. * @{
  499. */
  500. #define DSI_LP_GLW_DISABLE 0x00000000U
  501. #define DSI_LP_GLW_ENABLE DSI_CMCR_GLWTX
  502. /**
  503. * @}
  504. */
  505. /** @defgroup DSI_LP_LPDcsShortWriteNoP DSI LP LPDcs Short Write NoP
  506. * @{
  507. */
  508. #define DSI_LP_DSW0P_DISABLE 0x00000000U
  509. #define DSI_LP_DSW0P_ENABLE DSI_CMCR_DSW0TX
  510. /**
  511. * @}
  512. */
  513. /** @defgroup DSI_LP_LPDcsShortWriteOneP DSI LP LPDcs Short Write OneP
  514. * @{
  515. */
  516. #define DSI_LP_DSW1P_DISABLE 0x00000000U
  517. #define DSI_LP_DSW1P_ENABLE DSI_CMCR_DSW1TX
  518. /**
  519. * @}
  520. */
  521. /** @defgroup DSI_LP_LPDcsShortReadNoP DSI LP LPDcs Short Read NoP
  522. * @{
  523. */
  524. #define DSI_LP_DSR0P_DISABLE 0x00000000U
  525. #define DSI_LP_DSR0P_ENABLE DSI_CMCR_DSR0TX
  526. /**
  527. * @}
  528. */
  529. /** @defgroup DSI_LP_LPDcsLongWrite DSI LP LPDcs Long Write
  530. * @{
  531. */
  532. #define DSI_LP_DLW_DISABLE 0x00000000U
  533. #define DSI_LP_DLW_ENABLE DSI_CMCR_DLWTX
  534. /**
  535. * @}
  536. */
  537. /** @defgroup DSI_LP_LPMaxReadPacket DSI LP LPMax Read Packet
  538. * @{
  539. */
  540. #define DSI_LP_MRDP_DISABLE 0x00000000U
  541. #define DSI_LP_MRDP_ENABLE DSI_CMCR_MRDPS
  542. /**
  543. * @}
  544. */
  545. /** @defgroup DSI_HS_PrespMode DSI HS Presp Mode
  546. * @{
  547. */
  548. #define DSI_HS_PM_DISABLE 0x00000000U
  549. #define DSI_HS_PM_ENABLE DSI_TCCR3_PM
  550. /**
  551. * @}
  552. */
  553. /** @defgroup DSI_Automatic_Clk_Lane_Control DSI Automatic Clk Lane Control
  554. * @{
  555. */
  556. #define DSI_AUTO_CLK_LANE_CTRL_DISABLE 0x00000000U
  557. #define DSI_AUTO_CLK_LANE_CTRL_ENABLE DSI_CLCR_ACR
  558. /**
  559. * @}
  560. */
  561. /** @defgroup DSI_Number_Of_Lanes DSI Number Of Lanes
  562. * @{
  563. */
  564. #define DSI_ONE_DATA_LANE 0U
  565. #define DSI_TWO_DATA_LANES 1U
  566. /**
  567. * @}
  568. */
  569. /** @defgroup DSI_FlowControl DSI Flow Control
  570. * @{
  571. */
  572. #define DSI_FLOW_CONTROL_CRC_RX DSI_PCR_CRCRXE
  573. #define DSI_FLOW_CONTROL_ECC_RX DSI_PCR_ECCRXE
  574. #define DSI_FLOW_CONTROL_BTA DSI_PCR_BTAE
  575. #define DSI_FLOW_CONTROL_EOTP_RX DSI_PCR_ETRXE
  576. #define DSI_FLOW_CONTROL_EOTP_TX DSI_PCR_ETTXE
  577. #define DSI_FLOW_CONTROL_ALL (DSI_FLOW_CONTROL_CRC_RX | DSI_FLOW_CONTROL_ECC_RX | \
  578. DSI_FLOW_CONTROL_BTA | DSI_FLOW_CONTROL_EOTP_RX | \
  579. DSI_FLOW_CONTROL_EOTP_TX)
  580. /**
  581. * @}
  582. */
  583. /** @defgroup DSI_Color_Coding DSI Color Coding
  584. * @{
  585. */
  586. #define DSI_RGB565 0x00000000U /*!< The values 0x00000001 and 0x00000002 can also be used for the RGB565 color mode configuration */
  587. #define DSI_RGB666 0x00000003U /*!< The value 0x00000004 can also be used for the RGB666 color mode configuration */
  588. #define DSI_RGB888 0x00000005U
  589. /**
  590. * @}
  591. */
  592. /** @defgroup DSI_LooselyPacked DSI Loosely Packed
  593. * @{
  594. */
  595. #define DSI_LOOSELY_PACKED_ENABLE DSI_LCOLCR_LPE
  596. #define DSI_LOOSELY_PACKED_DISABLE 0x00000000U
  597. /**
  598. * @}
  599. */
  600. /** @defgroup DSI_HSYNC_Polarity DSI HSYNC Polarity
  601. * @{
  602. */
  603. #define DSI_HSYNC_ACTIVE_HIGH 0x00000000U
  604. #define DSI_HSYNC_ACTIVE_LOW DSI_LPCR_HSP
  605. /**
  606. * @}
  607. */
  608. /** @defgroup DSI_VSYNC_Active_Polarity DSI VSYNC Active Polarity
  609. * @{
  610. */
  611. #define DSI_VSYNC_ACTIVE_HIGH 0x00000000U
  612. #define DSI_VSYNC_ACTIVE_LOW DSI_LPCR_VSP
  613. /**
  614. * @}
  615. */
  616. /** @defgroup DSI_DATA_ENABLE_Polarity DSI DATA ENABLE Polarity
  617. * @{
  618. */
  619. #define DSI_DATA_ENABLE_ACTIVE_HIGH 0x00000000U
  620. #define DSI_DATA_ENABLE_ACTIVE_LOW DSI_LPCR_DEP
  621. /**
  622. * @}
  623. */
  624. /** @defgroup DSI_PLL_IDF DSI PLL IDF
  625. * @{
  626. */
  627. #define DSI_PLL_IN_DIV1 0x00000001U
  628. #define DSI_PLL_IN_DIV2 0x00000002U
  629. #define DSI_PLL_IN_DIV3 0x00000003U
  630. #define DSI_PLL_IN_DIV4 0x00000004U
  631. #define DSI_PLL_IN_DIV5 0x00000005U
  632. #define DSI_PLL_IN_DIV6 0x00000006U
  633. #define DSI_PLL_IN_DIV7 0x00000007U
  634. /**
  635. * @}
  636. */
  637. /** @defgroup DSI_PLL_ODF DSI PLL ODF
  638. * @{
  639. */
  640. #define DSI_PLL_OUT_DIV1 0x00000000U
  641. #define DSI_PLL_OUT_DIV2 0x00000001U
  642. #define DSI_PLL_OUT_DIV4 0x00000002U
  643. #define DSI_PLL_OUT_DIV8 0x00000003U
  644. /**
  645. * @}
  646. */
  647. /** @defgroup DSI_Flags DSI Flags
  648. * @{
  649. */
  650. #define DSI_FLAG_TE DSI_WISR_TEIF
  651. #define DSI_FLAG_ER DSI_WISR_ERIF
  652. #define DSI_FLAG_BUSY DSI_WISR_BUSY
  653. #define DSI_FLAG_PLLLS DSI_WISR_PLLLS
  654. #define DSI_FLAG_PLLL DSI_WISR_PLLLIF
  655. #define DSI_FLAG_PLLU DSI_WISR_PLLUIF
  656. #define DSI_FLAG_RRS DSI_WISR_RRS
  657. #define DSI_FLAG_RR DSI_WISR_RRIF
  658. /**
  659. * @}
  660. */
  661. /** @defgroup DSI_Interrupts DSI Interrupts
  662. * @{
  663. */
  664. #define DSI_IT_TE DSI_WIER_TEIE
  665. #define DSI_IT_ER DSI_WIER_ERIE
  666. #define DSI_IT_PLLL DSI_WIER_PLLLIE
  667. #define DSI_IT_PLLU DSI_WIER_PLLUIE
  668. #define DSI_IT_RR DSI_WIER_RRIE
  669. /**
  670. * @}
  671. */
  672. /** @defgroup DSI_SHORT_WRITE_PKT_Data_Type DSI SHORT WRITE PKT Data Type
  673. * @{
  674. */
  675. #define DSI_DCS_SHORT_PKT_WRITE_P0 0x00000005U /*!< DCS short write, no parameters */
  676. #define DSI_DCS_SHORT_PKT_WRITE_P1 0x00000015U /*!< DCS short write, one parameter */
  677. #define DSI_GEN_SHORT_PKT_WRITE_P0 0x00000003U /*!< Generic short write, no parameters */
  678. #define DSI_GEN_SHORT_PKT_WRITE_P1 0x00000013U /*!< Generic short write, one parameter */
  679. #define DSI_GEN_SHORT_PKT_WRITE_P2 0x00000023U /*!< Generic short write, two parameters */
  680. /**
  681. * @}
  682. */
  683. /** @defgroup DSI_LONG_WRITE_PKT_Data_Type DSI LONG WRITE PKT Data Type
  684. * @{
  685. */
  686. #define DSI_DCS_LONG_PKT_WRITE 0x00000039U /*!< DCS long write */
  687. #define DSI_GEN_LONG_PKT_WRITE 0x00000029U /*!< Generic long write */
  688. /**
  689. * @}
  690. */
  691. /** @defgroup DSI_SHORT_READ_PKT_Data_Type DSI SHORT READ PKT Data Type
  692. * @{
  693. */
  694. #define DSI_DCS_SHORT_PKT_READ 0x00000006U /*!< DCS short read */
  695. #define DSI_GEN_SHORT_PKT_READ_P0 0x00000004U /*!< Generic short read, no parameters */
  696. #define DSI_GEN_SHORT_PKT_READ_P1 0x00000014U /*!< Generic short read, one parameter */
  697. #define DSI_GEN_SHORT_PKT_READ_P2 0x00000024U /*!< Generic short read, two parameters */
  698. /**
  699. * @}
  700. */
  701. /** @defgroup DSI_Error_Data_Type DSI Error Data Type
  702. * @{
  703. */
  704. #define HAL_DSI_ERROR_NONE 0U
  705. #define HAL_DSI_ERROR_ACK 0x00000001U /*!< Acknowledge errors */
  706. #define HAL_DSI_ERROR_PHY 0x00000002U /*!< PHY related errors */
  707. #define HAL_DSI_ERROR_TX 0x00000004U /*!< Transmission error */
  708. #define HAL_DSI_ERROR_RX 0x00000008U /*!< Reception error */
  709. #define HAL_DSI_ERROR_ECC 0x00000010U /*!< ECC errors */
  710. #define HAL_DSI_ERROR_CRC 0x00000020U /*!< CRC error */
  711. #define HAL_DSI_ERROR_PSE 0x00000040U /*!< Packet Size error */
  712. #define HAL_DSI_ERROR_EOT 0x00000080U /*!< End Of Transmission error */
  713. #define HAL_DSI_ERROR_OVF 0x00000100U /*!< FIFO overflow error */
  714. #define HAL_DSI_ERROR_GEN 0x00000200U /*!< Generic FIFO related errors */
  715. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  716. #define HAL_DSI_ERROR_INVALID_CALLBACK 0x00000400U /*!< DSI Invalid Callback error */
  717. #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
  718. /**
  719. * @}
  720. */
  721. /** @defgroup DSI_Lane_Group DSI Lane Group
  722. * @{
  723. */
  724. #define DSI_CLOCK_LANE 0x00000000U
  725. #define DSI_DATA_LANES 0x00000001U
  726. /**
  727. * @}
  728. */
  729. /** @defgroup DSI_Communication_Delay DSI Communication Delay
  730. * @{
  731. */
  732. #define DSI_SLEW_RATE_HSTX 0x00000000U
  733. #define DSI_SLEW_RATE_LPTX 0x00000001U
  734. #define DSI_HS_DELAY 0x00000002U
  735. /**
  736. * @}
  737. */
  738. /** @defgroup DSI_CustomLane DSI CustomLane
  739. * @{
  740. */
  741. #define DSI_SWAP_LANE_PINS 0x00000000U
  742. #define DSI_INVERT_HS_SIGNAL 0x00000001U
  743. /**
  744. * @}
  745. */
  746. /** @defgroup DSI_Lane_Select DSI Lane Select
  747. * @{
  748. */
  749. #define DSI_CLK_LANE 0x00000000U
  750. #define DSI_DATA_LANE0 0x00000001U
  751. #define DSI_DATA_LANE1 0x00000002U
  752. /**
  753. * @}
  754. */
  755. /** @defgroup DSI_PHY_Timing DSI PHY Timing
  756. * @{
  757. */
  758. #define DSI_TCLK_POST 0x00000000U
  759. #define DSI_TLPX_CLK 0x00000001U
  760. #define DSI_THS_EXIT 0x00000002U
  761. #define DSI_TLPX_DATA 0x00000003U
  762. #define DSI_THS_ZERO 0x00000004U
  763. #define DSI_THS_TRAIL 0x00000005U
  764. #define DSI_THS_PREPARE 0x00000006U
  765. #define DSI_TCLK_ZERO 0x00000007U
  766. #define DSI_TCLK_PREPARE 0x00000008U
  767. /**
  768. * @}
  769. */
  770. /**
  771. * @}
  772. */
  773. /* Exported macros -----------------------------------------------------------*/
  774. /** @defgroup DSI_Exported_Macros DSI Exported Macros
  775. * @{
  776. */
  777. /**
  778. * @brief Reset DSI handle state.
  779. * @param __HANDLE__ DSI handle
  780. * @retval None
  781. */
  782. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  783. #define __HAL_DSI_RESET_HANDLE_STATE(__HANDLE__) do{ \
  784. (__HANDLE__)->State = HAL_DSI_STATE_RESET; \
  785. (__HANDLE__)->MspInitCallback = NULL; \
  786. (__HANDLE__)->MspDeInitCallback = NULL; \
  787. } while(0)
  788. #else
  789. #define __HAL_DSI_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_DSI_STATE_RESET)
  790. #endif /*USE_HAL_DSI_REGISTER_CALLBACKS */
  791. /**
  792. * @brief Enables the DSI host.
  793. * @param __HANDLE__ DSI handle
  794. * @retval None.
  795. */
  796. #define __HAL_DSI_ENABLE(__HANDLE__) do { \
  797. __IO uint32_t tmpreg = 0x00U; \
  798. SET_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
  799. /* Delay after an DSI Host enabling */ \
  800. tmpreg = READ_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
  801. UNUSED(tmpreg); \
  802. } while(0U)
  803. /**
  804. * @brief Disables the DSI host.
  805. * @param __HANDLE__ DSI handle
  806. * @retval None.
  807. */
  808. #define __HAL_DSI_DISABLE(__HANDLE__) do { \
  809. __IO uint32_t tmpreg = 0x00U; \
  810. CLEAR_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
  811. /* Delay after an DSI Host disabling */ \
  812. tmpreg = READ_BIT((__HANDLE__)->Instance->CR, DSI_CR_EN);\
  813. UNUSED(tmpreg); \
  814. } while(0U)
  815. /**
  816. * @brief Enables the DSI wrapper.
  817. * @param __HANDLE__ DSI handle
  818. * @retval None.
  819. */
  820. #define __HAL_DSI_WRAPPER_ENABLE(__HANDLE__) do { \
  821. __IO uint32_t tmpreg = 0x00U; \
  822. SET_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
  823. /* Delay after an DSI wrapper enabling */ \
  824. tmpreg = READ_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
  825. UNUSED(tmpreg); \
  826. } while(0U)
  827. /**
  828. * @brief Disable the DSI wrapper.
  829. * @param __HANDLE__ DSI handle
  830. * @retval None.
  831. */
  832. #define __HAL_DSI_WRAPPER_DISABLE(__HANDLE__) do { \
  833. __IO uint32_t tmpreg = 0x00U; \
  834. CLEAR_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
  835. /* Delay after an DSI wrapper disabling*/ \
  836. tmpreg = READ_BIT((__HANDLE__)->Instance->WCR, DSI_WCR_DSIEN);\
  837. UNUSED(tmpreg); \
  838. } while(0U)
  839. /**
  840. * @brief Enables the DSI PLL.
  841. * @param __HANDLE__ DSI handle
  842. * @retval None.
  843. */
  844. #define __HAL_DSI_PLL_ENABLE(__HANDLE__) do { \
  845. __IO uint32_t tmpreg = 0x00U; \
  846. SET_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
  847. /* Delay after an DSI PLL enabling */ \
  848. tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
  849. UNUSED(tmpreg); \
  850. } while(0U)
  851. /**
  852. * @brief Disables the DSI PLL.
  853. * @param __HANDLE__ DSI handle
  854. * @retval None.
  855. */
  856. #define __HAL_DSI_PLL_DISABLE(__HANDLE__) do { \
  857. __IO uint32_t tmpreg = 0x00U; \
  858. CLEAR_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
  859. /* Delay after an DSI PLL disabling */ \
  860. tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_PLLEN);\
  861. UNUSED(tmpreg); \
  862. } while(0U)
  863. /**
  864. * @brief Enables the DSI regulator.
  865. * @param __HANDLE__ DSI handle
  866. * @retval None.
  867. */
  868. #define __HAL_DSI_REG_ENABLE(__HANDLE__) do { \
  869. __IO uint32_t tmpreg = 0x00U; \
  870. SET_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
  871. /* Delay after an DSI regulator enabling */ \
  872. tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
  873. UNUSED(tmpreg); \
  874. } while(0U)
  875. /**
  876. * @brief Disables the DSI regulator.
  877. * @param __HANDLE__ DSI handle
  878. * @retval None.
  879. */
  880. #define __HAL_DSI_REG_DISABLE(__HANDLE__) do { \
  881. __IO uint32_t tmpreg = 0x00U; \
  882. CLEAR_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
  883. /* Delay after an DSI regulator disabling */ \
  884. tmpreg = READ_BIT((__HANDLE__)->Instance->WRPCR, DSI_WRPCR_REGEN);\
  885. UNUSED(tmpreg); \
  886. } while(0U)
  887. /**
  888. * @brief Get the DSI pending flags.
  889. * @param __HANDLE__ DSI handle.
  890. * @param __FLAG__ Get the specified flag.
  891. * This parameter can be any combination of the following values:
  892. * @arg DSI_FLAG_TE : Tearing Effect Interrupt Flag
  893. * @arg DSI_FLAG_ER : End of Refresh Interrupt Flag
  894. * @arg DSI_FLAG_BUSY : Busy Flag
  895. * @arg DSI_FLAG_PLLLS: PLL Lock Status
  896. * @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
  897. * @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
  898. * @arg DSI_FLAG_RRS : Regulator Ready Flag
  899. * @arg DSI_FLAG_RR : Regulator Ready Interrupt Flag
  900. * @retval The state of FLAG (SET or RESET).
  901. */
  902. #define __HAL_DSI_GET_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WISR & (__FLAG__))
  903. /**
  904. * @brief Clears the DSI pending flags.
  905. * @param __HANDLE__ DSI handle.
  906. * @param __FLAG__ specifies the flag to clear.
  907. * This parameter can be any combination of the following values:
  908. * @arg DSI_FLAG_TE : Tearing Effect Interrupt Flag
  909. * @arg DSI_FLAG_ER : End of Refresh Interrupt Flag
  910. * @arg DSI_FLAG_PLLL : PLL Lock Interrupt Flag
  911. * @arg DSI_FLAG_PLLU : PLL Unlock Interrupt Flag
  912. * @arg DSI_FLAG_RR : Regulator Ready Interrupt Flag
  913. * @retval None
  914. */
  915. #define __HAL_DSI_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->WIFCR = (__FLAG__))
  916. /**
  917. * @brief Enables the specified DSI interrupts.
  918. * @param __HANDLE__ DSI handle.
  919. * @param __INTERRUPT__ specifies the DSI interrupt sources to be enabled.
  920. * This parameter can be any combination of the following values:
  921. * @arg DSI_IT_TE : Tearing Effect Interrupt
  922. * @arg DSI_IT_ER : End of Refresh Interrupt
  923. * @arg DSI_IT_PLLL: PLL Lock Interrupt
  924. * @arg DSI_IT_PLLU: PLL Unlock Interrupt
  925. * @arg DSI_IT_RR : Regulator Ready Interrupt
  926. * @retval None
  927. */
  928. #define __HAL_DSI_ENABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER |= (__INTERRUPT__))
  929. /**
  930. * @brief Disables the specified DSI interrupts.
  931. * @param __HANDLE__ DSI handle
  932. * @param __INTERRUPT__ specifies the DSI interrupt sources to be disabled.
  933. * This parameter can be any combination of the following values:
  934. * @arg DSI_IT_TE : Tearing Effect Interrupt
  935. * @arg DSI_IT_ER : End of Refresh Interrupt
  936. * @arg DSI_IT_PLLL: PLL Lock Interrupt
  937. * @arg DSI_IT_PLLU: PLL Unlock Interrupt
  938. * @arg DSI_IT_RR : Regulator Ready Interrupt
  939. * @retval None
  940. */
  941. #define __HAL_DSI_DISABLE_IT(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER &= ~(__INTERRUPT__))
  942. /**
  943. * @brief Checks whether the specified DSI interrupt source is enabled or not.
  944. * @param __HANDLE__ DSI handle
  945. * @param __INTERRUPT__ specifies the DSI interrupt source to check.
  946. * This parameter can be one of the following values:
  947. * @arg DSI_IT_TE : Tearing Effect Interrupt
  948. * @arg DSI_IT_ER : End of Refresh Interrupt
  949. * @arg DSI_IT_PLLL: PLL Lock Interrupt
  950. * @arg DSI_IT_PLLU: PLL Unlock Interrupt
  951. * @arg DSI_IT_RR : Regulator Ready Interrupt
  952. * @retval The state of INTERRUPT (SET or RESET).
  953. */
  954. #define __HAL_DSI_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((__HANDLE__)->Instance->WIER & (__INTERRUPT__))
  955. /**
  956. * @}
  957. */
  958. /* Exported functions --------------------------------------------------------*/
  959. /** @defgroup DSI_Exported_Functions DSI Exported Functions
  960. * @{
  961. */
  962. /** @defgroup DSI_Group1 Initialization and Configuration functions
  963. * @brief Initialization and Configuration functions
  964. * @{
  965. */
  966. HAL_StatusTypeDef HAL_DSI_Init(DSI_HandleTypeDef *hdsi, DSI_PLLInitTypeDef *PLLInit);
  967. HAL_StatusTypeDef HAL_DSI_DeInit(DSI_HandleTypeDef *hdsi);
  968. void HAL_DSI_MspInit(DSI_HandleTypeDef *hdsi);
  969. void HAL_DSI_MspDeInit(DSI_HandleTypeDef *hdsi);
  970. HAL_StatusTypeDef HAL_DSI_ConfigErrorMonitor(DSI_HandleTypeDef *hdsi, uint32_t ActiveErrors);
  971. /* Callbacks Register/UnRegister functions ***********************************/
  972. #if (USE_HAL_DSI_REGISTER_CALLBACKS == 1)
  973. HAL_StatusTypeDef HAL_DSI_RegisterCallback(DSI_HandleTypeDef *hdsi, HAL_DSI_CallbackIDTypeDef CallbackID,
  974. pDSI_CallbackTypeDef pCallback);
  975. HAL_StatusTypeDef HAL_DSI_UnRegisterCallback(DSI_HandleTypeDef *hdsi, HAL_DSI_CallbackIDTypeDef CallbackID);
  976. #endif /* USE_HAL_DSI_REGISTER_CALLBACKS */
  977. /**
  978. * @}
  979. */
  980. /** @defgroup DSI_Group2 IO operation functions
  981. * @brief IO operation functions
  982. * @{
  983. */
  984. void HAL_DSI_IRQHandler(DSI_HandleTypeDef *hdsi);
  985. void HAL_DSI_TearingEffectCallback(DSI_HandleTypeDef *hdsi);
  986. void HAL_DSI_EndOfRefreshCallback(DSI_HandleTypeDef *hdsi);
  987. void HAL_DSI_ErrorCallback(DSI_HandleTypeDef *hdsi);
  988. /**
  989. * @}
  990. */
  991. /** @defgroup DSI_Group3 Peripheral Control functions
  992. * @brief Peripheral Control functions
  993. * @{
  994. */
  995. HAL_StatusTypeDef HAL_DSI_SetGenericVCID(DSI_HandleTypeDef *hdsi, uint32_t VirtualChannelID);
  996. HAL_StatusTypeDef HAL_DSI_ConfigVideoMode(DSI_HandleTypeDef *hdsi, DSI_VidCfgTypeDef *VidCfg);
  997. HAL_StatusTypeDef HAL_DSI_ConfigAdaptedCommandMode(DSI_HandleTypeDef *hdsi, DSI_CmdCfgTypeDef *CmdCfg);
  998. HAL_StatusTypeDef HAL_DSI_ConfigCommand(DSI_HandleTypeDef *hdsi, DSI_LPCmdTypeDef *LPCmd);
  999. HAL_StatusTypeDef HAL_DSI_ConfigFlowControl(DSI_HandleTypeDef *hdsi, uint32_t FlowControl);
  1000. HAL_StatusTypeDef HAL_DSI_ConfigPhyTimer(DSI_HandleTypeDef *hdsi, DSI_PHY_TimerTypeDef *PhyTimers);
  1001. HAL_StatusTypeDef HAL_DSI_ConfigHostTimeouts(DSI_HandleTypeDef *hdsi, DSI_HOST_TimeoutTypeDef *HostTimeouts);
  1002. HAL_StatusTypeDef HAL_DSI_Start(DSI_HandleTypeDef *hdsi);
  1003. HAL_StatusTypeDef HAL_DSI_Stop(DSI_HandleTypeDef *hdsi);
  1004. HAL_StatusTypeDef HAL_DSI_Refresh(DSI_HandleTypeDef *hdsi);
  1005. HAL_StatusTypeDef HAL_DSI_ColorMode(DSI_HandleTypeDef *hdsi, uint32_t ColorMode);
  1006. HAL_StatusTypeDef HAL_DSI_Shutdown(DSI_HandleTypeDef *hdsi, uint32_t Shutdown);
  1007. HAL_StatusTypeDef HAL_DSI_ShortWrite(DSI_HandleTypeDef *hdsi,
  1008. uint32_t ChannelID,
  1009. uint32_t Mode,
  1010. uint32_t Param1,
  1011. uint32_t Param2);
  1012. HAL_StatusTypeDef HAL_DSI_LongWrite(DSI_HandleTypeDef *hdsi,
  1013. uint32_t ChannelID,
  1014. uint32_t Mode,
  1015. uint32_t NbParams,
  1016. uint32_t Param1,
  1017. const uint8_t *ParametersTable);
  1018. HAL_StatusTypeDef HAL_DSI_Read(DSI_HandleTypeDef *hdsi,
  1019. uint32_t ChannelNbr,
  1020. uint8_t *Array,
  1021. uint32_t Size,
  1022. uint32_t Mode,
  1023. uint32_t DCSCmd,
  1024. uint8_t *ParametersTable);
  1025. HAL_StatusTypeDef HAL_DSI_EnterULPMData(DSI_HandleTypeDef *hdsi);
  1026. HAL_StatusTypeDef HAL_DSI_ExitULPMData(DSI_HandleTypeDef *hdsi);
  1027. HAL_StatusTypeDef HAL_DSI_EnterULPM(DSI_HandleTypeDef *hdsi);
  1028. HAL_StatusTypeDef HAL_DSI_ExitULPM(DSI_HandleTypeDef *hdsi);
  1029. HAL_StatusTypeDef HAL_DSI_PatternGeneratorStart(DSI_HandleTypeDef *hdsi, uint32_t Mode, uint32_t Orientation);
  1030. HAL_StatusTypeDef HAL_DSI_PatternGeneratorStop(DSI_HandleTypeDef *hdsi);
  1031. HAL_StatusTypeDef HAL_DSI_SetSlewRateAndDelayTuning(DSI_HandleTypeDef *hdsi, uint32_t CommDelay, uint32_t Lane,
  1032. uint32_t Value);
  1033. HAL_StatusTypeDef HAL_DSI_SetLowPowerRXFilter(DSI_HandleTypeDef *hdsi, uint32_t Frequency);
  1034. HAL_StatusTypeDef HAL_DSI_SetSDD(DSI_HandleTypeDef *hdsi, FunctionalState State);
  1035. HAL_StatusTypeDef HAL_DSI_SetLanePinsConfiguration(DSI_HandleTypeDef *hdsi, uint32_t CustomLane, uint32_t Lane,
  1036. FunctionalState State);
  1037. HAL_StatusTypeDef HAL_DSI_SetPHYTimings(DSI_HandleTypeDef *hdsi, uint32_t Timing, FunctionalState State,
  1038. uint32_t Value);
  1039. HAL_StatusTypeDef HAL_DSI_ForceTXStopMode(DSI_HandleTypeDef *hdsi, uint32_t Lane, FunctionalState State);
  1040. HAL_StatusTypeDef HAL_DSI_ForceRXLowPower(DSI_HandleTypeDef *hdsi, FunctionalState State);
  1041. HAL_StatusTypeDef HAL_DSI_ForceDataLanesInRX(DSI_HandleTypeDef *hdsi, FunctionalState State);
  1042. HAL_StatusTypeDef HAL_DSI_SetPullDown(DSI_HandleTypeDef *hdsi, FunctionalState State);
  1043. HAL_StatusTypeDef HAL_DSI_SetContentionDetectionOff(DSI_HandleTypeDef *hdsi, FunctionalState State);
  1044. /**
  1045. * @}
  1046. */
  1047. /** @defgroup DSI_Group4 Peripheral State and Errors functions
  1048. * @brief Peripheral State and Errors functions
  1049. * @{
  1050. */
  1051. uint32_t HAL_DSI_GetError(const DSI_HandleTypeDef *hdsi);
  1052. HAL_DSI_StateTypeDef HAL_DSI_GetState(const DSI_HandleTypeDef *hdsi);
  1053. /**
  1054. * @}
  1055. */
  1056. /**
  1057. * @}
  1058. */
  1059. /* Private types -------------------------------------------------------------*/
  1060. /* Private defines -----------------------------------------------------------*/
  1061. /* Private variables ---------------------------------------------------------*/
  1062. /* Private constants ---------------------------------------------------------*/
  1063. /** @defgroup DSI_Private_Constants DSI Private Constants
  1064. * @{
  1065. */
  1066. #define DSI_MAX_RETURN_PKT_SIZE (0x00000037U) /*!< Maximum return packet configuration */
  1067. /**
  1068. * @}
  1069. */
  1070. /* Private macros ------------------------------------------------------------*/
  1071. /** @defgroup DSI_Private_Macros DSI Private Macros
  1072. * @{
  1073. */
  1074. #define IS_DSI_PLL_NDIV(NDIV) ((10U <= (NDIV)) && ((NDIV) <= 125U))
  1075. #define IS_DSI_PLL_IDF(IDF) (((IDF) == DSI_PLL_IN_DIV1) || \
  1076. ((IDF) == DSI_PLL_IN_DIV2) || \
  1077. ((IDF) == DSI_PLL_IN_DIV3) || \
  1078. ((IDF) == DSI_PLL_IN_DIV4) || \
  1079. ((IDF) == DSI_PLL_IN_DIV5) || \
  1080. ((IDF) == DSI_PLL_IN_DIV6) || \
  1081. ((IDF) == DSI_PLL_IN_DIV7))
  1082. #define IS_DSI_PLL_ODF(ODF) (((ODF) == DSI_PLL_OUT_DIV1) || \
  1083. ((ODF) == DSI_PLL_OUT_DIV2) || \
  1084. ((ODF) == DSI_PLL_OUT_DIV4) || \
  1085. ((ODF) == DSI_PLL_OUT_DIV8))
  1086. #define IS_DSI_AUTO_CLKLANE_CONTROL(AutoClkLane) (((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_DISABLE)\
  1087. || ((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_ENABLE))
  1088. #define IS_DSI_NUMBER_OF_LANES(NumberOfLanes) (((NumberOfLanes) == DSI_ONE_DATA_LANE)\
  1089. || ((NumberOfLanes) == DSI_TWO_DATA_LANES))
  1090. #define IS_DSI_FLOW_CONTROL(FlowControl) (((FlowControl) | DSI_FLOW_CONTROL_ALL) == DSI_FLOW_CONTROL_ALL)
  1091. #define IS_DSI_COLOR_CODING(ColorCoding) ((ColorCoding) <= 5U)
  1092. #define IS_DSI_LOOSELY_PACKED(LooselyPacked) (((LooselyPacked) == DSI_LOOSELY_PACKED_ENABLE)\
  1093. || ((LooselyPacked) == DSI_LOOSELY_PACKED_DISABLE))
  1094. #define IS_DSI_DE_POLARITY(DataEnable) (((DataEnable) == DSI_DATA_ENABLE_ACTIVE_HIGH)\
  1095. || ((DataEnable) == DSI_DATA_ENABLE_ACTIVE_LOW))
  1096. #define IS_DSI_VSYNC_POLARITY(Vsync) (((Vsync) == DSI_VSYNC_ACTIVE_HIGH)\
  1097. || ((Vsync) == DSI_VSYNC_ACTIVE_LOW))
  1098. #define IS_DSI_HSYNC_POLARITY(Hsync) (((Hsync) == DSI_HSYNC_ACTIVE_HIGH)\
  1099. || ((Hsync) == DSI_HSYNC_ACTIVE_LOW))
  1100. #define IS_DSI_VIDEO_MODE_TYPE(VideoModeType) (((VideoModeType) == DSI_VID_MODE_NB_PULSES) || \
  1101. ((VideoModeType) == DSI_VID_MODE_NB_EVENTS) || \
  1102. ((VideoModeType) == DSI_VID_MODE_BURST))
  1103. #define IS_DSI_COLOR_MODE(ColorMode) (((ColorMode) == DSI_COLOR_MODE_FULL)\
  1104. || ((ColorMode) == DSI_COLOR_MODE_EIGHT))
  1105. #define IS_DSI_SHUT_DOWN(ShutDown) (((ShutDown) == DSI_DISPLAY_ON) || ((ShutDown) == DSI_DISPLAY_OFF))
  1106. #define IS_DSI_LP_COMMAND(LPCommand) (((LPCommand) == DSI_LP_COMMAND_DISABLE)\
  1107. || ((LPCommand) == DSI_LP_COMMAND_ENABLE))
  1108. #define IS_DSI_LP_HFP(LPHFP) (((LPHFP) == DSI_LP_HFP_DISABLE) || ((LPHFP) == DSI_LP_HFP_ENABLE))
  1109. #define IS_DSI_LP_HBP(LPHBP) (((LPHBP) == DSI_LP_HBP_DISABLE) || ((LPHBP) == DSI_LP_HBP_ENABLE))
  1110. #define IS_DSI_LP_VACTIVE(LPVActive) (((LPVActive) == DSI_LP_VACT_DISABLE)\
  1111. || ((LPVActive) == DSI_LP_VACT_ENABLE))
  1112. #define IS_DSI_LP_VFP(LPVFP) (((LPVFP) == DSI_LP_VFP_DISABLE) || ((LPVFP) == DSI_LP_VFP_ENABLE))
  1113. #define IS_DSI_LP_VBP(LPVBP) (((LPVBP) == DSI_LP_VBP_DISABLE) || ((LPVBP) == DSI_LP_VBP_ENABLE))
  1114. #define IS_DSI_LP_VSYNC(LPVSYNC) (((LPVSYNC) == DSI_LP_VSYNC_DISABLE)\
  1115. || ((LPVSYNC) == DSI_LP_VSYNC_ENABLE))
  1116. #define IS_DSI_FBTAA(FrameBTAAcknowledge) (((FrameBTAAcknowledge) == DSI_FBTAA_DISABLE)\
  1117. || ((FrameBTAAcknowledge) == DSI_FBTAA_ENABLE))
  1118. #define IS_DSI_TE_SOURCE(TESource) (((TESource) == DSI_TE_DSILINK) || ((TESource) == DSI_TE_EXTERNAL))
  1119. #define IS_DSI_TE_POLARITY(TEPolarity) (((TEPolarity) == DSI_TE_RISING_EDGE)\
  1120. || ((TEPolarity) == DSI_TE_FALLING_EDGE))
  1121. #define IS_DSI_AUTOMATIC_REFRESH(AutomaticRefresh) (((AutomaticRefresh) == DSI_AR_DISABLE)\
  1122. || ((AutomaticRefresh) == DSI_AR_ENABLE))
  1123. #define IS_DSI_VS_POLARITY(VSPolarity) (((VSPolarity) == DSI_VSYNC_FALLING)\
  1124. || ((VSPolarity) == DSI_VSYNC_RISING))
  1125. #define IS_DSI_TE_ACK_REQUEST(TEAcknowledgeRequest) (((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_DISABLE)\
  1126. || ((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_ENABLE))
  1127. #define IS_DSI_ACK_REQUEST(AcknowledgeRequest) (((AcknowledgeRequest) == DSI_ACKNOWLEDGE_DISABLE)\
  1128. || ((AcknowledgeRequest) == DSI_ACKNOWLEDGE_ENABLE))
  1129. #define IS_DSI_LP_GSW0P(LP_GSW0P) (((LP_GSW0P) == DSI_LP_GSW0P_DISABLE)\
  1130. || ((LP_GSW0P) == DSI_LP_GSW0P_ENABLE))
  1131. #define IS_DSI_LP_GSW1P(LP_GSW1P) (((LP_GSW1P) == DSI_LP_GSW1P_DISABLE)\
  1132. || ((LP_GSW1P) == DSI_LP_GSW1P_ENABLE))
  1133. #define IS_DSI_LP_GSW2P(LP_GSW2P) (((LP_GSW2P) == DSI_LP_GSW2P_DISABLE)\
  1134. || ((LP_GSW2P) == DSI_LP_GSW2P_ENABLE))
  1135. #define IS_DSI_LP_GSR0P(LP_GSR0P) (((LP_GSR0P) == DSI_LP_GSR0P_DISABLE)\
  1136. || ((LP_GSR0P) == DSI_LP_GSR0P_ENABLE))
  1137. #define IS_DSI_LP_GSR1P(LP_GSR1P) (((LP_GSR1P) == DSI_LP_GSR1P_DISABLE)\
  1138. || ((LP_GSR1P) == DSI_LP_GSR1P_ENABLE))
  1139. #define IS_DSI_LP_GSR2P(LP_GSR2P) (((LP_GSR2P) == DSI_LP_GSR2P_DISABLE)\
  1140. || ((LP_GSR2P) == DSI_LP_GSR2P_ENABLE))
  1141. #define IS_DSI_LP_GLW(LP_GLW) (((LP_GLW) == DSI_LP_GLW_DISABLE)\
  1142. || ((LP_GLW) == DSI_LP_GLW_ENABLE))
  1143. #define IS_DSI_LP_DSW0P(LP_DSW0P) (((LP_DSW0P) == DSI_LP_DSW0P_DISABLE)\
  1144. || ((LP_DSW0P) == DSI_LP_DSW0P_ENABLE))
  1145. #define IS_DSI_LP_DSW1P(LP_DSW1P) (((LP_DSW1P) == DSI_LP_DSW1P_DISABLE)\
  1146. || ((LP_DSW1P) == DSI_LP_DSW1P_ENABLE))
  1147. #define IS_DSI_LP_DSR0P(LP_DSR0P) (((LP_DSR0P) == DSI_LP_DSR0P_DISABLE)\
  1148. || ((LP_DSR0P) == DSI_LP_DSR0P_ENABLE))
  1149. #define IS_DSI_LP_DLW(LP_DLW) (((LP_DLW) == DSI_LP_DLW_DISABLE)\
  1150. || ((LP_DLW) == DSI_LP_DLW_ENABLE))
  1151. #define IS_DSI_LP_MRDP(LP_MRDP) (((LP_MRDP) == DSI_LP_MRDP_DISABLE)\
  1152. || ((LP_MRDP) == DSI_LP_MRDP_ENABLE))
  1153. #define IS_DSI_SHORT_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_WRITE_P0) || \
  1154. ((MODE) == DSI_DCS_SHORT_PKT_WRITE_P1) || \
  1155. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P0) || \
  1156. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P1) || \
  1157. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P2))
  1158. #define IS_DSI_LONG_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_LONG_PKT_WRITE) || \
  1159. ((MODE) == DSI_GEN_LONG_PKT_WRITE))
  1160. #define IS_DSI_READ_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_READ) || \
  1161. ((MODE) == DSI_GEN_SHORT_PKT_READ_P0) || \
  1162. ((MODE) == DSI_GEN_SHORT_PKT_READ_P1) || \
  1163. ((MODE) == DSI_GEN_SHORT_PKT_READ_P2))
  1164. #define IS_DSI_COMMUNICATION_DELAY(CommDelay) (((CommDelay) == DSI_SLEW_RATE_HSTX) || \
  1165. ((CommDelay) == DSI_SLEW_RATE_LPTX) || \
  1166. ((CommDelay) == DSI_HS_DELAY))
  1167. #define IS_DSI_LANE_GROUP(Lane) (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANES))
  1168. #define IS_DSI_CUSTOM_LANE(CustomLane) (((CustomLane) == DSI_SWAP_LANE_PINS)\
  1169. || ((CustomLane) == DSI_INVERT_HS_SIGNAL))
  1170. #define IS_DSI_LANE(Lane) (((Lane) == DSI_CLOCK_LANE) || \
  1171. ((Lane) == DSI_DATA_LANE0) || ((Lane) == DSI_DATA_LANE1))
  1172. #define IS_DSI_PHY_TIMING(Timing) (((Timing) == DSI_TCLK_POST ) || \
  1173. ((Timing) == DSI_TLPX_CLK ) || \
  1174. ((Timing) == DSI_THS_EXIT ) || \
  1175. ((Timing) == DSI_TLPX_DATA ) || \
  1176. ((Timing) == DSI_THS_ZERO ) || \
  1177. ((Timing) == DSI_THS_TRAIL ) || \
  1178. ((Timing) == DSI_THS_PREPARE ) || \
  1179. ((Timing) == DSI_TCLK_ZERO ) || \
  1180. ((Timing) == DSI_TCLK_PREPARE))
  1181. /**
  1182. * @}
  1183. */
  1184. /**
  1185. * @}
  1186. */
  1187. /**
  1188. * @}
  1189. */
  1190. #endif /* DSI */
  1191. #ifdef __cplusplus
  1192. }
  1193. #endif
  1194. #endif /* STM32L4xx_HAL_DSI_H */