The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Dependents:   hello SerialTestv11 SerialTestv12 Sierpinski ... more

mbed 2

This is the mbed 2 library. If you'd like to learn about Mbed OS please see the mbed-os docs.

Committer:
<>
Date:
Mon Jan 16 12:05:23 2017 +0000
Revision:
134:ad3be0349dc5
Parent:
128:9bcdf88f62b0
Child:
145:64910690c574
Release 134 of the mbed library

Ports for Upcoming Targets


Fixes and Changes

3488: Dev stm i2c v2 unitary functions https://github.com/ARMmbed/mbed-os/pull/3488
3492: Fix #3463 CAN read() return value https://github.com/ARMmbed/mbed-os/pull/3492
3503: [LPC15xx] Ensure that PWM=1 is resolved correctly https://github.com/ARMmbed/mbed-os/pull/3503
3504: [LPC15xx] CAN implementation improvements https://github.com/ARMmbed/mbed-os/pull/3504
3539: NUCLEO_F412ZG - Add support of TRNG peripheral https://github.com/ARMmbed/mbed-os/pull/3539
3540: STM: SPI: Initialize Rx in spi_master_write https://github.com/ARMmbed/mbed-os/pull/3540
3438: K64F: Add support for SERIAL ASYNCH API https://github.com/ARMmbed/mbed-os/pull/3438
3519: MCUXpresso: Fix ENET driver to enable interrupts after interrupt handler is set https://github.com/ARMmbed/mbed-os/pull/3519
3544: STM32L4 deepsleep improvement https://github.com/ARMmbed/mbed-os/pull/3544
3546: NUCLEO-F412ZG - Add CAN peripheral https://github.com/ARMmbed/mbed-os/pull/3546
3551: Fix I2C driver for RZ/A1H https://github.com/ARMmbed/mbed-os/pull/3551
3558: K64F UART Asynch API: Fix synchronization issue https://github.com/ARMmbed/mbed-os/pull/3558
3563: LPC4088 - Fix vector checksum https://github.com/ARMmbed/mbed-os/pull/3563
3567: Dev stm32 F0 v1.7.0 https://github.com/ARMmbed/mbed-os/pull/3567
3577: Fixes linking errors when building with debug profile https://github.com/ARMmbed/mbed-os/pull/3577

Who changed what in which revision?

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