fix LPC812 PWM

Dependents:   IR_LED_Send

Fork of mbed-dev by mbed official

Committer:
nameless129
Date:
Mon May 16 16:50:30 2016 +0000
Revision:
129:2e517c56bcfb
Parent:
19:112740acecfa
PWM Fix:Duty 0%??H???????????????

Who changed what in which revision?

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