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/Components/Common/io.h@4:c051317d4051, 2020-01-31 (annotated)
- Committer:
- Daniel_Lee
- Date:
- Fri Jan 31 07:17:05 2020 +0000
- Revision:
- 4:c051317d4051
- Parent:
- 0:4af3ca173992
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 io.h |
arostm | 0:4af3ca173992 | 4 | * @author MCD Application Team |
arostm | 0:4af3ca173992 | 5 | * @version V4.0.1 |
arostm | 0:4af3ca173992 | 6 | * @date 21-July-2015 |
arostm | 0:4af3ca173992 | 7 | * @brief This file contains all the functions prototypes for the IO driver. |
arostm | 0:4af3ca173992 | 8 | ****************************************************************************** |
arostm | 0:4af3ca173992 | 9 | * @attention |
arostm | 0:4af3ca173992 | 10 | * |
arostm | 0:4af3ca173992 | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
arostm | 0:4af3ca173992 | 12 | * |
arostm | 0:4af3ca173992 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
arostm | 0:4af3ca173992 | 14 | * are permitted provided that the following conditions are met: |
arostm | 0:4af3ca173992 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
arostm | 0:4af3ca173992 | 16 | * this list of conditions and the following disclaimer. |
arostm | 0:4af3ca173992 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
arostm | 0:4af3ca173992 | 18 | * this list of conditions and the following disclaimer in the documentation |
arostm | 0:4af3ca173992 | 19 | * and/or other materials provided with the distribution. |
arostm | 0:4af3ca173992 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
arostm | 0:4af3ca173992 | 21 | * may be used to endorse or promote products derived from this software |
arostm | 0:4af3ca173992 | 22 | * without specific prior written permission. |
arostm | 0:4af3ca173992 | 23 | * |
arostm | 0:4af3ca173992 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
arostm | 0:4af3ca173992 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
arostm | 0:4af3ca173992 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
arostm | 0:4af3ca173992 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
arostm | 0:4af3ca173992 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
arostm | 0:4af3ca173992 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
arostm | 0:4af3ca173992 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
arostm | 0:4af3ca173992 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
arostm | 0:4af3ca173992 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
arostm | 0:4af3ca173992 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
arostm | 0:4af3ca173992 | 34 | * |
arostm | 0:4af3ca173992 | 35 | ****************************************************************************** |
arostm | 0:4af3ca173992 | 36 | */ |
arostm | 0:4af3ca173992 | 37 | |
arostm | 0:4af3ca173992 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
arostm | 0:4af3ca173992 | 39 | #ifndef __IO_H |
arostm | 0:4af3ca173992 | 40 | #define __IO_H |
arostm | 0:4af3ca173992 | 41 | |
arostm | 0:4af3ca173992 | 42 | #ifdef __cplusplus |
arostm | 0:4af3ca173992 | 43 | extern "C" { |
arostm | 0:4af3ca173992 | 44 | #endif |
arostm | 0:4af3ca173992 | 45 | |
arostm | 0:4af3ca173992 | 46 | /* Includes ------------------------------------------------------------------*/ |
arostm | 0:4af3ca173992 | 47 | #include <stdint.h> |
arostm | 0:4af3ca173992 | 48 | |
arostm | 0:4af3ca173992 | 49 | /** @addtogroup BSP |
arostm | 0:4af3ca173992 | 50 | * @{ |
arostm | 0:4af3ca173992 | 51 | */ |
arostm | 0:4af3ca173992 | 52 | |
arostm | 0:4af3ca173992 | 53 | /** @addtogroup Components |
arostm | 0:4af3ca173992 | 54 | * @{ |
arostm | 0:4af3ca173992 | 55 | */ |
arostm | 0:4af3ca173992 | 56 | |
arostm | 0:4af3ca173992 | 57 | /** @addtogroup IO |
arostm | 0:4af3ca173992 | 58 | * @{ |
arostm | 0:4af3ca173992 | 59 | */ |
arostm | 0:4af3ca173992 | 60 | |
arostm | 0:4af3ca173992 | 61 | /** @defgroup IO_Exported_Types |
arostm | 0:4af3ca173992 | 62 | * @{ |
arostm | 0:4af3ca173992 | 63 | */ |
arostm | 0:4af3ca173992 | 64 | |
arostm | 0:4af3ca173992 | 65 | /** |
arostm | 0:4af3ca173992 | 66 | * @brief IO Bit SET and Bit RESET enumeration |
arostm | 0:4af3ca173992 | 67 | */ |
arostm | 0:4af3ca173992 | 68 | typedef enum |
arostm | 0:4af3ca173992 | 69 | { |
arostm | 0:4af3ca173992 | 70 | IO_PIN_RESET = 0, |
arostm | 0:4af3ca173992 | 71 | IO_PIN_SET |
arostm | 0:4af3ca173992 | 72 | }IO_PinState; |
arostm | 0:4af3ca173992 | 73 | |
arostm | 0:4af3ca173992 | 74 | typedef enum |
arostm | 0:4af3ca173992 | 75 | { |
arostm | 0:4af3ca173992 | 76 | IO_MODE_INPUT = 0, /* input floating */ |
arostm | 0:4af3ca173992 | 77 | IO_MODE_OUTPUT, /* output Push Pull */ |
arostm | 0:4af3ca173992 | 78 | IO_MODE_IT_RISING_EDGE, /* float input - irq detect on rising edge */ |
arostm | 0:4af3ca173992 | 79 | IO_MODE_IT_FALLING_EDGE, /* float input - irq detect on falling edge */ |
arostm | 0:4af3ca173992 | 80 | IO_MODE_IT_LOW_LEVEL, /* float input - irq detect on low level */ |
arostm | 0:4af3ca173992 | 81 | IO_MODE_IT_HIGH_LEVEL, /* float input - irq detect on high level */ |
arostm | 0:4af3ca173992 | 82 | /* following modes only available on MFX*/ |
arostm | 0:4af3ca173992 | 83 | IO_MODE_ANALOG, /* analog mode */ |
arostm | 0:4af3ca173992 | 84 | IO_MODE_OFF, /* when pin isn't used*/ |
arostm | 0:4af3ca173992 | 85 | IO_MODE_INPUT_PU, /* input with internal pull up resistor */ |
arostm | 0:4af3ca173992 | 86 | IO_MODE_INPUT_PD, /* input with internal pull down resistor */ |
arostm | 0:4af3ca173992 | 87 | IO_MODE_OUTPUT_OD, /* Open Drain output without internal resistor */ |
arostm | 0:4af3ca173992 | 88 | IO_MODE_OUTPUT_OD_PU, /* Open Drain output with internal pullup resistor */ |
arostm | 0:4af3ca173992 | 89 | IO_MODE_OUTPUT_OD_PD, /* Open Drain output with internal pulldown resistor */ |
arostm | 0:4af3ca173992 | 90 | IO_MODE_OUTPUT_PP, /* PushPull output without internal resistor */ |
arostm | 0:4af3ca173992 | 91 | IO_MODE_OUTPUT_PP_PU, /* PushPull output with internal pullup resistor */ |
arostm | 0:4af3ca173992 | 92 | IO_MODE_OUTPUT_PP_PD, /* PushPull output with internal pulldown resistor */ |
arostm | 0:4af3ca173992 | 93 | IO_MODE_IT_RISING_EDGE_PU, /* push up resistor input - irq on rising edge */ |
arostm | 0:4af3ca173992 | 94 | IO_MODE_IT_RISING_EDGE_PD, /* push dw resistor input - irq on rising edge */ |
arostm | 0:4af3ca173992 | 95 | IO_MODE_IT_FALLING_EDGE_PU, /* push up resistor input - irq on falling edge */ |
arostm | 0:4af3ca173992 | 96 | IO_MODE_IT_FALLING_EDGE_PD, /* push dw resistor input - irq on falling edge */ |
arostm | 0:4af3ca173992 | 97 | IO_MODE_IT_LOW_LEVEL_PU, /* push up resistor input - irq detect on low level */ |
arostm | 0:4af3ca173992 | 98 | IO_MODE_IT_LOW_LEVEL_PD, /* push dw resistor input - irq detect on low level */ |
arostm | 0:4af3ca173992 | 99 | IO_MODE_IT_HIGH_LEVEL_PU, /* push up resistor input - irq detect on high level */ |
arostm | 0:4af3ca173992 | 100 | IO_MODE_IT_HIGH_LEVEL_PD, /* push dw resistor input - irq detect on high level */ |
arostm | 0:4af3ca173992 | 101 | |
arostm | 0:4af3ca173992 | 102 | }IO_ModeTypedef; |
arostm | 0:4af3ca173992 | 103 | |
arostm | 0:4af3ca173992 | 104 | /** @defgroup IO_Driver_structure IO Driver structure |
arostm | 0:4af3ca173992 | 105 | * @{ |
arostm | 0:4af3ca173992 | 106 | */ |
arostm | 0:4af3ca173992 | 107 | typedef struct |
arostm | 0:4af3ca173992 | 108 | { |
arostm | 0:4af3ca173992 | 109 | void (*Init)(uint16_t); |
arostm | 0:4af3ca173992 | 110 | uint16_t (*ReadID)(uint16_t); |
arostm | 0:4af3ca173992 | 111 | void (*Reset)(uint16_t); |
arostm | 0:4af3ca173992 | 112 | |
arostm | 0:4af3ca173992 | 113 | void (*Start)(uint16_t, uint32_t); |
arostm | 0:4af3ca173992 | 114 | uint8_t (*Config)(uint16_t, uint32_t, IO_ModeTypedef); |
arostm | 0:4af3ca173992 | 115 | void (*WritePin)(uint16_t, uint32_t, uint8_t); |
arostm | 0:4af3ca173992 | 116 | uint32_t (*ReadPin)(uint16_t, uint32_t); |
arostm | 0:4af3ca173992 | 117 | |
arostm | 0:4af3ca173992 | 118 | void (*EnableIT)(uint16_t); |
arostm | 0:4af3ca173992 | 119 | void (*DisableIT)(uint16_t); |
arostm | 0:4af3ca173992 | 120 | uint32_t (*ITStatus)(uint16_t, uint32_t); |
arostm | 0:4af3ca173992 | 121 | void (*ClearIT)(uint16_t, uint32_t); |
arostm | 0:4af3ca173992 | 122 | |
arostm | 0:4af3ca173992 | 123 | }IO_DrvTypeDef; |
arostm | 0:4af3ca173992 | 124 | /** |
arostm | 0:4af3ca173992 | 125 | * @} |
arostm | 0:4af3ca173992 | 126 | */ |
arostm | 0:4af3ca173992 | 127 | |
arostm | 0:4af3ca173992 | 128 | /** |
arostm | 0:4af3ca173992 | 129 | * @} |
arostm | 0:4af3ca173992 | 130 | */ |
arostm | 0:4af3ca173992 | 131 | |
arostm | 0:4af3ca173992 | 132 | /** |
arostm | 0:4af3ca173992 | 133 | * @} |
arostm | 0:4af3ca173992 | 134 | */ |
arostm | 0:4af3ca173992 | 135 | |
arostm | 0:4af3ca173992 | 136 | /** |
arostm | 0:4af3ca173992 | 137 | * @} |
arostm | 0:4af3ca173992 | 138 | */ |
arostm | 0:4af3ca173992 | 139 | |
arostm | 0:4af3ca173992 | 140 | /** |
arostm | 0:4af3ca173992 | 141 | * @} |
arostm | 0:4af3ca173992 | 142 | */ |
arostm | 0:4af3ca173992 | 143 | |
arostm | 0:4af3ca173992 | 144 | #ifdef __cplusplus |
arostm | 0:4af3ca173992 | 145 | } |
arostm | 0:4af3ca173992 | 146 | #endif |
arostm | 0:4af3ca173992 | 147 | |
arostm | 0:4af3ca173992 | 148 | #endif /* __IO_H */ |
arostm | 0:4af3ca173992 | 149 | |
arostm | 0:4af3ca173992 | 150 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |