Ben Katz / mbed-dev_spine

Dependents:   SPIne CH_Communicatuin_Test CH_Communicatuin_Test2 MCP_SPIne ... more

Fork of mbed-dev-f303 by Ben Katz

Committer:
benkatz
Date:
Wed May 02 18:08:16 2018 +0000
Revision:
179:97f825502e2a
Parent:
168:9672193075cf

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 144:ef7eb2e8f9f7 1 /**
<> 144:ef7eb2e8f9f7 2 ******************************************************************************
<> 144:ef7eb2e8f9f7 3 * @file stm32f7xx_hal_ltdc_ex.c
<> 144:ef7eb2e8f9f7 4 * @author MCD Application Team
AnnaBridge 168:9672193075cf 5 * @version V1.2.2
AnnaBridge 168:9672193075cf 6 * @date 14-April-2017
<> 144:ef7eb2e8f9f7 7 * @brief LTDC Extension HAL module driver.
<> 144:ef7eb2e8f9f7 8 ******************************************************************************
<> 144:ef7eb2e8f9f7 9 * @attention
<> 144:ef7eb2e8f9f7 10 *
AnnaBridge 168:9672193075cf 11 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
<> 144:ef7eb2e8f9f7 12 *
<> 144:ef7eb2e8f9f7 13 * Redistribution and use in source and binary forms, with or without modification,
<> 144:ef7eb2e8f9f7 14 * are permitted provided that the following conditions are met:
<> 144:ef7eb2e8f9f7 15 * 1. Redistributions of source code must retain the above copyright notice,
<> 144:ef7eb2e8f9f7 16 * this list of conditions and the following disclaimer.
<> 144:ef7eb2e8f9f7 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
<> 144:ef7eb2e8f9f7 18 * this list of conditions and the following disclaimer in the documentation
<> 144:ef7eb2e8f9f7 19 * and/or other materials provided with the distribution.
<> 144:ef7eb2e8f9f7 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
<> 144:ef7eb2e8f9f7 21 * may be used to endorse or promote products derived from this software
<> 144:ef7eb2e8f9f7 22 * without specific prior written permission.
<> 144:ef7eb2e8f9f7 23 *
<> 144:ef7eb2e8f9f7 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
<> 144:ef7eb2e8f9f7 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
<> 144:ef7eb2e8f9f7 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
<> 144:ef7eb2e8f9f7 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
<> 144:ef7eb2e8f9f7 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
<> 144:ef7eb2e8f9f7 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
<> 144:ef7eb2e8f9f7 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
<> 144:ef7eb2e8f9f7 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
<> 144:ef7eb2e8f9f7 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
<> 144:ef7eb2e8f9f7 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
<> 144:ef7eb2e8f9f7 34 *
<> 144:ef7eb2e8f9f7 35 ******************************************************************************
<> 144:ef7eb2e8f9f7 36 */
<> 144:ef7eb2e8f9f7 37
<> 144:ef7eb2e8f9f7 38 /* Includes ------------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 39 #include "stm32f7xx_hal.h"
<> 144:ef7eb2e8f9f7 40
<> 144:ef7eb2e8f9f7 41 /** @addtogroup STM32F7xx_HAL_Driver
<> 144:ef7eb2e8f9f7 42 * @{
<> 144:ef7eb2e8f9f7 43 */
<> 144:ef7eb2e8f9f7 44 /** @defgroup LTDCEx LTDCEx
<> 144:ef7eb2e8f9f7 45 * @brief LTDC HAL module driver
<> 144:ef7eb2e8f9f7 46 * @{
<> 144:ef7eb2e8f9f7 47 */
<> 144:ef7eb2e8f9f7 48
<> 144:ef7eb2e8f9f7 49 #ifdef HAL_LTDC_MODULE_ENABLED
<> 144:ef7eb2e8f9f7 50
<> 144:ef7eb2e8f9f7 51 /* Private typedef -----------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 52 /* Private define ------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 53 /* Private macro -------------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 54 /* Private variables ---------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 55 /* Private function prototypes -----------------------------------------------*/
<> 144:ef7eb2e8f9f7 56 /* Exported functions --------------------------------------------------------*/
<> 144:ef7eb2e8f9f7 57
<> 144:ef7eb2e8f9f7 58 /** @defgroup LTDCEx_Exported_Functions LTDC Extended Exported Functions
<> 144:ef7eb2e8f9f7 59 * @{
<> 144:ef7eb2e8f9f7 60 */
<> 144:ef7eb2e8f9f7 61
<> 144:ef7eb2e8f9f7 62 /** @defgroup LTDCEx_Exported_Functions_Group1 Initialization and Configuration functions
<> 144:ef7eb2e8f9f7 63 * @brief Initialization and Configuration functions
<> 144:ef7eb2e8f9f7 64 *
<> 144:ef7eb2e8f9f7 65 @verbatim
<> 144:ef7eb2e8f9f7 66 ===============================================================================
<> 144:ef7eb2e8f9f7 67 ##### Initialization and Configuration functions #####
<> 144:ef7eb2e8f9f7 68 ===============================================================================
<> 144:ef7eb2e8f9f7 69 [..] This section provides functions allowing to:
<> 144:ef7eb2e8f9f7 70 (+) Initialize and configure the LTDC
<> 144:ef7eb2e8f9f7 71
<> 144:ef7eb2e8f9f7 72 @endverbatim
<> 144:ef7eb2e8f9f7 73 * @{
<> 144:ef7eb2e8f9f7 74 */
<> 144:ef7eb2e8f9f7 75 #if defined (STM32F769xx) || defined (STM32F779xx)
<> 144:ef7eb2e8f9f7 76 /**
<> 144:ef7eb2e8f9f7 77 * @brief Retrieve common parameters from DSI Video mode configuration structure
<> 144:ef7eb2e8f9f7 78 * @param hltdc: pointer to a LTDC_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 79 * the configuration information for the LTDC.
<> 144:ef7eb2e8f9f7 80 * @param VidCfg: pointer to a DSI_VidCfgTypeDef structure that contains
<> 144:ef7eb2e8f9f7 81 * the DSI video mode configuration parameters
<> 144:ef7eb2e8f9f7 82 * @note The implementation of this function is taking into account the LTDC
<> 144:ef7eb2e8f9f7 83 * polarities inversion as described in the current LTDC specification
<> 144:ef7eb2e8f9f7 84 * @retval HAL status
<> 144:ef7eb2e8f9f7 85 */
<> 144:ef7eb2e8f9f7 86 HAL_StatusTypeDef HAL_LTDC_StructInitFromVideoConfig(LTDC_HandleTypeDef* hltdc, DSI_VidCfgTypeDef *VidCfg)
<> 144:ef7eb2e8f9f7 87 {
<> 144:ef7eb2e8f9f7 88 /* Retrieve signal polarities from DSI */
<> 144:ef7eb2e8f9f7 89
<> 157:ff67d9f36b67 90 /* The following polarity is inverted:
<> 157:ff67d9f36b67 91 LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH */
<> 144:ef7eb2e8f9f7 92
<> 144:ef7eb2e8f9f7 93 /* Note 1 : Code in line w/ Current LTDC specification */
<> 144:ef7eb2e8f9f7 94 hltdc->Init.DEPolarity = (VidCfg->DEPolarity == DSI_DATA_ENABLE_ACTIVE_HIGH) ? LTDC_DEPOLARITY_AL : LTDC_DEPOLARITY_AH;
<> 157:ff67d9f36b67 95 hltdc->Init.VSPolarity = (VidCfg->VSPolarity == DSI_VSYNC_ACTIVE_HIGH) ? LTDC_VSPOLARITY_AH : LTDC_VSPOLARITY_AL;
<> 157:ff67d9f36b67 96 hltdc->Init.HSPolarity = (VidCfg->HSPolarity == DSI_HSYNC_ACTIVE_HIGH) ? LTDC_HSPOLARITY_AH : LTDC_HSPOLARITY_AL;
<> 144:ef7eb2e8f9f7 97
<> 144:ef7eb2e8f9f7 98 /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
<> 144:ef7eb2e8f9f7 99 /* hltdc->Init.DEPolarity = VidCfg->DEPolarity << 29;
<> 144:ef7eb2e8f9f7 100 hltdc->Init.VSPolarity = VidCfg->VSPolarity << 29;
<> 144:ef7eb2e8f9f7 101 hltdc->Init.HSPolarity = VidCfg->HSPolarity << 29; */
<> 144:ef7eb2e8f9f7 102
<> 144:ef7eb2e8f9f7 103 /* Retrieve vertical timing parameters from DSI */
<> 144:ef7eb2e8f9f7 104 hltdc->Init.VerticalSync = VidCfg->VerticalSyncActive - 1;
<> 144:ef7eb2e8f9f7 105 hltdc->Init.AccumulatedVBP = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch - 1;
<> 144:ef7eb2e8f9f7 106 hltdc->Init.AccumulatedActiveH = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + VidCfg->VerticalActive - 1;
<> 144:ef7eb2e8f9f7 107 hltdc->Init.TotalHeigh = VidCfg->VerticalSyncActive + VidCfg->VerticalBackPorch + VidCfg->VerticalActive + VidCfg->VerticalFrontPorch - 1;
<> 144:ef7eb2e8f9f7 108
<> 144:ef7eb2e8f9f7 109 return HAL_OK;
<> 144:ef7eb2e8f9f7 110 }
<> 144:ef7eb2e8f9f7 111
<> 144:ef7eb2e8f9f7 112 /**
<> 144:ef7eb2e8f9f7 113 * @brief Retrieve common parameters from DSI Adapted command mode configuration structure
<> 144:ef7eb2e8f9f7 114 * @param hltdc: pointer to a LTDC_HandleTypeDef structure that contains
<> 144:ef7eb2e8f9f7 115 * the configuration information for the LTDC.
<> 144:ef7eb2e8f9f7 116 * @param CmdCfg: pointer to a DSI_CmdCfgTypeDef structure that contains
<> 144:ef7eb2e8f9f7 117 * the DSI command mode configuration parameters
<> 144:ef7eb2e8f9f7 118 * @note The implementation of this function is taking into account the LTDC
<> 144:ef7eb2e8f9f7 119 * polarities inversion as described in the current LTDC specification
<> 144:ef7eb2e8f9f7 120 * @retval HAL status
<> 144:ef7eb2e8f9f7 121 */
<> 144:ef7eb2e8f9f7 122 HAL_StatusTypeDef HAL_LTDC_StructInitFromAdaptedCommandConfig(LTDC_HandleTypeDef* hltdc, DSI_CmdCfgTypeDef *CmdCfg)
<> 144:ef7eb2e8f9f7 123 {
<> 144:ef7eb2e8f9f7 124 /* Retrieve signal polarities from DSI */
<> 144:ef7eb2e8f9f7 125
<> 144:ef7eb2e8f9f7 126 /* The following polarities are inverted:
<> 144:ef7eb2e8f9f7 127 LTDC_DEPOLARITY_AL <-> LTDC_DEPOLARITY_AH
<> 144:ef7eb2e8f9f7 128 LTDC_VSPOLARITY_AL <-> LTDC_VSPOLARITY_AH
<> 144:ef7eb2e8f9f7 129 LTDC_HSPOLARITY_AL <-> LTDC_HSPOLARITY_AH)*/
<> 144:ef7eb2e8f9f7 130
<> 144:ef7eb2e8f9f7 131 /* Note 1 : Code in line w/ Current LTDC specification */
<> 144:ef7eb2e8f9f7 132 hltdc->Init.DEPolarity = (CmdCfg->DEPolarity == DSI_DATA_ENABLE_ACTIVE_HIGH) ? LTDC_DEPOLARITY_AL : LTDC_DEPOLARITY_AH;
<> 144:ef7eb2e8f9f7 133 hltdc->Init.VSPolarity = (CmdCfg->VSPolarity == DSI_VSYNC_ACTIVE_HIGH) ? LTDC_VSPOLARITY_AL : LTDC_VSPOLARITY_AH;
<> 144:ef7eb2e8f9f7 134 hltdc->Init.HSPolarity = (CmdCfg->HSPolarity == DSI_HSYNC_ACTIVE_HIGH) ? LTDC_HSPOLARITY_AL : LTDC_HSPOLARITY_AH;
<> 144:ef7eb2e8f9f7 135
<> 144:ef7eb2e8f9f7 136 /* Note 2: Code to be used in case LTDC polarities inversion updated in the specification */
<> 144:ef7eb2e8f9f7 137 /* hltdc->Init.DEPolarity = CmdCfg->DEPolarity << 29;
<> 144:ef7eb2e8f9f7 138 hltdc->Init.VSPolarity = CmdCfg->VSPolarity << 29;
<> 144:ef7eb2e8f9f7 139 hltdc->Init.HSPolarity = CmdCfg->HSPolarity << 29; */
<> 144:ef7eb2e8f9f7 140
<> 144:ef7eb2e8f9f7 141 return HAL_OK;
<> 144:ef7eb2e8f9f7 142 }
<> 144:ef7eb2e8f9f7 143 #endif /*STM32F769xx | STM32F779xx */
<> 144:ef7eb2e8f9f7 144
<> 144:ef7eb2e8f9f7 145 /**
<> 144:ef7eb2e8f9f7 146 * @}
<> 144:ef7eb2e8f9f7 147 */
<> 144:ef7eb2e8f9f7 148
<> 144:ef7eb2e8f9f7 149 /**
<> 144:ef7eb2e8f9f7 150 * @}
<> 144:ef7eb2e8f9f7 151 */
<> 144:ef7eb2e8f9f7 152
<> 144:ef7eb2e8f9f7 153 #endif /* HAL_LTCD_MODULE_ENABLED */
<> 144:ef7eb2e8f9f7 154 /**
<> 144:ef7eb2e8f9f7 155 * @}
<> 144:ef7eb2e8f9f7 156 */
<> 144:ef7eb2e8f9f7 157
<> 144:ef7eb2e8f9f7 158 /**
<> 144:ef7eb2e8f9f7 159 * @}
<> 144:ef7eb2e8f9f7 160 */
<> 144:ef7eb2e8f9f7 161
<> 144:ef7eb2e8f9f7 162 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/