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)
Drivers/BSP/STM32F413H-Discovery/stm32f413h_discovery_ts.h@4:c051317d4051, 2020-01-31 (annotated)
- 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?
User | Revision | Line number | New contents of line |
---|---|---|---|
arostm | 0:4af3ca173992 | 1 | /** |
arostm | 0:4af3ca173992 | 2 | ****************************************************************************** |
arostm | 0:4af3ca173992 | 3 | * @file stm32f413h_discovery_ts.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_ts.c driver. |
arostm | 0:4af3ca173992 | 7 | ****************************************************************************** |
arostm | 0:4af3ca173992 | 8 | * @attention |
arostm | 0:4af3ca173992 | 9 | * |
arostm | 0:4af3ca173992 | 10 | * <h2><center>© 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_TS_H |
arostm | 0:4af3ca173992 | 39 | #define __STM32F413H_DISCOVERY_TS_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 "stm32f413h_discovery_lcd.h" |
arostm | 0:4af3ca173992 | 48 | |
arostm | 0:4af3ca173992 | 49 | /* Include TouchScreen component driver */ |
arostm | 0:4af3ca173992 | 50 | #include "../Components/ft6x06/ft6x06.h" |
arostm | 0:4af3ca173992 | 51 | |
arostm | 0:4af3ca173992 | 52 | /** @addtogroup BSP |
arostm | 0:4af3ca173992 | 53 | * @{ |
arostm | 0:4af3ca173992 | 54 | */ |
arostm | 0:4af3ca173992 | 55 | |
arostm | 0:4af3ca173992 | 56 | /** @addtogroup STM32F413H_DISCOVERY |
arostm | 0:4af3ca173992 | 57 | * @{ |
arostm | 0:4af3ca173992 | 58 | */ |
arostm | 0:4af3ca173992 | 59 | |
arostm | 0:4af3ca173992 | 60 | /** @addtogroup STM32F413H_DISCOVERY_TS |
arostm | 0:4af3ca173992 | 61 | * @{ |
arostm | 0:4af3ca173992 | 62 | */ |
arostm | 0:4af3ca173992 | 63 | |
arostm | 0:4af3ca173992 | 64 | /** @defgroup STM32F413H_DISCOVERY_TS_Exported_Constants STM32F413H DISCOVERY TS Exported Constants |
arostm | 0:4af3ca173992 | 65 | * @{ |
arostm | 0:4af3ca173992 | 66 | */ |
arostm | 0:4af3ca173992 | 67 | /** @brief With FT6206 : maximum 2 touches detected simultaneously |
arostm | 0:4af3ca173992 | 68 | */ |
arostm | 0:4af3ca173992 | 69 | #define TS_MAX_NB_TOUCH ((uint32_t) FT6206_MAX_DETECTABLE_TOUCH) |
arostm | 0:4af3ca173992 | 70 | |
arostm | 0:4af3ca173992 | 71 | #define TS_NO_IRQ_PENDING ((uint8_t) 0) |
arostm | 0:4af3ca173992 | 72 | #define TS_IRQ_PENDING ((uint8_t) 1) |
arostm | 0:4af3ca173992 | 73 | |
arostm | 0:4af3ca173992 | 74 | #define TS_SWAP_NONE ((uint8_t) 0x01) |
arostm | 0:4af3ca173992 | 75 | #define TS_SWAP_X ((uint8_t) 0x02) |
arostm | 0:4af3ca173992 | 76 | #define TS_SWAP_Y ((uint8_t) 0x04) |
arostm | 0:4af3ca173992 | 77 | #define TS_SWAP_XY ((uint8_t) 0x08) |
arostm | 0:4af3ca173992 | 78 | |
arostm | 0:4af3ca173992 | 79 | #define TS_ORIENTATION_PORTRAIT ((uint8_t) 0) |
arostm | 0:4af3ca173992 | 80 | #define TS_ORIENTATION_LANDSCAPE ((uint8_t) 1) |
arostm | 0:4af3ca173992 | 81 | #define TS_ORIENTATION_LANDSCAPE_ROT180 ((uint8_t) 2) |
arostm | 0:4af3ca173992 | 82 | |
arostm | 0:4af3ca173992 | 83 | /** |
arostm | 0:4af3ca173992 | 84 | * @} |
arostm | 0:4af3ca173992 | 85 | */ |
arostm | 0:4af3ca173992 | 86 | |
arostm | 0:4af3ca173992 | 87 | /** @defgroup STM32F413H_DISCOVERY_TS_Exported_Types STM32F413H DISCOVERY TS Exported Types |
arostm | 0:4af3ca173992 | 88 | * @{ |
arostm | 0:4af3ca173992 | 89 | */ |
arostm | 0:4af3ca173992 | 90 | /** |
arostm | 0:4af3ca173992 | 91 | * @brief TS_StateTypeDef |
arostm | 0:4af3ca173992 | 92 | * Define TS State structure |
arostm | 0:4af3ca173992 | 93 | */ |
arostm | 0:4af3ca173992 | 94 | typedef struct |
arostm | 0:4af3ca173992 | 95 | { |
arostm | 0:4af3ca173992 | 96 | uint8_t touchDetected; /*!< Total number of active touches detected at last scan */ |
arostm | 0:4af3ca173992 | 97 | uint16_t touchX[TS_MAX_NB_TOUCH]; /*!< Touch X[0], X[1] coordinates on 12 bits */ |
arostm | 0:4af3ca173992 | 98 | uint16_t touchY[TS_MAX_NB_TOUCH]; /*!< Touch Y[0], Y[1] coordinates on 12 bits */ |
arostm | 0:4af3ca173992 | 99 | |
arostm | 0:4af3ca173992 | 100 | #if (TS_MULTI_TOUCH_SUPPORTED == 1) |
arostm | 0:4af3ca173992 | 101 | uint8_t touchWeight[TS_MAX_NB_TOUCH]; /*!< Touch_Weight[0], Touch_Weight[1] : weight property of touches */ |
arostm | 0:4af3ca173992 | 102 | uint8_t touchEventId[TS_MAX_NB_TOUCH]; /*!< Touch_EventId[0], Touch_EventId[1] : take value of type @ref TS_TouchEventTypeDef */ |
arostm | 0:4af3ca173992 | 103 | uint8_t touchArea[TS_MAX_NB_TOUCH]; /*!< Touch_Area[0], Touch_Area[1] : touch area of each touch */ |
arostm | 0:4af3ca173992 | 104 | uint32_t gestureId; /*!< type of gesture detected : take value of type @ref TS_GestureIdTypeDef */ |
arostm | 0:4af3ca173992 | 105 | #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ |
arostm | 0:4af3ca173992 | 106 | }TS_StateTypeDef; |
arostm | 0:4af3ca173992 | 107 | |
arostm | 0:4af3ca173992 | 108 | /** |
arostm | 0:4af3ca173992 | 109 | * @brief TS_StatusTypeDef |
arostm | 0:4af3ca173992 | 110 | * Define BSP_TS_xxx() functions possible return value, |
arostm | 0:4af3ca173992 | 111 | * when status is returned by those functions. |
arostm | 0:4af3ca173992 | 112 | */ |
arostm | 0:4af3ca173992 | 113 | typedef enum |
arostm | 0:4af3ca173992 | 114 | { |
arostm | 0:4af3ca173992 | 115 | TS_OK = 0x00, /*!< Touch Ok */ |
arostm | 0:4af3ca173992 | 116 | TS_ERROR = 0x01, /*!< Touch Error */ |
arostm | 0:4af3ca173992 | 117 | TS_TIMEOUT = 0x02, /*!< Touch Timeout */ |
arostm | 0:4af3ca173992 | 118 | TS_DEVICE_NOT_FOUND = 0x03 /*!< Touchscreen device not found */ |
arostm | 0:4af3ca173992 | 119 | } TS_StatusTypeDef; |
arostm | 0:4af3ca173992 | 120 | |
arostm | 0:4af3ca173992 | 121 | |
arostm | 0:4af3ca173992 | 122 | /** |
arostm | 0:4af3ca173992 | 123 | * @brief TS_GestureIdTypeDef |
arostm | 0:4af3ca173992 | 124 | * Define Possible managed gesture identification values returned by touch screen |
arostm | 0:4af3ca173992 | 125 | * driver. |
arostm | 0:4af3ca173992 | 126 | */ |
arostm | 0:4af3ca173992 | 127 | typedef enum |
arostm | 0:4af3ca173992 | 128 | { |
arostm | 0:4af3ca173992 | 129 | GEST_ID_NO_GESTURE = 0x00, /*!< Gesture not defined / recognized */ |
arostm | 0:4af3ca173992 | 130 | GEST_ID_MOVE_UP = 0x01, /*!< Gesture Move Up */ |
arostm | 0:4af3ca173992 | 131 | GEST_ID_MOVE_RIGHT = 0x02, /*!< Gesture Move Right */ |
arostm | 0:4af3ca173992 | 132 | GEST_ID_MOVE_DOWN = 0x03, /*!< Gesture Move Down */ |
arostm | 0:4af3ca173992 | 133 | GEST_ID_MOVE_LEFT = 0x04, /*!< Gesture Move Left */ |
arostm | 0:4af3ca173992 | 134 | GEST_ID_ZOOM_IN = 0x05, /*!< Gesture Zoom In */ |
arostm | 0:4af3ca173992 | 135 | GEST_ID_ZOOM_OUT = 0x06, /*!< Gesture Zoom Out */ |
arostm | 0:4af3ca173992 | 136 | GEST_ID_NB_MAX = 0x07 /*!< max number of gesture id */ |
arostm | 0:4af3ca173992 | 137 | } TS_GestureIdTypeDef; |
arostm | 0:4af3ca173992 | 138 | |
arostm | 0:4af3ca173992 | 139 | /** |
arostm | 0:4af3ca173992 | 140 | * @brief TS_TouchEventTypeDef |
arostm | 0:4af3ca173992 | 141 | * Define Possible touch events kind as returned values |
arostm | 0:4af3ca173992 | 142 | * by touch screen IC Driver. |
arostm | 0:4af3ca173992 | 143 | */ |
arostm | 0:4af3ca173992 | 144 | typedef enum |
arostm | 0:4af3ca173992 | 145 | { |
arostm | 0:4af3ca173992 | 146 | TOUCH_EVENT_NO_EVT = 0x00, /*!< Touch Event : undetermined */ |
arostm | 0:4af3ca173992 | 147 | TOUCH_EVENT_PRESS_DOWN = 0x01, /*!< Touch Event Press Down */ |
arostm | 0:4af3ca173992 | 148 | TOUCH_EVENT_LIFT_UP = 0x02, /*!< Touch Event Lift Up */ |
arostm | 0:4af3ca173992 | 149 | TOUCH_EVENT_CONTACT = 0x03, /*!< Touch Event Contact */ |
arostm | 0:4af3ca173992 | 150 | TOUCH_EVENT_NB_MAX = 0x04 /*!< max number of touch events kind */ |
arostm | 0:4af3ca173992 | 151 | } TS_TouchEventTypeDef; |
arostm | 0:4af3ca173992 | 152 | |
arostm | 0:4af3ca173992 | 153 | /** |
arostm | 0:4af3ca173992 | 154 | * @} |
arostm | 0:4af3ca173992 | 155 | */ |
arostm | 0:4af3ca173992 | 156 | |
arostm | 0:4af3ca173992 | 157 | /** @defgroup STM32F413H_DISCOVERY_TS_Imported_Variables STM32F413H DISCOVERY TS Imported Variables |
arostm | 0:4af3ca173992 | 158 | * @{ |
arostm | 0:4af3ca173992 | 159 | */ |
arostm | 0:4af3ca173992 | 160 | /** |
arostm | 0:4af3ca173992 | 161 | * @brief Table for touchscreen event information display on LCD : |
arostm | 0:4af3ca173992 | 162 | * table indexed on enum @ref TS_TouchEventTypeDef information |
arostm | 0:4af3ca173992 | 163 | */ |
arostm | 0:4af3ca173992 | 164 | extern char * ts_event_string_tab[TOUCH_EVENT_NB_MAX]; |
arostm | 0:4af3ca173992 | 165 | |
arostm | 0:4af3ca173992 | 166 | /** |
arostm | 0:4af3ca173992 | 167 | * @brief Table for touchscreen gesture Id information display on LCD : table indexed |
arostm | 0:4af3ca173992 | 168 | * on enum @ref TS_GestureIdTypeDef information |
arostm | 0:4af3ca173992 | 169 | */ |
arostm | 0:4af3ca173992 | 170 | extern char * ts_gesture_id_string_tab[GEST_ID_NB_MAX]; |
arostm | 0:4af3ca173992 | 171 | /** |
arostm | 0:4af3ca173992 | 172 | * @} |
arostm | 0:4af3ca173992 | 173 | */ |
arostm | 0:4af3ca173992 | 174 | /** @defgroup STM32F413H_DISCOVERY_TS_Exported_Functions STM32F413H DISCOVERY TS Exported Functions |
arostm | 0:4af3ca173992 | 175 | * @{ |
arostm | 0:4af3ca173992 | 176 | */ |
arostm | 0:4af3ca173992 | 177 | uint8_t BSP_TS_Init(uint16_t ts_SizeX, uint16_t ts_SizeY); |
arostm | 0:4af3ca173992 | 178 | uint8_t BSP_TS_InitEx(uint16_t ts_SizeX, uint16_t ts_SizeY, uint8_t orientation); |
arostm | 0:4af3ca173992 | 179 | uint8_t BSP_TS_GetState(TS_StateTypeDef *TS_State); |
arostm | 0:4af3ca173992 | 180 | |
arostm | 0:4af3ca173992 | 181 | #if (TS_MULTI_TOUCH_SUPPORTED == 1) |
arostm | 0:4af3ca173992 | 182 | uint8_t BSP_TS_Get_GestureId(TS_StateTypeDef *TS_State); |
arostm | 0:4af3ca173992 | 183 | uint8_t BSP_TS_ResetTouchData(TS_StateTypeDef *TS_State); |
arostm | 0:4af3ca173992 | 184 | #endif /* TS_MULTI_TOUCH_SUPPORTED == 1 */ |
arostm | 0:4af3ca173992 | 185 | |
arostm | 0:4af3ca173992 | 186 | uint8_t BSP_TS_ITConfig(void); |
arostm | 0:4af3ca173992 | 187 | |
arostm | 0:4af3ca173992 | 188 | /* These __weak function can be surcharged by application code in case the current settings |
arostm | 0:4af3ca173992 | 189 | need to be changed for specific (example GPIO allocation) */ |
arostm | 0:4af3ca173992 | 190 | void BSP_TS_INT_MspInit(void); |
arostm | 0:4af3ca173992 | 191 | |
arostm | 0:4af3ca173992 | 192 | /** |
arostm | 0:4af3ca173992 | 193 | * @} |
arostm | 0:4af3ca173992 | 194 | */ |
arostm | 0:4af3ca173992 | 195 | |
arostm | 0:4af3ca173992 | 196 | /** |
arostm | 0:4af3ca173992 | 197 | * @} |
arostm | 0:4af3ca173992 | 198 | */ |
arostm | 0:4af3ca173992 | 199 | |
arostm | 0:4af3ca173992 | 200 | /** |
arostm | 0:4af3ca173992 | 201 | * @} |
arostm | 0:4af3ca173992 | 202 | */ |
arostm | 0:4af3ca173992 | 203 | |
arostm | 0:4af3ca173992 | 204 | /** |
arostm | 0:4af3ca173992 | 205 | * @} |
arostm | 0:4af3ca173992 | 206 | */ |
arostm | 0:4af3ca173992 | 207 | |
arostm | 0:4af3ca173992 | 208 | |
arostm | 0:4af3ca173992 | 209 | #ifdef __cplusplus |
arostm | 0:4af3ca173992 | 210 | } |
arostm | 0:4af3ca173992 | 211 | #endif |
arostm | 0:4af3ca173992 | 212 | |
arostm | 0:4af3ca173992 | 213 | #endif /* __STM32F413H_DISCOVERY_TS_H */ |
arostm | 0:4af3ca173992 | 214 | |
arostm | 0:4af3ca173992 | 215 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |