Patched for Audio example - Add status check when DFSDM's filter and channel de-init.

Dependents:   DISCO_F413ZH-AUDIO-demo

The base repository is https://os.mbed.com/teams/ST/code/BSP_DISCO_F413ZH/. I've just added workaround patch for Audio-in demo on DISCO_F413ZH board(Microphone U16, U17)

Committer:
Daniel_Lee
Date:
Fri Jan 31 07:17:05 2020 +0000
Revision:
4:c051317d4051
Parent:
3:42b354f5069c
Patched for Audio example;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
arostm 0:4af3ca173992 1 /**
arostm 0:4af3ca173992 2 ******************************************************************************
arostm 0:4af3ca173992 3 * @file stm32f413h_discovery_lcd.h
arostm 0:4af3ca173992 4 * @author MCD Application Team
arostm 0:4af3ca173992 5 * @brief This file contains the common defines and functions prototypes for
arostm 0:4af3ca173992 6 * the stm32f413h_discovery_lcd.c driver.
arostm 0:4af3ca173992 7 ******************************************************************************
arostm 0:4af3ca173992 8 * @attention
arostm 0:4af3ca173992 9 *
arostm 0:4af3ca173992 10 * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
arostm 0:4af3ca173992 11 *
arostm 0:4af3ca173992 12 * Redistribution and use in source and binary forms, with or without modification,
arostm 0:4af3ca173992 13 * are permitted provided that the following conditions are met:
arostm 0:4af3ca173992 14 * 1. Redistributions of source code must retain the above copyright notice,
arostm 0:4af3ca173992 15 * this list of conditions and the following disclaimer.
arostm 0:4af3ca173992 16 * 2. Redistributions in binary form must reproduce the above copyright notice,
arostm 0:4af3ca173992 17 * this list of conditions and the following disclaimer in the documentation
arostm 0:4af3ca173992 18 * and/or other materials provided with the distribution.
arostm 0:4af3ca173992 19 * 3. Neither the name of STMicroelectronics nor the names of its contributors
arostm 0:4af3ca173992 20 * may be used to endorse or promote products derived from this software
arostm 0:4af3ca173992 21 * without specific prior written permission.
arostm 0:4af3ca173992 22 *
arostm 0:4af3ca173992 23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
arostm 0:4af3ca173992 24 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
arostm 0:4af3ca173992 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
arostm 0:4af3ca173992 26 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
arostm 0:4af3ca173992 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
arostm 0:4af3ca173992 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
arostm 0:4af3ca173992 29 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
arostm 0:4af3ca173992 30 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
arostm 0:4af3ca173992 31 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
arostm 0:4af3ca173992 32 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
arostm 0:4af3ca173992 33 *
arostm 0:4af3ca173992 34 ******************************************************************************
arostm 0:4af3ca173992 35 */
arostm 0:4af3ca173992 36
arostm 0:4af3ca173992 37 /* Define to prevent recursive inclusion -------------------------------------*/
arostm 0:4af3ca173992 38 #ifndef __STM32F413H_DISCOVERY_LCD_H
arostm 0:4af3ca173992 39 #define __STM32F413H_DISCOVERY_LCD_H
arostm 0:4af3ca173992 40
arostm 0:4af3ca173992 41 #ifdef __cplusplus
arostm 0:4af3ca173992 42 extern "C" {
arostm 0:4af3ca173992 43 #endif
arostm 0:4af3ca173992 44
arostm 0:4af3ca173992 45 /* Includes ------------------------------------------------------------------*/
arostm 0:4af3ca173992 46 #include "stm32f413h_discovery.h"
arostm 0:4af3ca173992 47 #include "../Components/st7789h2/st7789h2.h"
arostm 0:4af3ca173992 48 #include "../../../Utilities/Fonts/fonts.h"
arostm 0:4af3ca173992 49
arostm 0:4af3ca173992 50 /** @addtogroup BSP
arostm 0:4af3ca173992 51 * @{
arostm 0:4af3ca173992 52 */
arostm 0:4af3ca173992 53
arostm 0:4af3ca173992 54 /** @addtogroup STM32F413H_DISCOVERY
arostm 0:4af3ca173992 55 * @{
arostm 0:4af3ca173992 56 */
arostm 0:4af3ca173992 57
arostm 0:4af3ca173992 58 /** @addtogroup STM32F413H_DISCOVERY_LCD
arostm 0:4af3ca173992 59 * @{
arostm 0:4af3ca173992 60 */
arostm 0:4af3ca173992 61
arostm 0:4af3ca173992 62 /** @defgroup STM32F413H_DISCOVERY_LCD_Exported_Types STM32F413H DISCOVERY LCD Exported Types
arostm 0:4af3ca173992 63 * @{
arostm 0:4af3ca173992 64 */
arostm 0:4af3ca173992 65 typedef struct
arostm 0:4af3ca173992 66 {
arostm 0:4af3ca173992 67 uint32_t TextColor;
arostm 0:4af3ca173992 68 uint32_t BackColor;
arostm 0:4af3ca173992 69 sFONT *pFont;
arostm 0:4af3ca173992 70 }LCD_DrawPropTypeDef;
arostm 0:4af3ca173992 71
arostm 0:4af3ca173992 72 typedef struct
arostm 0:4af3ca173992 73 {
arostm 0:4af3ca173992 74 int16_t X;
arostm 0:4af3ca173992 75 int16_t Y;
arostm 0:4af3ca173992 76 }Point, * pPoint;
arostm 0:4af3ca173992 77
arostm 0:4af3ca173992 78 /**
arostm 0:4af3ca173992 79 * @brief Line mode structures definition
arostm 0:4af3ca173992 80 */
arostm 0:4af3ca173992 81 typedef enum
arostm 0:4af3ca173992 82 {
arostm 0:4af3ca173992 83 CENTER_MODE = 0x01, /* Center mode */
arostm 0:4af3ca173992 84 RIGHT_MODE = 0x02, /* Right mode */
arostm 0:4af3ca173992 85 LEFT_MODE = 0x03 /* Left mode */
arostm 0:4af3ca173992 86 }Line_ModeTypdef;
arostm 0:4af3ca173992 87
arostm 0:4af3ca173992 88 /**
arostm 0:4af3ca173992 89 * @}
arostm 0:4af3ca173992 90 */
arostm 0:4af3ca173992 91
arostm 0:4af3ca173992 92 /** @defgroup STM32F413H_DISCOVERY_LCD_Exported_Constants STM32F413H DISCOVERY LCD Exported Constants
arostm 0:4af3ca173992 93 * @{
arostm 0:4af3ca173992 94 */
arostm 0:4af3ca173992 95 /**
arostm 0:4af3ca173992 96 * @brief LCD status structure definition
arostm 0:4af3ca173992 97 */
arostm 0:4af3ca173992 98 #define LCD_OK ((uint8_t)0x00)
arostm 0:4af3ca173992 99 #define LCD_ERROR ((uint8_t)0x01)
arostm 0:4af3ca173992 100 #define LCD_TIMEOUT ((uint8_t)0x02)
arostm 0:4af3ca173992 101
arostm 0:4af3ca173992 102 #define LCD_ORIENTATION_PORTRAIT ((uint8_t)0x00) /*!< Portrait orientation choice of LCD screen */
arostm 0:4af3ca173992 103 #define LCD_ORIENTATION_LANDSCAPE ((uint8_t)0x01) /*!< Landscape orientation choice of LCD screen */
arostm 0:4af3ca173992 104 #define LCD_ORIENTATION_LANDSCAPE_ROT180 ((uint8_t)0x02) /*!< Landscape rotated 180° orientation choice of LCD screen */
arostm 0:4af3ca173992 105
arostm 0:4af3ca173992 106 /**
arostm 0:4af3ca173992 107 * @brief LCD color
arostm 0:4af3ca173992 108 */
arostm 0:4af3ca173992 109 #define LCD_COLOR_BLUE ((uint16_t)0x001F)
arostm 0:4af3ca173992 110 #define LCD_COLOR_GREEN ((uint16_t)0x07E0)
arostm 0:4af3ca173992 111 #define LCD_COLOR_RED ((uint16_t)0xF800)
arostm 0:4af3ca173992 112 #define LCD_COLOR_CYAN ((uint16_t)0x07FF)
arostm 0:4af3ca173992 113 #define LCD_COLOR_MAGENTA ((uint16_t)0xF81F)
arostm 0:4af3ca173992 114 #define LCD_COLOR_YELLOW ((uint16_t)0xFFE0)
arostm 0:4af3ca173992 115 #define LCD_COLOR_LIGHTBLUE ((uint16_t)0x841F)
arostm 0:4af3ca173992 116 #define LCD_COLOR_LIGHTGREEN ((uint16_t)0x87F0)
arostm 0:4af3ca173992 117 #define LCD_COLOR_LIGHTRED ((uint16_t)0xFC10)
arostm 0:4af3ca173992 118 #define LCD_COLOR_LIGHTMAGENTA ((uint16_t)0xFC1F)
arostm 0:4af3ca173992 119 #define LCD_COLOR_LIGHTYELLOW ((uint16_t)0xFFF0)
arostm 0:4af3ca173992 120 #define LCD_COLOR_DARKBLUE ((uint16_t)0x0010)
arostm 0:4af3ca173992 121 #define LCD_COLOR_DARKGREEN ((uint16_t)0x0400)
arostm 0:4af3ca173992 122 #define LCD_COLOR_DARKRED ((uint16_t)0x8000)
arostm 0:4af3ca173992 123 #define LCD_COLOR_DARKCYAN ((uint16_t)0x0410)
arostm 0:4af3ca173992 124 #define LCD_COLOR_DARKMAGENTA ((uint16_t)0x8010)
arostm 0:4af3ca173992 125 #define LCD_COLOR_DARKYELLOW ((uint16_t)0x8400)
arostm 0:4af3ca173992 126 #define LCD_COLOR_WHITE ((uint16_t)0xFFFF)
arostm 0:4af3ca173992 127 #define LCD_COLOR_LIGHTGRAY ((uint16_t)0xD69A)
arostm 0:4af3ca173992 128 #define LCD_COLOR_GRAY ((uint16_t)0x8410)
arostm 0:4af3ca173992 129 #define LCD_COLOR_DARKGRAY ((uint16_t)0x4208)
arostm 0:4af3ca173992 130 #define LCD_COLOR_BLACK ((uint16_t)0x0000)
arostm 0:4af3ca173992 131 #define LCD_COLOR_BROWN ((uint16_t)0xA145)
arostm 0:4af3ca173992 132 #define LCD_COLOR_ORANGE ((uint16_t)0xFD20)
arostm 0:4af3ca173992 133
arostm 0:4af3ca173992 134 /**
arostm 0:4af3ca173992 135 * @brief LCD default font
arostm 0:4af3ca173992 136 */
arostm 0:4af3ca173992 137 #define LCD_DEFAULT_FONT Font12
arostm 0:4af3ca173992 138
arostm 0:4af3ca173992 139 /**
arostm 0:4af3ca173992 140 * @brief LCD special pins
arostm 0:4af3ca173992 141 */
arostm 0:4af3ca173992 142 /* LCD reset pin */
arostm 0:4af3ca173992 143 #define LCD_RESET_PIN GPIO_PIN_13
arostm 0:4af3ca173992 144 #define LCD_RESET_GPIO_PORT GPIOB
arostm 0:4af3ca173992 145 #define LCD_RESET_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
arostm 0:4af3ca173992 146 #define LCD_RESET_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
arostm 0:4af3ca173992 147
arostm 0:4af3ca173992 148 /* LCD tearing effect pin */
arostm 0:4af3ca173992 149 #define LCD_TE_PIN GPIO_PIN_14
arostm 0:4af3ca173992 150 #define LCD_TE_GPIO_PORT GPIOB
arostm 0:4af3ca173992 151 #define LCD_TE_GPIO_CLK_ENABLE() __HAL_RCC_GPIOB_CLK_ENABLE()
arostm 0:4af3ca173992 152 #define LCD_TE_GPIO_CLK_DISABLE() __HAL_RCC_GPIOB_CLK_DISABLE()
arostm 0:4af3ca173992 153
arostm 0:4af3ca173992 154 /* Backlight control pin */
arostm 0:4af3ca173992 155 #define LCD_BL_CTRL_PIN GPIO_PIN_5
arostm 0:4af3ca173992 156 #define LCD_BL_CTRL_GPIO_PORT GPIOE
arostm 0:4af3ca173992 157 #define LCD_BL_CTRL_GPIO_CLK_ENABLE() __HAL_RCC_GPIOE_CLK_ENABLE()
arostm 0:4af3ca173992 158 #define LCD_BL_CTRL_GPIO_CLK_DISABLE() __HAL_RCC_GPIOE_CLK_DISABLE()
arostm 0:4af3ca173992 159
arostm 0:4af3ca173992 160 /**
arostm 0:4af3ca173992 161 * @}
arostm 0:4af3ca173992 162 */
arostm 0:4af3ca173992 163
arostm 0:4af3ca173992 164 /** @defgroup STM32F413H_DISCOVERY_LCD_Exported_Functions STM32F413H DISCOVERY LCD Exported Functions
arostm 0:4af3ca173992 165 * @{
arostm 0:4af3ca173992 166 */
arostm 0:4af3ca173992 167 uint8_t BSP_LCD_Init(void);
arostm 0:4af3ca173992 168 uint8_t BSP_LCD_InitEx(uint32_t orientation);
arostm 0:4af3ca173992 169 uint8_t BSP_LCD_DeInit(void);
arostm 0:4af3ca173992 170 uint32_t BSP_LCD_GetXSize(void);
arostm 0:4af3ca173992 171 uint32_t BSP_LCD_GetYSize(void);
arostm 0:4af3ca173992 172
arostm 0:4af3ca173992 173 uint16_t BSP_LCD_GetTextColor(void);
arostm 0:4af3ca173992 174 uint16_t BSP_LCD_GetBackColor(void);
arostm 0:4af3ca173992 175 void BSP_LCD_SetTextColor(__IO uint16_t Color);
arostm 0:4af3ca173992 176 void BSP_LCD_SetBackColor(__IO uint16_t Color);
arostm 0:4af3ca173992 177 void BSP_LCD_SetFont(sFONT *fonts);
arostm 0:4af3ca173992 178 sFONT *BSP_LCD_GetFont(void);
arostm 0:4af3ca173992 179
arostm 0:4af3ca173992 180 void BSP_LCD_Clear(uint16_t Color);
arostm 0:4af3ca173992 181 void BSP_LCD_ClearStringLine(uint16_t Line);
arostm 0:4af3ca173992 182 void BSP_LCD_DisplayStringAtLine(uint16_t Line, uint8_t *ptr);
arostm 0:4af3ca173992 183 void BSP_LCD_DisplayStringAt(uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Line_ModeTypdef Mode);
arostm 0:4af3ca173992 184 void BSP_LCD_DisplayChar(uint16_t Xpos, uint16_t Ypos, uint8_t Ascii);
arostm 0:4af3ca173992 185
arostm 0:4af3ca173992 186 uint16_t BSP_LCD_ReadPixel(uint16_t Xpos, uint16_t Ypos);
arostm 0:4af3ca173992 187 void BSP_LCD_DrawPixel(uint16_t Xpos, uint16_t Ypos, uint16_t RGB_Code);
arostm 0:4af3ca173992 188 void BSP_LCD_DrawHLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
arostm 0:4af3ca173992 189 void BSP_LCD_DrawVLine(uint16_t Xpos, uint16_t Ypos, uint16_t Length);
arostm 0:4af3ca173992 190 void BSP_LCD_DrawLine(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2);
arostm 0:4af3ca173992 191 void BSP_LCD_DrawRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
arostm 0:4af3ca173992 192 void BSP_LCD_DrawCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
arostm 0:4af3ca173992 193 void BSP_LCD_DrawPolygon(pPoint Points, uint16_t PointCount);
arostm 0:4af3ca173992 194 void BSP_LCD_DrawEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
arostm 0:4af3ca173992 195 void BSP_LCD_DrawBitmap(uint16_t Xpos, uint16_t Ypos, uint8_t *pbmp);
arostm 0:4af3ca173992 196 void BSP_LCD_DrawRGBImage(uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pbmp);
arostm 0:4af3ca173992 197 void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height);
arostm 0:4af3ca173992 198 void BSP_LCD_FillCircle(uint16_t Xpos, uint16_t Ypos, uint16_t Radius);
arostm 0:4af3ca173992 199 void BSP_LCD_FillPolygon(pPoint Points, uint16_t PointCount);
arostm 0:4af3ca173992 200 void BSP_LCD_FillEllipse(int Xpos, int Ypos, int XRadius, int YRadius);
arostm 0:4af3ca173992 201
arostm 0:4af3ca173992 202 void BSP_LCD_DisplayOff(void);
arostm 0:4af3ca173992 203 void BSP_LCD_DisplayOn(void);
arostm 0:4af3ca173992 204
arostm 0:4af3ca173992 205 /* These functions can be modified in case the current settings
arostm 0:4af3ca173992 206 need to be changed for specific application needs */
arostm 0:4af3ca173992 207 void BSP_LCD_MspInit(void);
arostm 0:4af3ca173992 208 void BSP_LCD_MspDeInit(void);
arostm 0:4af3ca173992 209
arostm 0:4af3ca173992 210 /**
arostm 0:4af3ca173992 211 * @}
arostm 0:4af3ca173992 212 */
arostm 0:4af3ca173992 213
arostm 0:4af3ca173992 214 /**
arostm 0:4af3ca173992 215 * @}
arostm 0:4af3ca173992 216 */
arostm 0:4af3ca173992 217
arostm 0:4af3ca173992 218 /**
arostm 0:4af3ca173992 219 * @}
arostm 0:4af3ca173992 220 */
arostm 0:4af3ca173992 221
arostm 0:4af3ca173992 222 /**
arostm 0:4af3ca173992 223 * @}
arostm 0:4af3ca173992 224 */
arostm 0:4af3ca173992 225
arostm 0:4af3ca173992 226 #ifdef __cplusplus
arostm 0:4af3ca173992 227 }
arostm 0:4af3ca173992 228 #endif
arostm 0:4af3ca173992 229
arostm 0:4af3ca173992 230 #endif /* __STM32F413H_DISCOVERY_LCD_H */
arostm 0:4af3ca173992 231
arostm 0:4af3ca173992 232 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/