stm32f4xx_dsi.h 39 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003
  1. /**
  2. ******************************************************************************
  3. * @file stm32f4xx_dsi.h
  4. * @author MCD Application Team
  5. * @version V1.8.1
  6. * @date 27-January-2022
  7. * @brief Header file of DSI module.
  8. ******************************************************************************
  9. * @attention
  10. *
  11. * Copyright (c) 2016 STMicroelectronics.
  12. * All rights reserved.
  13. *
  14. * This software is licensed under terms that can be found in the LICENSE file
  15. * in the root directory of this software component.
  16. * If no LICENSE file comes with this software, it is provided AS-IS.
  17. *
  18. ******************************************************************************
  19. */
  20. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef __STM32F4xx_DSI_H
  22. #define __STM32F4xx_DSI_H
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "stm32f4xx.h"
  28. /** @addtogroup STM32F4xx_StdPeriph_Driver
  29. * @{
  30. */
  31. /** @defgroup DSI
  32. * @{
  33. */
  34. #if defined(STM32F469_479xx)
  35. /* Exported types ------------------------------------------------------------*/
  36. /**
  37. * @brief DSI Init Structure definition
  38. */
  39. typedef struct
  40. {
  41. uint32_t AutomaticClockLaneControl; /*!< Automatic clock lane control
  42. This parameter can be any value of @ref DSI_Automatic_Clk_Lane_Control */
  43. uint32_t TXEscapeCkdiv; /*!< TX Escape clock division
  44. The values 0 and 1 stop the TX_ESC clock generation */
  45. uint32_t NumberOfLanes; /*!< Number of lanes
  46. This parameter can be any value of @ref DSI_Number_Of_Lanes */
  47. }DSI_InitTypeDef;
  48. /**
  49. * @brief DSI PLL Clock structure definition
  50. */
  51. typedef struct
  52. {
  53. uint32_t PLLNDIV; /*!< PLL Loop Division Factor
  54. This parameter must be a value between 10 and 125 */
  55. uint32_t PLLIDF; /*!< PLL Input Division Factor
  56. This parameter can be any value of @ref DSI_PLL_IDF */
  57. uint32_t PLLODF; /*!< PLL Output Division Factor
  58. This parameter can be any value of @ref DSI_PLL_ODF */
  59. }DSI_PLLInitTypeDef;
  60. /**
  61. * @brief DSI Video mode configuration
  62. */
  63. typedef struct
  64. {
  65. uint32_t VirtualChannelID; /*!< Virtual channel ID */
  66. uint32_t ColorCoding; /*!< Color coding for LTDC interface
  67. This parameter can be any value of @ref DSI_Color_Coding */
  68. uint32_t LooselyPacked; /*!< Enable or disable loosely packed stream (needed only when using
  69. 18-bit configuration).
  70. This parameter can be any value of @ref DSI_LooselyPacked */
  71. uint32_t Mode; /*!< Video mode type
  72. This parameter can be any value of @ref DSI_Video_Mode_Type */
  73. uint32_t PacketSize; /*!< Video packet size */
  74. uint32_t NumberOfChunks; /*!< Number of chunks */
  75. uint32_t NullPacketSize; /*!< Null packet size */
  76. uint32_t HSPolarity; /*!< HSYNC pin polarity
  77. This parameter can be any value of @ref DSI_HSYNC_Polarity */
  78. uint32_t VSPolarity; /*!< VSYNC pin polarity
  79. This parameter can be any value of @ref DSI_VSYNC_Polarity */
  80. uint32_t DEPolarity; /*!< Data Enable pin polarity
  81. This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
  82. uint32_t HorizontalSyncActive; /*!< Horizontal synchronism active duration (in lane byte clock cycles) */
  83. uint32_t HorizontalBackPorch; /*!< Horizontal back-porch duration (in lane byte clock cycles) */
  84. uint32_t HorizontalLine; /*!< Horizontal line duration (in lane byte clock cycles) */
  85. uint32_t VerticalSyncActive; /*!< Vertical synchronism active duration */
  86. uint32_t VerticalBackPorch; /*!< Vertical back-porch duration */
  87. uint32_t VerticalFrontPorch; /*!< Vertical front-porch duration */
  88. uint32_t VerticalActive; /*!< Vertical active duration */
  89. uint32_t LPCommandEnable; /*!< Low-power command enable
  90. This parameter can be any value of @ref DSI_LP_Command */
  91. uint32_t LPLargestPacketSize; /*!< The size, in bytes, of the low power largest packet that
  92. can fit in a line during VSA, VBP and VFP regions */
  93. uint32_t LPVACTLargestPacketSize; /*!< The size, in bytes, of the low power largest packet that
  94. can fit in a line during VACT region */
  95. uint32_t LPHorizontalFrontPorchEnable; /*!< Low-power horizontal front-porch enable
  96. This parameter can be any value of @ref DSI_LP_HFP */
  97. uint32_t LPHorizontalBackPorchEnable; /*!< Low-power horizontal back-porch enable
  98. This parameter can be any value of @ref DSI_LP_HBP */
  99. uint32_t LPVerticalActiveEnable; /*!< Low-power vertical active enable
  100. This parameter can be any value of @ref DSI_LP_VACT */
  101. uint32_t LPVerticalFrontPorchEnable; /*!< Low-power vertical front-porch enable
  102. This parameter can be any value of @ref DSI_LP_VFP */
  103. uint32_t LPVerticalBackPorchEnable; /*!< Low-power vertical back-porch enable
  104. This parameter can be any value of @ref DSI_LP_VBP */
  105. uint32_t LPVerticalSyncActiveEnable; /*!< Low-power vertical sync active enable
  106. This parameter can be any value of @ref DSI_LP_VSYNC */
  107. uint32_t FrameBTAAcknowledgeEnable; /*!< Frame bus-turn-around acknowledge enable
  108. This parameter can be any value of @ref DSI_FBTA_acknowledge */
  109. }DSI_VidCfgTypeDef;
  110. /**
  111. * @brief DSI Adapted command mode configuration
  112. */
  113. typedef struct
  114. {
  115. uint32_t VirtualChannelID; /*!< Virtual channel ID */
  116. uint32_t ColorCoding; /*!< Color coding for LTDC interface
  117. This parameter can be any value of @ref DSI_Color_Coding */
  118. uint32_t CommandSize; /*!< Maximum allowed size for an LTDC write memory command, measured in
  119. pixels. This parameter can be any value between 0x00 and 0xFFFF */
  120. uint32_t TearingEffectSource; /*!< Tearing effect source
  121. This parameter can be any value of @ref DSI_TearingEffectSource */
  122. uint32_t TearingEffectPolarity; /*!< Tearing effect pin polarity
  123. This parameter can be any value of @ref DSI_TearingEffectPolarity */
  124. uint32_t HSPolarity; /*!< HSYNC pin polarity
  125. This parameter can be any value of @ref DSI_HSYNC_Polarity */
  126. uint32_t VSPolarity; /*!< VSYNC pin polarity
  127. This parameter can be any value of @ref DSI_VSYNC_Polarity */
  128. uint32_t DEPolarity; /*!< Data Enable pin polarity
  129. This parameter can be any value of @ref DSI_DATA_ENABLE_Polarity */
  130. uint32_t VSyncPol; /*!< VSync edge on which the LTDC is halted
  131. This parameter can be any value of @ref DSI_Vsync_Polarity */
  132. uint32_t AutomaticRefresh; /*!< Automatic refresh mode
  133. This parameter can be any value of @ref DSI_AutomaticRefresh */
  134. uint32_t TEAcknowledgeRequest; /*!< Tearing Effect Acknowledge Request Enable
  135. This parameter can be any value of @ref DSI_TE_AcknowledgeRequest */
  136. }DSI_CmdCfgTypeDef;
  137. /**
  138. * @brief DSI command transmission mode configuration
  139. */
  140. typedef struct
  141. {
  142. uint32_t LPGenShortWriteNoP; /*!< Generic Short Write Zero parameters Transmission
  143. This parameter can be any value of @ref DSI_LP_LPGenShortWriteNoP */
  144. uint32_t LPGenShortWriteOneP; /*!< Generic Short Write One parameter Transmission
  145. This parameter can be any value of @ref DSI_LP_LPGenShortWriteOneP */
  146. uint32_t LPGenShortWriteTwoP; /*!< Generic Short Write Two parameters Transmission
  147. This parameter can be any value of @ref DSI_LP_LPGenShortWriteTwoP */
  148. uint32_t LPGenShortReadNoP; /*!< Generic Short Read Zero parameters Transmission
  149. This parameter can be any value of @ref DSI_LP_LPGenShortReadNoP */
  150. uint32_t LPGenShortReadOneP; /*!< Generic Short Read One parameter Transmission
  151. This parameter can be any value of @ref DSI_LP_LPGenShortReadOneP */
  152. uint32_t LPGenShortReadTwoP; /*!< Generic Short Read Two parameters Transmission
  153. This parameter can be any value of @ref DSI_LP_LPGenShortReadTwoP */
  154. uint32_t LPGenLongWrite; /*!< Generic Long Write Transmission
  155. This parameter can be any value of @ref DSI_LP_LPGenLongWrite */
  156. uint32_t LPDcsShortWriteNoP; /*!< DCS Short Write Zero parameters Transmission
  157. This parameter can be any value of @ref DSI_LP_LPDcsShortWriteNoP */
  158. uint32_t LPDcsShortWriteOneP; /*!< DCS Short Write One parameter Transmission
  159. This parameter can be any value of @ref DSI_LP_LPDcsShortWriteOneP */
  160. uint32_t LPDcsShortReadNoP; /*!< DCS Short Read Zero parameters Transmission
  161. This parameter can be any value of @ref DSI_LP_LPDcsShortReadNoP */
  162. uint32_t LPDcsLongWrite; /*!< DCS Long Write Transmission
  163. This parameter can be any value of @ref DSI_LP_LPDcsLongWrite */
  164. uint32_t LPMaxReadPacket; /*!< Maximum Read Packet Size Transmission
  165. This parameter can be any value of @ref DSI_LP_LPMaxReadPacket */
  166. uint32_t AcknowledgeRequest; /*!< Acknowledge Request Enable
  167. This parameter can be any value of @ref DSI_AcknowledgeRequest */
  168. }DSI_LPCmdTypeDef;
  169. /**
  170. * @brief DSI PHY Timings definition
  171. */
  172. typedef struct
  173. {
  174. uint32_t ClockLaneHS2LPTime; /*!< The maximum time that the D-PHY clock lane takes to go from high-speed
  175. to low-power transmission */
  176. uint32_t ClockLaneLP2HSTime; /*!< The maximum time that the D-PHY clock lane takes to go from low-power
  177. to high-speed transmission */
  178. uint32_t DataLaneHS2LPTime; /*!< The maximum time that the D-PHY data lanes takes to go from high-speed
  179. to low-power transmission */
  180. uint32_t DataLaneLP2HSTime; /*!< The maximum time that the D-PHY data lanes takes to go from low-power
  181. to high-speed transmission */
  182. uint32_t DataLaneMaxReadTime; /*!< The maximum time required to perform a read command */
  183. uint32_t StopWaitTime; /*!< The minimum wait period to request a High-Speed transmission after the
  184. Stop state */
  185. }DSI_PHY_TimerTypeDef;
  186. /**
  187. * @brief DSI HOST Timeouts definition
  188. */
  189. typedef struct
  190. {
  191. uint32_t TimeoutCkdiv; /*!< Time-out clock division */
  192. uint32_t HighSpeedTransmissionTimeout; /*!< High-speed transmission time-out */
  193. uint32_t LowPowerReceptionTimeout; /*!< Low-power reception time-out */
  194. uint32_t HighSpeedReadTimeout; /*!< High-speed read time-out */
  195. uint32_t LowPowerReadTimeout; /*!< Low-power read time-out */
  196. uint32_t HighSpeedWriteTimeout; /*!< High-speed write time-out */
  197. uint32_t HighSpeedWritePrespMode; /*!< High-speed write presp mode
  198. This parameter can be any value of @ref DSI_HS_PrespMode */
  199. uint32_t LowPowerWriteTimeout; /*!< Low-speed write time-out */
  200. uint32_t BTATimeout; /*!< BTA time-out */
  201. }DSI_HOST_TimeoutTypeDef;
  202. /* Exported constants --------------------------------------------------------*/
  203. /** @defgroup DSI_DCS_Command
  204. * @{
  205. */
  206. #define DSI_ENTER_IDLE_MODE 0x39
  207. #define DSI_ENTER_INVERT_MODE 0x21
  208. #define DSI_ENTER_NORMAL_MODE 0x13
  209. #define DSI_ENTER_PARTIAL_MODE 0x12
  210. #define DSI_ENTER_SLEEP_MODE 0x10
  211. #define DSI_EXIT_IDLE_MODE 0x38
  212. #define DSI_EXIT_INVERT_MODE 0x20
  213. #define DSI_EXIT_SLEEP_MODE 0x11
  214. #define DSI_GET_3D_CONTROL 0x3F
  215. #define DSI_GET_ADDRESS_MODE 0x0B
  216. #define DSI_GET_BLUE_CHANNEL 0x08
  217. #define DSI_GET_DIAGNOSTIC_RESULT 0x0F
  218. #define DSI_GET_DISPLAY_MODE 0x0D
  219. #define DSI_GET_GREEN_CHANNEL 0x07
  220. #define DSI_GET_PIXEL_FORMAT 0x0C
  221. #define DSI_GET_POWER_MODE 0x0A
  222. #define DSI_GET_RED_CHANNEL 0x06
  223. #define DSI_GET_SCANLINE 0x45
  224. #define DSI_GET_SIGNAL_MODE 0x0E
  225. #define DSI_NOP 0x00
  226. #define DSI_READ_DDB_CONTINUE 0xA8
  227. #define DSI_READ_DDB_START 0xA1
  228. #define DSI_READ_MEMORY_CONTINUE 0x3E
  229. #define DSI_READ_MEMORY_START 0x2E
  230. #define DSI_SET_3D_CONTROL 0x3D
  231. #define DSI_SET_ADDRESS_MODE 0x36
  232. #define DSI_SET_COLUMN_ADDRESS 0x2A
  233. #define DSI_SET_DISPLAY_OFF 0x28
  234. #define DSI_SET_DISPLAY_ON 0x29
  235. #define DSI_SET_GAMMA_CURVE 0x26
  236. #define DSI_SET_PAGE_ADDRESS 0x2B
  237. #define DSI_SET_PARTIAL_COLUMNS 0x31
  238. #define DSI_SET_PARTIAL_ROWS 0x30
  239. #define DSI_SET_PIXEL_FORMAT 0x3A
  240. #define DSI_SET_SCROLL_AREA 0x33
  241. #define DSI_SET_SCROLL_START 0x37
  242. #define DSI_SET_TEAR_OFF 0x34
  243. #define DSI_SET_TEAR_ON 0x35
  244. #define DSI_SET_TEAR_SCANLINE 0x44
  245. #define DSI_SET_VSYNC_TIMING 0x40
  246. #define DSI_SOFT_RESET 0x01
  247. #define DSI_WRITE_LUT 0x2D
  248. #define DSI_WRITE_MEMORY_CONTINUE 0x3C
  249. #define DSI_WRITE_MEMORY_START 0x2C
  250. /**
  251. * @}
  252. */
  253. /** @defgroup DSI_Video_Mode_Type
  254. * @{
  255. */
  256. #define DSI_VID_MODE_NB_PULSES 0
  257. #define DSI_VID_MODE_NB_EVENTS 1
  258. #define DSI_VID_MODE_BURST 2
  259. #define IS_DSI_VIDEO_MODE_TYPE(VideoModeType) (((VideoModeType) == DSI_VID_MODE_NB_PULSES) || \
  260. ((VideoModeType) == DSI_VID_MODE_NB_EVENTS) || \
  261. ((VideoModeType) == DSI_VID_MODE_BURST))
  262. /**
  263. * @}
  264. */
  265. /** @defgroup DSI_Color_Mode
  266. * @{
  267. */
  268. #define DSI_COLOR_MODE_FULL 0
  269. #define DSI_COLOR_MODE_EIGHT DSI_WCR_COLM
  270. #define IS_DSI_COLOR_MODE(ColorMode) (((ColorMode) == DSI_COLOR_MODE_FULL) || ((ColorMode) == DSI_COLOR_MODE_EIGHT))
  271. /**
  272. * @}
  273. */
  274. /** @defgroup DSI_ShutDown
  275. * @{
  276. */
  277. #define DSI_DISPLAY_ON 0
  278. #define DSI_DISPLAY_OFF DSI_WCR_SHTDN
  279. #define IS_DSI_SHUT_DOWN(ShutDown) (((ShutDown) == DSI_DISPLAY_ON) || ((ShutDown) == DSI_DISPLAY_OFF))
  280. /**
  281. * @}
  282. */
  283. /** @defgroup DSI_LP_Command
  284. * @{
  285. */
  286. #define DSI_LP_COMMAND_DISABLE 0
  287. #define DSI_LP_COMMAND_ENABLE DSI_VMCR_LPCE
  288. #define IS_DSI_LP_COMMAND(LPCommand) (((LPCommand) == DSI_LP_COMMAND_DISABLE) || ((LPCommand) == DSI_LP_COMMAND_ENABLE))
  289. /**
  290. * @}
  291. */
  292. /** @defgroup DSI_LP_HFP
  293. * @{
  294. */
  295. #define DSI_LP_HFP_DISABLE 0
  296. #define DSI_LP_HFP_ENABLE DSI_VMCR_LPHFPE
  297. #define IS_DSI_LP_HFP(LPHFP) (((LPHFP) == DSI_LP_HFP_DISABLE) || ((LPHFP) == DSI_LP_HFP_ENABLE))
  298. /**
  299. * @}
  300. */
  301. /** @defgroup DSI_LP_HBP
  302. * @{
  303. */
  304. #define DSI_LP_HBP_DISABLE 0
  305. #define DSI_LP_HBP_ENABLE DSI_VMCR_LPHBPE
  306. #define IS_DSI_LP_HBP(LPHBP) (((LPHBP) == DSI_LP_HBP_DISABLE) || ((LPHBP) == DSI_LP_HBP_ENABLE))
  307. /**
  308. * @}
  309. */
  310. /** @defgroup DSI_LP_VACT
  311. * @{
  312. */
  313. #define DSI_LP_VACT_DISABLE 0
  314. #define DSI_LP_VACT_ENABLE DSI_VMCR_LPVAE
  315. #define IS_DSI_LP_VACTIVE(LPVActive) (((LPVActive) == DSI_LP_VACT_DISABLE) || ((LPVActive) == DSI_LP_VACT_ENABLE))
  316. /**
  317. * @}
  318. */
  319. /** @defgroup DSI_LP_VFP
  320. * @{
  321. */
  322. #define DSI_LP_VFP_DISABLE 0
  323. #define DSI_LP_VFP_ENABLE DSI_VMCR_LPVFPE
  324. #define IS_DSI_LP_VFP(LPVFP) (((LPVFP) == DSI_LP_VFP_DISABLE) || ((LPVFP) == DSI_LP_VFP_ENABLE))
  325. /**
  326. * @}
  327. */
  328. /** @defgroup DSI_LP_VBP
  329. * @{
  330. */
  331. #define DSI_LP_VBP_DISABLE 0
  332. #define DSI_LP_VBP_ENABLE DSI_VMCR_LPVBPE
  333. #define IS_DSI_LP_VBP(LPVBP) (((LPVBP) == DSI_LP_VBP_DISABLE) || ((LPVBP) == DSI_LP_VBP_ENABLE))
  334. /**
  335. * @}
  336. */
  337. /** @defgroup DSI_LP_VSYNC
  338. * @{
  339. */
  340. #define DSI_LP_VSYNC_DISABLE 0
  341. #define DSI_LP_VSYNC_ENABLE DSI_VMCR_LPVSAE
  342. #define IS_DSI_LP_VSYNC(LPVSYNC) (((LPVSYNC) == DSI_LP_VSYNC_DISABLE) || ((LPVSYNC) == DSI_LP_VSYNC_ENABLE))
  343. /**
  344. * @}
  345. */
  346. /** @defgroup DSI_FBTA_acknowledge
  347. * @{
  348. */
  349. #define DSI_FBTAA_DISABLE 0
  350. #define DSI_FBTAA_ENABLE DSI_VMCR_FBTAAE
  351. #define IS_DSI_FBTAA(FrameBTAAcknowledge) (((FrameBTAAcknowledge) == DSI_FBTAA_DISABLE) || ((FrameBTAAcknowledge) == DSI_FBTAA_ENABLE))
  352. /**
  353. * @}
  354. */
  355. /** @defgroup DSI_TearingEffectSource
  356. * @{
  357. */
  358. #define DSI_TE_DSILINK 0
  359. #define DSI_TE_EXTERNAL DSI_WCFGR_TESRC
  360. #define IS_DSI_TE_SOURCE(TESource) (((TESource) == DSI_TE_DSILINK) || ((TESource) == DSI_TE_EXTERNAL))
  361. /**
  362. * @}
  363. */
  364. /** @defgroup DSI_TearingEffectPolarity
  365. * @{
  366. */
  367. #define DSI_TE_RISING_EDGE 0
  368. #define DSI_TE_FALLING_EDGE DSI_WCFGR_TEPOL
  369. #define IS_DSI_TE_POLARITY(TEPolarity) (((TEPolarity) == DSI_TE_RISING_EDGE) || ((TEPolarity) == DSI_TE_FALLING_EDGE))
  370. /**
  371. * @}
  372. */
  373. /** @defgroup DSI_Vsync_Polarity
  374. * @{
  375. */
  376. #define DSI_VSYNC_FALLING 0
  377. #define DSI_VSYNC_RISING DSI_WCFGR_VSPOL
  378. #define IS_DSI_VS_POLARITY(VSPolarity) (((VSPolarity) == DSI_VSYNC_FALLING) || ((VSPolarity) == DSI_VSYNC_RISING))
  379. /**
  380. * @}
  381. */
  382. /** @defgroup DSI_AutomaticRefresh
  383. * @{
  384. */
  385. #define DSI_AR_DISABLE 0
  386. #define DSI_AR_ENABLE DSI_WCFGR_AR
  387. #define IS_DSI_AUTOMATIC_REFRESH(AutomaticRefresh) (((AutomaticRefresh) == DSI_AR_DISABLE) || ((AutomaticRefresh) == DSI_AR_ENABLE))
  388. /**
  389. * @}
  390. */
  391. /** @defgroup DSI_TE_AcknowledgeRequest
  392. * @{
  393. */
  394. #define DSI_TE_ACKNOWLEDGE_DISABLE 0
  395. #define DSI_TE_ACKNOWLEDGE_ENABLE DSI_CMCR_TEARE
  396. #define IS_DSI_TE_ACK_REQUEST(TEAcknowledgeRequest) (((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_DISABLE) || ((TEAcknowledgeRequest) == DSI_TE_ACKNOWLEDGE_ENABLE))
  397. /**
  398. * @}
  399. */
  400. /** @defgroup DSI_AcknowledgeRequest
  401. * @{
  402. */
  403. #define DSI_ACKNOWLEDGE_DISABLE 0
  404. #define DSI_ACKNOWLEDGE_ENABLE DSI_CMCR_ARE
  405. #define IS_DSI_ACK_REQUEST(AcknowledgeRequest) (((AcknowledgeRequest) == DSI_ACKNOWLEDGE_DISABLE) || ((AcknowledgeRequest) == DSI_ACKNOWLEDGE_ENABLE))
  406. /**
  407. * @}
  408. */
  409. /** @defgroup DSI_LP_LPGenShortWriteNoP
  410. * @{
  411. */
  412. #define DSI_LP_GSW0P_DISABLE 0
  413. #define DSI_LP_GSW0P_ENABLE DSI_CMCR_GSW0TX
  414. #define IS_DSI_LP_GSW0P(LP_GSW0P) (((LP_GSW0P) == DSI_LP_GSW0P_DISABLE) || ((LP_GSW0P) == DSI_LP_GSW0P_ENABLE))
  415. /**
  416. * @}
  417. */
  418. /** @defgroup DSI_LP_LPGenShortWriteOneP
  419. * @{
  420. */
  421. #define DSI_LP_GSW1P_DISABLE 0
  422. #define DSI_LP_GSW1P_ENABLE DSI_CMCR_GSW1TX
  423. #define IS_DSI_LP_GSW1P(LP_GSW1P) (((LP_GSW1P) == DSI_LP_GSW1P_DISABLE) || ((LP_GSW1P) == DSI_LP_GSW1P_ENABLE))
  424. /**
  425. * @}
  426. */
  427. /** @defgroup DSI_LP_LPGenShortWriteTwoP
  428. * @{
  429. */
  430. #define DSI_LP_GSW2P_DISABLE 0
  431. #define DSI_LP_GSW2P_ENABLE DSI_CMCR_GSW2TX
  432. #define IS_DSI_LP_GSW2P(LP_GSW2P) (((LP_GSW2P) == DSI_LP_GSW2P_DISABLE) || ((LP_GSW2P) == DSI_LP_GSW2P_ENABLE))
  433. /**
  434. * @}
  435. */
  436. /** @defgroup DSI_LP_LPGenShortReadNoP
  437. * @{
  438. */
  439. #define DSI_LP_GSR0P_DISABLE 0
  440. #define DSI_LP_GSR0P_ENABLE DSI_CMCR_GSR0TX
  441. #define IS_DSI_LP_GSR0P(LP_GSR0P) (((LP_GSR0P) == DSI_LP_GSR0P_DISABLE) || ((LP_GSR0P) == DSI_LP_GSR0P_ENABLE))
  442. /**
  443. * @}
  444. */
  445. /** @defgroup DSI_LP_LPGenShortReadOneP
  446. * @{
  447. */
  448. #define DSI_LP_GSR1P_DISABLE 0
  449. #define DSI_LP_GSR1P_ENABLE DSI_CMCR_GSR1TX
  450. #define IS_DSI_LP_GSR1P(LP_GSR1P) (((LP_GSR1P) == DSI_LP_GSR1P_DISABLE) || ((LP_GSR1P) == DSI_LP_GSR1P_ENABLE))
  451. /**
  452. * @}
  453. */
  454. /** @defgroup DSI_LP_LPGenShortReadTwoP
  455. * @{
  456. */
  457. #define DSI_LP_GSR2P_DISABLE 0
  458. #define DSI_LP_GSR2P_ENABLE DSI_CMCR_GSR2TX
  459. #define IS_DSI_LP_GSR2P(LP_GSR2P) (((LP_GSR2P) == DSI_LP_GSR2P_DISABLE) || ((LP_GSR2P) == DSI_LP_GSR2P_ENABLE))
  460. /**
  461. * @}
  462. */
  463. /** @defgroup DSI_LP_LPGenLongWrite
  464. * @{
  465. */
  466. #define DSI_LP_GLW_DISABLE 0
  467. #define DSI_LP_GLW_ENABLE DSI_CMCR_GLWTX
  468. #define IS_DSI_LP_GLW(LP_GLW) (((LP_GLW) == DSI_LP_GLW_DISABLE) || ((LP_GLW) == DSI_LP_GLW_ENABLE))
  469. /**
  470. * @}
  471. */
  472. /** @defgroup DSI_LP_LPDcsShortWriteNoP
  473. * @{
  474. */
  475. #define DSI_LP_DSW0P_DISABLE 0
  476. #define DSI_LP_DSW0P_ENABLE DSI_CMCR_DSW0TX
  477. #define IS_DSI_LP_DSW0P(LP_DSW0P) (((LP_DSW0P) == DSI_LP_DSW0P_DISABLE) || ((LP_DSW0P) == DSI_LP_DSW0P_ENABLE))
  478. /**
  479. * @}
  480. */
  481. /** @defgroup DSI_LP_LPDcsShortWriteOneP
  482. * @{
  483. */
  484. #define DSI_LP_DSW1P_DISABLE 0
  485. #define DSI_LP_DSW1P_ENABLE DSI_CMCR_DSW1TX
  486. #define IS_DSI_LP_DSW1P(LP_DSW1P) (((LP_DSW1P) == DSI_LP_DSW1P_DISABLE) || ((LP_DSW1P) == DSI_LP_DSW1P_ENABLE))
  487. /**
  488. * @}
  489. */
  490. /** @defgroup DSI_LP_LPDcsShortReadNoP
  491. * @{
  492. */
  493. #define DSI_LP_DSR0P_DISABLE 0
  494. #define DSI_LP_DSR0P_ENABLE DSI_CMCR_DSR0TX
  495. #define IS_DSI_LP_DSR0P(LP_DSR0P) (((LP_DSR0P) == DSI_LP_DSR0P_DISABLE) || ((LP_DSR0P) == DSI_LP_DSR0P_ENABLE))
  496. /**
  497. * @}
  498. */
  499. /** @defgroup DSI_LP_LPDcsLongWrite
  500. * @{
  501. */
  502. #define DSI_LP_DLW_DISABLE 0
  503. #define DSI_LP_DLW_ENABLE DSI_CMCR_DLWTX
  504. #define IS_DSI_LP_DLW(LP_DLW) (((LP_DLW) == DSI_LP_DLW_DISABLE) || ((LP_DLW) == DSI_LP_DLW_ENABLE))
  505. /**
  506. * @}
  507. */
  508. /** @defgroup DSI_LP_LPMaxReadPacket
  509. * @{
  510. */
  511. #define DSI_LP_MRDP_DISABLE 0
  512. #define DSI_LP_MRDP_ENABLE DSI_CMCR_MRDPS
  513. #define IS_DSI_LP_MRDP(LP_MRDP) (((LP_MRDP) == DSI_LP_MRDP_DISABLE) || ((LP_MRDP) == DSI_LP_MRDP_ENABLE))
  514. /**
  515. * @}
  516. */
  517. /** @defgroup DSI_HS_PrespMode
  518. * @{
  519. */
  520. #define DSI_HS_PM_DISABLE 0
  521. #define DSI_HS_PM_ENABLE DSI_TCCR3_PM
  522. /**
  523. * @}
  524. */
  525. /** @defgroup DSI_Automatic_Clk_Lane_Control
  526. * @{
  527. */
  528. #define DSI_AUTO_CLK_LANE_CTRL_DISABLE 0
  529. #define DSI_AUTO_CLK_LANE_CTRL_ENABLE DSI_CLCR_ACR
  530. #define IS_DSI_AUTO_CLKLANE_CONTROL(AutoClkLane) (((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_DISABLE) || ((AutoClkLane) == DSI_AUTO_CLK_LANE_CTRL_ENABLE))
  531. /**
  532. * @}
  533. */
  534. /** @defgroup DSI_Number_Of_Lanes
  535. * @{
  536. */
  537. #define DSI_ONE_DATA_LANE 0
  538. #define DSI_TWO_DATA_LANES 1
  539. #define IS_DSI_NUMBER_OF_LANES(NumberOfLanes) (((NumberOfLanes) == DSI_ONE_DATA_LANE) || ((NumberOfLanes) == DSI_TWO_DATA_LANES))
  540. /**
  541. * @}
  542. */
  543. /** @defgroup DSI_FlowControl
  544. * @{
  545. */
  546. #define DSI_FLOW_CONTROL_CRC_RX DSI_PCR_CRCRXE
  547. #define DSI_FLOW_CONTROL_ECC_RX DSI_PCR_ECCRXE
  548. #define DSI_FLOW_CONTROL_BTA DSI_PCR_BTAE
  549. #define DSI_FLOW_CONTROL_EOTP_RX DSI_PCR_ETRXE
  550. #define DSI_FLOW_CONTROL_EOTP_TX DSI_PCR_ETTXE
  551. #define DSI_FLOW_CONTROL_ALL (DSI_FLOW_CONTROL_CRC_RX | DSI_FLOW_CONTROL_ECC_RX | \
  552. DSI_FLOW_CONTROL_BTA | DSI_FLOW_CONTROL_EOTP_RX | \
  553. DSI_FLOW_CONTROL_EOTP_TX)
  554. #define IS_DSI_FLOW_CONTROL(FlowControl) (((FlowControl) | DSI_FLOW_CONTROL_ALL) == DSI_FLOW_CONTROL_ALL)
  555. /**
  556. * @}
  557. */
  558. /** @defgroup DSI_Color_Coding
  559. * @{
  560. */
  561. #define DSI_RGB565 ((uint32_t)0x00000000) /*!< The values 0x00000001 and 0x00000002 can also be used for the RGB565 color mode configuration */
  562. #define DSI_RGB666 ((uint32_t)0x00000003) /*!< The value 0x00000004 can also be used for the RGB666 color mode configuration */
  563. #define DSI_RGB888 ((uint32_t)0x00000005)
  564. #define IS_DSI_COLOR_CODING(ColorCoding) ((ColorCoding) <= 5)
  565. /**
  566. * @}
  567. */
  568. /** @defgroup DSI_LooselyPacked
  569. * @{
  570. */
  571. #define DSI_LOOSELY_PACKED_ENABLE DSI_LCOLCR_LPE
  572. #define DSI_LOOSELY_PACKED_DISABLE 0
  573. #define IS_DSI_LOOSELY_PACKED(LooselyPacked) (((LooselyPacked) == DSI_LOOSELY_PACKED_ENABLE) || ((LooselyPacked) == DSI_LOOSELY_PACKED_DISABLE))
  574. /**
  575. * @}
  576. */
  577. /** @defgroup DSI_HSYNC_Polarity
  578. * @{
  579. */
  580. #define DSI_HSYNC_ACTIVE_HIGH 0
  581. #define DSI_HSYNC_ACTIVE_LOW DSI_LPCR_HSP
  582. #define IS_DSI_HSYNC_POLARITY(HSYNC) (((HSYNC) == DSI_HSYNC_ACTIVE_HIGH) || ((HSYNC) == DSI_HSYNC_ACTIVE_LOW))
  583. /**
  584. * @}
  585. */
  586. /** @defgroup DSI_VSYNC_Polarity
  587. * @{
  588. */
  589. #define DSI_VSYNC_ACTIVE_HIGH 0
  590. #define DSI_VSYNC_ACTIVE_LOW DSI_LPCR_VSP
  591. #define IS_DSI_VSYNC_POLARITY(VSYNC) (((VSYNC) == DSI_VSYNC_ACTIVE_HIGH) || ((VSYNC) == DSI_VSYNC_ACTIVE_LOW))
  592. /**
  593. * @}
  594. */
  595. /** @defgroup DSI_DATA_ENABLE_Polarity
  596. * @{
  597. */
  598. #define DSI_DATA_ENABLE_ACTIVE_HIGH 0
  599. #define DSI_DATA_ENABLE_ACTIVE_LOW DSI_LPCR_DEP
  600. #define IS_DSI_DE_POLARITY(DataEnable) (((DataEnable) == DSI_DATA_ENABLE_ACTIVE_HIGH) || ((DataEnable) == DSI_DATA_ENABLE_ACTIVE_LOW))
  601. /**
  602. * @}
  603. */
  604. /** @defgroup DSI_PLL_IDF
  605. * @{
  606. */
  607. #define DSI_PLL_IN_DIV1 ((uint32_t)0x00000001)
  608. #define DSI_PLL_IN_DIV2 ((uint32_t)0x00000002)
  609. #define DSI_PLL_IN_DIV3 ((uint32_t)0x00000003)
  610. #define DSI_PLL_IN_DIV4 ((uint32_t)0x00000004)
  611. #define DSI_PLL_IN_DIV5 ((uint32_t)0x00000005)
  612. #define DSI_PLL_IN_DIV6 ((uint32_t)0x00000006)
  613. #define DSI_PLL_IN_DIV7 ((uint32_t)0x00000007)
  614. #define IS_DSI_PLL_IDF(IDF) (((IDF) == DSI_PLL_IN_DIV1) || \
  615. ((IDF) == DSI_PLL_IN_DIV2) || \
  616. ((IDF) == DSI_PLL_IN_DIV3) || \
  617. ((IDF) == DSI_PLL_IN_DIV4) || \
  618. ((IDF) == DSI_PLL_IN_DIV5) || \
  619. ((IDF) == DSI_PLL_IN_DIV6) || \
  620. ((IDF) == DSI_PLL_IN_DIV7))
  621. /**
  622. * @}
  623. */
  624. /** @defgroup DSI_PLL_ODF
  625. * @{
  626. */
  627. #define DSI_PLL_OUT_DIV1 ((uint32_t)0x00000000)
  628. #define DSI_PLL_OUT_DIV2 ((uint32_t)0x00000001)
  629. #define DSI_PLL_OUT_DIV4 ((uint32_t)0x00000002)
  630. #define DSI_PLL_OUT_DIV8 ((uint32_t)0x00000003)
  631. #define IS_DSI_PLL_ODF(ODF) (((ODF) == DSI_PLL_OUT_DIV1) || \
  632. ((ODF) == DSI_PLL_OUT_DIV2) || \
  633. ((ODF) == DSI_PLL_OUT_DIV4) || \
  634. ((ODF) == DSI_PLL_OUT_DIV8))
  635. #define IS_DSI_PLL_NDIV(NDIV) ((10 <= (NDIV)) && ((NDIV) <= 125))
  636. /**
  637. * @}
  638. */
  639. /** @defgroup DSI_Flags
  640. * @{
  641. */
  642. #define DSI_FLAG_TE DSI_WISR_TEIF
  643. #define DSI_FLAG_ER DSI_WISR_ERIF
  644. #define DSI_FLAG_BUSY DSI_WISR_BUSY
  645. #define DSI_FLAG_PLLLS DSI_WISR_PLLLS
  646. #define DSI_FLAG_PLLL DSI_WISR_PLLLIF
  647. #define DSI_FLAG_PLLU DSI_WISR_PLLUIF
  648. #define DSI_FLAG_RRS DSI_WISR_RRS
  649. #define DSI_FLAG_RR DSI_WISR_RRIF
  650. #define IS_DSI_CLEAR_FLAG(FLAG) (((FLAG) == DSI_FLAG_TE) || ((FLAG) == DSI_FLAG_ER) || \
  651. ((FLAG) == DSI_FLAG_PLLL) || ((FLAG) == DSI_FLAG_PLLU) || \
  652. ((FLAG) == DSI_FLAG_RR))
  653. #define IS_DSI_GET_FLAG(FLAG) (((FLAG) == DSI_FLAG_TE) || ((FLAG) == DSI_FLAG_ER) || \
  654. ((FLAG) == DSI_FLAG_BUSY) || ((FLAG) == DSI_FLAG_PLLLS) || \
  655. ((FLAG) == DSI_FLAG_PLLL) || ((FLAG) == DSI_FLAG_PLLU) || \
  656. ((FLAG) == DSI_FLAG_RRS) || ((FLAG) == DSI_FLAG_RR))
  657. /**
  658. * @}
  659. */
  660. /** @defgroup DSI_Interrupts
  661. * @{
  662. */
  663. #define DSI_IT_TE DSI_WIER_TEIE
  664. #define DSI_IT_ER DSI_WIER_ERIE
  665. #define DSI_IT_PLLL DSI_WIER_PLLLIE
  666. #define DSI_IT_PLLU DSI_WIER_PLLUIE
  667. #define DSI_IT_RR DSI_WIER_RRIE
  668. #define IS_DSI_IT(IT) (((IT) == DSI_IT_TE) || ((IT) == DSI_IT_ER) || \
  669. ((IT) == DSI_IT_PLLL) || ((IT) == DSI_IT_PLLU) || \
  670. ((IT) == DSI_IT_RR))
  671. /**
  672. * @}
  673. */
  674. /** @defgroup DSI_SHORT_WRITE_PKT_Data_Type
  675. * @{
  676. */
  677. #define DSI_DCS_SHORT_PKT_WRITE_P0 ((uint32_t)0x00000005) /*!< DCS short write, no parameters */
  678. #define DSI_DCS_SHORT_PKT_WRITE_P1 ((uint32_t)0x00000015) /*!< DCS short write, one parameter */
  679. #define DSI_GEN_SHORT_PKT_WRITE_P0 ((uint32_t)0x00000003) /*!< Generic short write, no parameters */
  680. #define DSI_GEN_SHORT_PKT_WRITE_P1 ((uint32_t)0x00000013) /*!< Generic short write, one parameter */
  681. #define DSI_GEN_SHORT_PKT_WRITE_P2 ((uint32_t)0x00000023) /*!< Generic short write, two parameters */
  682. #define IS_DSI_SHORT_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_WRITE_P0) || \
  683. ((MODE) == DSI_DCS_SHORT_PKT_WRITE_P1) || \
  684. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P0) || \
  685. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P1) || \
  686. ((MODE) == DSI_GEN_SHORT_PKT_WRITE_P2))
  687. /**
  688. * @}
  689. */
  690. /** @defgroup DSI_LONG_WRITE_PKT_Data_Type
  691. * @{
  692. */
  693. #define DSI_DCS_LONG_PKT_WRITE ((uint32_t)0x00000039) /*!< DCS long write */
  694. #define DSI_GEN_LONG_PKT_WRITE ((uint32_t)0x00000029) /*!< Generic long write */
  695. #define IS_DSI_LONG_WRITE_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_LONG_PKT_WRITE) || \
  696. ((MODE) == DSI_GEN_LONG_PKT_WRITE))
  697. /**
  698. * @}
  699. */
  700. /** @defgroup DSI_SHORT_READ_PKT_Data_Type
  701. * @{
  702. */
  703. #define DSI_DCS_SHORT_PKT_READ ((uint32_t)0x00000006) /*!< DCS short read */
  704. #define DSI_GEN_SHORT_PKT_READ_P0 ((uint32_t)0x00000004) /*!< Generic short read, no parameters */
  705. #define DSI_GEN_SHORT_PKT_READ_P1 ((uint32_t)0x00000014) /*!< Generic short read, one parameter */
  706. #define DSI_GEN_SHORT_PKT_READ_P2 ((uint32_t)0x00000024) /*!< Generic short read, two parameters */
  707. #define IS_DSI_READ_PACKET_TYPE(MODE) (((MODE) == DSI_DCS_SHORT_PKT_READ) || \
  708. ((MODE) == DSI_GEN_SHORT_PKT_READ_P0) || \
  709. ((MODE) == DSI_GEN_SHORT_PKT_READ_P1) || \
  710. ((MODE) == DSI_GEN_SHORT_PKT_READ_P2))
  711. /**
  712. * @}
  713. */
  714. /** @defgroup DSI_Error_Data_Type
  715. * @{
  716. */
  717. #define DSI_ERROR_NONE 0
  718. #define DSI_ERROR_ACK ((uint32_t)0x00000001) /*!< acknowledge errors */
  719. #define DSI_ERROR_PHY ((uint32_t)0x00000002) /*!< PHY related errors */
  720. #define DSI_ERROR_TX ((uint32_t)0x00000004) /*!< transmission error */
  721. #define DSI_ERROR_RX ((uint32_t)0x00000008) /*!< reception error */
  722. #define DSI_ERROR_ECC ((uint32_t)0x00000010) /*!< ECC errors */
  723. #define DSI_ERROR_CRC ((uint32_t)0x00000020) /*!< CRC error */
  724. #define DSI_ERROR_PSE ((uint32_t)0x00000040) /*!< Packet Size error */
  725. #define DSI_ERROR_EOT ((uint32_t)0x00000080) /*!< End Of Transmission error */
  726. #define DSI_ERROR_OVF ((uint32_t)0x00000100) /*!< FIFO overflow error */
  727. #define DSI_ERROR_GEN ((uint32_t)0x00000200) /*!< Generic FIFO related errors */
  728. /**
  729. * @}
  730. */
  731. /** @defgroup DSI_Lane_Group
  732. * @{
  733. */
  734. #define DSI_CLOCK_LANE ((uint32_t)0x00000000)
  735. #define DSI_DATA_LANES ((uint32_t)0x00000001)
  736. #define IS_DSI_LANE_GROUP(Lane) (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANES))
  737. /**
  738. * @}
  739. */
  740. /** @defgroup DSI_Communication_Delay
  741. * @{
  742. */
  743. #define DSI_SLEW_RATE_HSTX ((uint32_t)0x00000000)
  744. #define DSI_SLEW_RATE_LPTX ((uint32_t)0x00000001)
  745. #define DSI_HS_DELAY ((uint32_t)0x00000002)
  746. #define IS_DSI_COMMUNICATION_DELAY(CommDelay) (((CommDelay) == DSI_SLEW_RATE_HSTX) || ((CommDelay) == DSI_SLEW_RATE_LPTX) || ((CommDelay) == DSI_HS_DELAY))
  747. /**
  748. * @}
  749. */
  750. /** @defgroup DSI_CustomLane
  751. * @{
  752. */
  753. #define DSI_SWAP_LANE_PINS ((uint32_t)0x00000000)
  754. #define DSI_INVERT_HS_SIGNAL ((uint32_t)0x00000001)
  755. #define IS_DSI_CUSTOM_LANE(CustomLane) (((CustomLane) == DSI_SWAP_LANE_PINS) || ((CustomLane) == DSI_INVERT_HS_SIGNAL))
  756. /**
  757. * @}
  758. */
  759. /** @defgroup DSI_Lane_Select
  760. * @{
  761. */
  762. #define DSI_CLOCK_LANE ((uint32_t)0x00000000)
  763. #define DSI_DATA_LANE0 ((uint32_t)0x00000001)
  764. #define DSI_DATA_LANE1 ((uint32_t)0x00000002)
  765. #define IS_DSI_LANE(Lane) (((Lane) == DSI_CLOCK_LANE) || ((Lane) == DSI_DATA_LANE0) || ((Lane) == DSI_DATA_LANE1))
  766. /**
  767. * @}
  768. */
  769. /** @defgroup DSI_PHY_Timing
  770. * @{
  771. */
  772. #define DSI_TCLK_POST ((uint32_t)0x00000000)
  773. #define DSI_TLPX_CLK ((uint32_t)0x00000001)
  774. #define DSI_THS_EXIT ((uint32_t)0x00000002)
  775. #define DSI_TLPX_DATA ((uint32_t)0x00000003)
  776. #define DSI_THS_ZERO ((uint32_t)0x00000004)
  777. #define DSI_THS_TRAIL ((uint32_t)0x00000005)
  778. #define DSI_THS_PREPARE ((uint32_t)0x00000006)
  779. #define DSI_TCLK_ZERO ((uint32_t)0x00000007)
  780. #define DSI_TCLK_PREPARE ((uint32_t)0x00000008)
  781. #define IS_DSI_PHY_TIMING(Timing) (((Timing) == DSI_TCLK_POST ) || \
  782. ((Timing) == DSI_TLPX_CLK ) || \
  783. ((Timing) == DSI_THS_EXIT ) || \
  784. ((Timing) == DSI_TLPX_DATA ) || \
  785. ((Timing) == DSI_THS_ZERO ) || \
  786. ((Timing) == DSI_THS_TRAIL ) || \
  787. ((Timing) == DSI_THS_PREPARE ) || \
  788. ((Timing) == DSI_TCLK_ZERO ) || \
  789. ((Timing) == DSI_TCLK_PREPARE))
  790. /**
  791. * @}
  792. */
  793. #define IS_DSI_ALL_PERIPH(PERIPH) ((PERIPH) == DSI)
  794. /* Exported macros -----------------------------------------------------------*/
  795. /* Exported functions --------------------------------------------------------*/
  796. /* Initialization and Configuration functions *********************************/
  797. void DSI_DeInit(DSI_TypeDef *DSIx);
  798. void DSI_Init(DSI_TypeDef *DSIx,DSI_InitTypeDef* DSI_InitStruct, DSI_PLLInitTypeDef *PLLInit);
  799. void DSI_StructInit(DSI_InitTypeDef* DSI_InitStruct, DSI_HOST_TimeoutTypeDef* DSI_HOST_TimeoutInitStruct);
  800. void DSI_SetGenericVCID(DSI_TypeDef *DSIx, uint32_t VirtualChannelID);
  801. void DSI_ConfigVideoMode(DSI_TypeDef *DSIx, DSI_VidCfgTypeDef *VidCfg);
  802. void DSI_ConfigAdaptedCommandMode(DSI_TypeDef *DSIx, DSI_CmdCfgTypeDef *CmdCfg);
  803. void DSI_ConfigCommand(DSI_TypeDef *DSIx, DSI_LPCmdTypeDef *LPCmd);
  804. void DSI_ConfigFlowControl(DSI_TypeDef *DSIx, uint32_t FlowControl);
  805. void DSI_ConfigPhyTimer(DSI_TypeDef *DSIx, DSI_PHY_TimerTypeDef *PhyTimers);
  806. void DSI_ConfigHostTimeouts(DSI_TypeDef *DSIx, DSI_HOST_TimeoutTypeDef *HostTimeouts);
  807. void DSI_PatternGeneratorStart(DSI_TypeDef *DSIx, uint32_t Mode, uint32_t Orientation);
  808. void DSI_PatternGeneratorStop(DSI_TypeDef *DSIx);
  809. void DSI_Start(DSI_TypeDef *DSIx);
  810. void DSI_Stop(DSI_TypeDef *DSIx);
  811. void DSI_Refresh(DSI_TypeDef *DSIx);
  812. void DSI_ColorMode(DSI_TypeDef *DSIx, uint32_t ColorMode);
  813. void DSI_Shutdown(DSI_TypeDef *DSIx, uint32_t Shutdown);
  814. /* Alias for compatibility with STM32F4XX Standard Peripherals Library version number V1.6.0 */
  815. #define DSI_ConfigLowPowerCommand DSI_ConfigCommand
  816. /* Data transfers management functions ****************************************/
  817. void DSI_ShortWrite(DSI_TypeDef *DSIx, uint32_t ChannelID, uint32_t Mode, uint32_t Param1, uint32_t Param2);
  818. void DSI_LongWrite(DSI_TypeDef *DSIx, uint32_t ChannelID, uint32_t Mode, uint32_t NbParams, uint32_t Param1, uint8_t* ParametersTable);
  819. void DSI_Read(DSI_TypeDef *DSIx, uint32_t ChannelNbr, uint8_t* Array, uint32_t Size, uint32_t Mode, uint32_t DCSCmd, uint8_t* ParametersTable);
  820. /* Low Power functions ********************************************************/
  821. void DSI_EnterULPMData(DSI_TypeDef *DSIx);
  822. void DSI_ExitULPMData(DSI_TypeDef *DSIx);
  823. void DSI_EnterULPM(DSI_TypeDef *DSIx);
  824. void DSI_ExitULPM(DSI_TypeDef *DSIx);
  825. void DSI_SetSlewRateAndDelayTuning(DSI_TypeDef *DSIx, uint32_t CommDelay, uint32_t Lane, uint32_t Value);
  826. void DSI_SetLowPowerRXFilter(DSI_TypeDef *DSIx, uint32_t Frequency);
  827. void DSI_SetSDD(DSI_TypeDef *DSIx, FunctionalState State);
  828. void DSI_SetLanePinsConfiguration(DSI_TypeDef *DSIx, uint32_t CustomLane, uint32_t Lane, FunctionalState State);
  829. void DSI_SetPHYTimings(DSI_TypeDef *DSIx, uint32_t Timing, FunctionalState State, uint32_t Value);
  830. void DSI_ForceTXStopMode(DSI_TypeDef *DSIx, uint32_t Lane, FunctionalState State);
  831. void DSI_ForceRXLowPower(DSI_TypeDef *DSIx, FunctionalState State);
  832. void DSI_ForceDataLanesInRX(DSI_TypeDef *DSIx, FunctionalState State);
  833. void DSI_SetPullDown(DSI_TypeDef *DSIx, FunctionalState State);
  834. void DSI_SetContentionDetectionOff(DSI_TypeDef *DSIx, FunctionalState State);
  835. /* Interrupts and flags management functions **********************************/
  836. void DSI_ITConfig(DSI_TypeDef* DSIx, uint32_t DSI_IT, FunctionalState NewState);
  837. FlagStatus DSI_GetFlagStatus(DSI_TypeDef* DSIx, uint16_t DSI_FLAG);
  838. void DSI_ClearFlag(DSI_TypeDef* DSIx, uint16_t DSI_FLAG);
  839. ITStatus DSI_GetITStatus(DSI_TypeDef* DSIx, uint32_t DSI_IT);
  840. void DSI_ClearITPendingBit(DSI_TypeDef* DSIx, uint32_t DSI_IT);
  841. void DSI_ConfigErrorMonitor(DSI_TypeDef *DSIx, uint32_t ActiveErrors);
  842. #endif /* STM32F469_479xx */
  843. /**
  844. * @}
  845. */
  846. /**
  847. * @}
  848. */
  849. #ifdef __cplusplus
  850. }
  851. #endif
  852. #endif /* __STM32F4xx_DSI_H */